mapbox / mapbox/mapbox-navigation-ios
[Bug]: navigationMapView.showRouteDuration(along:) is poorly positioned and color is not switching upon tapping alternative route
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
### Mapbox Navigation SDK version
2.6.0
### Steps to reproduce
Start a navigationViewController and give it the property navigationMapView?.showRouteDurations(along: routeResponse.routes). Then start the active navigation and tap on alternative Route.
### Expected behavior
-The Label showing the duration for each route should be positioned dynamically, like in other navigation services to avoid being hidden by the users position or to avoid overlapping with other labels of the same type. It should be more or less positioned in the center of the part of the route currently seen in the navigation view.
-The position the label aims at should be somewhere on the route, not beside it.
-There should always be a label showing the duration for every alternative shown on the map
-When tapping on an alternative Route, the blue label should turn white and the white label (former alternative route duration label) should turn blue, to indicate that this is the currently selected route.
### Actual behavior
- The Labels are poorly positioned and are sometimes hidden by overlapping labels or even by the users navigation puck.
- The label aims somewhere beside the route and does not touch the route, which would make more sense.
- Some labels are positioned in a way in which it is not 100% clear to which route they belong (see screenshot below), because they are pointing to a part of the route that is also part of the alternative route
- Sometimes, alternative routes don't show any duration labels. Even the main route is sometimes missing the label
- The labels don't switch color, as to be seen in the screenshots below:
Before tapping the alternatve route:

After tapping the alternative route:

### Is this a one-time issue or a repeatable issue?
repeatable
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 by reproducing the issue in a navigationViewController using navigationMapView?.showRouteDurations(along: routeResponse.routes), then tap an alternative route. Trace the route-duration label behavior from that entry point; done means every displayed route has a route-attached, non-overlapping label and the selected route's label colors switch correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100