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

Enable symbol-sort-key when text/icons on a layer have opposing overlap rules #9368

Open
chloekraw opened this issue Mar 3, 2020 · 1 comment

Comments

@chloekraw
Copy link
Contributor

When icon-allow-overlap: true and text-allow-overlap: false or vice-versa for a symbol layer, there is no way to sort icons + text consistently with symbol-sort-key.

Sort key determines draw order in the renderer. Features with lower sort keys are drawn and placed first.

  • When overlap is enabled, features with higher sort keys can be drawn and placed over previous features, so features with higher sort keys have higher priority.
  • When overlap is disabled, features with higher sort keys cannot be placed over previous features because of the way collision detection works. Therefore, during placement, features with lower sort keys have higher priority.

This behavior has always existed in the renderer and it won't be straightforward to change.


Screen Shot 2020-03-02 at 11 05 49 PM

@ryanbaumann
Copy link
Contributor

As a developer, I want to create a rank value for features in a symbol layer to control where they are drawn and placed. The challenging part is when I have to rank features differently and/or inversely when I toggle collision detection between symbol features on/off.

A simple solution for a developer would be to have an "always high values" or "always low values" are prioritized using symbol-sort-key, and not needing to change the ascending vs. descending order when I toggle collision detection on or off.

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

No branches or pull requests

2 participants