<font color="#000000"><font size="2"><font face="trebuchet ms,sans-serif">add this option<br><br>restrictedExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),<br><br>works for me! <br>and i've just read the api doc! ;-p<br>
<br><br>-Vito-<br><br><br clear="all"></font></font></font>--<br>-----------<br>Tafuni Vito<br><a href="mailto:vito@vitotafuni.com">vito@vitotafuni.com</a><br>---------------------------------------------<br>"Verba volant, scripta manent... data corrupted"<br>
<br><br><div class="gmail_quote">2010/7/14 Adrian Popa <span dir="ltr"><<a href="mailto:adrian_gh.popa@romtelecom.ro">adrian_gh.popa@romtelecom.ro</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br>
<br>
I have a map with a specific projection system, with the view limited<br>
between some bounds, but when I do map.zoomToMaxExtent() I get sent back<br>
to the world map, centered on (0,0).<br>
Here's my map definition:<br>
<br>
var lonlat = new OpenLayers.Projection("EPSG:4326");<br>
var sphericalMercator = new OpenLayers.Projection("EPSG:900913");<br>
var res =<br>
[2445.9849046875,1222.99245234375,611.496226171875,305.7481130859375,152.87405654296876,76.43702827148438,38.21851413574219,19.109257067871095,9.554628533935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.597164283];<br>
var options = { projection: sphericalMercator, displayProjection:<br>
lonlat, units: "m", numZoomLevels: 12, maxResolution: 2445.9849046875,<br>
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34,<br>
20037508.34, 20037508.34), resolutions: res};<br>
map = new OpenLayers.Map( 'map', options);<br>
var wms = new OpenLayers.Layer.WMS( 'OpenLayers/Metacarta',<br>
'<a href="http://labs.metacarta.com/wms/vmap0" target="_blank">http://labs.metacarta.com/wms/vmap0</a>', {layers: 'basic'} );<br>
map.addLayers([wms]);<br>
<br>
If I click on the globe icon from the zoom-pan bar (which does a<br>
map.zoomToMaxExtent()) I get a zoom seeing the world, instead of seeing<br>
just Romania (the map's bounds).<br>
<br>
Is this a bug in Openlayers or is there something wrong with my code?<br>
<br>
Thanks,<br>
Adrian<br>
<br>
_______________________________________________<br>
Dev mailing list<br>
<a href="mailto:Dev@openlayers.org">Dev@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/dev" target="_blank">http://openlayers.org/mailman/listinfo/dev</a><br>
</blockquote></div><br>