Hello all,

continuing with some GeoExt tutorials I have another question... How to render layers from layerlist to a map?
Addding layers manully to the map (map.addlayers) and creating a layerlist from these map layers works fine, even to control the visiblity using checkboxes and radio buttons.
Now I want to make visible only one layer at time starting with an initial layer. So I created a layerlist and add 'checkedGroup' to the children. Is there a way to add only the active layer to the map object at runtime?

Here the relevant code:

var layerList =[{           
                    ...
                    {                
                    text: 'Population',                   
                    leaf: false,
                    expanded: true,  
                    children: [{
                        nodeType: 'gx_layer',
                        layer: POP,
                        text: 'Population density [inh./ha]',
                        leaf: true,              
                        checkedGroup: 'maps', 
                        checked: false                       
                                       
                        }]
                           
                    },...    

var tree = new Ext.tree.TreePanel({
            region:        'west',
            title:             'Available Maps',
            width:         250,
            autoScroll: true,
            enableDD: true,
            lines:           false,
            collapsible:true,   
            loader:        new Ext.tree.TreeLoader({
                                  applyLoader: false                              
                               }),                      
            root:         {
                            nodeType: 'async',
                            children: layerList    ,
                            text:    'maps'
                                },
            rootVisible: false      
            }); 
...

best regards,
Christian
--------------------------------------------------------------------------------------------
						
Christian Gadge 				
Helmholtz-Zentrum für Umweltforschung GmbH - UFZ

_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users

Reply via email to