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: ) 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 )
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.
-
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.
See moreDeclaration
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 var geometry: [CLLocationCoordinate2D]
-
The start coordinate of the route.
Declaration
Swift
public let start: CLLocationCoordinate2D
-
The end coordinate of the route.
Declaration
Swift
public let end: CLLocationCoordinate2D
-
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 }
-
List of waypoints.
Declaration
Swift
public var waypoints: [Waypoint] { get }
-
The origin point of the route.
Declaration
Swift
public var origin: Origin? { get }
-
The destination point of the route.
Declaration
Swift
public var destination: Destination? { 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.