AlternativeRoutesOptions
public struct AlternativeRoutesOptions
Specifies options related to alternative routes.
Important
This is a Public Preview API. It may be changed or removed at any time.Note
Supporting points which are used for reconstructing a route and for calculating zero or more alternative routes to this reference route is part ofRouteLegOptions
-
Declaration
Swift
public init ( maxAlternatives: Int? = nil, alternativeType: AlternativeType? = nil, minDeviationDistance: Measurement<UnitLength>? = nil, minDeviationTime: Measurement<UnitDuration>? = nil ) throws
Parameters
maxAlternatives
Maximum number of alternative routes to generate in addition to the primary route.
alternativeType
Whether to find only better routes or any alternative to a given reference route. Can only be used with route reconstructions.
minDeviationDistance
Follow the reference route for at least this distance before deviating. Can only be used with route reconstructions.
minDeviationTime
Follow the reference route for at least this travel time before deviating. Can only be used with route reconstructions.
-
Maximum number of alternative routes to generate in addition to the primary route.
Declaration
Swift
public let maxAlternatives: Int?
-
Whether to find only better routes or any alternative to a given reference route. Can only be used with route reconstructions.
Declaration
Swift
public let alternativeType: AlternativeType?
-
Follow the reference route for at least this distance before deviating. Can only be used with route reconstructions.
Declaration
Swift
public let minDeviationDistance: Measurement<UnitLength>?
-
Follow the reference route for at least this travel time before deviating. Can only be used with route reconstructions.
Declaration
Swift
public let minDeviationTime: Measurement<UnitDuration>?
-
Copies the current AlternativeRoutesOptions with changes specified in build closure
Declaration
Swift
public func copy(build: (inout Builder) throws -> ()) throws -> AlternativeRoutesOptions
Parameters
build
This closure allows for change of AlternativeRoutesOptions values
Return Value
AlternativeRoutesOptions with the changes set on the closure
-
The
Builder
creates a new instance ofAlternativeRoutesOptions
with modified fields.Declaration
Swift
public struct Builder