Is the there a way of clearing the legend in Openlayers by unselecting all the layers? We have a map that starts with several layers.
I was thinking that we might be able to add a button to the map that would do this.
|
Is the there a way of clearing the legend in Openlayers by unselecting all the layers? We have a map that starts with several layers. I was thinking that we might be able to add a button to the map that would do this. |
|||||
|
|
You could use some JavaScript like the following:
This will disable all layers except base layers. The legend (LayerSwitcher) will be updated automatically. |
|||
|