@magiclane/maps-sdk
    Preparing search index...

    Class RoutePreferences

    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.

    Index

    Constructors

    • Parameters

      • __namedParameters: {
            accurateTrackMatch?: boolean;
            algorithmType?: PTAlgorithmType;
            allowOnlineCalculation?: boolean;
            alternativeRoutesBalancedSorting?: boolean;
            alternativesSchema?: RouteAlternativesSchema;
            automaticTimestamp?: boolean;
            avoidBikingHillFactor?: number;
            avoidCarpoolLanes?: boolean;
            avoidFerries?: boolean;
            avoidMotorways?: boolean;
            avoidTollRoads?: boolean;
            avoidTraffic?: TrafficAvoidance;
            avoidTurnAroundInstruction?: boolean;
            avoidUnpavedRoads?: boolean;
            bikeProfile?: BikeProfileElectricBikeProfile;
            buildConnections?: boolean;
            buildTerrainProfile?: BuildTerrainProfile;
            carProfile?: CarProfile;
            departureHeading?: DepartureHeading;
            emergencyVehicleExtraFreedomLevels?: number;
            emergencyVehicleMode?: boolean;
            evProfile?: EVProfile;
            ignoreRestrictionsOverTrack?: boolean;
            maximumDistanceConstraint?: boolean;
            maximumTransferTimeInMinutes?: number;
            maximumWalkDistance?: number;
            minimumTransferTimeInMinutes?: number;
            pathAlgorithm?: RoutePathAlgorithm;
            pathAlgorithmFlavor?: RoutePathAlgorithmFlavor;
            pedestrianProfile?: PedestrianProfile;
            resultDetails?: RouteResultDetails;
            routeGroupIdsEarlierLater?: number[];
            routeRanges?: number[];
            routeRangesQuality?: number;
            routeResultType?: RouteResultType;
            routeType?: RouteType;
            routeTypePreferences?: Set<RouteTypePreferences>;
            sortingStrategy?: PTSortingStrategy;
            timestamp?: Date;
            transportMode?: RouteTransportMode;
            truckProfile?: TruckProfile;
            useBikes?: boolean;
            useWheelchair?: boolean;
        } = {}

      Returns RoutePreferences

    Properties

    accurateTrackMatch: boolean

    Track accurate match.

    Default is true.

    algorithmType: PTAlgorithmType

    Get algorithm type.

    Default is PTAlgorithmType.departure.

    allowOnlineCalculation: boolean

    Get the online route calculation allowance.

    Default value is true.

    alternativeRoutesBalancedSorting: boolean

    Enable/disable alternative routes balanced sorting.

    Default is true.

    alternativesSchema: RouteAlternativesSchema

    Alternative schema.

    Default is RouteAlternativesSchema.defaultSchema.

    automaticTimestamp: boolean

    Automatic timestamp assignment. If true, timestamp is set automatically if not provided.

    Default is true.

    avoidBikingHillFactor: number

    Avoid biking hill factor 0.0 - no avoidance, 1.0 - full avoidance.

    Default is 0.5.

    avoidCarpoolLanes: boolean

    Avoid carpool lanes flag.

    Only available for custom builds containing TomTom map data. Ignored for public builds. Default is false.

    avoidFerries: boolean

    Avoid ferries flag.

    Default is false.

    avoidMotorways: boolean

    Avoid motorways flag.

    Default is false.

    avoidTollRoads: boolean

    Avoid toll roads flag.

    Default is false.

    avoidTraffic: TrafficAvoidance

    Route calculation traffic avoidance method.

    Default is TrafficAvoidance.none.

    avoidTurnAroundInstruction: boolean

    Avoid turnaround instruction flag.

    If set to true then the message "Turnaround when possible" will be avoided during navigation. This preference is always overridden in car/truck navigation route recalculations, in which case the current driving direction is used, except for the case when emergency mode is activated. For car/truck this preference is used when setting a user roadblock during navigation. If set to false, a turn around instruction may be generated. Default is true for car/truck transport modes and false for the rest. If emergency mode is active, default value is always false. Default is false.

    avoidUnpavedRoads: boolean

    Avoid unpaved roads flag.

    Default is false.

    Bike profile.

    buildConnections: boolean

    Get route connections build.

    Default is false.

    buildTerrainProfile: BuildTerrainProfile

    If BuildTerrainProfile.enable is set to false then the route computed will have the terrainProfile null.

    Default is set to an object with BuildTerrainProfile.enable set to false.

    carProfile?: CarProfile

    Car profile.

    departureHeading: DepartureHeading

    The departure heading.

    By default it is set to an object with heading set to -1 and accuracy set to -1, which means no departure heading is specified.

    emergencyVehicleExtraFreedomLevels: number

    The extra freedom levels for emergency vehicles, packed in an integer value.

    emergencyVehicleMode: boolean

    The emergency vehicle mode, true for activation. Emergency mode sets 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. Default is false.

    evProfile?: EVProfile

    The EV profile.

    ignoreRestrictionsOverTrack: boolean

    The ignore map restrictions in route-over-track mode.

    Default is false.

    maximumDistanceConstraint: boolean

    Service maximum distance constraint. Maximum distance constraint depends on transport and result details.

    Default is true.

    maximumTransferTimeInMinutes: number

    Maximum transfer time in minutes. Refers to the transfer time between two means of transportation. Enable the user to specify the desired maximum amount of minutes between the arrival of one means of transportation and the departure of the next one. Default is 300.

    maximumWalkDistance: number

    Maximum walk distance.

    Default is 5000.

    minimumTransferTimeInMinutes: number

    Get minimum transfer time in minutes. Refers to the transfer time between two means of transportation. Enable the user to specify the desired minimum amount of minutes between the arrival of one means of transportation and the departure of the next one. Default is 1.

    pathAlgorithm: RoutePathAlgorithm

    Path algorithm.

    Default is RoutePathAlgorithm.ml.

    pathAlgorithmFlavor: RoutePathAlgorithmFlavor

    Path algorithm flavor.

    Default is RoutePathAlgorithmFlavor.magicLane.

    pedestrianProfile: PedestrianProfile

    Pedestrian profile.

    Default is PedestrianProfile.walk.

    resultDetails: RouteResultDetails

    Result details.

    Default is RouteResultDetails.full.

    routeGroupIdsEarlierLater: number[]

    Group ids for earlier/later trip.

    routeRanges: number[]

    Route ranges list.

    Range units depend on route type: fastest - seconds, shortest - meters, economic - Wh. Default is an empty list.

    routeRangesQuality: number

    Range result quality must be a valid integer in the 0 - 100 range, where 0 = lowest quality, 100 = highest quality. Default is 100 (max quality).

    routeResultType: RouteResultType

    Route result type.

    The value is not passed to the route calculation, but used as a result via RouteBase.preferences.

    routeType: RouteType

    The route type.

    Default is RouteType.fastest.

    routeTypePreferences: Set<RouteTypePreferences>

    Route type preferences.

    Default is Set containing RouteTypePreferences.none.

    sortingStrategy: PTSortingStrategy

    Sorting strategy.

    Default is PTSortingStrategy.bestTime.

    timestamp?: Date

    The local time as a UTC Date object but containing the local time at the location.

    If timestamp is null then it defaults to the current timestamp internally. If algorithmType is PTAlgorithmType.departure then the timestamp represents the desired departure time. If algorithmType is PTAlgorithmType.arrival then the timestamp represents the desired arrival time.

    transportMode: RouteTransportMode

    Route transport mode.

    Default is RouteTransportMode.car.

    truckProfile?: TruckProfile

    Truck profile.

    useBikes: boolean

    Option toggle to use bike.

    Default is false.

    useWheelchair: boolean

    Option toggle to use wheelchair.

    Default is false.

    Methods

    • Parameters

      Returns boolean

    • Returns any