[Users] Layertree - help

Robert Buckley robertdbuckley at yahoo.com
Wed Sep 22 11:44:46 CEST 2010


I am trying to figure out how this code works...It is hacked from somewhere 
else.
My question is...how can I create more nodes to the overlay section of the tree. 
Somehow geoext seems to know which layers are base layers and which are not. How 
does this work?

If I wanted to create a folder in the baselayers branch for Google and another 
for OSM, and also create categories in the overlay section for Boders, Rasters 
etc how would this work?

Thanks for any help.

Robert

var tree = new Ext.tree.TreePanel({
    rootVisible: true,
    root: new GeoExt.tree.LayerContainer({
    layerStore: [mapPanel.layers]})
    });


    var layerListBase = new GeoExt.tree.BaseLayerContainer({
        text: "Basislayer",
        layerStore: mapPanel.layers,
        leaf: false,
        enableDD: true,
        expanded: true
    });    
 
    var layerListOver = new GeoExt.tree.OverlayLayerContainer({
        text: "Overlays",
        layerStore: mapPanel.layers,
        leaf: false,
        enableDD: true,
        expanded: true
    });  
    
    var layerRoot = new Ext.tree.TreeNode({
        text: "All Map Layers",
        expanded: true
    });
    
    layerRoot.appendChild(layerListBase);
    layerRoot.appendChild(layerListOver);
    
        layerTree = new Ext.tree.TreePanel ({
        region: 'north',
        root: layerRoot,
        enableDD: true,
        expanded: true,
        applyLoader: true,
        rootVisible: false,
        width: 300,
        height: 400

    });

    LayerTree={
    region: 'north',
    height: 250
    };




More information about the Users mailing list