Route

public struct Route: Decodable

A route from A to B.

  • Length of the route in meters.

    Declaration

    Swift

    public let length: Double
  • Duration of the route in minutes.

    Declaration

    Swift

    public let duration: Double
  • List of coordinates.

    Declaration

    Swift

    public let coords: [CLLocationCoordinate2D]
  • List of specific instructions.

    Declaration

    Swift

    public let instructions: [Instruction]
  • Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder
  • Routing Mode

    See more

    Declaration

    Swift

    public enum Mode: String
  • Fetch a route between two points.

    Declaration

    Swift

    public static func fetch(from origin: CLLocationCoordinate2D,
                                 to destination: CLLocationCoordinate2D,
                                 using mode: Route.Mode,
                                 session: URLSession = .shared,
                                 completion: @escaping (Result<Route>) -> Void)

    Parameters

    origin

    origin

    destination

    destination

    mode

    mode

    session

    session to use, defaults to .shared

    completion

    handler