[OpenLayers-Users] proj4js transform

Michael Adair madair at dmsolutions.ca
Mon Nov 5 07:10:51 PST 2012


The transform method doesn't accept OpenLayers.LonLat as input, use a 
OpenLayers.Geometry.Point or an object that has 'x' and 'y' properties 
as the point to be transformed.

Mike


On 05/11/2012 9:16 AM, Franz S. wrote:
> I have a problem with the "transform"-function when the "proj4js.js" is
> included.
>
> the following code doesnt work:
>
> /lonlat = new OpenLayers.LonLat(15.638, 48.203);
>
>       lonlat.transform(
>              new OpenLayers.Projection("EPSG:4326"), // transform from WGS
> 1984
>              new OpenLayers.Projection("EPSG:900913") // to Spherical
> Mercator
>            );/
>
> lonlat.lat and lonlat.lon aren't transformed to Spherical Mercator.
>
> Can somebody help?
>
>
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/proj4js-transform-tp5014016.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list