[Users] Layer Tree Layers not rendered in store order

Adam Ratcliffe adam at prema.co.nz
Fri May 14 00:16:07 CEST 2010


Hi,

I have a layer tree, configured as shown below.  I'm adding a base tile layer to the map first and then dynamically loading a set of WFS layers and adding these to the map.  When the layer tree is rendered the base tile layer is at the bottom of the tree.  Furthermore if I add additional layers to the map these layers appear at the top of the tree.  I've checked the order of the records in the map's layer store and it is correct so there must be something going on in the LayerContainer which is changing the layer order.

Any ideas?

Cheers
Adam

{
                id: 'layers',
                xtype: 'treepanel',
                autoScroll: true,
                animate: true,
                border: false,
                lines: false,
                title: 'Legend',
                region: 'center',
                root: new GeoExt.tree.LayerContainer({
                    text: 'Map Layers',
                    layerStore: mapPanel.layers,
                    leaf: false,
                    expanded: true
                }),
                rootVisible: false,
                listeners: {
                    'click': onLayerSelected
                }
            }


More information about the Users mailing list