[OpenLayers-Users] transform coordinates

Steve Way Steve.Way at infotech-enterprises.com
Tue Jul 3 04:38:54 PDT 2012


I would suggest setting the SRS of your map (EPSG:90913) in the WMS request also.

From: openlayers-users-bounces at lists.osgeo.org [mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Pedro Costa
Sent: 03 July 2012 21:38
To: Tobias Reinicke
Cc: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] transform coordinates

I'm resolved using map.zoomToExtend...
But now i have another problem...

My code:

http://pastebin.com/zizWku8a


I want to add a WMS layer from geosever to map, reprojected to srs 900913 but it is not visible in the correct area.
I only see osm layer.
Does anyone know what I'm doing wrong?
I know he is working because I added the same wms (non reprojected) to other maps, without the osm layer, and worked.

Thanks











Em 03-07-2012 09:43, Tobias Reinicke escreveu:
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<mailto: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<mailto:Users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/openlayers-users



________________________________

DISCLAIMER:

This email may contain confidential information and is intended only for the use of the specific individual(s) to which it is addressed. If you are not the intended recipient of this email, you are hereby notified that any unauthorized use, dissemination or copying of this email or the information contained in it or attached to it is strictly prohibited. If you received this message in error, please immediately notify the sender at Infotech or Mail.Admin at infotech-enterprises.com and delete the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120703/0c4c2dc5/attachment-0001.html>


More information about the Users mailing list