<br><br>On Friday, February 10, 2012, Lawrence Miller <<a href="mailto:lawrence.miller@noaa.gov">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>What if you create the map in an onload callback function as in the OpenLayers examples?<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>-- <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">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com">http://www.camptocamp.com</a><br><br>