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

symbol-sort-key placement behavior appears to fail along tile boundaries when icon-allow-overlap is false. #8896

Closed
ajfickas opened this issue Oct 23, 2019 · 2 comments · Fixed by #9054
Assignees
Labels

Comments

@ajfickas
Copy link

mapbox-gl-js version: 1.4.1

browser: Chrome 77.0.3865.120 and Safari 13.0.1 (14608.2.11.1.11)

Steps to Trigger Behavior

  1. Add a symbol layer with a source that contains Feature 1 with a lower symbol-sort-key and a Feature 2 with a higher symbol-sort-key whose icon collides with the Feature 1 but is in the tile either to the west or north of the tile of the Feature 1.

Link to Demonstration

The demonstration allows you to toggle between Feature 2 being in the tile to the west, east, north, or south of the tile of Feature 1. Green icon is the Feature 1, red icon is the Feature 2.
https://jsbin.com/favowijosu/2/edit?js,output

Expected Behavior

Feature 1 (having the lower symbol-sort-key) should be shown and Feature 2 (having the higher symbol-sort-key) should be hidden due to collision.

Actual Behavior

Feature 2 is shown and Feature 1 is hidden.

The expected behavior is seen if Feature 2 is in the tile to the east or south of Feature 1.

@ahk
Copy link
Contributor

ahk commented Oct 24, 2019

Hi, thanks for this report, it's really good. You have it exactly correct.

Currently this issue exists in both gl-native and gl-js projects. It's somewhere between a bug and an oversight, the symbol-sort-key property was never designed to solve this problem, but our documentation is really misleading if not actually wrong. A note to save you frustration: it only seems to work on the east or south tile boundaries because of implicit placement order, there is no actual logic for this.

Fixing this is on our roadmap and should be in the next release or two, though it's likely to land in gl-native first before being ported to gl-js.

@ajfickas
Copy link
Author

Thanks @ahk. Appreciate the explanation and good to hear it's on the roadmap. I'll stay tuned.

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

Successfully merging a pull request may close this issue.

4 participants