mapbox / mapbox/mapbox-navigation-android

OnRouteSelectionChangeListener doesn't fire when clicking already-selected route

Open
#2,267 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

archived
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

We implemented a simple MapView with a navigationRoute, and we would like to implement a function when the user taps on any navigationRoute (even on the currently selected), the map zooms out and shows the entire route. Currently the navigationRoute.onRouteSelectionChangeListener only works if there are at least 2 routes and the user select a different one than the currently selected. How could I access the click event of the already selected route?

### Steps to reproduce

1. Create a MapView
2. Add a NavigationRoute without alternatives and with onRouteSelectionChangeListener
3. Click on the currently shown route

### Expected behavior

The app should have a method which fires when the user taps on any route.

### Actual behavior

The onRouteSelectionChangeListener does not fire.

### Configuration

**Android versions:** 16-28
**Device models:** Any
**Mapbox SDK versions:** 8.3.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with a MapView and a NavigationRoute without alternatives on Android SDK 8.3.0, using the onRouteSelectionChangeListener configuration described in the report. Trace the route-tap and selection-listener entry points to determine the current behavior for the already-selected route. Done means a tap on any displayed route, including the selected route, produces the documented callback or an explicitly documented alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.