[Users] Disable treenode according to scale

Robert Buckley robertdbuckley at yahoo.com
Mon Jul 25 14:30:10 CEST 2011


Hi,

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.

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

Does anyone know how I could disable the node?


thanks,


Rob



// TREE
var layerList = new Ext.tree.TreeNode({
            text: "Kartenebene",
            
            expanded: true
            });
    layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({
            text: "Hintergrundkarten",
            map: map,
            expanded: true
            }));
    layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({
            text: "Themen",
            map: map,
            expanded: true
            }));
    var layerTree = new Ext.tree.TreePanel({
        title: "Karteninhalte",
        region: "center",
        root: layerRoot,
        enableDD: true,
        collapsible: true,
        height: 200,
        expanded: true
    });        



// Scale dependant layer
map.events.on({ "zoomend": function (e) {
      if (this.getZoom() > 9) {
    
      layer_wea_wms.setVisibility(true);
                  
      }
      else {
      layer_wea_wms.setVisibility(false);
      }
           }//end function (e)
    }); //end map.events.on 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20110725/1e46529b/attachment.htm 


More information about the Users mailing list