NavigationMatchOptions

open class NavigationMatchOptions : MatchOptions, OptimizedForNavigation

A NavigationMatchOptions object specifies turn-by-turn-optimized criteria for results returned by the Mapbox Map Matching API.

NavigationMatchOptions is a subclass of MatchOptions that has been optimized for navigation. Pass an instance of this class into the Directions.calculateRoutes(matching:completionHandler:). method.

Note: it is very important you specify the waypoints for the route. Usually the only two values for this IndexSet will be 0 and the length of the coordinates. Otherwise, all coordinates passed through will be considered waypoints.

  • Initializes a navigation route options object for routes between the given waypoints and an optional profile identifier optimized for navigation.

    Seealso

    RouteOptions

    Declaration

    Swift

    public required init(waypoints: [Waypoint], profileIdentifier: ProfileIdentifier? = .automobileAvoidingTraffic, queryItems: [URLQueryItem]? = nil)
  • Initializes a navigation match options object for routes between the given locations and an optional profile identifier optimized for navigation.

    Seealso

    MatchOptions

    Declaration

    Swift

    public convenience init(locations: [CLLocation], profileIdentifier: ProfileIdentifier? = .automobileAvoidingTraffic, queryItems: [URLQueryItem]? = nil)
  • Initializes a navigation match options object for routes between the given geographic coordinates and an optional profile identifier optimized for navigation.

    Seealso

    MatchOptions

    Declaration

    Swift

    public convenience init(coordinates: [CLLocationCoordinate2D], profileIdentifier: ProfileIdentifier? = .automobileAvoidingTraffic, queryItems: [URLQueryItem]? = nil)