Thread
#compose
    d

    darkmoon_uk

    1 year ago
    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?
    Adam Powell

    Adam Powell

    1 year ago
    cc @nickbutcher
    d

    darkmoon_uk

    1 year ago
    cc @Manuel Vivo 👆
    Manuel Vivo

    Manuel Vivo

    1 year ago
    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 oncehttps://github.com/android/compose-samples/pull/465