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

Support spiderfier-like functionality for clustering #2723

Closed
ouya99 opened this issue Jun 13, 2016 · 13 comments
Closed

Support spiderfier-like functionality for clustering #2723

ouya99 opened this issue Jun 13, 2016 · 13 comments

Comments

@ouya99
Copy link

ouya99 commented Jun 13, 2016

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

@lucaswoj lucaswoj changed the title Marker clustering spiderfier Support spiderfier-like functionality for clustering Jun 13, 2016
@lucaswoj
Copy link
Contributor

Is this feasible @mourner?

@mourner
Copy link
Member

mourner commented Jun 13, 2016

This is certainly very difficult to do and I don't think we'll be able to tackle this in the short term.

@hdrdavies
Copy link

This would be a really great feature!

@bewithjonam
Copy link

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.

@ouya99 ouya99 closed this as completed Nov 28, 2016
@digitaltopo
Copy link

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.

@jcisio
Copy link

jcisio commented Mar 13, 2018

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?

@thuanmb
Copy link

thuanmb commented Mar 18, 2018

For those who are ReactJS lover. This is a solution to show the points at same location using spiderifier.
https://github.com/thuanmb/react-mapbox-gl-spiderifier

@EgbertBleyenburg
Copy link

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.

@bewithjonam
Copy link

  • getChildren
  • getLeaves
    Above methods are required to find features in a cluster. These methods have been exposed in recent versions of mapbox-gl-js.

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.

@EgbertBleyenburg
Copy link

Thanx for quick reply:
Maybe i do not fully understand yet: The problem is not getting the features in the cluster, but showing all underlying symbols when you zoom in and the cluster evaporates.....
But I'll try and see if I can get something working with this spiderfy library....

@EgbertBleyenburg
Copy link

If anyone looks for a solution, I am working on one right here:
#7120

@FranckKe
Copy link

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.

@ouya99 ouya99 reopened this Sep 21, 2019
@ouya99
Copy link
Author

ouya99 commented Sep 21, 2019

Sorry for late re-opening. Any standard solution available? Any Mapbox sample around?
Checked last comment: thanks @FranckKe seems to be a working solution. closing again

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

No branches or pull requests

10 participants