I am using a ClusterManager
to cluster potentially thousands of markers. The default clustering shows values like 10+, 100+, 500+, etc and I needed to show the exact value.
I therefore overrode getClusterText(bucket: Int): String
. When completely zoomed out, the one cluster showing on the map would show 3987 and yet I passed 4000 markers to the cluster manager.
I then thought it had to do with caching or something, so I zoomed in to see if all markers were where they were expected. Lo and behold, it seems that when there are two or more markers on the same spot (same lat and long), and same title and snippet (i'm guessing), only one of them is shown, as if the manager is removing what it thinks are duplicates.
If there are indeed two or more on the spot I would expect it to cluster them, as it is doing in other areas (see image below).
I have verified at the time of passing the markers to the cluster manager that they are indeed 4000 count. But upon zoom out cluster, only 4000-x
What is interesting is that I have an iOS project that consumes the same data, it reports 4000 before adding to the map, and when completely zoomed out, it also shows 4000 and all the expected markers.
As you can see, clustering is working fine. However when there are two of the 'same' markers it doesn't render them. I have checked on all similar instances (same lat, long, etc) and the manager just renders one item.
I have also tried adjusting each ClusterItem
s position variable by adding a very small random fraction to the lat and long, and also adjust the title and snippet by adding a random string, didn't make a difference.
Is there something I am missing in ClusterManager or elsewhere?
I am unable to post the code at the moment
Update
I have checked my json response and there are indeed two items on that spot with the same data/information (which is required and needs to be shown). Still trying to figure out why it's not clustering them.