Directions

extension Directions: RoutingProvider
  • Declaration

    Swift

    @discardableResult
    public func calculateRoutes(options: RouteOptions,
                                completionHandler: @escaping IndexedRouteResponseCompletionHandler) -> NavigationProviderRequest?
  • Declaration

    Swift

    @available(*, deprecated, renamed: "calculateRoutes(options:completionHandler:﹚")
    @discardableResult
    public func calculateRoutes(options: RouteOptions, completionHandler: @escaping RouteCompletionHandler) -> NavigationProviderRequest?
  • Declaration

    Swift

    @discardableResult
    public func calculateRoutes(options: MatchOptions, completionHandler: @escaping MatchCompletionHandler) -> NavigationProviderRequest?
  • Declaration

    Swift

    @discardableResult
    public func refreshRoute(indexedRouteResponse: IndexedRouteResponse, fromLegAtIndex: UInt32, completionHandler: @escaping RouteCompletionHandler) -> NavigationProviderRequest?
  • Declaration

    Swift

    @discardableResult
    public func refreshRoute(indexedRouteResponse: IndexedRouteResponse, fromLegAtIndex: UInt32, currentRouteShapeIndex: Int, currentLegShapeIndex: Int, completionHandler: @escaping RouteCompletionHandler) -> NavigationProviderRequest?
  • Begins asynchronously calculating routes using the given options and delivers the results to a closure.

    This method retrieves the routes asynchronously from the Mapbox Directions API over a network connection. If a server error occurs, details about the error are passed into the given completion handler in lieu of the routes. If network error is encountered, onboard routing engine will attempt to provide directions using existing cached tiles.

    Routes may be displayed atop a Mapbox map.

    Declaration

    Swift

    @discardableResult
    public func calculateWithCache(options: RouteOptions, completionHandler: @escaping IndexedRouteResponseCompletionHandler) -> URLSessionDataTask?

    Parameters

    options

    A RouteOptions object specifying the requirements for the resulting routes.

    completionHandler

    The closure (block) to call with the resulting routes. This closure is executed on the application’s main thread.

    Return Value

    The data task used to perform the HTTP request. If, while waiting for the completion handler to execute, you no longer want the resulting routes, cancel this task.

  • Begins asynchronously calculating routes using the given options and delivers the results to a closure.

    This method retrieves the routes asynchronously from the Mapbox Directions API over a network connection. If a server error occurs, details about the error are passed into the given completion handler in lieu of the routes. If network error is encountered, onboard routing engine will attempt to provide directions using existing cached tiles.

    Routes may be displayed atop a Mapbox map.

    Declaration

    Swift

    @available(*, deprecated, renamed: "calculateWithCache(options:completionHandler:﹚")
    @discardableResult
    public func calculateWithCache(options: RouteOptions, completionHandler: @escaping RouteCompletionHandler) -> URLSessionDataTask?

    Parameters

    options

    A RouteOptions object specifying the requirements for the resulting routes.

    completionHandler

    The closure (block) to call with the resulting routes. This closure is executed on the application’s main thread.

    Return Value

    The data task used to perform the HTTP request. If, while waiting for the completion handler to execute, you no longer want the resulting routes, cancel this task.

  • Begins asynchronously calculating routes using the given options and delivers the results to a closure.

    This method retrieves the routes asynchronously from onboard routing engine using existing cached tiles.

    Routes may be displayed atop a Mapbox map.

    Declaration

    Swift

    public func calculateOffline(options: RouteOptions, completionHandler: @escaping IndexedRouteResponseCompletionHandler)

    Parameters

    options

    A RouteOptions object specifying the requirements for the resulting routes.

    completionHandler

    The closure (block) to call with the resulting routes. This closure is executed on the application’s main thread.

  • Begins asynchronously calculating routes using the given options and delivers the results to a closure.

    This method retrieves the routes asynchronously from onboard routing engine using existing cached tiles.

    Routes may be displayed atop a Mapbox map.

    Declaration

    Swift

    @available(*, deprecated, renamed: "calculateOffline(options:completionHandler:﹚")
    public func calculateOffline(options: RouteOptions, completionHandler: @escaping RouteCompletionHandler)

    Parameters

    options

    A RouteOptions object specifying the requirements for the resulting routes.

    completionHandler

    The closure (block) to call with the resulting routes. This closure is executed on the application’s main thread.