Skip to content

A package for using the VietMap APIs in Dart.

Vietmap API Flutter plugin

Contact vietmap.vn to register a valid key.

Getting started

Add library to pubspec.yaml file

  vietmap_flutter_plugin: latest_version

Check the latest version at https://pub.dev/packages/vietmap_flutter_plugin

or run this command in the terminal to add the library to the project:

  flutter pub add vietmap_flutter_plugin

Usage

Init plugin

  • You must call Vietmap.getInstance(apiKey) before using any other methods.
        Vietmap.getInstance('YOUR_API_KEY_HERE');
    
  • We provide below methods to use Vietmap APIs:
        Vietmap.autocomplete(VietMapAutoCompleteParams(textSearch: 'Hà Nội'));
    
        Vietmap.geoCode(VietMapAutoCompleteParams(textSearch: 'Hà Nội'));
    
        Vietmap.reverse(LatLng(21.027763, 105.834160));
    
        Vietmap.place('Place ID');
    
        Vietmap.routing(VietMapRoutingParams(points: [
          LatLng(21.027763, 105.834160),
          LatLng(21.027763, 105.834160)
        ]));
    
        /// This function is used to get the style url of Vietmap,
        /// which provide the style of the map for VietmapGL plugin.
        Vietmap.getVietmapStyleUrl();
    

Additional information

This package is a part of Vietmap API project.

Troubleshooting

Our plugin depend on dio and dartz package with latest version. If our plugin conflict with your current project, please try to use the latest version of these packages or follow the instruction below:

dependencies:
    dio: your_project_version
    dartz: your_project_version

dependencies_override:
    dio: our_plugin_version
    dartz: our_plugin_version

We use dartz package to response the api result. Please check the dartz package to know how to handle the result.

var autocompleteData = await Vietmap.autocomplete(VietMapAutoCompleteParams(textSearch: 'Hà Nội'));
autocompleteData.fold(
      (Failure left) {
        // Handle error here
      },
      (List<VietmapAutocompleteModel> right) {
        // Handle success here
      },
    );

Note: Replace apikey which is provided by VietMap to all YOUR_API_KEY_HERE tag to the application work normally

Email us: maps-api.support@vietmap.vn

Vietmap API and price here

Contact for support

Vietmap API document here

Have a bug to report? Open an issue. If possible, include a full log and information which shows the issue.

Have a feature request? Open an issue. Tell us what the feature should do and why you want the feature.