googlemaps / googlemaps/android-maps-compose
Clustering should support diff util
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 181
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
**Is your feature request related to a problem? Please describe.**
My map has millions of points so I cannot add all of them at once. Hence what map moves I download items only visible on screen. When user does only small map movements points and clusters flicker and animations looks bad. This is because current implementation look like this:
```
LaunchedEffect(itemsState) {
snapshotFlow { itemsState.value.toList() }
.collect { items ->
clusterManager.clearItems()
clusterManager.addItems(items)
clusterManager.cluster()
}
}
```
So when ever items are updated clustering is recreated.
**Describe the solution you'd like**
I think we should be able to provide some diffing to only add or remove a subset of items.
**Describe alternatives you've considered**
I also though about just coping whole `Clustering` method and add custom logic, but it's not possible to reuse `ResetMapListeners` method.
Contributor guide
Assessment
This issue has not been assessed yet.