Open pseudoankit opened 1 year ago
@pseudoankit Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
google-maps
tagThis is an automated message, feel free to ignore.
Update : Even if we mark data class with @Stable
then also many times it skips composition
Update 2: got some workaround
wrapping the compose method with key
block and providing the list as key seems to work
when using ImmutableCollection
data class Polyline(val latLngs : ImmutableList<LatLng>)
val mapPolylineList = persistentListOf<Polyline>()
key(mapPolylineList) {
PlotPolyline(mapPolyline = mapPolylineList)
}
Update 2: got some workaround wrapping the compose method with
key
block and providing the list as key seems to work when usingImmutableCollection
data class Polyline(val latLngs : ImmutableList<LatLng>) val mapPolylineList = persistentListOf<Polyline>() key(mapPolylineList) { PlotPolyline(mapPolyline = mapPolylineList) }
Any explanation on how this works ??
@GaneshShetty951 it's does exactly same how having parms in composable works but for some reasons composable annotated with @GoogeMapsCompose was not behaving correctly so key block also does the same if value changes then only it will recompose it's block
Exact same behavior with Marker
.
Using ImmutableCollection
does not trigger a recomposition of Marker
which causes some markers to not appear
I need to draw polylines if I pass
List<LatLng>
it's fine but recomposing unnecessarilyhttps://user-images.githubusercontent.com/54987308/231945860-6d484479-51b3-41c4-9d0f-edb1875f887d.mov
if I pass
ImmutableList<LatLng>
it's skipping composition even if required many timeshttps://user-images.githubusercontent.com/54987308/231947188-6521e465-a799-48d0-8d08-c5c6f7f7ec6d.mov