mapbox / mapbox/mapbox-maps-android
Entering the tunnel and then exiting, unable to obtain the latest positioning information, the current location icon on the map will no longer update its position
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Android OS version:Android 14
- Devices affected:Most mobile phones
- Maps SDK Version: com.mapbox.maps:android-ndk27:11.16.6,com.mapbox.navigationcore:android-ndk27:3.17.0-rc.3
## Observed behavior and steps to reproduce
1、Use the demo to obtain the current user location data. The app is always in the foreground. After entering the tunnel for more than ten minutes, the latitude and longitude returned by the "onNewPositionMatcherResult" method are always the latitude and longitude before entering the tunnel. The killing process will not update the latitude and longitude again
2、Our self-developed app uses mapboxNavigation. startTripSession() to start positioning, obtain the current location, exit to the background, enter the tunnel for more than ten minutes, and exit the tunnel. The "onNewPositionMatcherResult" method always returns the latitude and longitude before entering the tunnel, and the puck stops at the position when exiting to the background, not the current position. Killing the process will not update latitude and longitude again

## Expected behavior
1、Start positioning through "mapboxNavigation. startTripSession()" and return latitude and longitude through "onNewLayoutMatcherResult" in "PositionObserver"
2、Configuration:MapboxNavigationApp.setup(
NavigationOptions.Builder(context).locationOptions(
LocationOptions.Builder().request(
LocationProviderRequest.Builder().interval(
IntervalSettings.Builder().interval(3000L).minimumInterval(3000L).maximumInterval(3000L).build()
).accuracy(AccuracyLevel.HIGHEST).displacement(10F).build()
).build()
).build()
)
## Notes / preliminary analysis
1. The accumulation of internal cache in SDK leads to continuous return of historical latitude and longitude
2. SDK does not automatically switch location providers internally
3. Kill process re-entry, SDK failed to request new latitude and longitude again
## Additional links and references
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 PositionObserver callbacks, especially onNewPositionMatcherResult and the expected onNewLayoutMatcherResult, then trace the startTripSession flow configured through MapboxNavigationApp.setup and LocationOptions. Reproduce the tunnel and background scenarios described in the issue; done means callbacks and the map puck resume reporting the current location after exiting the tunnel.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100