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

allow disableVisibilityControls key for each legend entry #12

Open
brentfraser opened this issue Dec 5, 2019 · 3 comments
Open

allow disableVisibilityControls key for each legend entry #12

brentfraser opened this issue Dec 5, 2019 · 3 comments

Comments

@brentfraser
Copy link

No description provided.

@ka7eh
Copy link
Collaborator

ka7eh commented Jan 12, 2020

Can you elaborate more on this? Do you mean you'd like to be able to change the transparency of all the layers within a layer that is attached to a legend control? I'm afraid such a thing is beyond the scope of this plugin. Items in legend elements have no concept of which sub-layer they are representing.

@brentfraser
Copy link
Author

No. For some entries, I just use the control to show colors with description (see Layer 1 in your example site), but I don't want to have the show/hide symbol or the transparency control. I DO want the controls for the second layer (Layer 2 in your example).

Currently the disableVisibilityControls applies to all the entries in the legend. I would like to set it per entry.

One work-around would be to have separate legends, but that would clutter the map.

@ka7eh
Copy link
Collaborator

ka7eh commented Jan 12, 2020

I see what you mean. I updated the code and moved disableVisibilityControls to legend options. Now you can set that option to true for each legend that you don't want to have a visibility slider.

The new changes are in #13 and waiting for review. You can see its usage in layer 4 in the updated example.

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