mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 22:46:58 +00:00
Version 4.16.1. Improved manipulation and mouse pan handling
This commit is contained in:
parent
e44ca90653
commit
30ad3f6f0f
4 changed files with 127 additions and 81 deletions
45
MapControl/Shared/Map.cs
Normal file
45
MapControl/Shared/Map.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// © 2020 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
#if WINDOWS_UWP
|
||||
using Windows.UI.Xaml;
|
||||
#else
|
||||
using System.Windows;
|
||||
#endif
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// MapBase with default input event handling.
|
||||
/// </summary>
|
||||
public partial class Map : MapBase
|
||||
{
|
||||
public static readonly DependencyProperty MouseWheelZoomDeltaProperty = DependencyProperty.Register(
|
||||
nameof(MouseWheelZoomDelta), typeof(double), typeof(Map), new PropertyMetadata(1d));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the amount by which the ZoomLevel property changes during a MouseWheel event.
|
||||
/// The default value is 1.
|
||||
/// </summary>
|
||||
public double MouseWheelZoomDelta
|
||||
{
|
||||
get { return (double)GetValue(MouseWheelZoomDeltaProperty); }
|
||||
set { SetValue(MouseWheelZoomDeltaProperty, value); }
|
||||
}
|
||||
|
||||
private Vector translation;
|
||||
private double rotation;
|
||||
private double scale = 1d;
|
||||
private bool transformPending;
|
||||
|
||||
private void ResetTransform()
|
||||
{
|
||||
translation.X = 0d;
|
||||
translation.Y = 0d;
|
||||
rotation = 0d;
|
||||
scale = 1d;
|
||||
transformPending = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue