Search code examples
androidgoogle-mapsmarkerclusterer

Difference between OnClusterClickListener and OnClusterItemClickListener


The docs doesn't say much at all..

OnClusterItemClickListener - Called when an individual ClusterItem is clicked.

OnClusterClickListener - Called when a Cluster is clicked.

What exactly is the difference between them?

If a cluster is a group of map markers that were grouped into one, how exactly can a single item be clicked if only the cluster is showing on the map?


Solution

  • OK I understand my confusion now.

    When you add markers to the map, they are being added as items and when they are not grouped together and still show as an individual markers, you can click on them, and then the OnClusterItemClickListener is called.

    When the items are grouped to a single cluster, and you click on it, the OnClusterClickListener will be called.