Select to view content in your preferred language

Confuse API reference notes esri.geometry.lngLatToXY(long, lat, isLinear)

1170
3
02-07-2013 06:59 AM
AdrianMarsden
Honored Contributor
OK - late in the day here but on

http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#namespace_geometry/esri.geometry.lngLatToX...

For esri.geometry.lngLatToXY(long, lat, isLinear)

the example is


 var normalizedVal = esri.geometry.xyToLngLat(42215329, 1321748);
 console.log(normalizedVal); //returns 19.226, 11.789
 
 var value = esri.geometry.xyToLngLat(42215329, 1321748, true);
 console.log(value); // returns 379.22, 11.78


But the part for esri.geometry.xyToLngLat(long, lat) has no examples

Am I just confused?  All I am trying to do is use these to go from UK WKID (27700) to google map friendly co-ordinates (I realise there may be a small error, but all I need is a good approximation)


Cheers

ACM
0 Kudos
3 Replies
KellyHutchins
Esri Notable Contributor
Adrian,

Those methods are only for converting from Web Mercator to Geographic and the reverse. If you want to convert to another coordinate system take a look at the Geometry Service's project method:

http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/#GeometryService/project
0 Kudos
AdrianMarsden
Honored Contributor
Thanks for that - I realize I probably need the projecyt method - however what the post was really about was the mis-match between thing and the snippet the (it is under the esri.geometry.lngLatToXY but the snippet is for XYTolngLat.


Cheers

ACM
0 Kudos
KellyHutchins
Esri Notable Contributor
Ok now I get it - we'll get the error fixed in the documentation for the next release.

Kelly
0 Kudos