Directionsobject 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. A
RouteOptionsobject 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 aSee more
Routeobject. Depending on the
RouteOptionsobject 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.
open class Directions : NSObject
extension Directions: OfflineDirectionsProtocol
Waypointobject 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 a
RouteOptionsobject using waypoint objects and also receive waypoint objects in the completion handler of the
public class Waypoint : Codable, ForeignMemberContainerClass
extension Waypoint: Equatable
extension Waypoint: CustomStringConvertible