RouteStep
open class RouteStep : Codableextension RouteStep: Equatableextension RouteStep: CustomStringConvertibleA RouteStep object represents a single distinct maneuver along a route and the approach to the next maneuver. The route step object corresponds to a single instruction the user must follow to complete a portion of the route. For example, a step might require the user to turn then follow a road.
You do not create instances of this class directly. Instead, you receive route step objects as part of route objects when you request directions using the Directions.calculate(_:completionHandler:) method, setting the includesSteps option to true in the RouteOptions object that you pass into that method.
- 
                  init(transportType:maneuverLocation:maneuverType:maneuverDirection:instructions:initialHeading:finalHeading:drivingSide:exitCodes:exitNames:phoneticExitNames:distance:expectedTravelTime:typicalTravelTime:names:phoneticNames:codes:destinationCodes:destinations:intersections:speedLimitSignStandard:speedLimitUnit:instructionsSpokenAlongStep:instructionsDisplayedAlongStep:)Initializes a step. DeclarationSwift public init(transportType: TransportType, maneuverLocation: CLLocationCoordinate2D, maneuverType: ManeuverType, maneuverDirection: ManeuverDirection? = nil, instructions: String, initialHeading: CLLocationDirection? = nil, finalHeading: CLLocationDirection? = nil, drivingSide: DrivingSide, exitCodes: [String]? = nil, exitNames: [String]? = nil, phoneticExitNames: [String]? = nil, distance: CLLocationDistance, expectedTravelTime: TimeInterval, typicalTravelTime: TimeInterval? = nil, names: [String]? = nil, phoneticNames: [String]? = nil, codes: [String]? = nil, destinationCodes: [String]? = nil, destinations: [String]? = nil, intersections: [Intersection]? = nil, speedLimitSignStandard: SignStandard? = nil, speedLimitUnit: UnitSpeed? = nil, instructionsSpokenAlongStep: [SpokenInstruction]? = nil, instructionsDisplayedAlongStep: [VisualInstructionBanner]? = nil)ParameterstransportTypeThe mode of transportation used for the step. maneuverLocationThe location of the maneuver at the beginning of this step. maneuverTypeThe type of maneuver required for beginning this step. maneuverDirectionAdditional directional information to clarify the maneuver type. instructionsA string with instructions explaining how to perform the step’s maneuver. initialHeadingThe user’s heading immediately before performing the maneuver. finalHeadingThe user’s heading immediately after performing the maneuver. drivingSideIndicates what side of a bidirectional road the driver must be driving on. Also referred to as the rule of the road. exitCodesAny exit numbers assigned to the highway exit at the maneuver. exitNamesThe names of the roundabout exit. phoneticExitNamesA phonetic or phonemic transcription indicating how to pronounce the names in the exitNamesproperty.distanceThe step’s distance, measured in meters. expectedTravelTimeThe step’s expected travel time, measured in seconds. typicalTravelTimeThe step’s typical travel time, measured in seconds. namesThe names of the road or path leading from this step’s maneuver to the next step’s maneuver. phoneticNamesA phonetic or phonemic transcription indicating how to pronounce the names in the namesproperty.codesAny route reference codes assigned to the road or path leading from this step’s maneuver to the next step’s maneuver. destinationCodesAny route reference codes that appear on guide signage for the road leading from this step’s maneuver to the next step’s maneuver. destinationsDestinations, such as control cities, that appear on guide signage for the road leading from this step’s maneuver to the next step’s maneuver. intersectionsAn array of intersections along the step. speedLimitSignStandardThe sign design standard used for speed limit signs along the step. speedLimitUnitThe unit of speed limits on speed limit signs along the step. instructionsSpokenAlongStepInstructions about the next step’s maneuver, optimized for speech synthesis. instructionsDisplayedAlongStepInstructions about the next step’s maneuver, optimized for display in real time. 
- 
                  
                  DeclarationSwift public func encode(to encoder: Encoder) throws
- 
                  
                  DeclarationSwift public required init(from decoder: Decoder) throws
- 
                  
                  The path of the route step from the location of the maneuver to the location of the next step’s maneuver. The value of this property may be nil, for example when the maneuver type isarrive.Using the Mapbox Maps SDK for iOS or Mapbox Maps SDK for macOS, you can create an MGLPolylineobject using theLineString.coordinatesproperty to display a portion of a route on anMGLMapView.DeclarationSwift public var shape: LineString?
- 
                  
                  The mode of transportation used for the step. This step may use a different mode of transportation than the overall route. DeclarationSwift public let transportType: TransportType
- 
                  
                  The location of the maneuver at the beginning of this step. DeclarationSwift public let maneuverLocation: CLLocationCoordinate2D
- 
                  
                  The type of maneuver required for beginning this step. DeclarationSwift public let maneuverType: ManeuverType
- 
                  
                  Additional directional information to clarify the maneuver type. DeclarationSwift public let maneuverDirection: ManeuverDirection?
- 
                  
                  A string with instructions explaining how to perform the step’s maneuver. You can display this string or read it aloud to the user. The string does not include the distance to or from the maneuver. For instructions optimized for real-time delivery during turn-by-turn navigation, set the RouteOptions.includesSpokenInstructionsoption and use theinstructionsSpokenAlongStepproperty. If you need customized instructions, you can construct them yourself from the step’s other properties or use OSRM Text Instructions.Note If you use the MapboxDirections framework with the Mapbox Directions API, this property is formatted and localized for display to the user. If you use OSRM directly, this property contains a basic string that only includes the maneuver type and direction. Use OSRM Text Instructions to construct a complete, localized instruction string for display.DeclarationSwift public let instructions: String
- 
                  
                  The user’s heading immediately before performing the maneuver. DeclarationSwift public let initialHeading: CLLocationDirection?
- 
                  
                  The user’s heading immediately after performing the maneuver. The value of this property may differ from the user’s heading after traveling along the road past the maneuver. DeclarationSwift public let finalHeading: CLLocationDirection?
- 
                  
                  Indicates what side of a bidirectional road the driver must be driving on. Also referred to as the rule of the road. DeclarationSwift public let drivingSide: DrivingSide
- 
                  
                  The number of exits from the previous maneuver up to and including this step’s maneuver. If the maneuver takes place on a surface street, this property counts intersections. The number of intersections does not necessarily correspond to the number of blocks. If the maneuver takes place on a grade-separated highway (freeway or motorway), this property counts highway exits but not highway entrances. If the maneuver is a roundabout maneuver, the exit index is the number of exits from the approach to the recommended outlet. For the signposted exit numbers associated with a highway exit, use the exitCodesproperty.In some cases, the number of exits leading to a maneuver may be more useful to the user than the distance to the maneuver. DeclarationSwift open var exitIndex: Int?
- 
                  
                  Any exit numbers assigned to the highway exit at the maneuver. This property is only set when the maneuverTypeisManeuverType.takeOffRamp. For the number of exits from the previous maneuver, regardless of the highway’s exit numbering scheme, use theexitIndexproperty. For the route reference codes associated with the connecting road, use thedestinationCodesproperty. For the names associated with a roundabout exit, use theexitNamesproperty.An exit number is an alphanumeric identifier posted at or ahead of a highway off-ramp. Exit numbers may increase or decrease sequentially along a road, or they may correspond to distances from either end of the road. An alphabetic suffix may appear when multiple exits are located in the same interchange. If multiple exits are combined into a single exit, the step may have multiple exit codes. DeclarationSwift public let exitCodes: [String]?
- 
                  
                  The names of the roundabout exit. This property is only set for roundabout (traffic circle or rotary) maneuvers. For the signposted names associated with a highway exit, use the destinationsproperty. For the signposted exit numbers, use theexitCodesproperty.If you display a name to the user, you may need to abbreviate common words like “East” or “Boulevard” to ensure that it fits in the allotted space. DeclarationSwift public let exitNames: [String]?
- 
                  
                  A phonetic or phonemic transcription indicating how to pronounce the names in the exitNamesproperty.This property is only set for roundabout (traffic circle or rotary) maneuvers. The transcription is written in the International Phonetic Alphabet. DeclarationSwift public let phoneticExitNames: [String]?
- 
                  
                  The step’s distance, measured in meters. The value of this property accounts for the distance that the user must travel to go from this step’s maneuver location to the next step’s maneuver location. It is not the sum of the direct distances between the route’s waypoints, nor should you assume that the user would travel along this distance at a fixed speed. DeclarationSwift public let distance: CLLocationDistance
- 
                  
                  The step’s expected travel time, measured in seconds. The value of this property reflects the time it takes to go from this step’s maneuver location to the next step’s maneuver location. If the route was calculated using the DirectionsProfileIdentifier.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 this step. For other profiles, this property reflects travel time under ideal conditions and does not account for traffic congestion. If the step 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 step at a fixed speed. For the expected travel time on each individual segment along the leg, specify the AttributeOptions.expectedTravelTimeoption and use theRouteLeg.expectedSegmentTravelTimesproperty.DeclarationSwift open var expectedTravelTime: TimeInterval
- 
                  
                  The step’s typical travel time, measured in seconds. The value of this property reflects the typical time it takes to go from this step’s maneuver location to the next step’s maneuver location. This property is available when using the DirectionsProfileIdentifier.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 this step. If the step 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 step at a fixed speed. DeclarationSwift open var typicalTravelTime: TimeInterval?
- 
                  
                  The names of the road or path leading from this step’s maneuver to the next step’s maneuver. If the maneuver is a turning maneuver, the step’s names are the name of the road or path onto which the user turns. If you display a name to the user, you may need to abbreviate common words like “East” or “Boulevard” to ensure that it fits in the allotted space. If the maneuver is a roundabout maneuver, the outlet to take is named in the exitNamesproperty; thenamesproperty is only set for large roundabouts that have their own names.DeclarationSwift public let names: [String]?
- 
                  
                  A phonetic or phonemic transcription indicating how to pronounce the names in the namesproperty.The transcription is written in the International Phonetic Alphabet. If the maneuver traverses a large, named roundabout, the exitPronunciationHintsproperty contains a hint about how to pronounce the names of the outlet to take.DeclarationSwift public let phoneticNames: [String]?
- 
                  
                  Any route reference codes assigned to the road or path leading from this step’s maneuver to the next step’s maneuver. A route reference code commonly consists of an alphabetic network code, a space or hyphen, and a route number. You should not assume that the network code is globally unique: for example, a network code of “NH” may indicate a “National Highway” or “New Hampshire”. Moreover, a route number may not even uniquely identify a route within a given network. If a highway ramp is part of a numbered route, its reference code is contained in this property. On the other hand, guide signage for a highway ramp usually indicates route reference codes of the adjoining road; use the destinationCodesproperty for those route reference codes.DeclarationSwift public let codes: [String]?
- 
                  
                  Any route reference codes that appear on guide signage for the road leading from this step’s maneuver to the next step’s maneuver. This property is typically available in steps leading to or from a freeway or expressway. This property contains route reference codes associated with a road later in the route. If a highway ramp is itself part of a numbered route, its reference code is contained in the codesproperty. For the signposted exit numbers associated with a highway exit, use theexitCodesproperty.A route reference code commonly consists of an alphabetic network code, a space or hyphen, and a route number. You should not assume that the network code is globally unique: for example, a network code of “NH” may indicate a “National Highway” or “New Hampshire”. Moreover, a route number may not even uniquely identify a route within a given network. A destination code for a divided road is often suffixed with the cardinal direction of travel, for example “I 80 East”. DeclarationSwift public let destinationCodes: [String]?
- 
                  
                  Destinations, such as control cities, that appear on guide signage for the road leading from this step’s maneuver to the next step’s maneuver. This property is typically available in steps leading to or from a freeway or expressway. DeclarationSwift public let destinations: [String]?
- 
                  
                  An array of intersections along the step. Each item in the array corresponds to a cross street, starting with the intersection at the maneuver location indicated by the coordinates property and continuing with each cross street along the step. DeclarationSwift public let intersections: [Intersection]?
- 
                  
                  The sign design standard used for speed limit signs along the step. This standard affects how corresponding speed limits in the RouteLeg.segmentMaximumSpeedLimitsproperty should be displayed.DeclarationSwift public let speedLimitSignStandard: SignStandard?
- 
                  
                  The unit of speed limits on speed limit signs along the step. This standard affects how corresponding speed limits in the RouteLeg.segmentMaximumSpeedLimitsproperty should be displayed.DeclarationSwift public let speedLimitUnit: UnitSpeed?
- 
                  
                  Instructions about the next step’s maneuver, optimized for speech synthesis. As the user traverses this step, you can give them advance notice of the upcoming maneuver by reading aloud each item in this array in order as the user reaches the specified distances along this step. The text of the spoken instructions refers to the details in the next step, but the distances are measured from the beginning of this step. This property is non- nilif theRouteOptions.includesSpokenInstructionsoption is set totrue. For instructions designed for display, use theinstructionsproperty.DeclarationSwift public let instructionsSpokenAlongStep: [SpokenInstruction]?
- 
                  
                  Instructions about the next step’s maneuver, optimized for display in real time. As the user traverses this step, you can give them advance notice of the upcoming maneuver by displaying each item in this array in order as the user reaches the specified distances along this step. The text and images of the visual instructions refer to the details in the next step, but the distances are measured from the beginning of this step. This property is non- nilif theRouteOptions.includesVisualInstructionsoption is set totrue. For instructions designed for speech synthesis, use theinstructionsSpokenAlongStepproperty. For instructions designed for display in a static list, use theinstructionsproperty.DeclarationSwift public let instructionsDisplayedAlongStep: [VisualInstructionBanner]?
- 
                  
                  DeclarationSwift public static func == (lhs: RouteStep, rhs: RouteStep) -> Bool
- 
                  
                  DeclarationSwift public var description: String { get }
 Install in Dash
              Install in Dash
             RouteStep Class Reference
        RouteStep Class Reference