How do I disable a particular overlay checkbox in the Openlayers Layerswitcher?
[GIS] How to disable overlay check box after a certain zoom level
openlayers-2
openlayers-2
How do I disable a particular overlay checkbox in the Openlayers Layerswitcher?
Best Answer
There is a layer property, displayInLayerSwitcher but it makes the entire layer dissaper instead of simply disableing the checkbox.
However, there are always work arounds:
DEMO
You can work that functionality into the layer class prototype like so:
Then register the
zoomend
event like so:And handle that event: