Closed meierjan closed 6 years ago
Hi @meierjan. There is no public API in the library to change this, but you can modify the source code. Find the method ClusterManager.getClusters(...)
and increase the value of the tileCount
variable (line 138). The higher the value, the closer clusters will be to each other.
For example I changed it to this: long tileCount = (long) (Math.pow(2, zoomLevel) * 4);
and the result is the following:
Hey, thanks for the heads up. I dug into the source code and found exactly this spot. How do you feel about adding this to the public api? Maybe I can provide a PR
How would you name the method for setting this value?
I will read the source-code completely to understand what actually happens under the hood and then come back with a naming idea. I saw quad-trees so something like grid-size was my first intention.
I feel like grid-size
is too technical and exposes the internal implementation details. If you have other ideas, please let me know.
After thinking for a while what I really wanted was a minimum cluster size. Like not render them as clusters if there a less then X markers in the bucket. So you are free to close this issue if you don't think a "grid-size" is a good feature.
I did it like this. Maybe you have some thoughts: https://github.com/meierjan/google-maps-clustering/pull/1/files
The minimum cluster size is a good candidate to add to the public API. Please send a pull request and I will take a look.
Hey, thank you for writing this library - google maps utils really lacks maintainers...
I wonder if it's possible to change the range of the clusters. I've just seen the screenshots and the clusters seem very far apart.
Thanks in advance.