Skip to content
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

Question: Cluster by distance #189

Open
HunterJS-bit opened this issue Oct 26, 2020 · 4 comments
Open

Question: Cluster by distance #189

HunterJS-bit opened this issue Oct 26, 2020 · 4 comments

Comments

@HunterJS-bit
Copy link

First off all thank you for a great plugin :), second I have question regarding this plugin, does it support clustering by distance in meters ?

@fungiboletus
Copy link
Member

Thanks. It hasn't been maintained for a while unfortunately.

It doesn't support clustering by distance in meters. The main difficulty is with the classic web mercator projection (WGS84), the scale is not the same everywhere in the world. There is a huge difference between the equator line and the north or the south of the world. At the same time, this library uses a fixed grid everywhere in the world. Not having a fixed grid would mean writing a new library.

If you zoom though, like at a city zoom level, the differences are not significant and you could compute how many pixels your distance in meters is, using the right projection in this part of the world at this zoom level, and then change the cluster size dynamically.

@HunterJS-bit
Copy link
Author

@fungiboletus Thank you so much for answering 👍 , Do you know any other library that has this functionality ?
How could I do that what you described, do you have any code sample? I'm a bit noob

@fungiboletus
Copy link
Member

Sorry I don't know any library with this functionality. About what I described, it's not super easy to implement with leaflet so I would recommend to continue looking for a library with this functionality.

@HunterJS-bit
Copy link
Author

@fungiboletus Thank you for you answer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants