Route
A 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.calculate(_:completionHandler:)
or 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 RouteResponse
or MapMatchingResponse
object and access the RouteResponse.routes
or MapMatchingResponse.routes
property.
-
Initializes a route.
-
Initializes a route from a decoder.
Precondition
If the decoder is decoding JSON data from an API response, theDecoder.userInfo
dictionary must contain aRouteOptions
orMatchOptions
object in theCodingUserInfoKey.options
key. If it does not, aDirectionsCodingError.missingOptions
error is thrown. -
-
-
Configuration for applying
See moreRouteRefreshSource
updates to a route. -
Merges various properties from
refreshedRoute
legs to the reciever. -
Merges the attributes of the given route’s legs into the receiver’s legs.
-
Merges the attributes of the given route’s legs into the receiver’s legs.
-
Merges the incidents of the given route’s legs into the receiver’s legs.
-
Merges the incidents of the given route’s legs into the receiver’s legs.
-
Merges the closures of the given route’s legs into the receiver’s legs.
-