mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Added support for a new model layout property: allow-density-reduction

Open JoshuaJMoore opened this issue 8 months ago • 1 comments

We have a use-case where we want to be able to see all of the models and not reduce density of models when zoomed out. Mapbox's default behavior is to reduce density when zoomed out which has been maintained here, but with the option to disable it.

By introducing a new layout property model-allow-density-reduction, you can choose if that layer is to reduce density or not when zoomed out.

The property was named similar to existing properties such as 'icon-allow-overlap'.

When property is true we can see a density reduction in the number of models shown:

image

When property is false, we can see the density has no reduction:

image

JoshuaJMoore avatar Mar 13 '25 14:03 JoshuaJMoore

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 13 '25 14:03 CLAassistant

Hello, this is an awesome option that would solve a problem in my app. Are there any blockers to merging?

tibotiber avatar Nov 18 '25 08:11 tibotiber

Awesome! Heya @JoshuaJMoore, I didn't realize this was another of your PRs. You're on fire :). Thanks for the contributions which all seem to fix stuff for me.

tibotiber avatar Nov 20 '25 13:11 tibotiber

Closing this in favour of https://github.com/mapbox/mapbox-gl-js/pull/13595 which resolves the conflicts and adds a render test on top of the changes here.

ibesora avatar Dec 01 '25 11:12 ibesora