Hello all.<br><br>I am trying to use javascript to turn on a layer (an aerial photograph) but its not working. Jacob Delfos gave a rough draft of the script and i experimented on it. (I am not knowlegdeable in Javascript.)<br><br>In the map file, the layer name for the aerial photograph is "Aerial".<br><br>Here's the script:<br><br> <a href="javascript:becomeAerial()">Go to aerial mode</a><br><br> <script><br> function becomeAerial()<br> {<br> <br> for(i=0;i<document.form[0].legendlayername[].length;i++)<br>
{<br> if(document.form[0].legendlayername[i].value!="Aerial")<br> {<br> document.form[0].legendlayername[i].checked=true;<br> }<br> }<br> document.form[0].submit();<br> }<br>
</script><br><br><br>and the Legend Layer Template is:<br><br><br>[leg_layer_html order=ascending opt_flag=15]<br> <tr bgcolor="#ffffff"><br> <td><input type="radio" name="my_legend" onclick="CWCSelectLayer('[leg_layer_name]', true)"[if name=selected value=1] CHECKED[/if] ></td><br> <td align="center" width=20><input type="checkbox" name="legendlayername[]" <br>value="[leg_layer_name]"<br> [if name=layer_status oper=eq value=1]CHECKED[/if]<br> [if name=layer_status oper=eq value=2]CHECKED[/if]></td><br> <td><img src="[leg_icon width=20 height=18]" width="20" height="20"</td><br> [if name=wms_name oper=isnull]<br> <td><a href="#" onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span
class="label">[leg_layer_name]</span></a></td><br> </tr><br> [/if]<br> [if name=wms_name oper=isset]<br> <td><a href="#" onclick="javascript:LegendTemplateLayerInfo('[leg_layer_name]');"><span class="label">[metadata name=WMS_TITLE]</span></a></td><br> </tr><br> [/if]<br>[/leg_layer_html]<br><br><br><br>---<br><br>I hope somebody could help. Thanks.<br><br><br>Jojin<br><p>
                <hr size=1>Brings words and photos together (easily) with<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/PMall/*http://photomail.mail.yahoo.com">PhotoMail </a> - it's free and works with Yahoo! Mail.