SINTEF-9012 / PruneCluster

Fast and realtime marker clustering for Leaflet
MIT License
551 stars 131 forks source link

Clustering based on distance and get cluster details before Zoom-in #160

Open kirantpatil opened 6 years ago

kirantpatil commented 6 years ago

Hi,

Sorry, I have two questions in one issue and they are dependent.

How to cluster the markers whose distance is less than 3 meters ?

If it is possible then how to get cluster details as soon as map loads.

Ex: For below image I would like to get, 1 cluster with 6 markers (marker1, marker2, marker4, marker5, marker6, marker7) and each marker details (name, latlng, ...)

screenshot-2017-12-6 containermon

Thanks

fungiboletus commented 6 years ago

It's difficult to cluster based on a distance because the clusters are projected to pixels and not meters. It also change a lot if you are looking at data close to the equator line or close to the poles. I think supporting clusters based on distance would require many changes in this library, it might be simpler to start from scratch.

It's possible to get cluster details as soon as the map loads, but this library doesn't have any API for that.

DanielRuf commented 6 years ago

This might be a good idea.

DanielRuf commented 6 years ago

How would a px based solution look like to check the distance between all markers?

DanielRuf commented 6 years ago

Or setting the minimum required distance between all items to cluster elements.