[Users] Disable treenode according to scale

Robert Buckley robertdbuckley at yahoo.com
Tue Aug 2 15:50:58 CEST 2011


unfortunately not,

I didn´t get time to go into it. Any code to give away?

cheers,

Rob



________________________________
Von: brad <brad at numaps.com.au>
An: Robert Buckley <robertdbuckley at yahoo.com>
Gesendet: Montag, den 1. August 2011, 23:12:08 Uhr
Betreff: RE: [Users] Disable treenode according to scale


Robert did you get this resolved. I have done it the way that i suggested so 
just wondered if you did too?
 
Brad...
 
From:users-bounces at geoext.org [mailto:users-bounces at geoext.org] On Behalf Of 
Robert Buckley
Sent: Monday, 25 July 2011 10:30 PM
To: users at geoext.org
Subject: [Users] Disable treenode according to scale
 
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/20110802/17fda639/attachment.htm 


More information about the Users mailing list