The below code will return the lat & lon values, when i click any where on the map. The result is lon=8931183.8958044,lat=1456094.8596215
how to get the lat & lon exactly when clicking on the map what is the extact format for lat and lon Is this the correct lat & lon? because I see that the Lat & Lon comes in 2 digit (0-90) before can some one help me in converting the values? asked 13 Jun '13, 16:06 gayathri edited 14 Jun '13, 05:42 |
One Answer:
lonlat.lon, lonlat.lat answered 13 Jun '13, 19:42 yvecai Is this the correct lat & lon? because I see that the Lat & Lon comes in 2 digit (0-90) before can some one help me in converting the values? (14 Jun '13, 05:42) gayathri I guess you have read this https://wiki.openstreetmap.org/wiki/Bounding_box and noticed that it uses degrees and fractions in decimal format NOT degrees Minutes and Seconds so 45.5 deg= 45,30,00 DMS. If that does not help what lat lon were you expecting to get back from your code. Could you set it up so you know the result beforehand as a test? (14 Jun '13, 19:46) andy mackey 1 thank for u kindly reply.... i got answer (15 Jun '13, 07:26) gayathri
(15 Jun '13, 07:29) gayathri |
This is an OpenLayers question not OpenStreetMap try GIS Stack Exchange, read a bit about projections, and this blog post might be useful http://macwright.org/2012/01/12/openlayers.html.