Also if it helps any, I'm getting the following errors in my firebug console...<br><br><span class="objectBox objectBox-errorMessage hasBreakSwitch "><div class="errorTitle focusRow subLogRow ">OpenLayers is not defined</div>
<span class=" "></span><div class="errorSourceBox errorSource-show focusRow subLogRow "><img src="chrome://firebug/content/blank.gif" title="Break on this error" class="errorBreak a11yFocus "><a class="errorSource a11yFocus "> symbolizers: [OpenLayers.Feature.Vector.style["default"]],
</a><a class="objectLink objectLink-sourceLink a11yFocus "><div class=" ">Featur...erer.js (line 36)<br><br></div></a></div></span><div class="logRow logRow-errorMessage"><span class="objectBox objectBox-errorMessage hasBreakSwitch "><div class="errorTitle focusRow subLogRow ">
<span class="errorDuplication "></span>OpenLayers is not defined</div><span class=" "></span><div class="errorSourceBox errorSource-show focusRow subLogRow "><img src="chrome://firebug/content/blank.gif" title="Break on this error" class="errorBreak a11yFocus "><a class="errorSource a11yFocus "> "eq": OpenLayers.Filter.Comparison.EQUAL_TO,
</a><a class="objectLink objectLink-sourceLink a11yFocus "><div class=" ">form.js (line 78)</div></a></div></span></div><div class="logRow logRow-spy loaded opened"><div class="spyHead "><br>I've yet to conquer this issue so any other advices would be great and very much appreciated :)<br>
<br>Thank you,<br><br>elshae<br></div></div><br><br><div class="gmail_quote">On Mon, Sep 27, 2010 at 11:46 AM, IT Intern <span dir="ltr"><<a href="mailto:itintern12@gmail.com">itintern12@gmail.com</a>></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;">Andreas,<br><br>I have added the other changes you recommended. Everything looks good, except now it is back to what I started with. The Google Base layer loads first and as my overlays are loading, it disappears. I am positive that all my overlays are transparent...<div class="im">
<br>
<br>var options = {<br> controls: [new OpenLayers.Control.Navigation()],<br> maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),<br></div> units: 'm',<br>
allOverlays: false<br> }<br><div class="im"><br>var mapPanel = new GeoExt.MapPanel({<br> title: "Map",<br> map: options,<br> //center: map.setCenter(new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())),<br>
</div>
center: new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")),<div class="im"><br> zoom: 9, <br>
region: "center",<br>
bbar: [{<br> xtype: "label",<br> text: "Scale = 1 : "<br> }],<br> items: [{<br> xtype: "gx_zoomslider",<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> 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><br></div>Thanks, <br><br>elshae<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Mon, Sep 27, 2010 at 11:38 AM, Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>></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;">
Three things:<br>
<br>
* don't use map.getProjectionObject() in your transform - it is not available yet<br>
* don't use maxResolution: "auto".<br>
* remove the renderTo config option from your MapPanel.<br>
<font color="#888888"><br>
-Andreas.<br>
</font><div><div></div><div><br>
On Sep 27, 2010, at 17:21 , IT Intern wrote:<br>
<br>
> Andreas,<br>
><br>
> Sigh, it'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: "auto",<br>
> projection: new OpenLayers.Projection("EPSG:900913"),<br>
> units: 'm',<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: "Map",<br>
> map: options,<br>
> //center: map.setCenter(new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())),<br>
> center: new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection("EPSG:4326")),//, map.getProjectionObject()),<br>
> renderTo: document.body,<br>
> width: 1500,<br>
> height: 600,<br>
> zoom: 9,<br>
> region: "center",<br>
> bbar: [{<br>
> xtype: "label",<br>
> text: "Scale = 1 : "<br>
> }],<br>
> items: [{<br>
> xtype: "gx_zoomslider",<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>
> On Mon, Sep 27, 2010 at 10:51 AM, Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>> wrote:<br>
> On Sep 27, 2010, at 16:15 , IT Intern wrote:<br>
><br>
> > Andreas,<br>
> ><br>
> > What if I am using an Ext.Panel like this?<br>
> ><br>
> > var map = new OpenLayers.Map(options);<br>
><br>
> Make sure that there is no div in your options.<br>
><br>
> ><br>
> > var mapPanel = new GeoExt.MapPanel({<br>
> > title: "Map",<br>
> > map: map,<br>
><br>
> You can do this, but then you also have to destroy the map manually.<br>
><br>
> > center: map.setCenter(new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())),<br>
><br>
> This is wrong. Just provide the center here. Don't call map.setCenter.<br>
><br>
> > zoom: 9,<br>
> > region: "center",<br>
> > bbar: [{<br>
> > xtype: "label",<br>
> > text: "Scale = 1 : "<br>
> > }],<br>
> > items: [{<br>
> > xtype: "gx_zoomslider",<br>
> > vertical: true,<br>
> > height: 300,<br>
> > x: 10,<br>
> > y: 20,<br>
> > plugins: new GeoExt.ZoomSliderTip()<br>
> > }]<br>
> > });<br>
> ><br>
> > new Ext.Panel({<br>
> > width: 1800,<br>
> > height: 600,<br>
> > layout: "border",<br>
> > renderTo: document.body,<br>
> > items: [mapPanel, layerTree]<br>
> > //items: [mapPanel, groupLayerNode]<br>
> > });<br>
> ><br>
> > 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>
> var mapPanel = new GeoExt.MapPanel({});<br>
> var map = mapPanel.map;<br>
> // now map is an instance of OpenLayers.Map;<br>
><br>
> > 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>
> See above. The only reason why it could fail now is a "div" property in your map options.<br>
><br>
> Regards,<br>
> Andreas.<br>
><br>
> ><br>
> > Thank you,<br>
> ><br>
> > elshae<br>
> ><br>
> > On Sat, Sep 25, 2010 at 6:58 AM, Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>> wrote:<br>
> > Hi,<br>
> ><br>
> > you have to render the MapPanel to somewhere. Either add "renderTo: document.body" to the mapPanel'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>
> ><br>
> > Regards,<br>
> > Andreas.<br>
> ><br>
> > On Sep 24, 2010, at 19:19 , IT Intern wrote:<br>
> ><br>
> > > Jason,<br>
> > ><br>
> > > I am using Google Streets actually :). It just isn't working out for me atm...<br>
> > ><br>
> > ><br>
> > > Andreas,<br>
> > ><br>
> > > I tried both suggestions. I got rid of the 'map' 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>
> > > My entire page was blank...<br>
> > ><br>
> > > Thanks,<br>
> > ><br>
> > > elshae<br>
> > ><br>
> > > On Fri, Sep 24, 2010 at 10:39 AM, Andreas Hocevar <<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>> wrote:<br>
> > > Hi,<br>
> > ><br>
> > > the problem here is that you configure the OpenLayers map in the wrong mode. See below:<br>
> > ><br>
> > > On Sep 23, 2010, at 21:43 , IT Intern wrote:<br>
> > ><br>
> > > > Hello GeoExt users,<br>
> > > ><br>
> > > > This one'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'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's driving me crazy!!!<br>
> > > ><br>
> > > > Code:<br>
> > > ><br>
> > > > //Base Layers<br>
> > > ><br>
> > > > var ghyb = new OpenLayers.Layer.Google(<br>
> > > > "Google Hybrid",<br>
> > > > {type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20}<br>
> > > > );<br>
> > > ><br>
> > > > var gmap = new OpenLayers.Layer.Google(<br>
> > > > "Google Streets", // the default<br>
> > > > {numZoomLevels: 20},{visibility: true}<br>
> > > > );<br>
> > > ><br>
> > > > var osm = new OpenLayers.Layer.OSM();<br>
> > > ><br>
> > > > //.....<br>
> > > > ....<br>
> > > > ....<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: "auto",<br>
> > > > projection: new OpenLayers.Projection("EPSG:900913"),<br>
> > > > units: 'm',<br>
> > > > allOverlays: false<br>
> > > > }<br>
> > > ><br>
> > > ><br>
> > > > var map = new OpenLayers.Map('map', options);<br>
> > ><br>
> > > Wrong! If at all, use the following instead:<br>
> > ><br>
> > > var map = new OpenLayers.Map(options);<br>
> > ><br>
> > > You don't want to render the map at this point, so you have to configure it without a map div.<br>
> > ><br>
> > ><br>
> > > > 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>
> > > ><br>
> > > > var mapPanel = new GeoExt.MapPanel({<br>
> > > > title: "Map",<br>
> > > > map: map,<br>
> > ><br>
> > > Now the preferred way to configure a MapPanel would be to remove the "var map = ..." above entirely, and configure the map here:<br>
> > ><br>
> > > map: options,<br>
> > > 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>
> > ><br>
> > > Regards,<br>
> > > Andreas.<br>
> > ><br>
> > > > center: map.setCenter(new OpenLayers.LonLat(93.9, 29.53).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())),<br>
> > > > zoom: 9,<br>
> > > > region: "center",<br>
> > > > bbar: [{<br>
> > > > xtype: "label",<br>
> > > > text: "Scale = 1 : "<br>
> > > > }],<br>
> > > > items: [{<br>
> > > > xtype: "gx_zoomslider",<br>
> > > > vertical: true,<br>
> > > > height: 300,<br>
> > > > x: 10,<br>
> > > > y: 20,<br>
> > > > plugins: new GeoExt.ZoomSliderTip()<br>
> > > > }]<br>
> > > > });<br>
> > > ><br>
> > > > var layerRoot = new Ext.tree.TreeNode({<br>
> > > > text: "All Layers",<br>
> > > > expanded: true,<br>
> > > > autoLoad: true<br>
> > > > });<br>
> > > ><br>
> > > > //Is there something to set here???<br>
> > > > layerRoot.appendChild(new GeoExt.tree.BaseLayerContainer({<br>
> > > > text: "Base Layers",<br>
> > > > map: map,<br>
> > > > layerStore: mapPanel.layers,<br>
> > > > expanded: true,<br>
> > > > autoLoad: true<br>
> > > > }));<br>
> > > ><br>
> > > > //.....<br>
> > > ><br>
> > > > Thank you very much, I appreciate any suggestions :),<br>
> > > ><br>
> > > > elshae<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > Users mailing list<br>
> > > > <a href="mailto:Users@geoext.org" target="_blank">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>
> > ><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>
> > ><br>
> > > _______________________________________________<br>
> > > Users mailing list<br>
> > > <a href="mailto:Users@geoext.org" target="_blank">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>
> ><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>
> ><br>
> > _______________________________________________<br>
> > Users mailing list<br>
> > <a href="mailto:Users@geoext.org" target="_blank">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>
> --<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>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@geoext.org" target="_blank">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>
--<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>
</div></div></blockquote></div><br>