A package for using the VietMap APIs in JS/TS.
Vietmap API plugin¶
Installation¶
With npm:
With Yarn:
With pnpm:
Check the latest version at https://www.npmjs.com/package/@vietmap/vietmap-api
Usage¶
Import VietmapApi:¶
Create an instance using apiKey:
Examples¶
Reverse¶
Updating Reverse 3.0 API is a valuable resource for developers who want to incorporate location search features into their applications while achieving optimal performance. With its intelligent search algorithms and techniques, this latest version can swiftly deliver precise search results for users. This API is a powerful tool that can help enhance the user experience of location-based applications.
Autocomplete¶
Updating Autocomplete 3.0 API is a valuable resource that allows developers to integrate autocomplete functionality into their applications. This API is designed to help users quickly find and select items from a large set of options by suggesting potential matches as they type.
The API is built on a machine-learning model that analyzes user input and suggests potential matches based on the context of the search. This model can be updated in real-time, allowing the API to continuously improve its suggestions as more data becomes available.
const autoCompleteSearchResponseList = await vietmapApi.autoCompleteSearch(
new SearchRequest({ text: 'Vietmap' }),
);
Search - Geocode¶
Updating Geocode 3.0 API is a powerful tool for developers to integrate location search functionality into their applications with optimized performance. Additionally, this latest version utilizes intelligent search algorithms and methods to provide accurate and speedy search results for users.
Routing¶
A Route Maps API is a feature provided by VIETMAP that allows developers to calculate and display the optimal route between two or more locations on a map. With a Route Maps API, developers can specify the start and end points of a journey, along with any additional constraints such as preferred mode of transportation, and retrieve a detailed route that can be displayed on a map. The API may also provide information such as the total distance, estimated travel time, and turn-by-turn directions. Developers can use Route Maps APIs to create applications that help with navigation, transportation planning, and logistics management.
const res = await vietmapApi.route(
[[10.79628438955497,106.70592293472612], [10.801891047584164,106.70660958023404]],
new RouteRequest({ vehicle: 'car',apikey: envVariables.VIETMAP_API_KEY,points_encoded: true, optimize:true}),
)
Polyline decode¶
The routing API will respond to the route path in the encrypted string.
You must use the Polyline decode to convert it to LatLng
.
Email us: maps-api.support@vietmap.vn
Contact for support
Vietmap API document here
Have a bug to report? Open an issue. If possible, include a full log and information that shows the issue. Have a feature request? Open an issue. Tell us what the feature should do and why you want the feature.