mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MapImageLayer.cs
This commit is contained in:
parent
50c2429b07
commit
75d8d4a70b
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue