RoutePreferences class
Route preferences - contains the preferences used for route calculation.
A comprehensive configuration object for route calculation that centralizes routing behavior and result preferences. It lets callers tune algorithm and path selection, transport mode and vehicle characteristics, avoidance and traffic options, alternative‑route handling, and output/detail level for the computed route.
Main members contain a mix of boolean toggles, numeric limits and thresholds, enum selections for algorithms and modes, lists for grouping/range controls, and nested profile objects for vehicles, and bikes.
Provides highly customizable routing options, tailored to each RouteTransportMode:
- carProfile for car-specific routing preferences
- truckProfile for truck-specific routing preferences
- bikeProfile for bike-specific routing preferences
- pedestrianProfile for pedestrian-specific routing preferences
See the RoutingService class for computing routes.
Constructors
-
RoutePreferences.new({bool accurateTrackMatch = true, PTAlgorithmType algorithmType = PTAlgorithmType.departure, bool allowOnlineCalculation = true, bool alternativeRoutesBalancedSorting = true, RouteAlternativesSchema alternativesSchema = RouteAlternativesSchema.defaultSchema, double avoidBikingHillFactor = 0.5, bool avoidCarpoolLanes = false, bool avoidFerries = false, bool avoidMotorways = false, bool avoidTollRoads = false, TrafficAvoidance avoidTraffic = TrafficAvoidance.none, bool avoidTurnAroundInstruction = false, bool avoidUnpavedRoads = false, BikeProfileElectricBikeProfile? bikeProfile, bool buildConnections = false, BuildTerrainProfile buildTerrainProfile = const BuildTerrainProfile(), CarProfile? carProfile, DepartureHeading departureHeading = const DepartureHeading(), int emergencyVehicleExtraFreedomLevels = 0, bool emergencyVehicleMode = false, EVProfile? evProfile, bool ignoreRestrictionsOverTrack = false, bool maximumDistanceConstraint = true, int maximumTransferTimeInMinutes = 300, int maximumWalkDistance = 5000, int minimumTransferTimeInMinutes = 1, RoutePathAlgorithm pathAlgorithm = RoutePathAlgorithm.ml, RoutePathAlgorithmFlavor pathAlgorithmFlavor = RoutePathAlgorithmFlavor.magicLane, PedestrianProfile pedestrianProfile = PedestrianProfile.walk, RouteResultDetails resultDetails = RouteResultDetails.full, List<
int> routeGroupIdsEarlierLater = const <int>[], List<int> routeRanges = const <int>[], int routeRangesQuality = 100, RouteResultType routeResultType = RouteResultType.path, RouteType routeType = RouteType.fastest, Set<RouteTypePreferences> routeTypePreferences = const <RouteTypePreferences>{RouteTypePreferences.none}, PTSortingStrategy sortingStrategy = PTSortingStrategy.bestTime, DateTime? timestamp, RouteTransportMode transportMode = RouteTransportMode.car, TruckProfile? truckProfile, bool useBikes = false, bool useWheelchair = false}) -
RoutePreferences.fromJson(Map<
String, dynamic> json) -
factory
Properties
- accurateTrackMatch ↔ bool
-
Track accurate match.
getter/setter pair
- algorithmType ↔ PTAlgorithmType
-
Get algorithm type.
getter/setter pair
- allowOnlineCalculation ↔ bool
-
Get the online route calculation allowance
getter/setter pair
- alternativeRoutesBalancedSorting ↔ bool
-
Enable/disable alternative routes balanced sorting.
getter/setter pair
- alternativesSchema ↔ RouteAlternativesSchema
-
Alternative schema.
getter/setter pair
- avoidBikingHillFactor ↔ double
-
Avoid biking hill factor 0.f - no avoidance, 1.f - full avoidance.
getter/setter pair
- avoidCarpoolLanes ↔ bool
-
Avoid carpool lanes flag.
getter/setter pair
- avoidFerries ↔ bool
-
Avoid ferries flag.
getter/setter pair
- avoidMotorways ↔ bool
-
Avoid motorways flag.
getter/setter pair
- avoidTollRoads ↔ bool
-
Avoid toll roads flag.
getter/setter pair
- avoidTraffic ↔ TrafficAvoidance
-
Route calculation traffic avoidance method.
getter/setter pair
- avoidTurnAroundInstruction ↔ bool
-
Avoid turnaround instruction flag.
getter/setter pair
- avoidUnpavedRoads ↔ bool
-
Avoid unpaved roads flag.
getter/setter pair
- bikeProfile ↔ BikeProfileElectricBikeProfile?
-
Bike profile.
getter/setter pair
- buildConnections ↔ bool
-
Build terrain profile.
Get route connections build
getter/setter pair
- buildTerrainProfile ↔ BuildTerrainProfile
-
If BuildTerrainProfile.enable is set to false then the route computed will have the RouteBase.terrainProfile null.
getter/setter pair
- carProfile ↔ CarProfile?
-
Car profile.
getter/setter pair
- departureHeading ↔ DepartureHeading
-
The departure heading.
getter/setter pair
- emergencyVehicleExtraFreedomLevels ↔ int
-
The extra freedom levels for emergency vehicles, packed in an integer value.
getter/setter pair
- emergencyVehicleMode ↔ bool
-
The emergency vehicle mode, true for activation
Emergency mode set the default AvoidTurnAroundInstruction setting to false also for car/truck
Emergency mode enables access to emergency dedicated links and enables a more relaxed routing set of constraints
getter/setter pair
- evProfile ↔ EVProfile?
-
The EV profile
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreRestrictionsOverTrack ↔ bool
-
The ignore map restrictions in route-over-track mode.
getter/setter pair
- maximumDistanceConstraint ↔ bool
-
Service maximum distance constraint.
Maximum distance constraint depends on transport and result details.
getter/setter pair
- maximumTransferTimeInMinutes ↔ int
-
Maximum transfer time in minutes
Refers to the transfer time between two means of transportation.
getter/setter pair
- maximumWalkDistance ↔ int
-
Maximum walk distance.
getter/setter pair
- minimumTransferTimeInMinutes ↔ int
-
Get minimum transfer time in minutes.
Refers to the transfer time between two means of transportation.
getter/setter pair
- pathAlgorithm ↔ RoutePathAlgorithm
-
Path algorithm.
getter/setter pair
- pathAlgorithmFlavor ↔ RoutePathAlgorithmFlavor
-
Path algorithm flavor.
getter/setter pair
- pedestrianProfile ↔ PedestrianProfile
-
Pedestrian profile.
getter/setter pair
- resultDetails ↔ RouteResultDetails
-
Result details.
getter/setter pair
-
routeGroupIdsEarlierLater
↔ List<
int> -
Group ids for earlier/later trip.
getter/setter pair
-
routeRanges
↔ List<
int> -
Route ranges list.
getter/setter pair
- routeRangesQuality ↔ int
-
Range result quality must a valid integer in the 0 - 100 range, where 0 = lowest quality, 100 = highest quality
getter/setter pair
- routeResultType ↔ RouteResultType
-
Route result type.
getter/setter pair
- routeType ↔ RouteType
-
The route type.
Default is RouteType.fastest
getter/setter pair
-
routeTypePreferences
↔ Set<
RouteTypePreferences> -
Route type preferences.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sortingStrategy ↔ PTSortingStrategy
-
Sorting strategy
getter/setter pair
- timestamp ↔ DateTime?
-
The timestamp in UTC.
getter/setter pair
- transportMode ↔ RouteTransportMode
-
Route transport mode.
getter/setter pair
- truckProfile ↔ TruckProfile?
-
Truck profile.
getter/setter pair
- useBikes ↔ bool
-
Option toggle to use bike.
getter/setter pair
- useWheelchair ↔ bool
-
Option toggle to use wheelchair.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited