<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;">Hi,<br><br>this code turns off the layer "layer_wea_wms" when I zoom out by more than zoomlevel 8. What I would actually like to do is complete disable the treenode as well so that it is impossible to make it visible.<br><br>I have tried to get a reference to the treenodes by name, but I cannot return the object. The treenodes are loaded automatically using the code below<br><br>Does anyone know how I could disable the node?<br><br><br>thanks,<br><br><br>Rob<br><br><br><br>// TREE<br>var layerList = new Ext.tree.TreeNode({<br> text: "Kartenebene",<br> <br> expanded: true<br>
});<br> layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({<br> text: "Hintergrundkarten",<br> map: map,<br> expanded: true<br> }));<br> layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({<br> text: "Themen",<br> map: map,<br> expanded: true<br> }));<br> var layerTree = new Ext.tree.TreePanel({<br> title: "Karteninhalte",<br> region:
"center",<br> root: layerRoot,<br> enableDD: true,<br> collapsible: true,<br> height: 200,<br> expanded: true<br> }); <br><br><br><br>// Scale dependant layer<br>map.events.on({ "zoomend": function (e) {<br> if (this.getZoom() > 9) {<br> <br> layer_wea_wms.setVisibility(true);<br> <br> }<br> else {<br> layer_wea_wms.setVisibility(false);<br> }<br> }//end function
(e)<br> }); //end map.events.on <br><div><br></div>
</div></body></html>