Route
public final class 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.-
A unique identifier of the route in UUID format.
Declaration
Swift
public let id: UUID
-
List of route legs.
Declaration
Swift
public let legs: [RouteLeg]
-
Estimated departure time.
Declaration
Swift
public let departureDate: Date?
-
Estimated arrival time.
Declaration
Swift
public let arrivalDate: Date?
-
Summary of the route.
Declaration
Swift
public let summary: Summary
-
Route sections
Declaration
Swift
public let sections: Sections
-
The start coordinate of the route.
Declaration
Swift
public let startOfRoute: CLLocationCoordinate2D
-
The end coordinate of the route.
Declaration
Swift
public let endOfRoute: CLLocationCoordinate2D
-
List of the route points.
Declaration
Swift
public var routeStops: [TomTomSDKRoute.RouteStop]
-
List of the route coordinates.
Declaration
Swift
public var routeCoordinates: [RouteCoordinate]
-
List of all coordinates of the route.
Declaration
Swift
public lazy var geometry: [CLLocationCoordinate2D] { get set }
-
List of segment distances. Items on the list represent the cumulative offset (in meters) from the start coordinate of the route.
Declaration
Swift
public lazy var segmentDistances: [Double] { get set }
-
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 }
-
Calculates the index of the segment that includes a point on the route in the given distance along the route.
Declaration
Swift
public func getLineSegmentNr(preIndex: Int, distanceAlongRoute: Double) -> Int
Parameters
preIndex
The lowest index of the segment to start the calculation.
distanceAlongRoute
The distance along the route
Return Value
The index of the segment that includes a point on the route in the given distance. If the index can’t be calculated, a negative value is returned.
-
Copies the current route with changes specified in build closure
Declaration
Swift
public func copy(build: (inout Builder) -> ()) -> Route?
Parameters
build
This closure allows for change of Route values
Return Value
A route with the changes set on the closure