<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#ffffff" text="#333333">
Hello all,<br>
<br>
continuing with some GeoExt tutorials I have another question... How
to render layers from layerlist to a map?<br>
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.<br>
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? <br>
<br>
Here the relevant code:<br>
<br>
var layerList =[{ <br>
...<br>
{ <br>
text: 'Population', <br>
leaf: false,<br>
expanded: true, <br>
children: [{<br>
nodeType: 'gx_layer',<br>
layer: POP,<br>
text: 'Population density [inh./ha]',<br>
leaf: true, <br>
checkedGroup: 'maps', <br>
checked: false <br>
<br>
}] <br>
<br>
},... <br>
<br>
var tree = new Ext.tree.TreePanel({<br>
region: 'west',<br>
title: 'Available Maps',<br>
width: 250,<br>
autoScroll: true,<br>
enableDD: true,<br>
lines: false,<br>
collapsible:true, <br>
loader: new Ext.tree.TreeLoader({<br>
applyLoader: false
<br>
}), <br>
root: {<br>
nodeType: 'async',<br>
children: layerList ,<br>
text: 'maps'<br>
},<br>
rootVisible: false <br>
}); <br>
...<br>
<br>
best regards,<br>
Christian<br>
<pre class="moz-signature" cols="72">
--------------------------------------------------------------------------------------------
                                                
Christian Gadge                                 
Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
</pre>
</body>
</html>