Hello,<br><br>I have the same problem. Did you find a solution?<br><br>Thank you<br><br>L.Z<br><br><div class="gmail_quote">2012/3/5 Robert Buckley <span dir="ltr"><<a href="mailto:robertdbuckley@yahoo.com" target="_blank">robertdbuckley@yahoo.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:arial,helvetica,sans-serif"><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">
Hi,</div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">I have a mappping project which uses the Ext.TreePanel to configure the layers as displayed underneath. I would like to be able to move the layers around (which is possible using enableDD: true) but in my case the</div>
<div style="font-family:arial,helvetica,sans-serif;font-size:10pt">drawing order doesn´t change. I.e when I move a layer upwards the drawing order (z-index) stays the same.</div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">
<br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">What should I do to change the drawing order of
the layers in the map when I change the order in the tree?</div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">Thanks for any tips,</div>
<div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">Rob</div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br>
</div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">
<br></div><div style="font-family:arial,helvetica,sans-serif;font-size:10pt">First the layers definitions are defined...e.g</div><div><div><font face="arial, helvetica, sans-serif"> </font></div><div><font face="arial, helvetica, sans-serif">var layer_zgb_grenze = new OpenLayers.Layer.WMS("Verwaltungsgrenzen: Planungsraum / Landkreis", "/geoserver/gwc/service/wms", {</font></div>
<div><font face="arial, helvetica, sans-serif"> layers: 'LK_Grenzen_gwc',</font></div><div><font face="arial, helvetica, sans-serif"> format: 'image/png',</font></div><div><font face="arial, helvetica, sans-serif"> transparent: true,</font></div>
<div><font face="arial, helvetica, sans-serif"> singleTile: true</font></div><div><font face="arial, helvetica, sans-serif"> }, {</font></div><div><font face="arial, helvetica, sans-serif"> 'buffer': 0,</font></div>
<div><font face="arial, helvetica, sans-serif">
'opacity': 1,</font></div><div><font face="arial, helvetica, sans-serif"> 'isBaseLayer': false,</font></div><div><font face="arial, helvetica, sans-serif"> visibility: true</font></div>
<div><font face="arial, helvetica, sans-serif"> });</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">...etc</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><font face="arial, helvetica, sans-serif">then I put the layers into an array so I can check their initial drawing order in the map (ps I have around 100 layers so this way it´s easier to see)</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">e.g..</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><span style="white-space:pre-wrap">        </span>// layers added first are at the bottom of the z-index</font></div>
<div><span style="font-family:arial,helvetica,sans-serif;font-size:small"><br></span></div><div><font face="arial, helvetica, sans-serif"><div> </div><div> var grenzen_layers = [];</div><div> grenzen_layers.push(Layer_grenzen_sg,Layer_grenzen_mg,layer_zgb_grenze);</div>
<div> map.addLayers(grenzen_layers); </div></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">then the layers are put into the tree using the following....</font></div>
<div><font face="arial, helvetica,
sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">// create tree structure</font></div><div><font style="font-family:arial,helvetica,sans-serif;font-size:13px"><div>var treeConfig = [</div><div>
{</div><div> nodeType: "gx_baselayercontainer",</div><div> text: "Basiskarten",</div><div><span style="white-space:pre-wrap">        </span> expanded: true,<span style="white-space:pre-wrap">        </span></div>
<div><span style="white-space:pre-wrap">        </span> hidden:true, </div><div> leaf: true,</div><div><span style="white-space:pre-wrap">        </span> loader: {</div><div><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">        </span>param:
"LAYERS"</div><div><span style="white-space:pre-wrap">                        </span> }</div><div><span style="white-space:pre-wrap">                </span>},</div><div><span style="white-space:pre-wrap">                </span>{</div><div><span style="white-space:pre-wrap">                </span>text: "DOP",</div>
<div><span style="white-space:pre-wrap">                </span>expanded: true,</div><div><span style="white-space:pre-wrap">                </span>children: [</div><div><span style="white-space:pre-wrap">                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div>
<div><span style="white-space:pre-wrap">                                        </span> text:'DOP',</div><div><span style="white-space:pre-wrap">                </span> layer: dop,</div><div><span style="white-space:pre-wrap">                </span> // <span style="white-space:pre-wrap">        </span> icon: '<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Grenzen_SG_gen" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Grenzen_SG_gen</a>',</div>
<div><span style="white-space:pre-wrap">                </span> qtip: "DOP"</div><div><span style="white-space:pre-wrap">                </span> }]</div><div><span style="white-space:pre-wrap">                </span>},</div><div><span style="white-space:pre-wrap">                </span>{</div>
<div><span style="white-space:pre-wrap">                </span>text: "Verwaltungsgrenzen",</div><div><span style="white-space:pre-wrap">                </span>expanded: true,</div><div><span style="white-space:pre-wrap">                </span>children: [</div>
<div><span style="white-space:pre-wrap">                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div><div><span style="white-space:pre-wrap">                                        </span> text:'Planungsraum / Landkreis Grenze',</div>
<div><span style="white-space:pre-wrap">                </span> layer: layer_zgb_grenze,</div><div><span style="white-space:pre-wrap">                </span> <span style="white-space:pre-wrap">        </span>// icon: '<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V1_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V1_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "Metadata"</div><div><span style="white-space:pre-wrap">                </span>
},</div><div><span style="white-space:pre-wrap">                                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div><div><span style="white-space:pre-wrap">                                        </span> text:'Samtgemeinde Grenze',</div>
<div><span style="white-space:pre-wrap">                </span> layer: Layer_grenzen_sg,</div><div><span style="white-space:pre-wrap">                </span> <span style="white-space:pre-wrap">        </span>// icon: '<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V2_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V2_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "Metadata"</div><div><span style="white-space:pre-wrap">        
        </span> },</div><div><span style="white-space:pre-wrap">                                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div><div><span style="white-space:pre-wrap">                                        </span> text:'Mitgliedsgemeinde Grenze',</div>
<div><span style="white-space:pre-wrap">                </span> layer: Layer_grenzen_mg,</div><div><span style="white-space:pre-wrap">                </span> <span style="white-space:pre-wrap">        </span>// icon: '<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V3_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V3_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "Metadata"</div><div><span style="white-space:pre-wrap">                </span> }]</div><div><span style="white-space:pre-wrap">                </span>},</div><div><span style="white-space:pre-wrap">                </span>{</div>
<div><span style="white-space:pre-wrap">                </span>text: "LROP / RROP",</div><div><span style="white-space:pre-wrap">                </span>expanded: true,<span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap">                </span>children: [</div>
<div><span style="white-space:pre-wrap">                </span> {</div><div><span style="white-space:pre-wrap">                </span> text: "LROP", //,layer_RROP</div><div><span style="white-space:pre-wrap">                                        </span> expanded: true,<span style="white-space:pre-wrap">                                        </span> </div>
<div><span style="white-space:pre-wrap">                </span> children: [</div><div><span style="white-space:pre-wrap">                                        </span> {</div><div><span style="white-space:pre-wrap">                                        </span> nodeType: 'gx_layer',</div>
<div><span style="white-space:pre-wrap">                                                                </span> text:'LROP',</div><div><span style="white-space:pre-wrap">                                        </span> layer: layer_LROP,</div><div><span style="white-space:pre-wrap">                                        </span> // <span style="white-space:pre-wrap">        </span> icon: '<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=wea_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=wea_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                
        </span> qtip: "LROP"</div><div><span style="white-space:pre-wrap">                                        </span> }]</div><div><span style="white-space:pre-wrap">                                </span>}</div><div><span style="white-space:pre-wrap">                </span> ]<span style="white-space:pre-wrap">                                </span> </div>
<div><span style="white-space:pre-wrap">                </span>},</div><div><span style="white-space:pre-wrap">                </span>{</div><div><span style="white-space:pre-wrap">                </span>text: "DGM",</div><div><span style="white-space:pre-wrap">                </span>expanded: true,</div>
<div><span style="white-space:pre-wrap">                </span>children: [</div><div><span style="white-space:pre-wrap">                </span> {</div><div><span style="white-space:pre-wrap">                </span>
nodeType: 'gx_layer',</div><div><span style="white-space:pre-wrap">                                        </span> text:'DGM',</div><div><span style="white-space:pre-wrap">                </span> layer: layer_dgm,</div><div><span style="white-space:pre-wrap">                </span> // <span style="white-space:pre-wrap">        </span> icon: '<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Vorrangstandorte_WEA_RROP08_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Vorrangstandorte_WEA_RROP08_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "DGM"</div><div><span style="white-space:pre-wrap">                </span> }]</div><div><span style="white-space:pre-wrap">                </span>},</div><div><span style="white-space:pre-wrap">        
        </span>{</div><div><span style="white-space:pre-wrap">                </span>text: "Suchräume",</div><div><span style="white-space:pre-wrap">                </span>expanded: true,</div><div><span style="white-space:pre-wrap">                </span>children: [</div>
<div><span style="white-space:pre-wrap">                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div><div><span style="white-space:pre-wrap">                                        </span> text:'layer_suchraumV1',</div>
<div><span style="white-space:pre-wrap">                </span> layer: layer_dgm,</div><div><span style="white-space:pre-wrap">                </span> <span style="white-space:pre-wrap">        </span>// icon:
'<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V1_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V1_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "Metadata"</div><div><span style="white-space:pre-wrap">                </span> },</div><div><span style="white-space:pre-wrap">                                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div>
<div><span style="white-space:pre-wrap">                                        </span> text:'layer_suchraumV2',</div><div><span style="white-space:pre-wrap">                </span> layer: layer_dgm,</div><div><span style="white-space:pre-wrap">                </span> <span style="white-space:pre-wrap">        </span>// icon:
'<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V2_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V2_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "Metadata"</div><div><span style="white-space:pre-wrap">                </span> },</div><div><span style="white-space:pre-wrap">                                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div>
<div><span style="white-space:pre-wrap">                                        </span> text:'layer_suchraumV3',</div><div><span style="white-space:pre-wrap">                </span> layer: layer_dgm,</div><div><span style="white-space:pre-wrap">                </span> <span style="white-space:pre-wrap">        </span>// icon:
'<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V3_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V3_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "Metadata"</div><div><span style="white-space:pre-wrap">                </span> },</div><div><span style="white-space:pre-wrap">                                </span> {</div><div><span style="white-space:pre-wrap">                </span> nodeType: 'gx_layer',</div>
<div><span style="white-space:pre-wrap">                                        </span> text:'layer_suchraumV4',</div><div><span style="white-space:pre-wrap">                </span> layer: layer_dgm,</div><div><span style="white-space:pre-wrap">                </span> <span style="white-space:pre-wrap">        </span>// icon:
'<a href="http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V4_wgs84" target="_blank">http://maps.zgb.de/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=16&LAYER=Suchraum_V4_wgs84</a>',</div>
<div><span style="white-space:pre-wrap">                                        </span> qtip: "Metadata"</div><div><span style="white-space:pre-wrap">                </span> }]</div><div><span style="white-space:pre-wrap">                </span>}</div><div><br></div>
<div> ];</div><div><br></div><div><span style="white-space:pre-wrap">        </span></div><div>// create TreePanel</div><div><span style="white-space:pre-wrap">        </span></div><div>var layerTree = new Ext.tree.TreePanel({</div><div>
text: "Karteninhalt",</div><div> border: true,</div><div> region: "west",</div><div> animate: true,</div><div> height: 500,</div><div> width: 350,</div><div> enableDD:
true,</div><div> split: true,</div><div> autoScroll: true,</div><div> containerScroll: true,</div><div> xtype: "gx_legendpanel",</div><div> showWmsLegend: true,</div><div> loader: new Ext.tree.TreeLoader({</div>
<div><span style="white-space:pre-wrap">                </span> applyLoader: false,</div><div><span style="white-space:pre-wrap">                </span> uiProviders: {</div><div><span style="white-space:pre-wrap">                </span> "layernodeui": LayerNodeUI</div>
<div><span style="white-space:pre-wrap">                                        </span> }</div><div><span style="white-space:pre-wrap">                                        </span> }),</div><div><span style="white-space:pre-wrap">                                        </span> root:
{</div><div><span style="white-space:pre-wrap">                                        </span> text: "ZGB GeoPortal",</div><div><span style="white-space:pre-wrap">                                        </span> nodeType: "async",</div><div><span style="white-space:pre-wrap">                                        </span> children: treeConfig,</div>
<div><span style="white-space:pre-wrap">                                                        </span>expanded: true</div><div><span style="white-space:pre-wrap">                                        </span> },</div><div><span style="white-space:pre-wrap">                                        </span> rootVisible: true,</div><div>
<span style="white-space:pre-wrap">                                        </span> lines: true</div><div><span style="white-space:pre-wrap">                                                </span></div><div><span style="white-space:pre-wrap">                </span>});</div></font></div></div></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br>