[OSM-dev] OpenLayers problem with latitude and longitude placement

Thomas Wood grand.edgemaster at gmail.com
Sun Dec 7 17:14:53 GMT 2008


A few things
The maxExtent set on the Map object must be in the projection defined
on the Map object
The maxResolution option on the Map object is currently not doing
anything at a guess, this is what is causing the vectors to disappear
at >z13
The units are not degrees on this map (but that option doesn't do
anything important)


2008/12/7 Maarten Deen <mdeen at xs4all.nl>:
> Ulf Lamping wrote:
>> 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
>>> OpenLayers.Bounds(-180,-90,180,90))
>>>
>>> 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.
>
> Yes, that does the trick.
>
> It's not flawless, the lines disappear from zoom 13 and deeper. I guess that's
> some OpenLayers bug.
>
> Maarten
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>



-- 
Regards,
Thomas Wood
(Edgemaster)




More information about the dev mailing list