Update MapImageLayer.cs

This commit is contained in:
ClemensFischer 2025-08-19 23:28:22 +02:00
parent f98fc34ba5
commit 79b9e9d33d

View file

@ -193,7 +193,7 @@ namespace MapControl
cancellationTokenSource = null; cancellationTokenSource = null;
if (image != null) if (image != null && Children.Count >= 2)
{ {
SwapImages(image, boundingBox); SwapImages(image, boundingBox);
} }
@ -210,8 +210,6 @@ namespace MapControl
} }
private void SwapImages(ImageSource image, BoundingBox boundingBox) private void SwapImages(ImageSource image, BoundingBox boundingBox)
{
if (Children.Count >= 2)
{ {
var topImage = (Image)Children[0]; var topImage = (Image)Children[0];
@ -233,4 +231,3 @@ namespace MapControl
} }
} }
} }
}