[OSM-dev] OpenLayers problem with latitude and longitude placement
ulf.lamping at googlemail.com
Sun Dec 7 14:14:35 GMT 2008
Maarten Deen schrieb:
> Are there any OpenLayers experts here?
> I'm trying to draw lines on a map using plain latitude and longitude
> coordinates. So that I can use (0,0) for the equator and (0, 51) for some point
> on the Greenwich meridian in England.
> But I can't find out how to do it.
> I have an example at <http://www.maasluip.nl/ebt/test.html>
> I make the lines in a loop at line 52. I almost thought "nice, it's degrees *
> 111320", but that doesn't add up at higher latitudes.
> I understood the maxExtent in the projection to be the way to control this, but
> apparently it isn't (as I have the map created with maxExtent: new
> Any ideas?
No expert here, but I'm currently playing around with OSM myself.
I guess it's better to use the LonLat.transform function.
Maybe something like (quick hack):
for (var p=0; p <= 50; p++)
var pointList = ;
var lonLat0 = new OpenLayers.LonLat(0,
var lonLat1 = new OpenLayers.LonLat(1,
newPoint = new OpenLayers.Geometry.Point(lonLat0.lon,
newPoint = new OpenLayers.Geometry.Point(lonLat1.lon,
var lineFeature = new OpenLayers.Feature.Vector(
Please let me know, if this is the correct solution.
I may need it later myself ...
More information about the dev