MatrixOptions
public class MatrixOptions : Codable
extension MatrixOptions: Equatable
Options for calculating matrices from the Mapbox Matrix service.
-
Initializes a matrix options object for matrices and a given profile identifier.
sources
anddestinations
should not be empty, otherwise matrix would not make sense. Total number of waypoints may differ depending on theprofileIdentifier
. See documentation for details.Declaration
Swift
public init(sources: [Waypoint], destinations: [Waypoint], profileIdentifier: ProfileIdentifier)
Parameters
sources
An array of
Waypoints
objects representing sources.destinations
An array of
Waypoints
objects representing destinations.profileIdentifier
A string specifying the primary mode of transportation for the routes.
-
A string specifying the primary mode of transportation for the contours.
Declaration
Swift
public var profileIdentifier: ProfileIdentifier
-
An array of
Waypoints
objects representing locations that will be in the matrix.Declaration
Swift
public var waypoints: [Waypoint] { get }
-
Attribute options for the matrix.
Only
distance
andexpectedTravelTime
are supported. EmptyattributeOptions
will result in default values assumed.Declaration
Swift
public var attributeOptions: AttributeOptions
-
Declaration
Swift
public func encode(to encoder: Encoder) throws
-
Declaration
Swift
public required init(from decoder: Decoder) throws
-
An array of URL query items (parameters) to include in an HTTP request.
Declaration
Swift
public var urlQueryItems: [URLQueryItem] { get }
-
Declaration
Swift
public static func == (lhs: MatrixOptions, rhs: MatrixOptions) -> Bool