I have several vectors and WMS layers in layer switcher. But I don't need these layers to be displaying in layer switcher. How can I remove these layers from layer switcher?
nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
asked Aug 13, 2012 at 10:54
-
From ol-layerswitcher 4.x you can you can simply leave the value "Title" to undefined and the layer will not be shownKoba– Koba2025年06月03日 14:35:29 +00:00Commented Jun 3 at 14:35
1 Answer 1
The option, displayInLayerSwitcher is True by default. You must pass this parameter explicitly with the False arguement. http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html
var ol_wms = new OpenLayers.Layer.WMS("OpenLayers WMS","http://vmap0.tiles.osgeo.org/wms/vmap0",
{layers: 'basic'},
{'displayInLayerSwitcher':false}
);
Ian Turton
84.1k6 gold badges93 silver badges190 bronze badges
-
1@Mohammedshafeek If the answer works for you, consider accepting it so the author can get true internet karma based thanksdassouki– dassouki2012年08月13日 14:04:19 +00:00Commented Aug 13, 2012 at 14:04
lang-js