<div>Hi,<br></div><div></div><div>You can either specify the zoom level in your map options and drop the zoomtomaxextent, or once you&#39;ve loaded data, you a map.centerfunction set on whatever data you load.</div><div>best,</div>
<div>N</div><div></div><div>e.g.</div><div>         if( ! map.getCenter() ){<br>                 sites2.events.register(&#39;loadend&#39;, sites2, function(){map.zoomToExtent(sites2.getDataExtent())});<br>                 map.setCenter(null, null);<br>                 };<br>
}<br>or <br></div><div>map = new OpenLayers.Map (&quot;map&quot;, <br>                                 {<br>                                 controls:[<br>                                 new OpenLayers.Control.Navigation(),<br>                                 new OpenLayers.Control.PanZoomBar(),<br>                                 new OpenLayers.Control.LayerSwitcher(),<br>
                                 new OpenLayers.Control.Attribution()],<br>                         sphericalMercator: true,<br>                         maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),<br>                         maxResolution: 156543.0399,<br>                         numZoomLevels: 19,<br>
</div><div>                         units: &#39;m&#39;,<br>                         projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),<br>                         displayProjection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br><br></div><div>and then specify a specific lon-lat for your map center, and a zoom level in your variables (e.g var zoom = 2, var lat=x var lon=y) and then map.setCenter(lon, lat, zoom)</div>
<br><div class="gmail_quote">On Tue, Aug 4, 2009 at 12:41 AM, Raul David Orozco <span dir="ltr">&lt;<a href="mailto:hagen1113@yahoo.com">hagen1113@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Hi. I´m dealing with an issue  and I&#39;m out of ideas right now.<br><br>I&#39;ve a layer created in my own WMS server, this layer is built with data from some part of my city of residence, but when I load the layer with OL, the zoom level is very far away, because of that my map looks like a tiny black dot, so I have to do zoom a lot of times to actually see something. I need to know how to set the initial zoom level. Here&#39;s the code I&#39;m using to create the Layer.<br>
<br> Layer = new OpenLayers.Layer.WMS( <a href="http://layer.name" target="_blank">layer.name</a>, <br>                                            &quot;<a href="http://192.168.1.5:9090/smms/wms.php" target="_blank">http://192.168.1.5:9090/smms/wms.php</a>&quot;,
 <br>                                            {&#39;layers&#39;: <a href="http://layer.name" target="_blank">layer.name</a>, format: &quot;image/png&quot;},<br>                                            { MinExtent: new OpenLayers.Bounds(-75.69927, -4.79079, -75.67719, 4.81273),<br>
                                            MaxExtent: new OpenLayers.Bounds(-180,-90,180,90),
 <br>                                             maxResolution: &quot;auto&quot;});<br><br>&quot;This coordinates (-75.69927, -4.79079, -75.67719, 4.81273) contain inside all the graphic I want to show in the initial zoom level &quot;.  I used ZoomtoMaExtent but I get an error of &quot;bounds is null&quot;. Thanks.<br>
</td></tr></tbody></table><div class="hm"><br>






      <hr size="1"><br><font face="Verdana" size="-2">¡Obtén la mejor experiencia en la web!<br>Descarga gratis el nuevo Internet Explorer 8<br>
<a href="http://downloads.yahoo.com/ieak8/?l=e1" target="_blank">http://downloads.yahoo.com/ieak8/?l=e1</a></font></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br>