I have run into an issue that doesn't appear to be covered in the docs and is a bit of a showstopper for me.
I am using clustering, but within some clusters I have many points that all share identical lng/lat and their markers are all stacked together.
I need these markers to be independently visible/clickable once they have broken out of their clusters. Is this currently possible?
It appears to be a feature in Leaflet - in this example it looks as if there are many points that are _really_ close but not identical. It handles stacking pretty elegantly: https://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html
Currently there's no way to do that in GL JS. However there's an API for retrieving child items from a cluster on click 鈥斅爐his may help you create the UI you need: https://www.mapbox.com/mapbox-gl-js/api#geojsonsource#getclusterleaves
@alanshortis
Did you ever sort this out?
A solution which is working for me now is to set the zooming to a max (so that multiple points on the same location keep showing up as a cluster/otherwise the cluster disappears and only the top symbol shows) and add "get clusterleaves" to the click event on the cluster (https://github.com/bewithjonam/mapboxgl-spiderifier#getting-features-in-a-cluster-from-mapboxgl-and-spiderfying-them) check if the zoom level is at its max and then work something out for the underlying features.
[But I expected to have a standard mapbox gl solution for this not realy being a very unusual use-case]
Most helpful comment
@alanshortis
Did you ever sort this out?
A solution which is working for me now is to set the zooming to a max (so that multiple points on the same location keep showing up as a cluster/otherwise the cluster disappears and only the top symbol shows) and add "get clusterleaves" to the click event on the cluster (https://github.com/bewithjonam/mapboxgl-spiderifier#getting-features-in-a-cluster-from-mapboxgl-and-spiderfying-them) check if the zoom level is at its max and then work something out for the underlying features.
[But I expected to have a standard mapbox gl solution for this not realy being a very unusual use-case]