[OpenLayers-Users] transform coordinates

Tobias Reinicke ramotswa at gmail.com
Tue Jul 3 01:43:59 PDT 2012


You are passing bounds into your setCenter function.
map.setCenter(extend, 6);

What openlayers will do here is take the first x and y coord and zoom there
(which is prob why it's at the wrong location).

Use either  map.zoomToExtent(bounds, closest)
or setCenter passing the correct coordinates.

See here for proper usage;

http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.zoomToExtent


Toby

On 3 July 2012 09:23, Pedro Costa <pedrocostaarma at sapo.pt> wrote:

> Hi,
>
> I want to transform coordinates in EPSG: 27492 to  EPSG:900913 and center
> the map with the result but openlayers fixed map in the wrong place.
>
> I did so:
>
> http://pastebin.com/Uph7CWtg
>
>
> Can anyone help me with that?I'm doing something wrong?
>
> Thanks
> ______________________________**_________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/openlayers-**users<http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120703/9be14b74/attachment.html>


More information about the Users mailing list