open class Route : DirectionsResult
extension Route: Equatable
Route object defines a single route that the user can follow to visit a series of waypoints in order. The route object includes information about the route, such as its distance and expected travel time. Depending on the criteria used to calculate the route, the route object may also include detailed turn-by-turn instructions.
Typically, you do not create instances of this class directly. Instead, you receive route objects when you request directions using the
Directions.calculateRoutes(matching:completionHandler:) method. However, if you use the
Directions.url(forCalculating:) method instead, you can use
JSONDecoder to convert the HTTP response into a
MapMatchingResponse object and access the
Initializes a route.
public override init(legs: [RouteLeg], shape: LineString?, distance: CLLocationDistance, expectedTravelTime: TimeInterval)
The legs that are traversed in order.
The roads or paths taken as a contiguous polyline.
The route’s distance, measured in meters.
The route’s expected travel time, measured in seconds.
Initializes a route from a decoder.
public required init(from decoder: Decoder) throws
The decoder of JSON-formatted API response data or a previously encoded
public static func == (lhs: Route, rhs: Route) -> Bool