mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-03-16 10:14:42 +01:00
Version 4.7.0: Fixed UWP MapBase.CenterPoint
This commit is contained in:
parent
05cf3e7d3d
commit
9566c2d708
|
|
@ -63,10 +63,6 @@ namespace MapControl
|
||||||
nameof(TileFadeDuration), typeof(TimeSpan), typeof(MapBase),
|
nameof(TileFadeDuration), typeof(TimeSpan), typeof(MapBase),
|
||||||
new PropertyMetadata(Tile.FadeDuration, (o, e) => Tile.FadeDuration = (TimeSpan)e.NewValue));
|
new PropertyMetadata(Tile.FadeDuration, (o, e) => Tile.FadeDuration = (TimeSpan)e.NewValue));
|
||||||
|
|
||||||
internal static readonly DependencyProperty CenterPointProperty = DependencyProperty.Register(
|
|
||||||
"CenterPoint", typeof(Point), typeof(MapBase),
|
|
||||||
new PropertyMetadata(new Point(), (o, e) => ((MapBase)o).CenterPointPropertyChanged((Point)e.NewValue)));
|
|
||||||
|
|
||||||
private PointAnimation centerAnimation;
|
private PointAnimation centerAnimation;
|
||||||
private DoubleAnimation zoomLevelAnimation;
|
private DoubleAnimation zoomLevelAnimation;
|
||||||
private DoubleAnimation headingAnimation;
|
private DoubleAnimation headingAnimation;
|
||||||
|
|
@ -497,11 +493,11 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CenterPointPropertyChanged(Point centerPoint)
|
private void CenterPointPropertyChanged(Location center)
|
||||||
{
|
{
|
||||||
if (centerAnimation != null)
|
if (centerAnimation != null)
|
||||||
{
|
{
|
||||||
SetValueInternal(CenterProperty, new Location(centerPoint.Y, centerPoint.X));
|
SetValueInternal(CenterProperty, center);
|
||||||
UpdateTransform();
|
UpdateTransform();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@ namespace MapControl
|
||||||
nameof(TargetHeading), typeof(double), typeof(MapBase),
|
nameof(TargetHeading), typeof(double), typeof(MapBase),
|
||||||
new PropertyMetadata(0d, (o, e) => ((MapBase)o).TargetHeadingPropertyChanged((double)e.NewValue)));
|
new PropertyMetadata(0d, (o, e) => ((MapBase)o).TargetHeadingPropertyChanged((double)e.NewValue)));
|
||||||
|
|
||||||
|
internal static readonly DependencyProperty CenterPointProperty = DependencyProperty.Register(
|
||||||
|
"CenterPoint", typeof(Windows.Foundation.Point), typeof(MapBase),
|
||||||
|
new PropertyMetadata(new Windows.Foundation.Point(), (o, e) => ((MapBase)o).CenterPointPropertyChanged((Windows.Foundation.Point)e.NewValue)));
|
||||||
|
|
||||||
public MapBase()
|
public MapBase()
|
||||||
{
|
{
|
||||||
MapProjection = new WebMercatorProjection();
|
MapProjection = new WebMercatorProjection();
|
||||||
|
|
@ -61,5 +65,10 @@ namespace MapControl
|
||||||
UpdateTransform();
|
UpdateTransform();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CenterPointPropertyChanged(Windows.Foundation.Point center)
|
||||||
|
{
|
||||||
|
CenterPointPropertyChanged(new Location(center.Y, center.X));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,10 @@ namespace MapControl
|
||||||
0d, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
|
0d, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
|
||||||
(o, e) => ((MapBase)o).TargetHeadingPropertyChanged((double)e.NewValue)));
|
(o, e) => ((MapBase)o).TargetHeadingPropertyChanged((double)e.NewValue)));
|
||||||
|
|
||||||
|
private static readonly DependencyProperty CenterPointProperty = DependencyProperty.Register(
|
||||||
|
"CenterPoint", typeof(Point), typeof(MapBase),
|
||||||
|
new PropertyMetadata(new Point(), (o, e) => ((MapBase)o).CenterPointPropertyChanged((Point)e.NewValue)));
|
||||||
|
|
||||||
static MapBase()
|
static MapBase()
|
||||||
{
|
{
|
||||||
ClipToBoundsProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(true));
|
ClipToBoundsProperty.OverrideMetadata(typeof(MapBase), new FrameworkPropertyMetadata(true));
|
||||||
|
|
@ -63,5 +67,10 @@ namespace MapControl
|
||||||
ResetTransformCenter();
|
ResetTransformCenter();
|
||||||
UpdateTransform();
|
UpdateTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CenterPointPropertyChanged(Point center)
|
||||||
|
{
|
||||||
|
CenterPointPropertyChanged(new Location(center.Y, center.X));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue