Display cluster members when a cluster is pressed

I used   https://developers.google.com/maps/documentation/android/utility/marker-clustering?hl=FR

implement clustering on my google map. When I zoom in and zoom out, the cluster elements get rendered and clusters are created. Everything works perfectly. My question is that I want to display a cluster element when the user also clicks on the cluster. I did not find any method to force the rendering of cluster members. How should I do it?

I get a click event for a cluster,

@Override
public boolean onClusterClick(Cluster<MapStoreData> cluster) {
    // TODO Auto-generated method stub
    Log.v("cluster clicked", "found...");

    return true;
}

this method.

Thanks at Advance.

+4
source share
2 answers

, , , . -

0

:

// Cluster only
Collection<Marker> clusters = mClusterManager.getClusterMarkerCollection().getMarkers();
for(Marker marker : clusters) {
    onBeforeClusterRendered(getCluster(marker), new MarkerOptions());
}

// Cluster item only
Collection<Marker> markers = mClusterManager.getMarkerCollection().getMarkers();
for(Marker marker : markers) {
    onBeforeClusterItemRendered(getClusterItem(marker), new MarkerOptions());
}
0

All Articles