osmbonuspack icon indicating copy to clipboard operation
osmbonuspack copied to clipboard

ANR with Marker Clustering

Open Whappens opened this issue 2 years ago • 2 comments

I have ANR using RadiusMarkerClusterer using zoom with 5k+ markers on the map. And it's fine enough (no ANRs) while I use simple FolderOverlay. I see no extra code repeats and suppose, I can't wrap it within a coroutine or something like that to increase performance.

items.forEach { item ->
    val marker = Marker(mapView).apply {
        position = GeoPoint(item.latLng.latitude, item.latLng.longitude)
//            relatedObject = item
    }

    marker.setOnMarkerClickListener { osmMarker, _ ->
        Timber.v("Marker clicked: ${osmMarker.title}")
        true
    }
    cluster.add(marker)
}

Whappens avatar Sep 15 '23 13:09 Whappens

Is the ANR occuring when creating markers/cluster, or at drawing, or specifically at a zoom level change ?

MKergall avatar Sep 19 '23 09:09 MKergall

Zoom change.

I see no extra code repeats

Psijic avatar Sep 19 '23 14:09 Psijic