RouteResponse
A RouteResponse
object is a structure that corresponds to a directions response returned by the Mapbox Directions API.
-
-
The raw HTTP response from the Directions API.
-
The unique identifier that the Mapbox Directions API has assigned to this response.
-
An array of
Waypoint
objects in the order of the input coordinates. EachWaypoint
is an input coordinate snapped to the road and path network.This property omits the waypoint corresponding to any waypoint in
RouteOptions.waypoints
that hasWaypoint.separatesLegs
set totrue
. -
The criteria for the directions response.
-
The credentials used to make the request.
-
The time when this
RouteResponse
object was created, which is immediately upon recieving the raw URL response.If you manually start fetching a task returned by
Directions.url(forCalculating:)
, this property is set tonil
; use theURLSessionTaskTransactionMetrics.responseEndDate
property instead. This property may also be set tonil
if you create this result from a JSON object or encoded object.This property does not persist after encoding and decoding.
-
Managed array of
RoadClasses
restrictions specified toRouteOptions.roadClassesToAvoid
which were violated during route calculation.Routing engine may still utilize
RoadClasses
meant to be avoided in cases when routing is impossible otherwise.Violations are ordered by routes from the
routes
array, then by a leg, step, and intersection, whereRoadClasses
restrictions were ignored.nil
and empty return arrays correspond tonil
and emptyroutes
array respectively. -
-
-
-
-
Filters
roadClassExclusionViolations
lazily to search for specific leg and step.Passing
nil
aslegIndex
will result in searching for all legs. -
Filters
roadClassExclusionViolations
lazily to search for specific leg and step.Passing
nil
asstepIndex
will result in searching for all steps. -
Filters
roadClassExclusionViolations
lazily to search for specific leg, step and intersection.Passing
nil
asintersectionIndex
will result in searching for all intersections of given step.