Markers at the same location#49
Conversation
There was a problem hiding this comment.
Could you explain this change? I think you might want to revert it.
|
This can be solved by subclassing the DefaultClusterRenderer. See the "PersonRenderer", which subclasses "shouldRenderAsCluster" - it always returns true. |
This reverts commit 2340693.
|
I reverted the change to .gitignore. The intention was to ignore The method Yes, the changes could be achieved with a custom subclass of |
Thanks for this library.
In my app, I have several groups of markers with the same latitude/longitude value. My expectation is that markers at the same location still build a cluster, independent of the minimum cluster size that's configured in
DefaultClusterRenderer.Let's say that there are two markers at (52.0/13.0) and one at (52.01/13.01). Because
MIN_CLUSTER_SIZEinDefaultClusterRendereris currently set to 4, all three markers are separated and placed individually on the map. The two markers at the same location are not accessible by the user because they are rendered on top of each other. Instead, I would expect one cluster with two markers at (52.0/13.0) and the other marker rendered as individual marker.To help the problem, I added
setMinClusterSize/getMinClusterSizeto make the minimum cluster size configurable. This way, I can set the minimum to 1, which will always cluster the markers. In addition, I added the methodisOneLocationtoCluster, which allows me to check for clusters that consist of markers at the same location.Could you please have a look at my additions. Happy to hear your opinion on this problem.