-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
averaged center of cluster #5
Comments
Hi, thanks for pointing this out. Yes, this is a known limitation due to the simple way how cluster centers are calculated at the moment. The center will be the position of the first marker added to the cluster. Since this first marker will depend on the current zoom level (which determines the view boundaries and the visible markers), it's somewhat random how clusters are formed in different zoom levels. Also there can be different definitions of "center". One close to intuition would be one calculated with some weighted algorithm which would put the center in the densest spot. But at the moment this again is not so, the center will be just the very first marker the script encounters that can't be put in a pre-existing cluster and so will create a new cluster. The solution I was thinking of is to pre-calculate the clusters per zoom level, but I haven't yet gotten down to the details of how to implement it. |
In this code |
marimil: thanks, I will look at that implementation, try to track down the bug you mentioned and port it. If you can help patches are welcome! :) |
Please implement the calculation of coordinates of the marker cluster as the average of the coordinates of the markers that belong to the cluster.
In this example http://z-lowicza.pl/mapy/c is drawn incorrectly.
The text was updated successfully, but these errors were encountered: