Classes
The following classes are available globally.
-
A
Directions
object provides you with optimal directions between different locations, or waypoints. The directions object passes your request to the Mapbox Directions API and returns the requested information to a closure (block) that you provide. A directions object can handle multiple simultaneous requests. ARouteOptions
object specifies criteria for the results, such as intermediate waypoints, a mode of transportation, or the level of detail to be returned.Each result produced by the directions object is stored in a
See moreRoute
object. Depending on theRouteOptions
object you provide, each route may include detailed information suitable for turn-by-turn directions, or it may include only high-level information such as the distance, estimated travel time, and name of each leg of the trip. The waypoints that form the request may be conflated with nearby locations, as appropriate; the resulting waypoints are provided to the closure.Declaration
Swift
open class Directions: NSObject
-
A single cross street along a step.
See moreDeclaration
Swift
public class Intersection: NSObject, NSSecureCoding
-
A lane on the road approaching an intersection.
See moreDeclaration
Swift
public class Lane: NSObject, NSSecureCoding
-
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
See moreDirections.calculate(_:completionHandler:)
method. However, if you use theDirections.url(forCalculating:)
method instead, you can pass the results of the HTTP request into this class’s initializer.Declaration
Swift
open class Route: NSObject, NSSecureCoding
-
A
RouteLeg
object defines a single leg of a route between two waypoints. If the overall route has only two waypoints, it has a singleRouteLeg
object that covers the entire route. The route leg object includes information about the leg, such as its name, distance, and expected travel time. Depending on the criteria used to calculate the route, the route leg object may also include detailed turn-by-turn instructions.You do not create instances of this class directly. Instead, you receive route leg objects as part of route objects when you request directions using the
See moreDirections.calculate(_:completionHandler:)
method.Declaration
Swift
open class RouteLeg: NSObject, NSSecureCoding
-
A
RouteOptions
object is a structure that specifies the criteria for results returned by the Mapbox Directions API.Pass an instance of this class into the
See moreDirections.calculate(_:completionHandler:)
method.Declaration
Swift
open class RouteOptions: NSObject, NSSecureCoding
-
A
RouteOptionsV4
object is a structure that specifies the criteria for results returned by the Mapbox Directions API v4.Pass an instance of this class into the
See moreDirections.calculate(_:completionHandler:)
method.Declaration
Swift
open class RouteOptionsV4: RouteOptions
-
A
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
See moreDirections.calculate(_:completionHandler:)
method, setting theincludesSteps
option totrue
in theRouteOptions
object that you pass into that method.Declaration
Swift
open class RouteStep: NSObject, NSSecureCoding
-
A
See moreWaypoint
object indicates a location along a route. It may be the route’s origin or destination, or it may be another location that the route visits. A waypoint object indicates the location’s geographic location along with other optional information, such as a name or the user’s direction approaching the waypoint. You create aRouteOptions
object using waypoint objects and also receive waypoint objects in the completion handler of theDirections.calculate(_:completionHandler:)
method.Declaration
Swift
open class Waypoint: NSObject, NSCopying, NSSecureCoding