Rallista / maplibre-compose-playground

Composable MapLibre for Android Kotlin.
Mozilla Public License 2.0
6 stars 3 forks source link

Convert MapControls to MutableState (or similar) #46

Closed Archdoog closed 2 weeks ago

Archdoog commented 1 month ago

Currently the MapControls are set and listened to in the LaunchedEffect in MapLibre.ktL#111. This means that anytime the map controls change, the entire MapLibre launched effect re-runs, fetching the style and rebuilding the map in a new coroutine context. This is particularly problematic if the MapControls change rapidly more than once before the style can load.

Desired behavior

We want MapControls to be settable at any time and simply run an applier process like the MapViewCamera to change the map controls on the existing map.