UWP Maps:MapControl PointerMoved event - does not fire only once

tamasoz 21 Reputation points
2020-12-01T14:11:00.257+00:00

I have been having issues implementing the PointerMoved event for Bing Maps in UWP.
My XAML code is as follows:

     <Maps:MapControl x:Name="mainMap" IsTapEnabled="True" MapTapped="mainMap_MapTapped" 
                         MapServiceToken="XXXTOKENXXX" LandmarksVisible="True"  PointerMoved="mainMap_PointerMoved">

Every time I load the map in the mainMap_PointerMoved event handler only fires once and never again. I tried the similar PointerMoved feature on Grid on a different page and it worked as expected. I understand that this event inherits from UIElement.

I developed Bing Maps application for WinRT in the past and in that occasion I had to use PointerMovedOverride event - but it worked without any issues.

I'm using some latest version of Win10 and the project is configured for 1809 as minimum version.

Well this is it. Any help would be appreciated.

Universal Windows Platform (UWP)
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
257 questions
{count} votes

1 answer

Sort by: Most helpful
  1. tamasoz 21 Reputation points
    2020-12-02T12:06:32.203+00:00

    Thanks for confirming my finding RoyLi! As you suggest it is indeed a workaround to overlay the map with a transparent XAML element and work with that element's pointer events - but that unnecessarily increase application complexity - and as you said this isn't really an ideal situation as then the user actually interacts with the invisible element instead of the MapControl.

    This did not work in this way in Bing Maps WinRT API and the PointerMovedOverride event is working normally - so I assume that this should be the case in Bing Maps UWP API too.

    I have been working with a vast range of online map SDK's but PointerMove event handling were all implemented correctly (ie same way as in WinRT API). The documentation of the UWP SDK for the PointerMoved event states "Occurs when a pointer moves while the pointer remains within the hit test area of this element." - but its not. I see you are a Microsoft employee - would you mind to log a bug report on this?

    Thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.