diff --git a/MapControl/UWP/Map.UWP.cs b/MapControl/UWP/Map.UWP.cs index cd0f8209..3d21c01c 100644 --- a/MapControl/UWP/Map.UWP.cs +++ b/MapControl/UWP/Map.UWP.cs @@ -2,8 +2,6 @@ // © 2020 Clemens Fischer // Licensed under the Microsoft Public License (Ms-PL) -using System; -using Windows.UI.Core; using Windows.UI.Xaml; using Windows.UI.Xaml.Input; @@ -17,11 +15,6 @@ namespace MapControl public static readonly DependencyProperty MouseWheelZoomDeltaProperty = DependencyProperty.Register( nameof(MouseWheelZoomDelta), typeof(double), typeof(Map), new PropertyMetadata(1d)); - private Vector transformTranslation; - private double transformRotation; - private double transformScale = 1d; - private bool transformPending; - public Map() { ManipulationMode = ManipulationModes.Scale @@ -43,26 +36,9 @@ namespace MapControl set { SetValue(MouseWheelZoomDeltaProperty, value); } } - private async void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) + private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) { - transformTranslation.X += e.Delta.Translation.X; - transformTranslation.Y += e.Delta.Translation.Y; - transformRotation += e.Delta.Rotation; - transformScale *= e.Delta.Scale; - - if (!transformPending) - { - transformPending = true; - - await Dispatcher.RunAsync(CoreDispatcherPriority.Low, - () => TransformMap(e.Position, transformTranslation, transformRotation, transformScale)); - - transformTranslation.X = 0d; - transformTranslation.Y = 0d; - transformRotation = 0d; - transformScale = 1d; - transformPending = false; - } + TransformMap(e.Position, e.Delta.Translation, e.Delta.Rotation, e.Delta.Scale); } private void OnPointerWheelChanged(object sender, PointerRoutedEventArgs e) diff --git a/MapControl/UWP/MapOverlay.UWP.cs b/MapControl/UWP/MapOverlay.UWP.cs index 3eb62792..e6b877db 100644 --- a/MapControl/UWP/MapOverlay.UWP.cs +++ b/MapControl/UWP/MapOverlay.UWP.cs @@ -56,6 +56,11 @@ namespace MapControl public static readonly DependencyProperty StrokeMiterLimitProperty = DependencyProperty.Register( nameof(StrokeMiterLimit), typeof(double), typeof(MapOverlay), new PropertyMetadata(1d)); + public MapOverlay() + { + IsHitTestVisible = false; + } + protected override void SetParentMap(MapBase map) { if (map != null) diff --git a/MapControl/WPF/MapOverlay.WPF.cs b/MapControl/WPF/MapOverlay.WPF.cs index 44b98f31..6330b448 100644 --- a/MapControl/WPF/MapOverlay.WPF.cs +++ b/MapControl/WPF/MapOverlay.WPF.cs @@ -56,6 +56,11 @@ namespace MapControl public static readonly DependencyProperty StrokeMiterLimitProperty = Shape.StrokeMiterLimitProperty.AddOwner( typeof(MapOverlay), new FrameworkPropertyMetadata { AffectsRender = true }); + static MapOverlay() + { + IsHitTestVisibleProperty.OverrideMetadata(typeof(MapOverlay), new FrameworkPropertyMetadata(false)); + } + public MapOverlay() { // Set Stroke Binding in a Loaded handler to allow Stroke value from a Style Setter. diff --git a/SampleApps/UniversalApp/MainPage.xaml b/SampleApps/UniversalApp/MainPage.xaml index d8b1f027..3c72eb44 100644 --- a/SampleApps/UniversalApp/MainPage.xaml +++ b/SampleApps/UniversalApp/MainPage.xaml @@ -130,15 +130,6 @@ - - - - - - - - -