RouteOptions class

The options to specify how the route will be calculated.

Constructors

RouteOptions([OptimizationMode optimizationMode = OptimizationMode.fastest, int alternatives = 0, DateTime? departureTime = null, DateTime? arrivalTime = null, double? speedCapInMetersPerSecond = null, bool enableRouteHandle = false, TrafficOptimizationMode trafficOptimizationMode = TrafficOptimizationMode.timeDependent, bool enableTolls = false, bool optimizeWaypointsOrder = false, bool enableRouteLabels = false])
Creates a new instance.
RouteOptions.withDefaults()
Creates a new instance.

Properties

alternatives ↔ int
Maximum number of alternative routes that will be calculated, in addition to the best one. The provided value must be in the range [0, 6]. Alternative routes can be unavailable, thus they are not guaranteed to be returned. The order of routes is from the best to the worst, as evaluated by the route calculation algorithm and according to the given input parameters. Defaults to 0, which means there are no alternatives, i.e. only the best route is returned. Must be 0 for isoline calculation.
getter/setter pair
arrivalTime ↔ DateTime?
Optional time when travel is expected to end. Traffic speed and incidents shall be taken into account in the calculation of the route, per RouteOptions.trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, to predict the arrival time. Therefore, by default, a time-aware route request is initiated including traffic.
getter/setter pair
departureTime ↔ DateTime?
Optional time when travel is expected to start. Traffic speed and incidents shall be taken into account in the calculation of the route, per RouteOptions.trafficOptimizationMode. By default, the time is not set. If the time is not set, the current time will be used internally, i.e. now. Therefore, by default, a time-aware route request is initiated including traffic.
getter/setter pair
enableRouteHandle ↔ bool
A flag that indicates whether the resulting route should contain a RouteHandle. Defaults to false. Note that a RouteHandle generated by the online RoutingEngine is not compatible with the OfflineRoutingEngine and vice versa.
getter/setter pair
enableRouteLabels ↔ bool
Specifies whether route labels should be included in the route response. Route labels identify major highways or road names along the route. By default, this is set to false.
getter/setter pair
enableTolls ↔ bool
A flag that indicates whether the resulting route Section.tolls properties should contain tolls data. Defaults to false.
getter/setter pair
hashCode → int
The hash code for this object.
no setter
optimizationMode OptimizationMode
The optimization mode to be used for route calculation. By default, it is OptimizationMode.fastest.
getter/setter pair
optimizeWaypointsOrder ↔ bool
A flag that indicates whether the order of waypoints that is passed to calculateRoute() should be optimized in the best order. The best order is calculated by the same metrics that are used during regular calculation, e.g. OptimizationMode. The starting and destination Waypoint are not reordered. If the whole number of waypoints is fewer than 4 - the flag doesn't affect the resulting route (nothing to optimize). The resulting order of waypoints can be identified by their waypoint indices in the route sections (see Route.sections, Section.departurePlace, Section.arrivalPlace, RoutePlace.waypointIndex). Currently, the waypoints order optimization is available only when using the OfflineRoutingEngine (not available for all editions). Defaults to false.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
speedCapInMetersPerSecond ↔ double?
Specifies the maximum speed in meters per second, which the user wishes not to exceed. The valid range is [1, 70] meters per second. Note that it is valid only for TransportMode.car, TransportMode.truck and TransportMode.scooter transport modes. For car, truck and scooter transport modes, it will affect Route.duration of the route. Only for scooter transport mode, it may affect the route geometry. Defaults to null, which means that no speed cap is set.
getter/setter pair
trafficOptimizationMode TrafficOptimizationMode
The traffic optimization mode to be used for route calculation. By default, it is TrafficOptimizationMode.timeDependent, which enables traffic-aware routing.
getter/setter pair

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.