I need to disable L.control.layers when user click's on a certain button and enable when it click's on a seccond button.
Is this possible?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
You could just do it using CSS.
Select the layer control using its class leaflet-control-layers:
var lc = document.getElementsByClassName('leaflet-control-layers');
And then hide it:
lc.style.visibility = 'hidden';
or show it:
lc.style.visibility = 'visible';
In case you are using jQuery: