[Users] Layertree with sublevelse

Lars-Göran Edholm lged.morris at gmail.com
Tue Jan 31 12:56:40 CET 2012


Hi!
I'm trying to make a tree with sublayers.
My code to make the tree is like:

//***********************************************
var layerRoot = new Ext.tree.TreeNode({
text: "Alla lager",
expanded: true
});
//***********************************************
layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({
text: "Baslager",
map: map,
expanded: true
}));

layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({
text: "Övriga",
map: map,
expanded: true
}));
//***********************************************
var tibNaturalLayers = new GeoExt.data.LayerStore({
                    map: map,
                    initDir: 0,
                    layers: [riks1,riks2]
 });

layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({
                        text: "Div layers",
                        layerStore: tibNaturalLayers,
                        expanded: false,
                        loader: {param: "LAYERS"}
 }));
//***********************************************
var tibNaturalLayers1 = new GeoExt.data.LayerStore({
                    map: map,
                    initDir: 0,
                    layers: [fast]
 });

layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({
                        text: "More layers",
                        layerStore: tibNaturalLayers1,
                        expanded: false,
                        loader: {param: "LAYERS"}
 }));
//***********************************************

With enableDD: true in the treepanel I can drag the layer so I get the tree
I want, se attached file treewithsublevels4.jpg.
What shall I change in my code to get the tree like the one in
treewithsublevels4.jpg

Lars-Göran Edholm
Bygg- och miljöförvaltningen
Sandvikens kommun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120131/22f22623/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: treewithsublevels4.JPG
Type: image/jpeg
Size: 20855 bytes
Desc: not available
Url : http://www.geoext.org/pipermail/users/attachments/20120131/22f22623/attachment-0001.jpeg 


More information about the Users mailing list