mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Set AffectsRender flag on MapPanel.ViewportPosition property, fixed Map.ZoomMap method.
This commit is contained in:
parent
5760471c1c
commit
e8b29be79e
|
|
@ -405,6 +405,7 @@ namespace MapControl
|
|||
UpdateTransform();
|
||||
}
|
||||
|
||||
ResetTransformOrigin();
|
||||
TranslateMap(translation);
|
||||
}
|
||||
|
||||
|
|
@ -414,8 +415,13 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public void ZoomMap(Point origin, double zoomLevel)
|
||||
{
|
||||
SetTransformOrigin(origin);
|
||||
double targetZoomLebel = TargetZoomLevel;
|
||||
TargetZoomLevel = zoomLevel;
|
||||
|
||||
if (TargetZoomLevel != targetZoomLebel) // TargetZoomLevel might be coerced
|
||||
{
|
||||
SetTransformOrigin(origin);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace MapControl
|
|||
|
||||
private static readonly DependencyPropertyKey ViewportPositionPropertyKey = DependencyProperty.RegisterAttachedReadOnly(
|
||||
"ViewportPosition", typeof(Point?), typeof(MapPanel),
|
||||
new FrameworkPropertyMetadata(ViewportPositionPropertyChanged));
|
||||
new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender, ViewportPositionPropertyChanged));
|
||||
|
||||
public static readonly DependencyProperty ViewportPositionProperty = ViewportPositionPropertyKey.DependencyProperty;
|
||||
|
||||
|
|
@ -93,15 +93,13 @@ namespace MapControl
|
|||
|
||||
protected virtual void OnViewportChanged()
|
||||
{
|
||||
Map parentMap = ParentMap;
|
||||
|
||||
foreach (UIElement element in InternalChildren)
|
||||
{
|
||||
Location location = GetLocation(element);
|
||||
|
||||
if (location != null)
|
||||
{
|
||||
SetViewportPosition(element, parentMap, location);
|
||||
SetViewportPosition(element, ParentMap, location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue