4

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?

1 Answer 1

13

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.