This commit is contained in:
ClemensFischer 2025-06-07 15:08:36 +02:00
parent 085154c614
commit 0696441a4e
4 changed files with 9 additions and 9 deletions

View file

@ -7,7 +7,7 @@
public static readonly StyledProperty<Location> LocationProperty =
DependencyPropertyHelper.AddOwner<MapItem, Location>(MapPanel.LocationProperty, null,
(item, oldValue, newValue) => item.UpdateMapTransform(newValue));
(item, oldValue, newValue) => item.UpdateMapTransform());
protected override void OnPointerPressed(PointerPressedEventArgs e)
{

View file

@ -60,7 +60,7 @@ namespace MapControl
//
parentMap.ViewportChanged += OnViewportChanged;
UpdateMapTransform(Location);
UpdateMapTransform();
}
}
}
@ -81,7 +81,7 @@ namespace MapControl
{
parentMap.ViewportChanged += OnViewportChanged;
UpdateMapTransform(Location);
UpdateMapTransform();
}
}
@ -91,14 +91,14 @@ namespace MapControl
private void OnViewportChanged(object sender, ViewportChangedEventArgs e)
{
UpdateMapTransform(Location);
UpdateMapTransform();
}
private void UpdateMapTransform(Location location)
private void UpdateMapTransform()
{
if (mapTransform != null && parentMap != null && location != null)
if (mapTransform != null && parentMap != null && Location != null)
{
mapTransform.Matrix = parentMap.GetMapTransform(location);
mapTransform.Matrix = parentMap.GetMapTransform(Location);
}
}
}

View file

@ -11,7 +11,7 @@ namespace MapControl
public static readonly DependencyProperty LocationProperty =
DependencyPropertyHelper.AddOwner<MapItem, Location>(MapPanel.LocationProperty, null,
(item, oldValue, newValue) => item.UpdateMapTransform(newValue));
(item, oldValue, newValue) => item.UpdateMapTransform());
static MapItem()
{

View file

@ -25,7 +25,7 @@ namespace MapControl
(item, oldValue, newValue) =>
{
MapPanel.SetLocation(item, newValue);
item.UpdateMapTransform(newValue);
item.UpdateMapTransform();
});
private Windows.Foundation.Point? pointerPressedPosition;