OlaRoutingService class
Directions, distance matrix, and fleet helpers for Ola Maps Routing.
Constructors
- OlaRoutingService({required String apiKey, OlaMapsHttp? httpClient})
-
Creates a routing client. Pass
httpClientto share language defaults.
Properties
Methods
-
getDirections(
{required double originLat, required double originLng, required double destLat, required double destLng, String mode = 'driving', bool alternatives = false, bool steps = false, Object? language}) → Future< List< Map< >String, double> > - Fetch directions from origin to destination.
-
getDirectionsRaw(
{required Location origin, required Location destination, String mode = 'driving', bool alternatives = false, bool steps = false, String overview = 'full', bool basic = false, Object? language, String? requestId, String? correlationId}) → Future< Map< String, dynamic> > - Full directions JSON (not decoded to lat/lng points).
-
getDistanceMatrix(
{required List< Location> origins, required List<Location> destinations, String mode = 'driving', bool basic = false, Object? language, String? requestId, String? correlationId}) → Future<Map< String, dynamic> > -
Travel times and distances between
originsanddestinations. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
optimizeRoute(
Map< String, dynamic> body, {Object? language, String? requestId, String? correlationId}) → Future<Map< String, dynamic> > -
Multi-stop route optimizer (
/routing/v1/routeOptimizer). -
planFleet(
Map< String, dynamic> body, {Object? language, String? requestId, String? correlationId}) → Future<Map< String, dynamic> > -
Fleet planner (
/routing/v1/fleetPlanner). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited