I have a known feature with latitude and longitude.
I have as second point defined by x and y offsets in meters from the known position. This second point is within a few KM of the known position.
I found algorithm - Calculating new longitude, latitude from old + n meters - Stack Overflow to calculate the lat/long of the second point.
Is there a better way to do this in ArcGIS Javascript?
Glenn,
absolutely. The JS API Point class has an offset method.
https://developers.arcgis.com/javascript/3/jsapi/point-amd.html#offset
to convert between lat long and meters you can use webMercatorUtils geographictowebmercator method
esri/geometry/webMercatorUtils | API Reference | ArcGIS API for JavaScript 3.27
Where did this move to in 4.X?
webMercatorUtils | API Reference | ArcGIS API for JavaScript 4.10
Awesome! Thanks!
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.