addRoute method

Future<PowerMapRouteResult?> addRoute({
  1. required LatLng start,
  2. required LatLng destination,
  3. List<LatLng>? waypoints,
  4. bool optimize = false,
  5. String profile = 'driving',
  6. String language = 'th',
  7. bool fitCamera = true,
})

Calculates and draws a route on the map matching the Web SDK format.

Connects start to destination. Optional waypoints can be provided.

Implementation

Future<PowerMapRouteResult?> addRoute({
  required LatLng start,
  required LatLng destination,
  List<LatLng>? waypoints,
  bool optimize = false,
  String profile = 'driving',
  String language = 'th',
  bool fitCamera = true,
}) async {
  return await routing.addRoute(
    start: start,
    destination: destination,
    waypoints: waypoints ?? [],
    optimize: optimize,
    profile: profile,
    language: language,
    fitCamera: fitCamera,
  );
}