I get the same effect when I load the script as in the examples.<div><br></div><div> <script src="<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>"></script><div>
<script type="text/javascript"></div><div> var map;</div><div> function init (){</div><div> var options = {</div><div> maxExtent: new OpenLayers.Bounds(0,0,1410,913),</div>
<div> maxResolution: "auto"...</div><div><br></div><div><div><div> </script></div><div> </head></div><div> <body onload="init()" ></div><div> <h1 id="title">AAWU Product Layering Test</h1></div>
<div> <div style="width:696px; height: 425px; border: 1px solid;" id="map"></div></div><div> </body></div></div></div><div><br></div><div><br></div><div><br></div><div><br></div>
<br><div class="gmail_quote">On Sun, Feb 12, 2012 at 8:29 PM, Eric Lemoine <span dir="ltr"><<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br><br>On Friday, February 10, 2012, Lawrence Miller <<a href="mailto:lawrence.miller@noaa.gov" target="_blank">lawrence.miller@noaa.gov</a>> wrote:<br>> I am trying to load a basemap and layers into a 696x425 frame. The map won't appear in the center of the frame, it appears centered low and to the left. I can drag the map into the correct location, but I would prefer it just appear there. Any suggestions?<br>
> <br>> my script:<br>> <div style="width:696px; height: 425px; border: 1px solid;" id="map"></div><br>> <script defer="defer" type="text/javascript"><br>
<br></div>What if you create the map in an onload callback function as in the OpenLayers examples?<div class="HOEnZb"><div class="h5"><br><br><br>> var options = {<br>> maxExtent: new OpenLayers.Bounds(0,0,1410,913),<br>
> maxResolution: "auto"<br>
> };<br>> var map = new OpenLayers.Map('map',options);<br>> var base = new OpenLayers.Layer.Image("Basemap",<br>> "newestbasemap.gif",<br>> new OpenLayers.Bounds(0,0,1410,913),<br>
> new OpenLayers.Size(1410,913),<br>> {isBaseLayer: true}<br>> );<br>> var ice = new OpenLayers.Layer.Image("Freezing Level",<br>> "pt3.gif",<br>
> new OpenLayers.Bounds(0,0,1410,913),<br>> new OpenLayers.Size(1410,913),<br>> {isBaseLayer: false,<br>> visibility: false,<br>> opacity: 0.80}<br>
> );<br>> var wind = new OpenLayers.Layer.Image("Wind Speed",<br>> "pt3windspd.gif",<br>> new OpenLayers.Bounds(0,0,1410,913),<br>> new OpenLayers.Size(1410,913),<br>
> {isBaseLayer: false,<br>> visibility: false,<br>> opacity: 0.60}<br>> );<br>> var turb = new OpenLayers.Layer.Image("Turbulence",<br>
> "pt3turb.gif",<br>> new OpenLayers.Bounds(0,0,1410,913),<br>> new OpenLayers.Size(1410,913),<br>> {isBaseLayer: false,<br>> visibility: false,<br>
> opacity: 0.60}<br>> );<br>> map.addLayers([base, ice, wind, turb]);<br>> map.setCenter(new OpenLayers.LonLat(705,456));<br>> map.zoomToMaxExtent();<br>
> map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
> </script><br><br></div></div><span class="HOEnZb"><font color="#888888">-- <br>Eric Lemoine<br><br>Camptocamp France SAS<br>Savoie Technolac, BP 352<br>73377 Le Bourget du Lac, Cedex<br><br>Tel : 00 33 4 79 44 44 96<br>
Mail : <a href="mailto:eric.lemoine@camptocamp.com" target="_blank">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br><br>
</font></span></blockquote></div><br></div>