mapbox / mapbox/mapbox-navigation-ios-examples
Example for refreshing a route on a preview map
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 63
- Forks
- 32
- Avg merge
- 5m
- Merged PRs (30d)
- 1
Description
If the application calculates and displays a route on a preview map, but the user leaves the preview map sitting there for over 2 minutes without starting a trip, the application should ideally refresh the route to reflect current traffic conditions. The process is straightforward but not especially discoverable, so we should add an example of it.
As far as I can tell, refreshing the route would entail:
- Call
Directions.refreshRoute(responseIdentifier:routeIndex:fromLegAtIndex:completionHandler:)on a timer. - In the completion handler, call
Route.refreshLegAttributes(from:). - Call
NavigationMapView.show(_:legIndex:).
It’s only possible to refresh a single route at a time. We could chain the refresh calls to refresh all the routes in series, or we could refresh only the currently selected route, restarting the timer when selecting a different route.
/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
Start with the preview-map example and the listed Directions.refreshRoute, Route.refreshLegAttributes, and NavigationMapView.show entry points. Decide whether the example refreshes only the selected route or chains all routes, then demonstrate refreshing after two minutes of inactivity and verify that the displayed route reflects the refreshed data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- documentation, mobile
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100