I am working with ArcGIS SDK for dot net. I am programming using vc#. I want to execute a piece of code as soon as the mouse pointer enters a particular longitude/latitude on map or if mouse is clicked on that location. there are many event handlers but I don't know how to retrieve the location the mouse pointer is at. e.g I want to display some picture as soon as mouse pointer is at longitude 25 and lat 33.
MouseMove
listener to your MapView
.MouseEventArgs
. Call GetPosition(null)
on that parameter to get the screen point.MapView.ScreenToLocation(Point)
to get the MapPoint in map coordinates.GeometryEngine.Project(Geometry, SpatialReference.Create(4326))
to convert to longitude/latitude.I tried posting my source code here but Stack Overflow gave me an error, so here it is as a screenshot: