Closed MichelVHoward closed 1 month ago
@MichelVHoward there was a known issue about sharing the root map node between map instances, which is fixed in v11.3.0-rc.1, could you try the latest Maps SDK https://github.com/mapbox/mapbox-maps-android/releases/tag/v11.3.0-rc.1 ?
I have tested with the mentioned version at it seems to work now thanx :-)
It works
Environment
Observed behavior and steps to reproduce
When using compose navigation directly from one MapboxMap composable, with One pointAnnotation, to the antother MapboxMap composable, the annotation on the navigated to composable disappears after a short while. It does not happen if you have a composable navigation step in between, and it does not happen in simple conditional rendering controlled by some simple boolean state. The code for trying the three different scenarios are shown in the following code and preview of a composable, which i easy to load into a project connected to MapBox. Of course you have to change theme and R.drawable.Ids.
The behavior is the same if coding the contents in a normal Activity!
Expected behavior
The expected behavior is that navigating to a MapboxMap to another keeps the pointannotation in the navigated to MapboxMap The two last preview tests do indeed do this, but not the first
Notes / preliminary analysis
I have tried many ways to avoid this problem but the best hack i have come up with is a fake destination in between the navigation destinations as shown in the second preview
Additional links and references
I have attached a video and here is a logcat snippet that looks suspicious
https://github.com/mapbox/mapbox-maps-android/assets/93967568/d4bb48bb-1d27-494e-b2ec-c375678f2779