Fix an issue with small-radius clusters and uncap clusterMaxZoom #10300
+45
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2898. Closes #6454. There were two issues here:
clusterMaxZoom
was always capped bysource.maxzoom - 1
, which is not always desirable. This PR changes behavior so that the option is respected without capping (although it's stillmaxzoom - 1
by default if not set). This means that you can set it in such a way that clusters occur at all zoom levels, including the max one, but this is no longer an issue because you can still recover original points if needed withsource.getClusterLeaves
, and we leave the decision whether to force the last zoom level to be unclustered to the user.Launch Checklist
clusterMaxZoom
behavior now matches the existing docs more closely)clusterMaxZoom
change needs to be reflected in nativemapbox-gl-js
changelog:<changelog>Fix a bug where close points where sometimes not clustered on higher zoom levels given a small clustering radius. Fix clusterMaxZoom so that it's not capped by source maxzoom.</changelog>