Generate coordinates on mouse move

668
2
10-24-2018 12:09 PM
AlexVelez
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

0 Kudos
2 Replies
NathanCastle1
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.

AlexVelez
New Contributor III

thanks , im going to check it

0 Kudos