RoutePoint

public struct RoutePoint

Represents a route point together with its distance offset along the route and estimated travel time.

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Initializer

    Declaration

    Swift

    public init(coordinate: CLLocationCoordinate2D, routeOffset: Measurement<UnitLength>, travelTime: Measurement<UnitDuration>)

    Parameters

    coordinate

    CLLocationCoordinate2D from the Route polyline.

    routeOffset

    The distance offset along the route.

    travelTime

    Travel time (including traffic delay) from the start of the route.

Public

  • CLLocationCoordinate2D from the Route polyline.

    Declaration

    Swift

    public let coordinate: CLLocationCoordinate2D
  • The distance offset along the route.

    Declaration

    Swift

    public let routeOffset: Measurement<UnitLength>
  • Travel time (including traffic delay) from the start of the route.

    Declaration

    Swift

    public let travelTime: Measurement<UnitDuration>

RoutePoint

  • Calculates the geographic distance from this coordinate to the coordinate given as an argument

    Declaration

    Swift

    public func distance(to otherCoordinate: CLLocationCoordinate2D) -> Measurement<UnitLength>

    Parameters

    otherCoordinate

    A coordinate for calculation

    Return Value

    Calculated distance in meters.

  • Calculates the angle (bearing) between this coordinate and the coordinate given as an argument.

    Declaration

    Swift

    public func angle(to otherCoordinate: CLLocationCoordinate2D) -> Double

    Parameters

    otherCoordinate

    A coordinate for calculation

    Return Value

    Calculated angle.