Android – cluster map tags when zooming in and not when zooming in
I am using Google map Android clustering security with Google Maps V2 playback service
I didn't get the behavior I expected. As you can see in the two pictures below, when I zoom in, I can see a cluster of 20 and a single mark to the left, but when I zoom out until they are on top of each other, I can't see their clusters. 20 clusters still say 20 instead of 21?
Is this expected behavior? Is there any way to make the cluster display 21 instead of 20
resolvent:
This is the default behavior specified in defaultclasterrender#onbeforeclusterrendered():
Note that the marked text is selected based on the bucket, not the exact number of items in the cluster
A quick solution is to modify the descriptor creation to:
Of course, you can implement a custom clasterrender and provide it to the clustermanager. In this way, you will be responsible for rendering your tags, but if you just want to change "20" to "21" – I will use the approach first
Edit:
Question in the comments: if you want to increase / decrease the distance threshold for grouped items – you can modify the default algorithm for clustering. Just use this constant (which should be smaller in your case):
But the correct solution is to consider the marker bitmap size rather than a constant value. I assume that Mr. broadfood leaves that as a lover's job:)