[OpenLayers-Users] Koordinaten Format LonLat vs. LatLon

Marco Krage marco at my-azur.de
Tue Jun 12 23:21:11 PDT 2012


Hi,
of course i can use the following to display the coords in LatLon order in UI.
console.log(OpenLayers.LonLat.lat+","+OpenLayers.LonLat.lon);

But for example
map.addControl(new OpenLayers.Control.MousePosition());

Prints the coords in LonLat order. Not very usable for the User (me).  
Because it's the wrong order. if you use this coords in google maps,  
it will point you to a different position.
I know there are custom methods to print the MousePosition. But i  
don't know any system that is using this order Openlayer uses.

If you get the coords, 23.545,24.787 you dont know which is the lat wn  
what the lon.

excuse me for that bad english ;-)


Zitat von Javier Mr <javiersdevmail at ymail.com>:

>
>
> Hi marco,
>
> I have never used it but it looks like the GPX parser is what you  
> are looking for  
> (http://dev.openlayers.org/releases/OpenLayers-2.11/doc/apidocs/files/OpenLayers/Format/GPX-js.html), but can't tell how to use it, here is an example of how to use another formater in this case for JSON  
> (http://www.openlayers.org/dev/examples/geojson.html).
>
> About the order of the coordinates, i really dont see the problem,  
> and object containing the coordinates should have a getLat and  
> getLon methods, just like OpenLayers, how to show then to the user  
> depends of the user/developer preference.
>
> But maybe i haven't understand your question deeply enough.
>
> Gruß
> Javi
>
>
>
>
>> ________________________________
>> De: Marco Krage <marco at my-azur.de>
>> Para: openlayers-users at lists.osgeo.org
>> Enviado: Miércoles 13 de junio de 2012 7:17
>> Asunto: [OpenLayers-Users] Koordinaten Format LonLat vs. LatLon
>>
>> Hallo,
>> ich beginne gerade mit Openlayers und möchte gerne meine GPX Tracks  
>> darstellen.
>> Was ich nun nicht ganz verstehe ist, wieso Openlayers die  
>> Koordinaten nur im LonLat Format annimmt und ausgibt.
>>
>> Alle Quellen, sei es Google Maps oder GPX Tracks liefern die  
>> Koordinaten im LatLon Format.
>>
>> Google Maps (Dortmund City): 51.512161,7.465782
>> GPS Tracker (Dortmund City): 51.512161,7.465782
>> Openlayers (Dortmund City): 7.465782,51.512161
>>
>> Wie soll ich damit umgehen, dass Openlayers die Koordinaten  
>> umgekehrt annimmt?
>>
>> Gruß Marco
>>
>> --www.my-azur.de - einfach wunderbar
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>>


-- 
www.my-azur.de - einfach wunderbar



More information about the Users mailing list