mapbox / mapbox/mapbox-navigation-ios-examples
Disable proactive rerouting, route refreshing after map matching
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 63
- Forks
- 32
- Avg merge
- 5m
- Merged PRs (30d)
- 1
Description
The “Custom Server” example relies on the Map Matching API to derive a route from a series of waypoints. This example is intended for a “Bring Your Own Route” use case where the waypoints are control points from a route produced by another routing engine. In that case, proactive rerouting would automatically undo any customization implemented through the BYOR workflow. The route refreshing functionality added in mapbox/mapbox-navigation-ios#2284 would also fail because the route doesn’t come from the Directions API but is instead synthesized on the client-side.
The navigation SDK has no way to distinguish a Route obtained through `Directions.calculateRoutes(matching:completionHandler:)` from one obtained through `calculate(_:completionHandler:)`. So it falls to the developer to disable proactive rerouting and route refreshing manually:
```swift
let router = navigationViewController.navigationService.router
router.reroutesProactively = false
router.refreshesRoute = false
```
We should add these lines to the “Custom Server” example:
https://github.com/mapbox/navigation-ios-examples/blob/e85b6f530e7b6a0e9fe8f18f5d22472323e43eb7/Navigation-Examples/Examples/Custom-Server.swift#L30-L33
/cc @mapbox/navigation-ios
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open Navigation-Examples/Examples/Custom-Server.swift around lines 30–33 and review how the navigation service router is configured. Disable proactive rerouting and route refreshing for this example, then build or run the Custom Server example to confirm the BYOR route remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100