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

Collision groups #822

Open
westnordost opened this issue Sep 18, 2024 · 2 comments
Open

Collision groups #822

westnordost opened this issue Sep 18, 2024 · 2 comments

Comments

@westnordost
Copy link
Contributor

westnordost commented Sep 18, 2024

User Story

I want to have name labels not collide with pins. At the same time, both the pins and the labels should of course each in their own layer collide among themselves so that pins don't overlap with other pins and name labels don't overlap with other labels.

Rationale

I've got a map dotted with a lot pins. In fact, there are so many pins that not all should be displayed, which is why the layer that shows the pins defines "icon-allow-overlap": false. (The dots you see in the screenshot are a different layer with the same data that allows overlapping in order to achieve the effect that hidden pins are at least displayed as little dots.)

You see in the above screenshot that road name labels are only displayed where there are no pins.

The method I know from tangram to solve this use case would be collision groups: Each layer can specify a bitmask of collision groups it should be part of, so the user can freely define which layer's elements collide with which other layer's elements.
Such a symbol-collision-groups layout property could for example be defined by a bitmask (e.g. 0b110) or an array of named groups (e.g. ["labels", "pins"])

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

No branches or pull requests

2 participants