5

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
1
  • From ol-layerswitcher 4.x you can you can simply leave the value "Title" to undefined and the layer will not be shown Commented Jun 3 at 14:35

1 Answer 1

14

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
answered Aug 13, 2012 at 12:11
1
  • 1
    @Mohammedshafeek If the answer works for you, consider accepting it so the author can get true internet karma based thanks Commented Aug 13, 2012 at 14:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.