vietmap_flutter_plugin 0.5.2 copy "vietmap_flutter_plugin: ^0.5.2" to clipboard
vietmap_flutter_plugin: ^0.5.2 copied to clipboard

A flutter plugin for VietMap APIs. This plugin is a wrapper around VietMap APIs for Android and iOS.

A Dart 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.flutter-io.cn/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 the following methods for using VietMap APIs v3, but we recommend using VietMap APIs v4 instead:
    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();
    Vietmap.matrix(VietmapMatrixParams(
      points: [
        const LatLng(10.768897, 106.678505),
        const LatLng(10.765496, 106.67626),
        const LatLng(10.7627936, 106.6750729),
        const LatLng(10.7616745, 106.6792425),
        const LatLng(10.765605, 106.685383),
      ],
      sourcePoints: [0, 1],
      isShowTablePreview: true,
      destinationPoints: [
        2, 3, 4,
    ]));
                
  • From version 0.5.1, we provide methods to use Vietmap APIs v4 with enhanced features:
    
    Vietmap.autocompleteV4(VietmapAutocompleteParamsV4(text: 'Hà Nội'));
    
    Vietmap.geoCodeV4(VietmapAutocompleteParamsV4(text: 'Hà Nội'));
    
    Vietmap.reverseV4(VietmapReverseParams(latLng: LatLng(21.027763, 105.834160)));
    
    /// refId: A unique refid identifier generated from search response
    Vietmap.placeV4('refId');
    
    Vietmap.migrateAddress(
      VietmapMigrateAddressParams(text: '197 Trần Phú, Phường 4, Quận 5, Thành phố Hồ Chí Minh, Việt Nam')
    );
    
    Vietmap.getMapStyle(type: TileMapEnum.vectorDefault); // Other options: vectorLight, rasterDefault, etc.

Why use v4 APIs? #

  • Autocomplete v4: Enhanced address suggestions with better accuracy, more relevant results, and advanced filtering options including categories and boundaries

  • Geocode v4: Improved address resolution with more detailed address components, better handling of Vietnamese addresses, and enhanced entry point data

  • Reverse v4: Richer location context with more detailed address information, better handling of complex areas, and improved category classification

  • Place v4: More comprehensive place details including enhanced POI information, accurate entry points, and improved address context

  • Migrate Address API: New functionality to standardize addresses across different formats and provide consistent addressing for your applications

v4 APIs provide better performance, more accurate results, and richer data to improve your user experience.

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.

2
likes
150
points
288
downloads

Publisher

verified publishermaps.vietmap.vn

Weekly Downloads

A flutter plugin for VietMap APIs. This plugin is a wrapper around VietMap APIs for Android and iOS.

Homepage
Repository (GitHub)
View/report issues

Topics

#vietmap #map #flutter-map #map-toolkit #routing

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

dartz, dio, flutter, vietmap_gl_platform_interface

More

Packages that depend on vietmap_flutter_plugin