Android how to uncluster on single tap on a cluster marker maps v2
mClusterManager
.setOnClusterClickListener(new OnClusterClickListener<MyItem>() {
@Override
public boolean onClusterClick(final Cluster<MyItem> cluster) {
map.animateCamera(CameraUpdateFactory.newLatLngZoom(
cluster.getPosition(), (float) Math.floor(map
.getCameraPosition().zoom + 1)), 300,
null);
return true;
}
});
you can do that on the click of the marker too ,
but before that you need to do map.setOnMarkerClickListener(mClusterManager);
so that cluster manager gets the click events and you can do
mClusterManagersetOnClusterItemClickListener(new OnClusterItemClickListener<MyItem>() {
}
Bit late to the party
In your onClusterClick function:
LatLngBounds.Builder builder = LatLngBounds.builder();
for (ClusterItem item : cluster.getItems()) {
builder.include(item.getPosition());
}
final LatLngBounds bounds = builder.build();
getMap().animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 100));