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
Parameters
legs
The legs that are traversed in order.
shape
The matching roads or paths as a contiguous polyline.
distance
The matched path’s cumulative distance, measured in meters.
expectedTravelTime
The route’s expected travel time, measured in seconds.
confidence
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.
weight
A
Weight
enum, 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.userInfo
dictionary must contain aMatchOptions
object in theCodingUserInfoKey.options
key. If it does not, aDirectionsCodingError.missingOptions
error is thrown.Declaration
Swift
public required init(from decoder: Decoder) throws
Parameters
decoder
The decoder of JSON-formatted API response data or a previously encoded
Match
object. -
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