-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Support spiderfier-like functionality for clustering #2723
Comments
Is this feasible @mourner? |
This is certainly very difficult to do and I don't think we'll be able to tackle this in the short term. |
This would be a really great feature! |
Basic spiderfying in mapbox clustering: https://bewithjonam.github.io/mapboxgl-spiderifier/docs/mapbox-gl-cluster-spiderfy.html Library: https://github.com/bewithjonam/mapboxgl-spiderifier Forks:
Right now, there is no way of tracking points involved in a cluster. These forks minimally adds support for tracking points in a cluster using a property field starting from configured zoom level. |
So is spidering points with the same coordinates possible in Mapbox GL js? Can anyone explain how to achieve this? I'm clustering some points up till a certain zoom level, then they just overlap each other since they have the same lat/longs. Is there any way to spider them out when they come out of a cluster? Following this example: https://www.mapbox.com/mapbox-gl-js/example/cluster Sorry to reopen this issue, let me know if I should open a new one instead. |
Same question. The current support for spiderfier is complex. New version of supercluster supports getChildren() used by spidifier, but it has not yet been merged to mapbox-gl-js (#3318). There is a working demo of supercluster/mapbox-gl-js (https://bl.ocks.org/ryanbaumann/f7eb6c9fd2b8a9a2942b0ff77b2b583a) but with older version of supercluster. So it seems that we still need several forks as mentionned on #2723 (comment). Could this issue be reopenned? |
For those who are ReactJS lover. This is a solution to show the points at same location using spiderifier. |
I also vote for reopening this issue. It is a very basic use case (f.i. artworks in e museum, multi-purpose buildings, etc.) so it is strange that there is no standard solution for this. |
Using those methods, you can get the features in a cluster. And then call spiderifier to spiderfy them. Doc for the same. No forks are required anymore. Only mapboxgl-js and mapboxgl-spiderfier library. |
Thanx for quick reply: |
If anyone looks for a solution, I am working on one right here: |
Here is an vanilla example of spiderifier using a layer or markers if anyone needs it. Github repo, Codepen I think this is a common issue for people using cluster. It would be nice if anyone at Mapbox could add it to examples. |
Sorry for late re-opening. Any standard solution available? Any Mapbox sample around? |
Is there an easy way to get a spiderfier for markers that share same location?
(as in https://github.com/Leaflet/Leaflet.markercluster/blob/master/example/marker-clustering-spiderfier.html)
What would you suggest to do in such a case of overlapping markers?
Thanks
java99
The text was updated successfully, but these errors were encountered: