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'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"><<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>></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 <<a href="mailto:hfpmartins@gmail.com">hfpmartins@gmail.com</a>> wrote:<br>
> Hello,<br>
><br>
> I'm trying to make a zoomToExtent based on a postgres table which has in the<br>
> same column the values for defining a bounding box. So, for each record<br>
> there i have one field with minx, miny, maxx and maxy (example of a record:<br>
> "010101", "-8.341552734375, 40.4988288879395, -8.24995231628418,<br>
> 40.5880279541016"). On my application i have 3 combos which leads the user<br>
> to select one record from that table and to parse a variable (called freg)<br>
> with the bounding box exactly as shown before. Finally, i have a button with<br>
> the following handler:<br>
><br>
> console.log(freg);<br>
><br>
> var bbounds = new OpenLayers.Bounds(freg);<br>
> console.log('bbounds: ' + bbounds);<br>
> var centrarBB = bbounds.transform(wgs, mercator);<br>
> console.log('centrarBB:' + centrarBB);<br>
> map.zoomToExtent(centrarBB, {closest: true});<br>
><br>
> I think this code is working. The problem happens just in the beginning when<br>
> defining openlayers bounds (it is just accepting the first coordinate from<br>
> the variable freg. Here is the output form firebug:<br>
><br>
> freg: -6.94578313827515, 41.2489624023438, -6.88994789123535,<br>
> 41.317310333252<br>
> bbounds: left-bottom=(-6.94578313827515,null) right-top=(null,null)<br>
> centrarBB:left-bottom=(-773201.0421132954,-7.081154551613622e-10)<br>
> right-top=(0,-7.081154551613622e-10)<br>
><br>
> Do you have any suggestions??<br>
> Thanks in advance,<br>
<br>
</div></div>Try this:<br>
<br>
var bounds = OpenLayers.Bounds.fromString("-8.341552734375,<br>
40.4988288879395, -8.24995231628418, 40.5880279541016");<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>