<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div>Hi all,</div><div><br></div><div>It may be a very disgusting question from me a noob .<br></div><div> I am very Upset to be failed to create nested tree in the tree.js file (included in the examples folder).</div><div>I need it very much, very much(not a superfluous word). I failed to do it after trying a month</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;">THANKS A LOT IN ADVANCE</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif;
background-color: transparent; font-style: normal;">var mapPanel, tree;<br>Ext.onReady(function() {<br> // create a map panel with some layers that we will show in our layer tree<br> // below.<br> mapPanel = new GeoExt.MapPanel({<br> border: true,<br> region: "center",<br> // we do not want all overlays, to try the OverlayLayerContainer<br> map: new OpenLayers.Map({allOverlays: 1}),<br> center: [146.1569825, -41.6109735],<br> zoom: 6,<br> layers: [<br> new OpenLayers.Layer.WMS("Global
Imagery",<br> "http://maps.opengeo.org/geowebcache/service/wms", {<br> layers: "bluemarble"<br> }, {<br> isBaseLayer: false,<br> buffer: 0,<br> visibility: false<br> }<br>
),<br> new OpenLayers.Layer.WMS("Tasmania State Boundaries",<br> "http://demo.opengeo.org/geoserver/wms", {<br> layers: "topp:tasmania_state_boundaries"<br> }, {<br> isBaseLayer: false,<br> buffer: 0<br> }<br>
),<br> new OpenLayers.Layer.WMS("Water",<br> "http://demo.opengeo.org/geoserver/wms", {<br> layers: "topp:tasmania_water_bodies",<br> transparent: true,<br> format: "image/gif"<br> }, {<br> isBaseLayer:
false,<br> buffer: 0<br> }<br> ),<br> new OpenLayers.Layer.WMS("Cities",<br> "http://demo.opengeo.org/geoserver/wms", {<br> layers: "topp:tasmania_cities",<br> transparent: true,<br> format:
"image/gif"<br> }, {<br> isBaseLayer: false,<br> buffer: 0<br> }<br> ),<br> new OpenLayers.Layer.WMS("Tasmania Roads",<br> "http://demo.opengeo.org/geoserver/wms", {<br> layers:
"topp:tasmania_roads",<br> transparent: true,<br> format: "image/gif"<br> }, {<br> isBaseLayer: false,<br> buffer: 0<br> }<br> ),<br> // create a group layer (with several layers in the "layers"
param)<br> // to show how the LayerParamLoader works<br> new OpenLayers.Layer.WMS("Tasmania (Group Layer)",<br> "http://demo.opengeo.org/geoserver/wms", {<br> layers: [<br> "topp:tasmania_state_boundaries",<br>
"topp:tasmania_water_bodies",<br> "topp:tasmania_cities",<br> "topp:tasmania_roads"<br> ],<br> transparent: true,<br> format: "image/gif"<br> },
{<br> isBaseLayer: false,<br> buffer: 0,<br> // exclude this layer from layer container nodes<br> displayInLayerSwitcher: false,<br> visibility: false<br> }<br> ),<br><br> new
OpenLayers.Layer.WMS("Tasmania State Boundaries",<br> "http://demo.opengeo.org/geoserver/wms", {<br> layers: "topp:tasmania_state_boundaries"<br> }, {<br> isBaseLayer: false,<br> buffer: 0<br> }<br> )<br> ]</div><div style="color: rgb(0, 0, 0);
font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"> I think i need add severel array into the above portion but how do i this, Does I have to edit tree config block below.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;">Block--1<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"> var
treeConfig = [{<br> nodeType: "gx_baselayercontainer"<br> }, {<br> nodeType: "gx_overlaylayercontainer",<br> expanded: true,<br> // render the nodes inside this container with a radio button,<br> // and assign them the group "foo".<br> loader: {<br> baseAttrs: {<br> radioGroup: "foo",<br> uiProvider: "layernodeui"<br> }<br>
}<br> }, {<br> nodeType: "gx_layer",<br> layer: "Tasmania (Group Layer)",<br> isLeaf: false,<br> // create subnodes for the layers in the LAYERS param. If we assign<br> // a loader to a LayerNode and do not provide a loader class, a<br> // LayerParamLoader will be assumed.<br> loader: {<br> param: "LAYERS"<br> }<br> }];<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color:
rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;">Block--2</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"> tree = new Ext.tree.TreePanel({<br> border: true,<br> region: "west",<br> title: "Layers",<br> width:
200,<br> split: true,<br> collapsible: true,<br> collapseMode: "mini",<br> autoScroll: true,<br> plugins: [<br> new GeoExt.plugins.TreeNodeRadioButton({<br> listeners: {<br> "radiochange": function(node) {<br> alert(node.text + " is now the active
layer.");<br> }<br> }<br> })<br> ],<br> loader: new Ext.tree.TreeLoader({<br> // applyLoader has to be set to false to not interfer with loaders<br> // of nodes further down the tree hierarchy<br> applyLoader: false,<br> uiProviders: {<br> "layernodeui":
LayerNodeUI<br> }<br> }),<br> root: {<br> nodeType: "async",<br> // the children property of an Ext.tree.AsyncTreeNode is used to<br> // provide an initial set of layer nodes. We use the treeConfig<br> // from above, that we created with OpenLayers.Format.JSON.write.<br> children: Ext.decode(treeConfig)<br> // Don't use the line above in your application. Instead,
use<br> //children: treeConfig<br> <br> },<br> listeners: {<br> "radiochange": function (node) {<br> alert(node.layer.name + " is now the the active layer.");<br> }<br> },<br> rootVisible: false,<br> lines: false,<br> bbar: [{<br> text: "Show/Edit Tree
Config",<br> handler: function () {<br> treeConfigWin.show();<br> Ext.getCmp("treeconfig").setValue(treeConfig);<br> }<br> }]<br> });</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;">Thanks in advance a lot.<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier
New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"> });<br></div></div></body></html>