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

Group layers so they can be swithced on/off together #27

Open
apanagio opened this issue May 17, 2024 · 0 comments
Open

Group layers so they can be swithced on/off together #27

apanagio opened this issue May 17, 2024 · 0 comments

Comments

@apanagio
Copy link

Is your feature request related to a problem? Please describe.
I'd like to have two or more layers with a single legend, so that they can be shown / hidden together. Currently this cannot be done.

Describe the solution you'd like
A solution could be to show one legend for layers that have the same label.

  • Legend styling should be taken from the first layer
  • In order to not brake backwards compatibility the feature should be turned on with a config flag

Describe alternatives you've considered
I cosidered this: https://github.com/developmentseed/mapbox-gl-layers, but it doesn't seem to work

Additional context
A common pattern when you want to make a line layer easily clickable, is to add an additional layer with opacity 0.01 and much bigger line-width. You don't want an extra legend for that layer and you'd want to toggle the two layers together

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

1 participant