Quantcast
Viewing all articles
Browse latest Browse all 256

UWP MapControl events do not happen, but I've found a workaround....

Dear all,

this time I'm not writing to ask help in found a solution but to understand why the solution I've found works :)

I've a simple map control in my XAML:

<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Expedition_map_tool"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:maps="using:Windows.UI.Xaml.Controls.Maps"
x:Class="Expedition_map_tool.MainPage"
mc:Ignorable="d" Width="Auto" Height="Auto">

<maps:MapControl Grid.Column="1" Grid.ColumnSpan="4" x:Name="MyMap" ZoomInteractionMode="GestureOnly" RotateInteractionMode="Disabled" TiltInteractionMode="GestureAndControl" PanInteractionMode="Auto" MapServiceToken="...... " Canvas.ZIndex="0" />


---- other controls here -------


</Page>

If I try to catch the mouse movement whit the event procedure

Private Sub MyMap_PointerMoved(sender As Object, e As PointerRoutedEventArgs) Handles MyMap.PointerMoved

......

End sub


nothing happen, but if I add a simple Stack Panel over the map it work, like this:


<StackPanel x:Name="overlay" Grid.Column="1" Grid.ColumnSpan="3" Canvas.ZIndex="5" Background="Transparent" IsHitTestVisible="False" />


all the mouse events on the map start working... WHY ?????

Thanks, Stefano

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>