Conversation
5932f1b to
095503c
Compare
|
@jill-cardamon, it'd be good to update this PR as it's pretty outdated. |
|
@1ec5, could you please take a look when you have time? |
fd00171 to
3725e95
Compare
Codecov Report
@@ Coverage Diff @@
## main #626 +/- ##
==========================================
- Coverage 85.30% 84.34% -0.96%
==========================================
Files 52 57 +5
Lines 4545 4854 +309
==========================================
+ Hits 3877 4094 +217
- Misses 668 760 +92
|
| /** | ||
| An array of `Waypoints` objects representing locations that will be in the matrix. | ||
| */ | ||
| public var waypoints: [Waypoint] |
There was a problem hiding this comment.
Should we reuse Waypoint for the Matrix API? Judging from the public API documentation, many of the options in Waypoint don’t apply to the Matrix API, either as input or output.
There was a problem hiding this comment.
My thought was that using same Waypoint would be useful when after requesting the Matrix, user will pick these same waypoints to build an actual route.
| /** | ||
| The coordinates at a given index in the `waypoints` array that should be used as destinations. | ||
|
|
||
| By default, all waypoints in the `waypoints` array are used as destinations. | ||
| */ | ||
| public var destinations: [Int]? | ||
|
|
||
| /** | ||
| The coordinates at a given index in the `waypoints` array that should be used as sources. | ||
|
|
||
| By default, all waypoints in the `waypoints` array are used as sources. | ||
| */ | ||
| public var sources: [Int]? |
There was a problem hiding this comment.
If we make a separate Matrix.Waypoint type, then it could have isSource and isDestination properties to avoid the need for maintaining parallel arrays of indices, which introduce the potential for out-of-bounds errors. Otherwise, a subclass of Waypoint might still be valuable as a place to put these properties.
There was a problem hiding this comment.
Re-worked this approach to have separate arrays of waypoints for sources and destinations.
… added coding unit test
…tions arrays to get rid of indices array.
…ributeOptions; code docs updated
2063bf9 to
cdc813a
Compare
|
Detected breaking changes are not related to current PR: |
…t common pieces for url request composing for different services.
Even if breaking change isn't related, it shouldn't be in output after PR is merged. https://github.com/mapbox/mapbox-directions-swift/tree/main/swift-package-baseline#the-procedure-of-accepting-breaking-changes describes what to do to accept a breaking change. |
Fixes #419.
This PR adds a
Matrixobject to access the Matrix API. Integration is similar toDirectionsandIsochrones.Needs to be rebased on top of main.