Skip to content

Conversation

@JoshuaJMoore
Copy link

@JoshuaJMoore JoshuaJMoore commented Mar 13, 2025

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 JoshuaJMoore requested a review from a team as a code owner March 13, 2025 14:30
@CLAassistant
Copy link

CLAassistant commented Mar 13, 2025

CLA assistant check
All committers have signed the CLA.

@tibotiber
Copy link

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

Copy link
Contributor

@ibesora ibesora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @JoshuaJMoore , thanks for this PR!
It looks like a nice improvement. We have debated internally if we would do it the same way but agreed on merging this with one change: marking the model-allow-density-reduction property in style spec with "experimental": true.

Can you please do that and resolve the conflicts on this PR? If not, let me know and I'll push it through the finish line myself.
Thanks! And sorry for the long waiting time.

@tibotiber
Copy link

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants