mapbox / mapbox/mapbox-maps-android
CameraDebugView is not updating on app start
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: 13
- Devices affected: Google Pixel 4a
- Maps SDK Version: 11.6.0, 11.8.1
Observed behavior and steps to reproduce
Compose app with MapView and MapViewDebugOptions.CAMERA enabled. For example - https://github.com/mapbox/mapbox-maps-android/blob/main/compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/basic/DebugModeActivity.kt
CameraDebugView is not updating (lat, lon, etc.) on app start, But after minimize and return to app again app starts updating of CameraDebugView.
https://github.com/user-attachments/assets/6774ce0b-7254-4048-a96f-9e19483e0c24
Expected behavior
CameraDebugView should always show camera updates
Notes / preliminary analysis
CameraDebugView is not updating because on app start it does not have supscription to CameraChanged event due to DebugOptionsController has value started == false. Only in MapView.onStart() this value is setting to true but at first onStart next contdition is not met:
if (debugOptionsControllerDelegate.isInitialized()) {
debugOptionsController.started = true
}
Workaround: call MapView.onStart() after setting debug options
MapEffect(Unit) { mapView ->
mapView.debugOptions = setOf(
MapViewDebugOptions.CAMERA,
)
mapView.onStart()
}
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 compose-app/src/main/java/com/mapbox/maps/compose/testapp/examples/basic/DebugModeActivity.kt and trace MapView.onStart(), DebugOptionsController.started, and CameraDebugView initialization. Reproduce with CAMERA debug options enabled and verify that CameraDebugView updates immediately on app start without requiring an additional lifecycle call.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100