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

Deslectable exclusive layers #60

Open
lkamb opened this issue Dec 19, 2017 · 4 comments
Open

Deslectable exclusive layers #60

lkamb opened this issue Dec 19, 2017 · 4 comments

Comments

@lkamb
Copy link

lkamb commented Dec 19, 2017

It would be useful (for me, anyway) to have groups of mutually exclusive layers that could also be deselected such that none of the layers is showing. In the current implementation of exclusive layers using radio buttons, there is no way to turn off all of the layers once one has been selected. I would like to have mutually exclusive layers controlled by checkboxes that behaved as radio buttons such that when one is already selected and another is selected the first becomes unselected and turns off (as with radio buttons) but also allowing the user to deselect and turn off the currently selected layer and have none of the layers visible.

@lkamb
Copy link
Author

lkamb commented Dec 19, 2017

I have tried to implement a work-around by adding onAdd handlers which remove all the other layers of the group when a new one is selected, but the leaflet layer control goes and re-adds all the layers that had been previously selected, and I haven't figured out a hook to get in before the leaflet control gathers its list of previously selected layers.

@pwangsom
Copy link

Hi Ikamb,
I also interested in this feature. Can you implement it?
If you were done, cloud you share the implementation.

Thank you.

@hhsm95
Copy link

hhsm95 commented Apr 30, 2020

Same issue here, I'm also working in a solution

@pfruidur
Copy link

pfruidur commented Apr 9, 2024

I'm also interested in this issue. Anyone managed to implement it?

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

4 participants