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.

Lifecycle

Public

  • 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 more

    Declaration

    Swift

    public enum ComputedAs
  • id

    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
  • end

    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.