RoutingService class abstract Routes & Navigation

Static service for asynchronous route calculation and navigation planning.

Provides methods to calculate routes between waypoints using configurable preferences, supporting multiple transport modes (car, pedestrian, bicycle, public transit, truck), route types (fastest, shortest, economic), and various routing constraints (avoid tolls, ferries, traffic, etc.). All route calculations execute asynchronously with callback-based result delivery and comprehensive error reporting.

Example

TaskHandler? taskHandler = RoutingService.calculateRoute(
  [departureLandmark, destinationLandmark],
  routePreferences,
  (err, routes) {
    if (err == GemError.success) {
      // Do something with the calculated routes
    } else {
      print('Error: $err');
    }
  },
);

See also:

Constructors

RoutingService.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

transferStatistics TransferStatistics
Retrieves network transfer statistics for online route calculations.
no setter

Static Methods

calculateRoute(List<Landmark> waypoints, RoutePreferences routePreferences, void onComplete(GemError err, List<Route> routes)) TaskHandler?
Calculates routes between specified waypoints asynchronously.
cancelRoute(TaskHandler taskHandler) → void
Cancels an ongoing route calculation.
getRouteStatus(TaskHandler taskHandler) RouteStatus
Retrieves the current status of a route calculation.
isCalculationRunning(TaskHandler taskHandler) bool
Checks if a route calculation is still in progress.
resetRouteRoadBlocks() → void
Clears all user-defined road blocks.
setRouteRoadBlock(RouteInstructionBase instruction) GemError
Sets a user-defined road block to trigger route recalculation.