diff --git a/app/src/main/java/com/geeksville/mesh/ui/map/MapFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/map/MapFragment.kt index e1a80d11..49f8bf61 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/map/MapFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/map/MapFragment.kt @@ -121,10 +121,9 @@ private fun MapView.UpdateMarkers( overlays.removeAll { it is MarkerWithLabel } // overlays.addAll(nodeMarkers + waypointMarkers) overlays.addAll(waypointMarkers) - nodeClusterer.getItems().clear() - nodeMarkers.forEach { - nodeClusterer.add(it) - } + nodeClusterer.items.clear() + nodeClusterer.items.addAll(nodeMarkers) + nodeClusterer.invalidate() } /** @@ -491,7 +490,9 @@ fun MapView( if (myLocationOverlay != null && overlays.none { it is MyLocationNewOverlay }) { overlays.add(myLocationOverlay) } - map.overlays.add(nodeClusterer) + if (overlays.none { it is RadiusMarkerClusterer }) { + overlays.add(nodeClusterer) + } addCopyright() // Copyright is required for certain map sources createLatLongGrid(false)