Generate coordinates on mouse move

123
2
10-24-2018 12:09 PM
Highlighted
New Contributor III

Hi 

In a WPF application i need to add a panel inside the map with the current coordinate based on mouse position and is refreshing every time that the mouse is moved

something like this:

What can i do?

Thanks

Reply
0 Kudos
2 Replies
Highlighted
Esri Contributor

Hi Alex,

The Format coordinates sample demonstrates how to show coordinates in Degrees/Minutes/Seconds format when clicking on the map.

If you replace

MyMapView.GeoViewTapped += (sender, args) => { UpdateUIFromMapPoint(args.Location); }; 
with
MyMapView.MouseMove += (sender, args) => { UpdateUIFromMapPoint(MyMapView.ScreenToLocation(args.GetPosition(MyMapView)));};

You should get the behavior you want - coordinates refreshing whenever the mouse moves. Let me know if that works for you.

Highlighted
New Contributor III

thanks , im going to check it

Reply
0 Kudos