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 ) throwsParameters
maxAlternativesMaximum number of alternative routes to generate in addition to the primary route.
alternativeTypeWhether to find only better routes or any alternative to a given reference route. Can only be used with route reconstructions.
minDeviationDistanceFollow the reference route for at least this distance before deviating. Can only be used with route reconstructions.
minDeviationTimeFollow 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 -> AlternativeRoutesOptionsParameters
buildThis closure allows for change of AlternativeRoutesOptions values
Return Value
AlternativeRoutesOptions with the changes set on the closure
-
The
Buildercreates a new instance ofAlternativeRoutesOptionswith modified fields.Declaration
Swift
public struct Builder
AlternativeRoutesOptions Structure Reference