Update MapImageLayer.cs

This commit is contained in:
ClemensFischer 2025-04-04 14:35:18 +02:00
parent 50c2429b07
commit 75d8d4a70b

View file

@ -176,21 +176,6 @@ namespace MapControl
updateTimer.Stop();
ImageSource image = null;
var boundingBox = GetImageBoundingBox();
if (boundingBox != null)
{
image = await GetImageAsync(boundingBox, loadingProgress);
}
SwapImages(image, boundingBox);
updateInProgress = false;
}
}
private BoundingBox GetImageBoundingBox()
{
BoundingBox boundingBox = null;
if (ParentMap != null && ParentMap.ActualWidth > 0d && ParentMap.ActualHeight > 0d)
@ -201,9 +186,14 @@ namespace MapControl
var y = (ParentMap.ActualHeight - height) / 2d;
boundingBox = ParentMap.ViewRectToBoundingBox(new Rect(x, y, width, height));
image = await GetImageAsync(boundingBox, loadingProgress);
}
return boundingBox;
SwapImages(image, boundingBox);
updateInProgress = false;
}
}
private void ClearImages()