Looks like there's a bug in the Crane Compose samp...
# compose
d
Looks like there's a bug in the Crane Compose sample, here: See this line where the map is updated e.g. by a change in zoom. The map preparation coroutine will run with every recomposition. Firstly it feels to me like running
getMapAsync
every time is rather inefficient, the first returned instance could be cached? But ok, if we let that pass and assume that the same Map instance will be returned each time... then this code is continually adding more MapMarkers to the map and never removing them?
a
cc @nickbutcher
👀 1
d
cc @Manuel Vivo 👆
m
Thanks! I’ll take a look, I think we’re relying on
AndroidView
to not recompose that much
Thanks for flagging, definitely an issue when the zoom is updated 🙂 the map should be initalised only once https://github.com/android/compose-samples/pull/465