Search code examples
uwpmouseoveruwp-maps

UWP MapControl mouse/pointer over


I am new to UWP and am using the MapControl. I would like to know if there is any way to get it to respond to the MouseOver (PointerOver for UWP) event. I have a couple of scenarios where I could use this type of information:

  1. I want to allow my users to draw on the map. Therefore, as they are drawing a line, the line could show as the user moves the mouse.
  2. As they move the mouse over the map, I would like to show a cross-hair and textboxes with the current Latitude and Longitude.

Even though I am using UWP to get the app into the Windows store, I am only targeting PCs that would have a mouse. I am not concerned with phones, xbox, etc. for my app.

Thanks for any info you could provide.


Solution

  • At the moment, the map control does not raise the OnPointerXXX events. You can work around this by putting another transparent XAML element over the map control and registering for Pointer events on that element, but this can cause other issues with events not getting routed properly.