mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
|
|
// 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;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|