<div dir="ltr">I use the following code to accomplish this exact thing:<br><br>layerName = display name of the layer you wish to turn on or off<br>layerBoolean = true/false where true is on.<br><br><pre>function mapLayerActivateDeactivate(layerName, layerBoolean) {<br>
        var layerArray = map.layers;<br>        for (var i=0;i<layerArray.length;i++) {<br>                if (map.layers[i].name == layerName) {<br>                        map.layers[i].setVisibility(layerBoolean);<br>                }<br>        }<br>}<br></pre><br clear="all">--<br>Nathan Gerber<br>
<br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 1:30 PM, Kenny <span dir="ltr"><<a href="mailto:kenny@xarex.com">kenny@xarex.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-ZA">
<div>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Hi All,</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Is it possible (example) to "turn" a layer on /
off without using the layers switcher on the map?</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">I mean if I have a marker layer I can click a link and
display / hide a specific layer?</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">Thanks</span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>
<p><font size="2" face="Arial"><span style="font-size: 10pt; font-family: Arial;">K-</span></font></p>
<p><font size="3" face="Times New Roman"><span style="font-size: 12pt;"> </span></font></p>
</div>
<br><hr>I am using the Free version of SPAMfighter for Personal use.<br>SPAMfighter has removed 2722 of my spam emails to date.<br>Try <a href="http://www.spamfighter.com/len" target="_blank">SPAMfighter</a> for free now!<br>
<br>The Trial and Professional version does not have this message in the email<br>
</div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>