addRouteWithAlternatives method

Future<PowerMapRoutesResult?> addRouteWithAlternatives({
  1. required LatLng start,
  2. required LatLng destination,
  3. String profile = 'driving',
  4. String language = 'th',
  5. int maxAlternatives = 3,
  6. bool fitCamera = true,
})

Calculates multiple alternative routes and draws them on the map.

The active route is highlighted in blue, and alternative routes in slate gray. Use selectRoute to switch between paths.

Implementation

Future<PowerMapRoutesResult?> addRouteWithAlternatives({
  required LatLng start,
  required LatLng destination,
  String profile = 'driving',
  String language = 'th',
  int maxAlternatives = 3,
  bool fitCamera = true,
}) async {
  return await routing.addRouteWithAlternatives(
    start: start,
    destination: destination,
    profile: profile,
    language: language,
    maxAlternatives: maxAlternatives,
    fitCamera: fitCamera,
  );
}