RoutePoint

public struct RoutePoint

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

  • Creates an instance of RoutePoint.

    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.

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

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