Creates a new set of routing preferences used to customize how routes are calculated.
Can be called in two ways for backward compatibility:
new RoutePreferences(id) - Internal constructor with pointer IDnew RoutePreferences(options) - Public constructor with configuration optionsOptionalidOrOptions: anyEither a pointer ID (string/number, internal use) or configuration options object
Enables accurate track matching for route-over-track computations.
When true, the SDK uses more precise track matching algorithms during route calculation when track-based landmarks are provided.
Default is true
Enables accurate track matching for route-over-track computations.
True to enable accurate track matching, false to disable.
Get accurate waypoints approach. An accurate approach implies that the route arrives at the waypoint on the drive side of the region.
Default is false
ExperimentalSet the accurate waypoints approach. An accurate approach implies that the route arrives at the waypoint on the drive side of the region.
Public transport algorithm type for determining departure or arrival time optimization.
Default is PTAlgorithmType.departure
The algorithm type to use for public transport routing.
Allows route calculation using online services when available.
Default is true
True to allow online calculation, false to use only offline data.
Enables balanced sorting for alternative route results.
Default is true
True to enable balanced sorting, false to disable.
Schema defining how alternative routes are generated and returned.
Default is RouteAlternativesSchema.defaultSchema
The schema to use for generating alternative routes.
Hill avoidance factor for bicycle routes, ranging from 0.0 to 1.0.
Avoids carpool/HOV lanes when calculating routes.
Default is false
True to avoid carpool lanes, false to allow them.
Avoids ferry crossings when calculating routes.
Default is false
True to avoid ferries, false to allow them.
ExperimentalGet the geofence anti-area avoidance IDs list
An anti-area geofence is an area within which boundaries the route should remain during calculation. If immutableRoadblockAvoidance is true and the route cannot stay in the requested boundaries, routing will fail.
ExperimentalSet avoidance of the given geofence anti-area IDs
Get the geofence area avoidance IDs list
Set avoidance of the given geofence area IDs
Send an empty list to disable geofence area avoidance
Avoids motorways/highways when calculating routes.
Default is false
True to avoid motorways, false to allow them.
Avoids toll roads when calculating routes.
Default is false
True to avoid toll roads, false to allow them.
Traffic avoidance strategy for route calculation.
Default is TrafficAvoidance.none
The traffic avoidance strategy to apply.
Avoids generating "Turnaround when possible" instructions during navigation.
Default is false
True to avoid turn-around instructions, false to allow them.
Avoids unpaved roads when calculating routes.
Default is false
True to avoid unpaved roads, false to allow them.
Bicycle routing profile for standard and electric bikes.
Default is null (no bike profile)
The bike profile configuration to use.
Enables building route segment connections metadata.
Default is false
True to build connections metadata, false to omit it.
ExperimentalGet route connections build max length.
Default is -1
Controls whether terrain profile data is generated for the route.
Default terrain profile disabled.
The terrain profile build configuration.
Car routing profile with vehicle-specific constraints.
Default is null (no car profile)
The car profile configuration to use.
Departure heading and accuracy for route calculation.
Default heading and accuracy are -1 (no constraint).
The departure heading configuration.
Extra freedom levels for emergency vehicle routing constraints.
Only applies when emergencyVehicleMode is true.
Default is 0
The extra freedom levels as a packed integer.
Enables emergency vehicle routing mode with relaxed constraints.
Default is false
True to enable emergency vehicle mode, false to disable.
Bike & pedestrian routing fitness factor, ranging from 0.0 to 1.0.
Default is 0.5 (normal/good shape)
Factor from 0.0 (untrained) to 1.0 (professional).
Ignores map restrictions during route-over-track calculations.
Default is false
True to ignore restrictions, false to apply them.
Get the immutable roadblock avoidance state. If set, the algorithm rather fails than routing through roadblocks.
Default is false
True to enable immutable roadblock avoidance, false otherwise.
Track resume mode for path-based routing with track landmarks.
Default is true
True to resume from closest point, false to use entire track.
Enables maximum distance constraints based on transport mode.
Default is true
True to enable distance constraints, false to disable.
Maximum transfer time between public transport connections, in minutes.
Default is 300 (5 hours)
Maximum transfer time in minutes.
Maximum walking distance for public transport routes, in meters.
Default is 5000 meters (5 km)
Maximum walking distance in meters.
Minimum transfer time between public transport connections, in minutes.
Default is 1 minute
Minimum transfer time in minutes.
Path calculation algorithm to use for routing.
Default is RoutePathAlgorithm.ml
The path algorithm to use.
Flavor variant of the selected path algorithm.
Default is RoutePathAlgorithmFlavor.magicLane
The algorithm flavor to use.
Pedestrian routing profile for walking and wheelchair accessibility.
Default is PedestrianProfile.walk
The pedestrian profile to use.
Level of detail to include in route calculation results.
Default is RouteResultDetails.full
The level of detail to include in results.
Set parameters for roundtrip feature.
The roundtrip parameters configuration.
Get roundtrip random seed.
ExperimentalGet roundtrip range.
Route group IDs for earlier/later trip calculations in public transport.
Default is an empty list
List of route group IDs.
Route range values for isoline/isochrone calculations.
Default is an empty list (no range calculation)
List of range values in units based on route type.
Quality level for route range calculations, from 0 to 100.
Default is 100 (maximum quality)
Quality level from 0 to 100.
Route result type indicating the format of the returned route.
Default is RouteResultType.path.
Additional route type preference flags.
Default is {RouteTypePreferences.none}
Set of route type preferences to apply.
Public transport route sorting strategy.
Default is PTSortingStrategy.bestTime
The sorting strategy to use.
Local departure or arrival time for public transport routing.
Default is null (current time)
The timestamp to use, or null for current time.
Primary transport mode for route calculation.
Default is RouteTransportMode.car
The transport mode to use for routing.
Truck routing profile with vehicle-specific constraints.
Default is null (no truck profile)
The truck profile configuration to use.
Ensures bike accessibility for public transport routes.
Default is false
True to ensure bike accessibility, false otherwise.
Ensures wheelchair accessibility for public transport routes.
Default is false
True to ensure wheelchair accessibility, false otherwise.
Returns the vehicle registration profile for the current transport mode.
Extracts the relevant vehicle profile (CarProfile, TruckProfile, or ElectricBikeProfile) based on the selected transportMode. Returns null for pedestrian, public, and shared vehicle modes or when no profile is configured.
ProtectedregisterRegisters an object for auto release. When the object is not used anymore, it will be released automatically from C++.
The pointer ID to register
StaticcreateCreates a new set of routing preferences used to customize how routes are calculated.
These preferences control routing behavior such as transport mode, avoidance options, algorithm selection, profile overrides, and constraints for transfers, walking distance, and timing. Provide only the options you need; unspecified profile fields will fall back to default behavior. This constructor configures a request-level set of hints that influence route generation and result formatting.
Optionaloptions: {Configuration options for route preferences
OptionalaccurateTrackMatch?: booleanWhen true, prefer tighter matching of the computed route to an existing track or path to increase positional accuracy. Default: true
OptionalaccurateWaypointsApproach?: booleanEnable accurate waypoints approach. Default: false
OptionalalgorithmType?: PTAlgorithmTypePublic-transport algorithm selection. Default: PTAlgorithmType.departure
OptionalallowOnlineCalculation?: booleanWhether online calculation can be used. Default: true
OptionalalternativeRoutesBalancedSorting?: booleanBalances sorting of alternative routes. Default: true
OptionalalternativesSchema?: RouteAlternativesSchemaDefines the schema for alternative routes. Default: RouteAlternativesSchema.defaultSchema
OptionalavoidBikingHillFactor?: numberOptionalavoidCarpoolLanes?: booleanWhen true, avoid carpool/HOV lanes. Default: false
OptionalavoidFerries?: booleanWhen true, avoid ferry segments. Default: false
OptionalavoidMotorways?: booleanWhen true, avoid motorways/highways. Default: false
OptionalavoidTollRoads?: booleanWhen true, avoid toll roads. Default: false
OptionalavoidTraffic?: TrafficAvoidanceLevel of traffic avoidance. Default: TrafficAvoidance.none
OptionalavoidTurnAroundInstruction?: booleanWhen true, prefer routes without turn-around maneuvers. Default: false
OptionalavoidUnpavedRoads?: booleanWhen true, avoid unpaved roads. Default: false
OptionalbikeProfile?: BikeProfileElectricBikeProfileOptional bike-specific routing profile
OptionalbuildConnections?: booleanWhen true, construct and include connections. Default: false
OptionalbuildTerrainProfile?: BuildTerrainProfileOptions for terrain profile building. Default: new BuildTerrainProfile()
OptionalcarProfile?: CarProfileOptional car-specific routing profile
OptionaldepartureHeading?: DepartureHeadingOptional heading constraint at route origin. Default: new DepartureHeading()
OptionalemergencyVehicleExtraFreedomLevels?: numberExtra freedom levels for emergency vehicles. Default: 0
OptionalemergencyVehicleMode?: booleanWhen true, enable emergency-vehicle routing. Default: false
OptionalfitnessFactor?: numberFactor that influences routing for bikes and pedestrians. Default: 0.5
OptionalignoreRestrictionsOverTrack?: booleanWhen true, ignore map restrictions during path-based calculations. Default: false
OptionalimmutableRoadblockAvoidance?: booleanIf true, fail rather than route through roadblocks. Default: false
OptionalisTrackResume?: booleanWhether path-based routing resumes from closest point. Default: true
OptionalmaximumDistanceConstraint?: booleanWhen true, enforce maximum distance constraints. Default: true
OptionalmaximumTransferTimeInMinutes?: numberMaximum transfer time in minutes. Default: 300
OptionalmaximumWalkDistance?: numberMaximum walking distance in meters. Default: 5000
OptionalminimumTransferTimeInMinutes?: numberMinimum transfer time in minutes. Default: 1
OptionalpathAlgorithm?: RoutePathAlgorithmPathfinding algorithm to use. Default: RoutePathAlgorithm.ml
OptionalpathAlgorithmFlavor?: RoutePathAlgorithmFlavorVariant of path algorithm. Default: RoutePathAlgorithmFlavor.magicLane
OptionalpedestrianProfile?: PedestrianProfilePedestrian profile selection. Default: PedestrianProfile.walk
OptionalresultDetails?: RouteResultDetailsLevel of detail in returned route. Default: RouteResultDetails.full
OptionalroundTripParameters?: RoundTripParametersOptional parameters for roundtrip route generation
OptionalrouteGroupIdsEarlierLater?: number[]IDs for earlier/later route groups. Default: []
OptionalrouteRanges?: number[]Route range thresholds. Default: []
OptionalrouteRangesQuality?: numberQuality threshold for route ranges. Default: 100
OptionalrouteType?: RouteTypePreferred route type. Default: RouteType.fastest
OptionalrouteTypePreferences?: Set<RouteTypePreferences>Additional public-transport preferences. Default: {RouteTypePreferences.none}
OptionalsortingStrategy?: PTSortingStrategyStrategy for sorting public-transport alternatives. Default: PTSortingStrategy.bestTime
Optionaltimestamp?: Date | nullReference timestamp for routing request. Default: null
OptionaltransportMode?: RouteTransportModePrimary transport mode. Default: RouteTransportMode.car
OptionaltruckProfile?: TruckProfileOptional truck-specific routing profile
OptionaluseBikes?: booleanWhen true, enable bike-accessible routing. Default: false
OptionaluseWheelchair?: booleanWhen true, enable wheelchair-accessible routing. Default: false
A new RoutePreferences instance with the specified options
Comprehensive route calculation configuration for customizing routing behavior.
RoutePreferences centralizes all route calculation options including transport mode, vehicle profiles, avoidance settings (motorways, tolls, ferries, unpaved roads), traffic handling, algorithm selection, result detail levels, and alternative route handling. Set preferences before calling RoutingService.calculateRoute to control how routes are computed.
Each transport mode supports specific profile configurations:
Common preferences include routeType (fastest, shortest, economic), avoidMotorways, avoidTollRoads, avoidFerries, avoidUnpavedRoads, and avoidTraffic strategies. Public transport options include departure/arrival times via timestamp and algorithmType, transfer constraints, and sorting strategies. Emergency vehicle mode relaxes routing constraints.