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

Fix bug causing clusters to disappear when "clusterRadius" is very small #2898

Closed
icreatestuff opened this issue Jul 20, 2016 · 17 comments · Fixed by mapbox/supercluster#173 or #10300
Closed
Assignees
Labels
Milestone

Comments

@icreatestuff
Copy link

mapbox-gl-js version: 0.21.0

Steps to Trigger Behavior

Add a Map source with options (https://www.mapbox.com/mapbox-gl-js/api/#GeoJSONSource):

{
type: 'geojson',
data: GeoJSONdata,
maxzoom: 20,
cluster: true,
clusterMaxZoom: 20,
clusterRadius: 1
}

doesn't produce the expected outcome.

Expected Behavior

I would expect that cluster layers using that source remain visible up to and including zoom level 20 (i.e. they never disappear)

The documentation for cluserMaxZoom indicates that by default this property is set to 1 less than maxzoom but seems to imply that if set explicitly it'll honour that value. From what I can gather it is always returning the lower of the 2 between (maxzoom - 1) and what is set for clusterMaxZoom.

Actual Behavior

What I actually see is that some layers disappear at zoom level 19, some at zoom level 18 and some at zoom level 17.

@mourner
Copy link
Member

mourner commented Jul 20, 2016

Can you set up a minimal JSFiddle reproducing the behavior?

@icreatestuff
Copy link
Author

@mourner
Copy link
Member

mourner commented Jul 20, 2016

Yeah, it seems to be a bug and somehow related to small cluster radius — changing the value in JSFiddle to 10 seems to fix the behavior. Needs investigating.

@mourner mourner self-assigned this Jul 20, 2016
@lucaswoj lucaswoj changed the title GeoJSONSource maxzoom and clusterMaxZoom don't work as expected Fix bug causing clusters to disappear when "clusterRadius" is very small Jul 29, 2016
@sdawson26
Copy link

Here's another example relating to heat maps.
https://jsfiddle.net/6rz6gt9u/3/

I just posted #4710 moments ago and realized this is basically the same issue.

@GLosch
Copy link

GLosch commented Aug 10, 2017

Is there an ETA for this being resolved?

@GLosch
Copy link

GLosch commented Jan 3, 2018

Got it working in my case, thanks to a tip from the mapbox team. I needed an extra layer for the _un_clustered markers. The problem was that once the clusters tried to separate into individual dots, there wasn't a layer to represent them. Adding a new layer with filter: ['!has', 'point_count'] took care of it.

@jfhidakatsu
Copy link

anyone figure out a solution to this?

@GLosch
Copy link

GLosch commented Sep 26, 2018

@jfhidakatsu see my comment right before yours. Are you having a different issue?

@jfhidakatsu
Copy link

@jfhidakatsu see my comment right before yours. Are you having a different issue?

Yes, I don't have any issue showing unclustered markers. The issue is showing clusters when zoomed in far. I solved it by setting max zoom to 17.9, as the clusters seem to disappear at 18.

@hadrienl
Copy link

I have the same problem. Cluster breaks after 18 zoom. I have set my global maxzoom to 24, and my clusterMaxZoom to 24, but passed 18 zoom, my points are displayed as superposed single points instead of clusters.

@yulolimum
Copy link

I noticed this as well. Zoom greater than 17.9 - unclusters.

Related: #6454 (comment)

@0xTomDaniel
Copy link

Would be great if this was fixed sometime within the next decade.

@igal1c0de4n
Copy link

+1 waiting on fix for this

@BellamyTrinette
Copy link

+1 would be great to have a fix

@mourner
Copy link
Member

mourner commented Dec 9, 2020

Sorry for the delay everyone, now I'll finally have the time to investigate this soon! Quite a weird issue.

@mourner
Copy link
Member

mourner commented Jan 19, 2021

Finally got my hands on this — check out #10300 and let me know if there are any remaining issues with clustering. The fix should be included in v2.1.

@ikhidebright
Copy link

This is still an issue for me, when I zoom in I post items in the cluster, on zoom out a cluster would have 23 and then when you zoom it it shows just one item in that cluster

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