Thanks Eric,<br><br>I had solved this problem by making a column to each bounding coordinate (xmin, ymin, ...). After selection on the combobox i&#39;m able to access different columns in the postgres. This was my solution and it is working. Nevertheless, thanks a lot for your answers which are, no doubt, pretty much helpfull.<br>
Cheers,<br><br>Hugo<br><br><br><div class="gmail_quote">On Mon, Apr 13, 2009 at 3:21 PM, Eric Lemoine <span dir="ltr">&lt;<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Thu, Apr 9, 2009 at 5:21 PM, Hugo &lt;<a href="mailto:hfpmartins@gmail.com">hfpmartins@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m trying to make a zoomToExtent based on a postgres table which has in the<br>
&gt; same column the values for defining a bounding box. So, for each record<br>
&gt; there i have one field with minx, miny, maxx and maxy (example of a record:<br>
&gt; &quot;010101&quot;, &quot;-8.341552734375, 40.4988288879395, -8.24995231628418,<br>
&gt; 40.5880279541016&quot;). On my application i have 3 combos which leads the user<br>
&gt; to select one record from that table and to parse a variable (called freg)<br>
&gt; with the bounding box exactly as shown before. Finally, i have a button with<br>
&gt; the following handler:<br>
&gt;<br>
&gt; console.log(freg);<br>
&gt;<br>
&gt; var bbounds = new OpenLayers.Bounds(freg);<br>
&gt; console.log(&#39;bbounds: &#39; + bbounds);<br>
&gt; var centrarBB = bbounds.transform(wgs, mercator);<br>
&gt; console.log(&#39;centrarBB:&#39; + centrarBB);<br>
&gt; map.zoomToExtent(centrarBB, {closest: true});<br>
&gt;<br>
&gt; I think this code is working. The problem happens just in the beginning when<br>
&gt; defining openlayers bounds (it is just accepting the first coordinate from<br>
&gt; the variable freg. Here is the output form firebug:<br>
&gt;<br>
&gt; freg: -6.94578313827515, 41.2489624023438, -6.88994789123535,<br>
&gt; 41.317310333252<br>
&gt; bbounds: left-bottom=(-6.94578313827515,null) right-top=(null,null)<br>
&gt; centrarBB:left-bottom=(-773201.0421132954,-7.081154551613622e-10)<br>
&gt; right-top=(0,-7.081154551613622e-10)<br>
&gt;<br>
&gt; Do you have any suggestions??<br>
&gt; Thanks in advance,<br>
<br>
</div></div>Try this:<br>
<br>
var bounds = OpenLayers.Bounds.fromString(&quot;-8.341552734375,<br>
40.4988288879395, -8.24995231628418, 40.5880279541016&quot;);<br>
<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" target="_blank">http://www.camptocamp.com</a><br>
</blockquote></div><br>