Hi, <div>Following the tree tutorial I&#39;ve created a map with a layerTree, It works but I want the tree in the west region and map at center, but instead of this, all is displayed at left side with the tree up the map.  What I&#39;m doing wrong?</div>
<div><br></div><div>Thanks a lot!</div><div><br></div><div><br></div><div>The whole code is:</div><div><br></div><div><div>&lt;html&gt;</div><div>&lt;head&gt;</div><div><br></div><div>&lt;title&gt; Projectes AUMA &lt;/title&gt;</div>
<div>&lt;script src=&quot;ext-3.3.1/adapter/ext/ext-base.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</div><div>&lt;script src=&quot;ext-3.3.1/ext-all.js&quot;  type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</div>
<div>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;ext-3.3.1/resources/css/ext-all.css&quot;&gt;&lt;/link&gt;</div><div>&lt;script src=&quot;OpenLayers/OpenLayers.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</div>
<div>&lt;script src=&quot;GeoExt/lib/GeoExt.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</div><div>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;GeoExt/resources/geoext-all-debug.css&quot;&gt;&lt;/link&gt;</div>
<div><br></div><div>&lt;script type=&quot;text/javascript&quot;&gt;</div><div><br></div><div><br></div><div>var mapPanel, tree;</div><div>Ext.onReady(function() {</div><div>    // create a map panel with some layers that we will show in our layer tree</div>
<div>    // below.</div><div>    </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>mapPanel = new GeoExt.MapPanel({</div><div>        border: true,</div><div>        region: &quot;center&quot;,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>map: new OpenLayers.Map(),</div><div>        renderTo: &#39;gxmap&#39;,</div><div>        height: 500,</div><div>        width: 800,</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>title: &#39;Projectes AUMA&#39;,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>zoom: 4,</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>center: new OpenLayers.LonLat (-3,38),</div><div>        layers: [</div><div>
            new OpenLayers.Layer.WMS(</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>&quot;World&quot;, &quot;<a href="http://www.opengis.uab.es/cgi-bin/world/MiraMon.cgi">http://www.opengis.uab.es/cgi-bin/world/MiraMon.cgi</a>?&quot;,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>layers:[&#39;BlueMarble_NG&#39;,&#39;admin_level1-world&#39;]</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>}, {</div>
<div>                    buffer: 0,</div><div>                    visibility: false</div><div>                }</div><div>            ),</div><div>            </div><div>            new OpenLayers.Layer.WMS(</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&quot;Projectes UTM31&quot;,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&quot;<a href="http://localhost:8080/geoserver/AUMA/wms">http://localhost:8080/geoserver/AUMA/wms</a>&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>{</div>
<div>                     layers: &#39;AUMA:Projectes_UTM31&#39;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span> transparent:true,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span> format: &#39;image/png&#39;},</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span> {</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span> isBaseLayer:false, </div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span> buffer: 0</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>),</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>new OpenLayers.Layer.WMS(</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&quot;Projectes UTM30&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>&quot;<a href="http://localhost:8080/geoserver/AUMA/wms">http://localhost:8080/geoserver/AUMA/wms</a>&quot;,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span>{</div><div>                     layers: &#39;AUMA:Projectes_Esp&#39;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span> transparent:true,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span> format: &#39;image/png&#39;},</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span> {</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span> isBaseLayer:false,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                        </span> buffer: 0</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>)</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span></div><div>            </div><div>           </div><div>        ]</div><div>    });</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>var LayerNodeUI = Ext.extend(GeoExt.tree.LayerNodeUI, new GeoExt.tree.TreeNodeUIEventMixin());</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>var treeConfig = [{</div><div>        nodeType: &quot;gx_baselayercontainer&quot;</div>
<div>    }, {</div><div>        nodeType: &quot;gx_overlaylayercontainer&quot;,</div><div>        expanded: true,</div><div>        // render the nodes inside this container with a radio button,</div><div>        // and assign them the group &quot;foo&quot;.</div>
<div>        loader: {</div><div>            baseAttrs: {</div><div>                radioGroup: &quot;foo&quot;,</div><div>                uiProvider: &quot;layernodeui&quot;</div><div>            }</div><div>        }</div>
<div>    }];</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>var layerList = new GeoExt.tree.LayerContainer({</div><div>    text: &#39;Capes&#39;,</div>
<div>    layerStore: mapPanel.layers,</div><div>    leaf: false,</div><div>    expanded: true</div><div>});</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>var layerTree = new Ext.tree.TreePanel({</div>
<div>    title: &#39;Map Layers&#39;,</div><div>    renderTo: &#39;layerTree&#39;,</div><div>    root: layerList,<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>border: true,</div>
<div>    region: &quot;west&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>width: 200,</div><div>    split: true,</div><div>    collapsible: true,</div><div>        collapseMode: &quot;mini&quot;,</div>
<div>        autoScroll: true,</div><div>        plugins: [</div><div>            new GeoExt.plugins.TreeNodeRadioButton({</div><div>                listeners: {</div><div>                    &quot;radiochange&quot;: function(node) {</div>
<div>                        alert(node.text + &quot; is now the active layer.&quot;);</div><div>                    }</div><div>                }</div><div>            })</div><div>        ],</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>loader: new Ext.tree.TreeLoader({</div>
<div>            // applyLoader has to be set to false to not interfer with loaders</div><div>            // of nodes further down the tree hierarchy</div><div>            applyLoader: false,</div><div>            uiProviders: {</div>
<div>                &quot;layernodeui&quot;: LayerNodeUI</div><div>            }</div><div>        }),</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>listeners: {</div><div>            &quot;radiochange&quot;: function(node){</div>
<div>                alert(<a href="http://node.layer.name">node.layer.name</a> + &quot; is now the the active layer.&quot;);</div><div>            }</div><div>        },<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>rootVisible: false,</div><div>    lines: false<span class="Apple-tab-span" style="white-space:pre">        </span></div><div>});</div><div><br></div><div>new Ext.Viewport({</div>
<div>        layout: &quot;fit&quot;,</div><div>        hideBorders: true,</div><div>        items: {</div><div>            layout: &quot;border&quot;,</div><div>            deferredRender: false,</div><div>            items: [mapPanel, layerTree, {</div>
<div>                contentEl: &quot;desc&quot;,</div><div>                region: &quot;east&quot;,</div><div>                bodyStyle: {&quot;padding&quot;: &quot;5px&quot;},</div><div>                collapsible: true,</div>
<div>                collapseMode: &quot;mini&quot;,</div><div>                split: true,</div><div>                width: 200,</div><div>                title: &quot;Description&quot;</div><div>            }]</div><div>
        }</div><div>    });</div><div><br></div><div>   </div><div>});</div><div><br></div><div>&lt;/script&gt;</div><div>&lt;/head&gt;</div><div>&lt;body&gt;</div><div><br></div><div>&lt;div id=&quot;gxmap&quot;&gt;&lt;/div&gt;</div>
<div>&lt;div id=&quot;layerTree&quot;&gt;&lt;/div&gt;</div><div><br></div><div><br></div><div>&lt;/body&gt;</div><div>&lt;/html&gt;</div></div><div><br></div><div><br clear="all"><div><br></div>-- <br><a href="http://kikocanas.blogspot.com" target="_blank">http://kikocanas.blogspot.com</a><br>

</div>