Andreas, <br><br>Sigh, it&#39;s still not working out for me.  Now no base layer is coming up, my zoom slider is not in the right position, and my map div is once again in its own container :(<br><br>This is the code with the changes I have understood I should make:<br>
<br>    var options = {<br>                    controls: [new OpenLayers.Control.Navigation()],<br>                    maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),<br>                    maxResolution: &quot;auto&quot;,<br>
                    projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>                    units: &#39;m&#39;,<br>                    allOverlays: false<br>            }<br><br><br>            //var map = new OpenLayers.Map(options);<br>
            //map.addLayers([gphy, gmap, ghyb, osm, all_chn, all_tib, chn_bridges, tib_bridges, chn_countys, tib_countys, chn_farms, tib_farms, chn_glaciers, tib_glaciers, chn_grazing, tib_grazing, chn_hwyCrew, tib_hwyCrew, chn_hospitals, tib_hospitals, chn_lakes, tib_lakes, chn_monastaries, tib_monastaries, chn_pass, tib_pass, chn_rivers, tib_rivers, chn_townships, tib_townships, chn_villages, tib_villages]);                    <br>
<br>            var mapPanel = new GeoExt.MapPanel({<br>                title: &quot;Map&quot;,<br>                map: options,<br>                //center: map.setCenter(new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;), map.getProjectionObject())),<br>
                center: new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;)),//, map.getProjectionObject()),<br>                renderTo: document.body,<br>                width: 1500,<br>
                height: 600,<br>                zoom: 9, <br>                region: &quot;center&quot;,<br>                bbar: [{<br>                    xtype: &quot;label&quot;,<br>                    text: &quot;Scale = 1 : &quot;<br>
                }],<br>                items: [{<br>                    xtype: &quot;gx_zoomslider&quot;,<br>                    vertical: true,<br>                    height: 300,<br>                    x: 10,<br>                    y: 20,<br>
                    plugins: new GeoExt.ZoomSliderTip()<br>                }]<br>            });<br><br>            var map = mapPanel.map;<br><br>            map.addLayers([gphy, gmap, ghyb, osm, all_chn, all_tib, chn_bridges, tib_bridges, chn_countys, tib_countys, chn_farms, tib_farms, chn_glaciers, tib_glaciers, chn_grazing, tib_grazing, chn_hwyCrew, tib_hwyCrew, chn_hospitals, tib_hospitals, chn_lakes, tib_lakes, chn_monastaries, tib_monastaries, chn_pass, tib_pass, chn_rivers, tib_rivers, chn_townships, tib_townships, chn_villages, tib_villages]);       <br>
<br>Thank you,<br><br>elshae             <br><br><br><div class="gmail_quote">On Mon, Sep 27, 2010 at 10:51 AM, Andreas Hocevar <span dir="ltr">&lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Sep 27, 2010, at 16:15 , IT Intern wrote:<br>
<br>
&gt; Andreas,<br>
&gt;<br>
&gt; What if I am using an Ext.Panel like this?<br>
&gt;<br>
&gt; var map = new OpenLayers.Map(options);<br>
<br>
</div>Make sure that there is no div in your options.<br>
<div class="im"><br>
&gt;<br>
&gt; var mapPanel = new GeoExt.MapPanel({<br>
&gt;                 title: &quot;Map&quot;,<br>
&gt;                 map: map,<br>
<br>
</div>You can do this, but then you also have to destroy the map manually.<br>
<div class="im"><br>
&gt;                 center: map.setCenter(new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;), map.getProjectionObject())),<br>
<br>
</div>This is wrong. Just provide the center here. Don&#39;t call map.setCenter.<br>
<div class="im"><br>
&gt;                 zoom: 9,<br>
&gt;                 region: &quot;center&quot;,<br>
&gt;                 bbar: [{<br>
&gt;                     xtype: &quot;label&quot;,<br>
&gt;                     text: &quot;Scale = 1 : &quot;<br>
&gt;                 }],<br>
&gt;                 items: [{<br>
&gt;                     xtype: &quot;gx_zoomslider&quot;,<br>
&gt;                     vertical: true,<br>
&gt;                     height: 300,<br>
&gt;                     x: 10,<br>
&gt;                     y: 20,<br>
&gt;                     plugins: new GeoExt.ZoomSliderTip()<br>
&gt;                 }]<br>
&gt;             });<br>
&gt;<br>
&gt; new Ext.Panel({<br>
&gt;                 width: 1800,<br>
&gt;                 height: 600,<br>
&gt;                 layout: &quot;border&quot;,<br>
&gt;                 renderTo: document.body,<br>
&gt;                 items: [mapPanel, layerTree]<br>
&gt;                 //items: [mapPanel, groupLayerNode]<br>
&gt;             });<br>
&gt;<br>
&gt; Because I tried with just using map: options, for the mapPanel and then to refer back to my map was a pain.  I tried using mapPanel.map everywhere the original variable map was used and my code broke.<br>
<br>
</div>var mapPanel = new GeoExt.MapPanel({});<br>
var map = mapPanel.map;<br>
// now map is an instance of OpenLayers.Map;<br>
<div class="im"><br>
&gt;  I also added renderTo: document.body, but since I have the Ext.Panel, it placed the mapPanel in a separate div, even after specifying width and height.  My only other guess is maybe I need to get rid of the Ext.Panel, but then do I add the items: [layerTree] to the mapPanel instead?  I really like having the Ext.Panel instead and adding things to it...<br>

<br>
</div>See above. The only reason why it could fail now is a &quot;div&quot; property in your map options.<br>
<br>
Regards,<br>
<font color="#888888">Andreas.<br>
</font><div><div></div><div class="h5"><br>
&gt;<br>
&gt; Thank you,<br>
&gt;<br>
&gt; elshae<br>
&gt;<br>
&gt; On Sat, Sep 25, 2010 at 6:58 AM, Andreas Hocevar &lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; you have to render the MapPanel to somewhere. Either add &quot;renderTo: document.body&quot; to the mapPanel&#39;s configuration, or add it to a container. If you do the former, you also have to configure a width and height on the mapPanel.<br>

&gt;<br>
&gt; Regards,<br>
&gt; Andreas.<br>
&gt;<br>
&gt; On Sep 24, 2010, at 19:19 , IT Intern wrote:<br>
&gt;<br>
&gt; &gt; Jason,<br>
&gt; &gt;<br>
&gt; &gt; I am using Google Streets actually :).  It just isn&#39;t working out for me atm...<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Andreas,<br>
&gt; &gt;<br>
&gt; &gt; I tried both suggestions.  I got rid of the &#39;map&#39; parameter in the map instantiation and had the same result, the layer was blank.  Then I tried again with using my options variable in my mapPanel and nothing loaded up at all when I did this :(<br>

&gt; &gt; My entire page was blank...<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt;<br>
&gt; &gt; elshae<br>
&gt; &gt;<br>
&gt; &gt; On Fri, Sep 24, 2010 at 10:39 AM, Andreas Hocevar &lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt; wrote:<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; the problem here is that you configure the OpenLayers map in the wrong mode. See below:<br>
&gt; &gt;<br>
&gt; &gt; On Sep 23, 2010, at 21:43 , IT Intern wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; Hello GeoExt users,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; This one&#39;s gotten me totally stumped.  I have some base layers and a few wms overlays.  When my page loads it shows the base layer for a quick second and then goes blank as it loads my overlays.  It stays blank until I click the map, etc.  Then it displays properly.  I&#39;ve Googled all sorts of things concerning this sort of issue and have come up with nothing that gives me a hint as to why this could be.  This never happened to me before until I started using GeoExt to display my map.  Is it something in code I must write for GeoExt or OpenLayers so that this doesnt happen?  It&#39;s driving me crazy!!!<br>

&gt; &gt; &gt;<br>
&gt; &gt; &gt; Code:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; //Base Layers<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;              var ghyb = new OpenLayers.Layer.Google(<br>
&gt; &gt; &gt;                     &quot;Google Hybrid&quot;,<br>
&gt; &gt; &gt;                     {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}<br>
&gt; &gt; &gt;                 );<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;             var gmap = new OpenLayers.Layer.Google(<br>
&gt; &gt; &gt;                     &quot;Google Streets&quot;, // the default<br>
&gt; &gt; &gt;                     {numZoomLevels: 20},{visibility: true}<br>
&gt; &gt; &gt;             );<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;             var osm = new OpenLayers.Layer.OSM();<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; //.....<br>
&gt; &gt; &gt; ....<br>
&gt; &gt; &gt; ....<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; var options = {<br>
&gt; &gt; &gt;                     controls: [new OpenLayers.Control.Navigation()],<br>
&gt; &gt; &gt;                     maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),<br>
&gt; &gt; &gt;                     maxResolution: &quot;auto&quot;,<br>
&gt; &gt; &gt;                     projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>
&gt; &gt; &gt;                     units: &#39;m&#39;,<br>
&gt; &gt; &gt;                     allOverlays: false<br>
&gt; &gt; &gt;             }<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;             var map = new OpenLayers.Map(&#39;map&#39;, options);<br>
&gt; &gt;<br>
&gt; &gt; Wrong! If at all, use the following instead:<br>
&gt; &gt;<br>
&gt; &gt;              var map = new OpenLayers.Map(options);<br>
&gt; &gt;<br>
&gt; &gt; You don&#39;t want to render the map at this point, so you have to configure it without a map div.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt;             map.addLayers([gmap, ghyb, osm, all_chn, all_tib, chn_bridges, tib_bridges, chn_countys, tib_countys, chn_farms, tib_farms, chn_glaciers, tib_glaciers, chn_grazing, tib_grazing, chn_hwyCrew, tib_hwyCrew, chn_hospitals, tib_hospitals, chn_lakes, tib_lakes, chn_monastaries, tib_monastaries, chn_pass, tib_pass, chn_rivers, tib_rivers, chn_townships, tib_townships, chn_villages, tib_villages]);<br>

&gt; &gt; &gt;<br>
&gt; &gt; &gt;             var mapPanel = new GeoExt.MapPanel({<br>
&gt; &gt; &gt;                 title: &quot;Map&quot;,<br>
&gt; &gt; &gt;                 map: map,<br>
&gt; &gt;<br>
&gt; &gt; Now the preferred way to configure a MapPanel would be to remove the &quot;var map = ...&quot; above entirely, and configure the map here:<br>
&gt; &gt;<br>
&gt; &gt;                  map: options,<br>
&gt; &gt;                  layers: [gmap, ghyb, osm, all_chn, all_tib, chn_bridges, tib_bridges, chn_countys, tib_countys, chn_farms, tib_farms, chn_glaciers, tib_glaciers, chn_grazing, tib_grazing, chn_hwyCrew, tib_hwyCrew, chn_hospitals, tib_hospitals, chn_lakes, tib_lakes, chn_monastaries, tib_monastaries, chn_pass, tib_pass, chn_rivers, tib_rivers, chn_townships, tib_townships, chn_villages, tib_villages]<br>

&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Andreas.<br>
&gt; &gt;<br>
&gt; &gt; &gt;                 center: map.setCenter(new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection(&quot;EPSG:4326&quot;), map.getProjectionObject())),<br>
&gt; &gt; &gt;                 zoom: 9,<br>
&gt; &gt; &gt;                 region: &quot;center&quot;,<br>
&gt; &gt; &gt;                 bbar: [{<br>
&gt; &gt; &gt;                     xtype: &quot;label&quot;,<br>
&gt; &gt; &gt;                     text: &quot;Scale = 1 : &quot;<br>
&gt; &gt; &gt;                 }],<br>
&gt; &gt; &gt;                 items: [{<br>
&gt; &gt; &gt;                     xtype: &quot;gx_zoomslider&quot;,<br>
&gt; &gt; &gt;                     vertical: true,<br>
&gt; &gt; &gt;                     height: 300,<br>
&gt; &gt; &gt;                     x: 10,<br>
&gt; &gt; &gt;                     y: 20,<br>
&gt; &gt; &gt;                     plugins: new GeoExt.ZoomSliderTip()<br>
&gt; &gt; &gt;                 }]<br>
&gt; &gt; &gt;             });<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;             var layerRoot = new Ext.tree.TreeNode({<br>
&gt; &gt; &gt;                 text: &quot;All Layers&quot;,<br>
&gt; &gt; &gt;                 expanded: true,<br>
&gt; &gt; &gt;                 autoLoad: true<br>
&gt; &gt; &gt;                 });<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; //Is there something to set here???<br>
&gt; &gt; &gt;                 layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({<br>
&gt; &gt; &gt;                 text: &quot;Base Layers&quot;,<br>
&gt; &gt; &gt;                 map: map,<br>
&gt; &gt; &gt;                 layerStore: mapPanel.layers,<br>
&gt; &gt; &gt;                 expanded: true,<br>
&gt; &gt; &gt;                 autoLoad: true<br>
&gt; &gt; &gt;                 }));<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; //.....<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Thank you very much, I appreciate any suggestions :),<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; elshae<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; _______________________________________________<br>
&gt; &gt; &gt; Users mailing list<br>
&gt; &gt; &gt; <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
&gt; &gt; &gt; <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Andreas Hocevar<br>
&gt; &gt; OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
&gt; &gt; Expert service straight from the developers.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; Users mailing list<br>
&gt; &gt; <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
&gt; &gt; <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Andreas Hocevar<br>
&gt; OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
&gt; Expert service straight from the developers.<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
&gt; <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>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
<br>
</div></div></blockquote></div><br>