Search code examples
androidgoogle-maps-android-api-2markermarkerclusterer

Markers having same locations not showing in Map when using Google Map Android Clusters library. Shows only clustered item (10+)


I am using the Google Map Android clustering Utitlity With Google Maps v2 play services.

I cannot able to view the markers having the same locations. The cluster shows as 10 and I cannot able to view those 10 markers even with the max zoom. I want to know the possibility of where to add the offset to the markers with same locations. Is there any predefined methods involved in the cluster utility to overcome this problem.

Thanks in advance.

enter image description here


Solution

  • Finally, i found a work around to overcome this problem. Sorry for answering to my own question, it may help some.

    Just changed a private method in DefaultClusterRenderer from Utility library. It has a method,

    protected boolean shouldRenderAsCluster(Cluster<T> cluster)
    

    Change the above method to return false if map goes to maximum or specific zoom level. If I zoom the map to maximum level, it shows all markers in the map in same location it may appear as single marker since it is in same location. To show the marker info/details for all markers, then I displayed the list of marker details when marker clicks. It will be handled on your Activity,

    public boolean onClusterItemClick(Object item)