Hi all,<br><br>I'm playing with geoExt library and I'm trying to understand how it works in deep.<br>I've created a mapPanel with no map constructor as above : <br><br>var mapPanel = new GeoExt.MapPanel({<br> map: {<br>
controls: [<br> new OpenLayers.Control.Navigation()<br> ,new OpenLayers.Control.PanPanel()<br> ,new OpenLayers.Control.ZoomPanel()<br> ]<br> }<br>
,region : 'center'<br> ,title : 'map'<br> ,layers: [bluemarble]<br> ,extent: [-5, 35, 15, 55]<br> });<br><br><br>After that I have created a tree layer as above : <br><br>/* tree layer */<br>
var layerRoot = new Ext.tree.TreeNode({<br> text: "All Layers"<br> ,expanded: true<br> ,loader: new GeoExt.tree.LayerLoader({<br> applyLoader: true<br> })<br> });<br>
<br> //Base Layers<br> layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({<br> text: "Base Layers"<br> ,map: mapPanel.map<br> ,expanded: true<br> }));<br> <br> layerRoot.appendChild(new GeoExt.tree.OverlayLayerContainer({<br>
text: "Overlays"<br> ,map: mapPanel.map<br> ,expanded: true<br> }));<br> <br> var layerTree = new Ext.tree.TreePanel({<br> title: "Map Layers",<br> root: layerRoot,<br>
expanded: true<br> });<br><br>The things works almost perfectly but all my layers seems to be considering as "overlays".<br><br>So I've looked in the MapPanel Class to understand what is wrong and I've found in the line 101 why it doesn't work properly :<br>
<br> if(!(this.map instanceof OpenLayers.Map)) {<br> this.map = new OpenLayers.Map(<br> Ext.applyIf(this.map || {}, {allOverlays: true})<br> );<br> }<br><br><br>So my question is why the GeoExt developpers have decided to force the allOverlays properties to false instead of true?<br>
Indeed if I modify the class and set it to true my tree layer chow me a correct result.<br><br>Can someone help me to understand.<br><br>Regards<br><br><br>Arnaud<br><br>-- <br>--------------------------------------------------------------------<br>
Van De Casteele Arnaud<br>72 Rue de la colline des camélias 97400 Saint-Denis<br>0262 30 67 79 - 0692 76 24 48<br>SIG - WebMapping - GPS embarqué<br>Site internet : <a href="http://geotribu.net/">http://geotribu.net/</a><br>