<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Hi,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; ">I am trying to turn off my basemaps according to the current zoom level....ie for zoom levels over 6 show,enable and check "layer_0", otherwise show,enable and check "layer_1"</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt; "><code></div><div><div><font face="arial, helvetica, sans-serif" size="2">map.events.on({</font></div><div><font face="arial, helvetica, sans-serif" size="2"> "zoomend": function (e) {</font></div><div><font face="arial, helvetica,
sans-serif" size="2"> if (this.getZoom() >6) {</font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2"><div style="font-family: 'Times New Roman'; font-size: medium; "><font face="arial, helvetica, sans-serif" size="2"> </font><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> layerTree.getRootNode().findChild('layer', layer_0, true).disable();</span></div><div style="font-family: 'Times New Roman'; font-size: 16px; "><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space: pre; ">                </span></font><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">layer_0.setVisibility(false);</span></div><div style="font-family: 'Times New Roman'; font-size: 16px; "><span style="font-family:
arial, helvetica, sans-serif; font-size: 13px; "><span class="Apple-tab-span" style="white-space:pre">                </span></span><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">layerTree.getRootNode().findChild('layer', layer_0 , true).checked==false;</span><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> </span></div><div style="font-family: 'Times New Roman'; font-size: 16px; "><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span></div></font></div><div><font face="arial, helvetica, sans-serif" size="2"> } else {</font></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: small;"><br></span></div><div><font face="arial, helvetica, sans-serif" size="2"> layerTree.getRootNode().findChild('layer', layer_1,
true).disable();</font></div><div><font face="arial, helvetica, sans-serif" size="2"><span class="Apple-tab-span" style="white-space:pre">                </span></font><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">layer_1.setVisibility(true);</span></div><div><font face="arial, helvetica, sans-serif" size="2"> </font><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">layerTree.getRootNode().findChild('layer', layer_1 , true).checked==true;</span><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> </span><span style="font-family: arial, helvetica, sans-serif; font-size: small; "> </span></div><div><font face="arial, helvetica, sans-serif" size="2"> </font></div><div><font face="arial, helvetica, sans-serif"
size="2"> </font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> }</font></div><div><font face="arial, helvetica, sans-serif" size="2"> });</font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font face="arial, helvetica, sans-serif" size="2"><br></font></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">The problems are as follows...</span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">1. The nodes do not "check"</span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;
"><br></span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">2. The disable method works ok, but when I zoom out again the layer still remains visible but does not zoom?!?</span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;"><br></span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;"><br></span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;">Has anyone done this successfully and can show me how?</span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;"><br></span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;"><br></span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;">yours,</span></div><div><span style="font-family: arial, helvetica, sans-serif; font-size: 13px;"><br></span></div><div><span
style="font-family: arial, helvetica, sans-serif; font-size: 13px;">Rob</span></div></div></div></body></html>