Route
public struct Route : CustomStringConvertible
The Route class provides information about the navigation route.
Important
This is a Public Preview API. It may be changed or removed at any time.-
init(id:
computedAs: summary: legs: routeStops: sections: routePoints: guidanceProgressOffset: modificationHistory: planningReason: junctionViews: ) Initializer
Declaration
Swift
public init?( id: UUID = UUID(), computedAs: ComputedAs = .primary, summary: Summary, legs: [RouteLeg], routeStops: [TomTomSDKRoute.RouteStop], sections: Sections, routePoints: [RoutePoint] = [], guidanceProgressOffset: Measurement<UnitLength> = .tt.centimeters(0), modificationHistory: RouteModificationHistory = RouteModificationHistory(), planningReason: PlanningReason = .requested, junctionViews: [JunctionViewInformation] = [] )
Parameters
id
A unique identifier of the route in
UUID
format.computedAs
Determines if the route was computed as primary or path alternative with regards to the given cost model.
summary
Summary of the route.
legs
List of route legs.
routeStops
List of the route stops.
sections
Route sections.
routePoints
List of the route points.
guidanceProgressOffset
The offset where incremental computation of route contents was paused.
modificationHistory
Route modification history.
planningReason
The reason why the route was planned.
junctionViews
List containing views of junctions along the route.
-
Determines if the route was computed as primary with regards to the given cost model, or if it is a path alternative, meaning a distinct path depending on the previous computed routes.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum ComputedAs
-
A unique identifier of the route in UUID format.
Declaration
Swift
public let id: UUID
-
Defines how was the route initially computed. Whether as primary, or pathAlternative.
Declaration
Swift
public let computedAs: ComputedAs
-
Summary of the route.
Declaration
Swift
public let summary: Summary
-
List of route legs.
Declaration
Swift
public let legs: [RouteLeg]
-
List of the route stops.
Declaration
Swift
public var routeStops: [RouteStop]
-
Route sections.
Declaration
Swift
public let sections: Sections
-
List of the route points.
Declaration
Swift
public var routePoints: [RoutePoint]
-
List of all coordinates of the route.
Declaration
Swift
public let geometry: [CLLocationCoordinate2D]
-
The route modification history.
Declaration
Swift
public var modificationHistory: RouteModificationHistory
-
The reason why the route was planned.
Declaration
Swift
public var planningReason: PlanningReason
-
The offset where incremental computation of route contents was paused.
Declaration
Swift
public var guidanceProgressOffset: Measurement<UnitLength>
-
The description of the route.
Declaration
Swift
public var description: String { get }
-
The list of waypoints.
Declaration
Swift
public var waypoints: [RouteStop] { get }
-
The origin point of the route.
Declaration
Swift
public var origin: RouteStop? { get }
-
The destination point of the route.
Declaration
Swift
public var destination: RouteStop? { get }
-
Returns a 2D array (broken into legs) of route points still to be driven.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public func remainingRoutePoints(distanceAlongRoute: Measurement<UnitLength>) -> [[RoutePoint]]
Parameters
distanceAlongRoute
Distance already traveled along the route.