[OpenLayers-Users] need help with projection issues

Christopher Schmidt crschmidt at metacarta.com
Mon Jan 14 12:22:08 EST 2008


On Mon, Jan 14, 2008 at 05:35:51PM +0100, O. Baum wrote:
> I have some polyline data in the format of the geo-coordinates which
> are used directly in Google Maps (guess they are called "Spherical
> Mercator"). E.g., a line from (52.50953477032727, 13.38134765625) to
> (48.850258199721495, 2.35107421875) reaches from Berlin to Paris. Now
> I want to draw this line on an OpenLayers Vector layer when displaying
> a Google Maps layer and switched to Spherical Mercator like described
> in http://trac.openlayers.org/wiki/SphericalMercator.
> 
> I suppose then this one of your proposals is the correct solution, is it?

Yep.

> > If you mean "How can I create features programatically using data in
> > geographic coordinates", the answer is that you will (in trunk) create
> > them, then, once your features are created, call
> > feature.geometry.transform(new OpenLayers.Projection("EPSG:4326"), new
> > OpenLayers.Projection("EPSG:900913")), before you add your features to
> > the map.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list