Skip to content

ANR with Marker Clustering #438

@Whappens

Description

@Whappens

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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions