<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Thank you for your reply Vito!<br>
<br>
I hadn't noticed that option in the map definition. Also, I've just
noticed that I have a problem with my Bounds (it's wrong) :)<br>
<br>
Thanks again!<br>
<br>
On 07/14/2010 05:10 PM, Vito Tafuni wrote:
<blockquote
 cite="mid:AANLkTin63EyvIwRJo7DBDWbEhfFHJetIYvv4gbekRBea@mail.gmail.com"
 type="cite"><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 moz-do-not-send="true" 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">&lt;<a
 moz-do-not-send="true" href="mailto:adrian_gh.popa@romtelecom.ro">adrian_gh.popa@romtelecom.ro</a>&gt;</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 moz-do-not-send="true" 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 moz-do-not-send="true" href="mailto:Dev@openlayers.org">Dev@openlayers.org</a><br>
    <a moz-do-not-send="true"
 href="http://openlayers.org/mailman/listinfo/dev" target="_blank">http://openlayers.org/mailman/listinfo/dev</a><br>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
--- 
Adrian Popa
NOC Division
Network Engineer
Divizia Centrul National de Operare Retea
Departament Transport IP &amp; Metro
Compartiment IP Core &amp; Backbone
Phone: +40 21 400 3099
</pre>
</body>
</html>