<div dir="ltr"><div><div>It's working now.<br></div>I forgot I had dynamic visibility enabled in the SLD for this layer.<br><br></div>Thanks,<br><br>Paul<br><br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">
2013/1/8 Diego Guidi <span dir="ltr"><<a href="mailto:diegoguidi@gmail.com" target="_blank">diegoguidi@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> I set visibility: false when creating the WMS layer.<br>
> This results in the layer being shown in the layer switcher but turned off.<br>
> Exactly what I want. But I can't turn it on anymore. It seems to be<br>
> disabled.<br>
<br>
</div>Tried using layer,setVisibility(true) instead of layer.visibility = true?<br>
<a href="http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.setVisibility" target="_blank">http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.setVisibility</a><br>
</blockquote></div><br></div></div></div></div></div>