DirectionsResult
open class DirectionsResult : Codableextension DirectionsResult: CustomStringConvertibleA DirectionsResult represents a result returned from either the Mapbox Directions service.
You do not create instances of this class directly. Instead, you receive Route or Match objects when you request directions using the Directions.calculate(_:completionHandler:) or Directions.calculateRoutes(matching:completionHandler:) method.
- 
                  
                  DeclarationSwift public required init(from decoder: Decoder) throws
- 
                  
                  DeclarationSwift public func encode(to encoder: Encoder) throws
- 
                  
                  The roads or paths taken as a contiguous polyline. The shape may be nilor simplified depending on theDirectionsOptions.routeShapeResolutionproperty of the originalRouteOptionsorMatchOptionsobject.Using the Mapbox Maps SDK for iOS or Mapbox Maps SDK for macOS, you can create an MGLPolylineobject using these coordinates to display an overview of the route on anMGLMapView.DeclarationSwift public let shape: LineString?
- 
                  
                  The legs that are traversed in order. The number of legs in this array depends on the number of waypoints. A route with two waypoints (the source and destination) has one leg, a route with three waypoints (the source, an intermediate waypoint, and the destination) has two legs, and so on. To determine the name of the route, concatenate the names of the route’s legs. DeclarationSwift public let legs: [RouteLeg]
- 
                  
                  The route’s distance, measured in meters. The value of this property accounts for the distance that the user must travel to traverse the path of the route. It is the sum of the distanceproperties of the route’s legs, not the sum of the direct distances between the route’s waypoints. You should not assume that the user would travel along this distance at a fixed speed.DeclarationSwift public let distance: CLLocationDistance
- 
                  
                  The route’s expected travel time, measured in seconds. The value of this property reflects the time it takes to traverse the entire route. It is the sum of the expectedTravelTimeproperties of the route’s legs. If the route was calculated using theDirectionsProfileIdentifier.automobileAvoidingTrafficprofile, this property reflects current traffic conditions at the time of the request, not necessarily the traffic conditions at the time the user would begin the route. For other profiles, this property reflects travel time under ideal conditions and does not account for traffic congestion. If the route makes use of a ferry or train, the actual travel time may additionally be subject to the schedules of those services.Do not assume that the user would travel along the route at a fixed speed. For more granular travel times, use the RouteLeg.expectedTravelTimeorRouteStep.expectedTravelTime. For even more granularity, specify theAttributeOptions.expectedTravelTimeoption and use theRouteLeg.expectedSegmentTravelTimesproperty.DeclarationSwift open var expectedTravelTime: TimeInterval
- 
                  
                  The route’s typical travel time, measured in seconds. The value of this property reflects the typical time it takes to traverse the entire route. It is the sum of the typicalTravelTimeproperties of the route’s legs. This property is available when using theDirectionsProfileIdentifier.automobileAvoidingTrafficprofile. This property reflects typical traffic conditions at the time of the request, not necessarily the typical traffic conditions at the time the user would begin the route. If the route makes use of a ferry, the typical travel time may additionally be subject to the schedule of this service.Do not assume that the user would travel along the route at a fixed speed. For more granular typical travel times, use the RouteLeg.typicalTravelTimeorRouteStep.typicalTravelTime.DeclarationSwift open var typicalTravelTime: TimeInterval?
- 
                  
                  The locale to use for spoken instructions. This locale is specific to Mapbox Voice API. If nilis returned, the instruction should be spoken with an alternative speech synthesizer.DeclarationSwift open var speechLocale: Locale?
- 
                  
                  A unique identifier for a directions request. Each route produced by a single call to Directions.calculate(_:completionHandler:)has the same route identifier.DeclarationSwift open var routeIdentifier: String?
- 
                  
                  The time immediately before a Directionsobject fetched this result.If you manually start fetching a task returned by Directions.url(forCalculating:), this property is set tonil; use theURLSessionTaskTransactionMetrics.fetchStartDateproperty instead. This property may also be set tonilif you create this result from a JSON object or encoded object.This property does not persist after encoding and decoding. DeclarationSwift open var fetchStartDate: Date?
- 
                  
                  The time immediately before a Directionsobject received the last byte of this result.If you manually start fetching a task returned by Directions.url(forCalculating:), this property is set tonil; use theURLSessionTaskTransactionMetrics.responseEndDateproperty instead. This property may also be set tonilif you create this result from a JSON object or encoded object.This property does not persist after encoding and decoding. DeclarationSwift open var responseEndDate: Date?
- 
                  
                  DeclarationSwift public var description: String { get }
 Install in Dash
              Install in Dash
             DirectionsResult Class Reference
        DirectionsResult Class Reference