Match
open class Match : DirectionsResult
extension Match: Equatable
A Match object defines a single route that was created from a series of points that were matched against a road network.
Typically, you do not create instances of this class directly. Instead, you receive match objects when you pass a MatchOptions object into the Directions.calculate(_:completionHandler:) method.
-
Initializes a match.
Typically, you do not create instances of this class directly. Instead, you receive match objects when you request matches using the
Directions.calculate(_:completionHandler:)method.Declaration
Swift
public init(legs: [RouteLeg], shape: LineString?, distance: LocationDistance, expectedTravelTime: TimeInterval, confidence: Float, weight: Weight)Parameters
legsThe legs that are traversed in order.
shapeThe matching roads or paths as a contiguous polyline.
distanceThe matched path’s cumulative distance, measured in meters.
expectedTravelTimeThe route’s expected travel time, measured in seconds.
confidenceA number between 0 and 1 that indicates the Map Matching API’s confidence that the match is accurate. A higher confidence means the match is more likely to be accurate.
weightA
Weightenum, which represents the weight given to a specificMatch. -
Creates a match from a decoder.
Precondition
If the decoder is decoding JSON data from an API response, theDecoder.userInfodictionary must contain aMatchOptionsobject in theCodingUserInfoKey.optionskey. If it does not, aDirectionsCodingError.missingOptionserror is thrown.Declaration
Swift
public required init(from decoder: Decoder) throwsParameters
decoderThe decoder of JSON-formatted API response data or a previously encoded
Matchobject. -
Declaration
Swift
open override func encode(to encoder: Encoder) throws -
A number between 0 and 1 that indicates the Map Matching API’s confidence that the match is accurate. A higher confidence means the match is more likely to be accurate.
Declaration
Swift
open var confidence: Float -
Declaration
Swift
public static func == (lhs: Match, rhs: Match) -> Bool
Install in Dash
Match Class Reference