RoutePlanningOptions
public struct RoutePlanningOptions : RoutingOptionsWithItinerary
Options for route planning.
Options for calculating more than one route.
Declaration
Swift
public var alternativeRoutesOptions: AlternativeRoutesOptions?
Specifies road side on arrival preference for waypoints and destination.
Declaration
Swift
public var arrivalSidePreference: ArrivalSidePreference
An arrival time for the route. Cannot be used together with departAt.
Declaration
Swift
public var arriveAt: Date?
Specifies avoidance criteria.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public private(set) var avoidOptions: AvoidOptions? { get }
Additional options for electric vehicles to take charging into account.
Declaration
Swift
public var chargingOptions: ChargingOptions?
Defines if live traffic should be used in route calculation.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public private(set) var considerTraffic: ConsiderTraffic? { get }
Options governing which paths to prefer.
Declaration
Swift
public var costModel: CostModel? { get set }
A departure time for the route. Cannot be used together with arriveAt.
Declaration
Swift
public var departAt: Date?
Properties for the generated instructions. Instructions will not be generated if the options are not set.
Declaration
Swift
public var guidanceOptions: GuidanceOptions?
init(itinerary:costModel:alternativeRoutesOptions:routeLegOptions:guidanceOptions:departAt:arriveAt:vehicle:chargingOptions:queryOptions:waypointOptimization:mode:arrivalSidePreference:reconstructionMode:)
Creates a new RoutePlanningOptions
instance.
Throws
RoutingOptionsError
if an invalid combination of options is used. Invalid combinations are:
- using non-zero
pauseTime
for the origin or destination - using
departAt
andarriveAt
at the same time - using
routeLegOptions
where any leg has only 1 supporting point - using
arriveAt
withAlternativeRoutesOptions.minDeviationTime
or `AlternativeRoutesOptions.minDeviationDistance
- using
AlternativeRoutesOptions.minDeviationTime
orAlternativeRoutesOptions.minDeviationDistance
with norouteLegOptions
or less than two supporting points in any leg - using motorized
vehicle
with combustion and electric engines at the same time - using
chargingOptions
with- a non-motorized
vehicle
- a motorized
vehicle
without an electric engine - an electric
vehicle
without a charge level chargingOptions.minChargeAtDestination
greater thanchargeLevel.maxCharge
chargingOptions.minChargeAtChargingStops
greater thanchargeLevel.maxCharge
waypointOptimization
other thanWaypointOptimization.none
costModel.routeType
other thanRouteType.fast
- a non-motorized
- using
reconstructionMode
set toReconstructionMode.update
orReconstructionMode.route
with anitinerary
in which the origin and destination coordinates do not match the first and last point of the supporting polyline respectively.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init
(
itinerary: Itinerary,
costModel: CostModel? = nil,
alternativeRoutesOptions: AlternativeRoutesOptions? = nil,
routeLegOptions: [RouteLegOptions] = [],
guidanceOptions: GuidanceOptions? = nil,
departAt: Date? = nil,
arriveAt: Date? = nil,
vehicle: any Vehicle = Car(),
chargingOptions: ChargingOptions? = nil,
queryOptions: QueryOptions? = nil,
waypointOptimization: WaypointOptimization? = nil,
mode: RouteInformationMode = .complete,
arrivalSidePreference: ArrivalSidePreference = .anySide,
reconstructionMode: ReconstructionMode? = nil
) throws
Parameters
itinerary
|
The list of route locations. |
costModel
|
Options governing which paths to prefer. |
alternativeRoutesOptions
|
Options for calculating more than one route. |
routeLegOptions
|
Options for each route leg, such as a polyline to follow. |
guidanceOptions
|
Properties for the generated instructions. Instructions will not be generated if the options are not set. |
departAt
|
A departure time for the route. Cannot be used together with arriveAt. |
arriveAt
|
An arrival time for the route. Cannot be used together with departAt. |
vehicle
|
The vehicle dimensions, restrictions and engine parameters. If |
chargingOptions
|
Additional options for electric vehicles to take charging into account. |
queryOptions
|
Options regarding the way the request is sent to the server. |
waypointOptimization
|
Defines how to optimize the order of waypoints. |
mode
|
Defines how much guidance information (instructions and land guidance) is returned with the route. Defaults to |
arrivalSidePreference
|
Defines road side on arrival preference for waypoints and destination. |
reconstructionMode
|
Defines the reconstruction mode used for route reconstruction. If the value is nil and at least one |
init(itinerary:routeType:considerTraffic:avoidOptions:alternativeRoutesOptions:routeLegOptions:guidanceOptions:departAt:arriveAt:vehicle:chargingOptions:queryOptions:waypointOptimization:mode:arrivalSidePreference:reconstructionMode:)
Creates a new RoutePlanningOptions
instance.
Throws
RoutingOptionsError
if if an invalid combination of options is used. Invalid combinations are:
- using non-zero
pauseTime
for the origin or destination - using
departAt
andarriveAt
at the same time - using
routeLegOptions
where any leg has only 1 supporting point - using
arriveAt
withAlternativeRoutesOptions.minDeviationTime
or `AlternativeRoutesOptions.minDeviationDistance
- using
AlternativeRoutesOptions.minDeviationTime
orAlternativeRoutesOptions.minDeviationDistance
with norouteLegOptions
or less than two supporting points in any leg - using motorized
vehicle
with combustion and electric engines at the same time - using
chargingOptions
with- a non-motorized
vehicle
- a motorized
vehicle
without an electric engine - an electric
vehicle
without a charge level chargingOptions.minChargeAtDestination
greater thanchargeLevel.maxCharge
chargingOptions.minChargeAtChargingStops
greater thanchargeLevel.maxCharge
waypointOptimization
other thanWaypointOptimization.none
costModel.routeType
other thanRouteType.fast
- a non-motorized
- using
reconstructionMode
set toReconstructionMode.update
orReconstructionMode.route
with anitinerary
in which the origin and destination coordinates do not match the first and last point of the supporting polyline respectively.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public init
(
itinerary: Itinerary,
routeType: RouteType? = nil,
considerTraffic: ConsiderTraffic? = nil,
avoidOptions: AvoidOptions? = nil,
alternativeRoutesOptions: AlternativeRoutesOptions? = nil,
routeLegOptions: [RouteLegOptions] = [],
guidanceOptions: GuidanceOptions? = nil,
departAt: Date? = nil,
arriveAt: Date? = nil,
vehicle: any Vehicle = Car(),
chargingOptions: ChargingOptions? = nil,
queryOptions: QueryOptions? = nil,
waypointOptimization: WaypointOptimization? = nil,
mode: RouteInformationMode = .complete,
arrivalSidePreference: ArrivalSidePreference = .anySide,
reconstructionMode: ReconstructionMode? = nil
) throws
Parameters
itinerary
|
The list of route locations. |
routeType
|
General strategy for selecting roads during route calculation. |
considerTraffic
|
Use live traffic in the route calculation. |
avoidOptions
|
Avoidance criteria. |
alternativeRoutesOptions
|
Options for calculating more than one route. |
routeLegOptions
|
Options for each route leg, such as a polyline to follow. |
guidanceOptions
|
Properties for the generated instructions. Instructions will not be generated if the options are not set. |
departAt
|
A departure time for the route. Cannot be used together with arriveAt. |
arriveAt
|
An arrival time for the route. Cannot be used together with departAt. |
vehicle
|
The vehicle dimensions, restrictions and engine parameters. If |
chargingOptions
|
Additional options for electric vehicles to take charging into account. |
queryOptions
|
Options regarding the way the request is sent to the server. |
waypointOptimization
|
Defines how to optimize the order of waypoints. |
mode
|
Defines how much guidance information (instructions and land guidance) is returned with the route. Defaults to |
arrivalSidePreference
|
Defines road side on arrival preference for waypoints and destination. |
reconstructionMode
|
Defines the reconstruction mode used for route reconstruction. If the value is nil and at least one |
The list of route locations.
Declaration
Swift
public var itinerary: Itinerary
Defines how much guidance information (instructions and lane guidance) is returned with the route.
Declaration
Swift
public var mode: RouteInformationMode
Options regarding the way the request is sent to the server.
Declaration
Swift
public var queryOptions: QueryOptions?
Defines the reconstruction mode used for route reconstruction.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var reconstructionMode: ReconstructionMode?
Options for each route leg, such as a polyline to follow.
Declaration
Swift
public var routeLegOptions: [RouteLegOptions]
Defines general strategy for selecting roads during route calculation.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public private(set) var routeType: RouteType? { get }
The vehicle dimensions, restrictions and engine parameters.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public var vehicle: any Vehicle
The way of optimizing the order of waypoints
Declaration
Swift
public var waypointOptimization: WaypointOptimization?