mapbox-maps-android
mapbox-maps-android copied to clipboard
Request of having View Annotation Manager methods in MapViewportState in Jetpack Compose extension.
New Feature Request
A request of having View Annotation Manager methods in MapViewportState in Jetpack Compose extension.
Issue with current implementation
I am using Mapbox official jetpack compose extension I have a problem statement where I have to change the View Annotation at certain zoom levels while changing the viewAnnotation, I have to clear the previous annotation which can be done by the method of View Annotation Manager right now which can be accessed by the object of map which is inside the MapEffect of MapBox Composable, due to coroutine scope of mapeffect removal of the marker is happening in the background which sometimes removed the marker which is added after.
Anyhow I have implemented a hacky way to solve my current problem, I am adding an artificial delay while adding the marker on the map which is still not reliable, If i get the methods of View Annotation Manager in the MapViewportState itself then this problem won't occur.
I also would like to know how I can change markers on some certain zoom levels, any approach which can work reliably with current Jetpack compose extension.
@Parth-Thakar could you share some code snippets or sample project where this issue can be reproduced? We tend not to expose ViewAnnotationManager in the MapViewportState as it's mixing different APIs, we could potentially suggest a workaround in your specific use case.