<span class="gI">Hi all,<br>I have been trying for a long time to accomplish something which should be simple but it seems today it&#39;s not my day. <br>I just want to zoom my map to a BBOX value that I am getting from Postgis in order to present a certain feature so I am using map.zoomToExtent(new OpenLayers.Bounds(533052, 22268, 533052, 22268)); in the following way but no zoom is being made.. map is being displayed at its maxim extent as defined.. does anyone have a clue?<br>
Thanks!<br><br>function makeMap() {<br>        <br>    var maximExtent = new OpenLayers.Bounds(521500,15000,556500,40000); //andorra<br>    var resolutions = [68.359375,34.1796875,17.08984375,8.544921875,4.2724609375,2.13623046875,1.068115234375]; <br>
        var genericMapOptions = {<br>            maxExtent: new OpenLayers.Bounds(521500, 15000, 556500, 40000),<br>            maxResolution: &#39;auto&#39;,<br>            units: &#39;meters&#39;,<br>            projection: &#39;EPSG:27573&#39;<br>
        }<br>    var overviewMapSize = new OpenLayers.Size(128, 123);<br>        var url = &quot;<a href="http://xxxxx/tilecache.py">http://xxxxx/tilecache.py</a>?&quot;;<br>        var urlNoCache = &quot;<a href="http://xxxxxx">http://xxxxxx</a>&quot;;<br>
    <br>        var geoLayers = [&#39;corbes_5&#39;, &#39;corbes_25&#39;, &#39;corbes_100&#39;, &#39;carreteres&#39;, &#39;rius&#39;, &#39;limit_pais&#39;, &#39;edificis&#39;]<br><br>        var orto_andorra = new OpenLayers.Layer.WMS(&quot;Ortofoto&quot;, &quot;<a href="http://www.ideandorra.ad/wmsorto2003/request.aspx">http://www.ideandorra.ad/wmsorto2003/request.aspx</a>?&quot;, {layers: &quot;masaic_5m&quot;},{isBaseLayer: true, resolutions: resolutions, transitionEffect:&#39;resize&#39;} )<br>
<br>        var molleres = new OpenLayers.Layer.WMS(&quot;molleres&quot;, urlNoCache, {layers: &quot;molleres&quot;,transparent:&quot;true&quot;},{resolutions: resolutions, transitionEffect:&#39;resize&#39;} )<br><br>        var geografia = new OpenLayers.Layer.WMS(&quot;geografia&quot;, urlNoCache, {layers: geoLayers,transparent:&quot;true&quot;},{resolutions: resolutions, transitionEffect:&#39;resize&#39;} )<br>
<br>    var layers = [orto_andorra,molleres,geografia];<br><br>    var mapControls = [<br>        new OpenLayers.Control.Navigation(),<br>        new OpenLayers.Control.PanZoomBar(),<br>        new OpenLayers.Control.MousePosition()<br>
    ];<br><br>    <br>    var mapOptions = OpenLayers.Util.extend({<br>            resolutions: resolutions,<br>            controls: mapControls,<br>            restrictedExtent: maximExtent<br>        }, genericMapOptions);<br>
<br><br><br>    map = new OpenLayers.Map(&quot;mapa&quot;, mapOptions);<br>    map.addLayers(layers);<br>    <br>    map.zoomToExtent(new OpenLayers.Bounds(533052, 22268, 533052, 22268));<br><br><br>    return map;<br>}<br>
<br><br><br></span>