googlemaps / googlemaps/android-maps-compose

Clustering should support diff util

Offen
#504 4 Kommentare 14 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
priority: p2 type: feature request
Vorherrschende Sprache
Kotlin
Sterne
1.3k
Forks
181
Ø Merge
2 T. 23 Std.
Gemergte PRs (30 T.)
18

Beschreibung

**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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die Clustering-Implementierung rund um die gezeigte itemsState-Sammlung sowie die Aufrufe von clusterManager clearItems/addItems/cluster nachzuverfolgen. Lies, wie ResetMapListeners verwendet wird, bestimme anschließend das erwartete Verhalten beim Ermitteln von Item-Differenzen und überprüfe, dass kleine Kartenaktualisierungen nicht mehr alle Cluster neu erstellen oder Probleme mit Flackern und Animationen verursachen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, kotlin
Bereich
mobile
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.