Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add waypoint indices option for Directions API #334

Closed
1ec5 opened this issue Jan 29, 2019 · 2 comments
Closed

Add waypoint indices option for Directions API #334

1ec5 opened this issue Jan 29, 2019 · 2 comments
Assignees
Labels
improvement Improvement for an existing feature.

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jan 29, 2019

The Directions API will soon expose a waypoints parameter similar to the Map Matching API’s: Project-OSRM/osrm-backend#5345. To support it, we could move MatchOptions.waypointIndices and its support code to DirectionsOptions, allowing RouteOptions to inherit it:

https://github.com/mapbox/MapboxDirections.swift/blob/c350b60489c33845551cf0163a5481d32c940479/MapboxDirections/Match/MBMatchOptions.swift#L49-L56

However, this would be a good opportunity to replace the parallel index set with a more object-oriented property on Waypoint that determines whether the individual waypoint is explicitly persisted in the route response. I’m not sure what to name it: isPersistent? isIncludedInCalculatedRoute? isRepresentedByArrivalAndDepartureSteps? separatesTwoLegs? isIncludedInInstructions? isImpliedByCalculatedRoute? isViaPoint?

Based on this property, we’ll have to revisit the assumption that RouteOptions.waypoints lines up with the response’s waypoints:

https://github.com/mapbox/MapboxDirections.swift/blob/c350b60489c33845551cf0163a5481d32c940479/MapboxDirections/MBRoute.swift#L27-L29

/cc @mapbox/navigation-ios @danesfeder

@1ec5
Copy link
Contributor Author

1ec5 commented Jan 30, 2019

@JThramer suggested a WaypointType enumeration with the values .stop and .via. The enumeration values will need to make sense for both RouteOptions and MatchOptions.

@1ec5 1ec5 self-assigned this Feb 1, 2019
@1ec5
Copy link
Contributor Author

1ec5 commented Feb 6, 2019

mapbox/mapbox-navigation-android#875 and mapbox/mapbox-java#956 track the equivalent for Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement for an existing feature.
Projects
None yet
Development

No branches or pull requests

1 participant