My method is very similar to Pierre's. I have a TreePanel plugin who's init function wires up event listeners to the map's zoom change event and async node expand event.
it walks the tree and for each gx_layer type node it checks if the associated layer is in range. If not then it disables the node and all of its children if any. It also checks for any node that has all of its children disabled, and if so it also disables that node. I should have a working patch with test soon. Matt Priour -------------------------------------------------- From: "Alexandre Dube" <[email protected]> Sent: Thursday, October 21, 2010 9:52 AM To: "Matt Priour" <[email protected]> Cc: "Andreas Hocevar" <[email protected]>; "GeoEXT Users" <[email protected]> Subject: Re: [Users] Tree node disabling with min/max scale > Hi Matt, > > Nah, it's no "race" but I definitively need that feature soon, so I > rather share how I would have done it. > > Ideally, I would have made a new "rangechange" event for the > OpenLayers.Layer object and listen to that event to disable/enable the UI > of the node accordingly. Upon creation, a node would be disabled if the > 'inRange' is set to 'false' (unless it's a base layer). > > That's pretty much it. Does that make sense ? How about your method ? > > Alexandre > > > On 10-10-21 10:29 AM, Matt Priour wrote: >> "It's a race" ;) >> I am working on implementing that feature today as well. >> >> Matt Priour >> Kestrel Computer Consutling >> >> >> -------------------------------------------------- >> From: "Alexandre Dube" <[email protected]> >> Sent: Thursday, October 21, 2010 8:55 AM >> To: "Andreas Hocevar" <[email protected]> >> Cc: "GeoEXT Users" <[email protected]> >> Subject: Re: [Users] Tree node disabling with min/max scale >> >>> Got it. I guess it shouldn't be that hard to implement, so I'll give it >>> a try and report back with a patch + ticket if it goes well. >>> >>> Thanks, >>> >>> Alexandre >>> >>> >>> On 10-10-21 09:39 AM, Andreas Hocevar wrote: >>>> Hi, >>>> >>>> this would be a useful improvement, but it is not yet implemented - >>>> patches welcome! >>>> >>>> Regards, >>>> Andreas. >>>> >>>> On Oct 21, 2010, at 15:30 , Alexandre Dube wrote: >>>> >>>> >>>>> Hi, >>>>> >>>>> The LayerSwitcher automatically disables its layer elements when >>>>> zooming in/out following the min/max scale values of each layer. Is >>>>> that feature available with GeoExt tree nodes as well or do I need to >>>>> do >>>>> that manually ? >>>>> >>>>> Thanks, >>>>> >>>>> -- >>>>> Alexandre Dubé >>>>> Mapgears >>>>> www.mapgears.com >>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> [email protected] >>>>> http://www.geoext.org/cgi-bin/mailman/listinfo/users >>>>> >>>> >>>> >>>> >>> >>> >>> -- >>> Alexandre Dubé >>> Mapgears >>> www.mapgears.com >>> >>> _______________________________________________ >>> Users mailing list >>> [email protected] >>> http://www.geoext.org/cgi-bin/mailman/listinfo/users >>> > > > -- > Alexandre Dubé > Mapgears > www.mapgears.com > > _______________________________________________ Users mailing list [email protected] http://www.geoext.org/cgi-bin/mailman/listinfo/users
