MatchOptions

@objcMembers
@objc(MBMatchOptions)
open class MatchOptions : DirectionsOptions

A MatchOptions object is a structure that specifies the criteria for results returned by the Mapbox Map Matching API.

Pass an instance of this class into the Directions.calculate(_:completionHandler:) method.

  • Initializes a match options object for matching locations against the road network.

    Declaration

    Swift

    @objc
    public convenience init(locations: [CLLocation], profileIdentifier: MBDirectionsProfileIdentifier? = nil)

    Parameters

    locations

    An array of CLLocation objects representing locations to attempt to match against the road network. The array should contain at least two locations (the source and destination) and at most 25 locations. (Some profiles, such as MBDirectionsProfileIdentifierAutomobileAvoidingTraffic, may have lower limits.)

    profileIdentifier

    A string specifying the primary mode of transportation for the routes. This parameter, if set, should be set to MBDirectionsProfileIdentifierAutomobile, MBDirectionsProfileIdentifierAutomobileAvoidingTraffic, MBDirectionsProfileIdentifierCycling, or MBDirectionsProfileIdentifierWalking. MBDirectionsProfileIdentifierAutomobile is used by default.

  • Initializes a match options object for matching geographic coordinates against the road network.

    Declaration

    Swift

    @objc
    public convenience init(coordinates: [CLLocationCoordinate2D], profileIdentifier: MBDirectionsProfileIdentifier? = nil)

    Parameters

    coordinates

    An array of geographic coordinates representing locations to attempt to match against the road network. The array should contain at least two locations (the source and destination) and at most 25 locations. (Some profiles, such as MBDirectionsProfileIdentifierAutomobileAvoidingTraffic, may have lower limits.) Each coordinate is converted into a Waypoint object.

    profileIdentifier

    A string specifying the primary mode of transportation for the routes. This parameter, if set, should be set to MBDirectionsProfileIdentifierAutomobile, MBDirectionsProfileIdentifierAutomobileAvoidingTraffic, MBDirectionsProfileIdentifierCycling, or MBDirectionsProfileIdentifierWalking. MBDirectionsProfileIdentifierAutomobile is used by default.

  • Declaration

    Swift

    @objc
    public required init(waypoints: [Waypoint], profileIdentifier: MBDirectionsProfileIdentifier?)
  • If true, the input locations are re-sampled for improved map matching results. The default is false.

    Declaration

    Swift

    @objc
    open var resamplesTraces: Bool
  • An index set containing indices of two or more items in coordinates. These will be represented by Waypoints in the resulting Match objects.

    Use this property when the DirectionsOptions.includesSteps property is true or when coordinates represents a trace with a high sample rate. If this property is nil, the resulting Match objects contain a waypoint for each coordinate in the match options.

    If specified, each index must correspond to a valid index in coordinates, and the index set must contain 0 and the last index (one less than endIndex) of coordinates.

    Declaration

    Swift

    @available(*, deprecated, message: "Use Waypoint.separatesLegs instead.")
    @objc
    open var waypointIndices: IndexSet?
  • Declaration

    Swift

    override open var urlQueryItems: [URLQueryItem] { get }