I have a pretty basic question, but for whatever reason, I have not been able to find the answer. I am porting some code based on a pretty old version of the ESRI .NET API. We would convert coordinates with methods like ESRI.ArcGIS.Client.Bing.Transform.WebMercatorToGeographic. I am simply trying to get the latitude and longitude of the mouse location. Any suggestions on where to start?
Solved! Go to Solution.
If you use the tap or holding event on the map, it would be something like:
//Get the map point in WGS84
var holdPt = new MapPoint (e.Location.X, e.Location.Y, EsriMapView.SpatialReference);
var mapPt = (MapPoint)GeometryEngine.Project (holdPt, SpatialReferences.Wgs84);
If you use the tap or holding event on the map, it would be something like:
//Get the map point in WGS84
var holdPt = new MapPoint (e.Location.X, e.Location.Y, EsriMapView.SpatialReference);
var mapPt = (MapPoint)GeometryEngine.Project (holdPt, SpatialReferences.Wgs84);
Wow, I had something almost identical, and I am still unsure as to why the results I was getting were incorrect, but what you have works for me. Thanks so much.