How to get click on the android cluster group?

Issue

I am not able to click on the android cluster group, even after I tried different solutions.

The first solution was to split the cluster using the below solution:

override fun shouldRenderAsCluster(cluster: Cluster<PlaceMedico>): Boolean {
        return cluster.size > 1
    }

It didn’t work as some of the clusters are not splitting.

The second solution was to get click on the cluster group as shown below screenshot, but I am getting click only in the marker, not the cluster:

clusterManager.setOnClusterItemClickListener { item ->
                [email protected] false
}

I need to click on the cluster group, to show data of each item in the cluster on a custom view. Is this possible?

enter image description here

Solution

You need to use setOnClusterClickListener

clusterManager.setOnClusterClickListener { item ->
                ..........
}

Check this question, is the opposite of your problem

Google maps android on cluster items click not working

Answered By – Gireada

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published