mappls_direction_plugin 1.0.0 copy "mappls_direction_plugin: ^1.0.0" to clipboard
mappls_direction_plugin: ^1.0.0 copied to clipboard

A Flutter plugin for integrating Mappls Direction widget in a Flutter application on Android and iOS platfroms.

Flutter Mappls Direction Widget #

A ready to use Fragment to show the Routes in an Android platform. It offers the following basic functionalities:

  • Takes support of Mappls Place search for searching locations of origin, destinations and via points.
  • It allows to use origin and destinations in Mappls digital address (semicolon separated) mappls pin or WGS 84 geographical coordinates both.
  • The ability to set the vehicle profile like driving, and biking.
  • Easily set the resource for traffic and ETA information.
    For more details, please contact apisupport@mappls.com.

Getting Started #

To work with Mappls Direction Widget in flutter add these to your package's pubspec.yaml file:

dependencies:  
 mappls_direction_plugin: ^1.0.0  

Now in your dart code you need to import this package:

import 'package:mappls_direction_plugin/mappls_direction_plugin.dart';  

Adding Mappls Keys #

You must provide your keys through the MapplsAccountManager class.(click here)

Direction Widget #

Use method openDirectionWidget to open Direction Widget:

// Platform messages may fail, so we use a try/catch PlatformException.  
try {  
  
DirectionCallbcak directionCallback = await openDirectionWidget(directionOptions:options );  
} on PlatformException {  
  
}  

You can use DirectionOptions to set the properties of the widget:

  1. resource(String): Below are the available resource:
    • DirectionsCriteria.RESOURCE_ROUTE (Default): to calculate a route & its duration without considering traffic conditions.
    • DirectionsCriteria.RESOURCE_ROUTE_ETA get the updated duration of a route considering live traffic; Applicable for India only "region=ind" and "rtype=1" is not supported. This is different from route_traffic; since this doesn't search for a route considering traffic, it only applies delays to the default route.
    • DirectionsCriteria.RESOURCE_ROUTE_TRAFFIC:
      to search for routes considering live traffic; Applicable for India only “region=ind” and “rtype=1” is not supported
  2. showAlternative(Boolean): Show alternative routes.
  3. profile(String): Below are the available profile:
    • DirectionsCriteria.PROFILE_DRIVING (Default):Meant for car routing
    • DirectionsCriteria.PROFILE_WALKING: Meant for pedestrian routing. Routing with this profile is restricted to route_adv only. region & rtype request parameters are not supported in pedestrian routing
    • DirectionsCriteria.PROFILE_BIKING:Meant for two-wheeler routing. Routing with this profile is restricted to route_adv only. region & rtype request parameters are not supported in two-wheeler routing.
    • DirectionsCriteria.PROFILE_TRUCKING:Meant for Truck routing. Routing with this profile is restricted to route_adv only. region & rtype request parameters are not supported in truck routing.
  4. overview(String): Add overview geometry either full, simplified according to highest zoom level it could be display on, or not at all. Below are the available value:
    • DirectionsCriteria.OVERVIEW_FULL
    • DirectionsCriteria.OVERVIEW_FALSE
    • DirectionsCriteria.OVERVIEW_SIMPLIFIED
  5. steps(Boolean): Return route steps for each route leg. Possible values are true/false. By default it will be used as false.
  6. excludes(List<String>) : Additive list of road classes to avoid, order does not matter. Below are the available value:
    • DirectionsCriteria.EXCLUDE_FERRY
    • DirectionsCriteria.EXCLUDE_MOTORWAY
    • DirectionsCriteria.EXCLUDE_TOLL
  7. showStartNavigation(Boolean): To show the Start Navigation button if the origin is current location.
  8. destination(DirectionPoint): You can use DirectionPoint to pass the destination in direction widget:
    • location(LatLng): Latitude and longitude of destination
    • mapplsPin(String): It takes mappls pin
    • placeName(String): It takes the place name
    • placeAddress(String): It takes the address
  9. searchPlaceOption(PlaceOptions): To set the properties of search widget




For any queries and support, please contact:


Email us at apisupport@mappls.com


Support
Need support? contact us!






@ Copyright 2023 CE Info Systems Ltd. All Rights Reserved.
1
likes
110
pub points
73%
popularity

Publisher

verified publishermapmyindia.com

A Flutter plugin for integrating Mappls Direction widget in a Flutter application on Android and iOS platfroms.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, mappls_gl, mappls_place_widget

More

Packages that depend on mappls_direction_plugin