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
f98fc34ba5
commit
79b9e9d33d
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
@ -211,25 +211,22 @@ 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];
|
||||||
|
|
||||||
|
Children.RemoveAt(0);
|
||||||
|
Children.Insert(1, topImage);
|
||||||
|
|
||||||
|
topImage.Source = image;
|
||||||
|
SetBoundingBox(topImage, boundingBox);
|
||||||
|
|
||||||
|
if (MapBase.ImageFadeDuration > TimeSpan.Zero)
|
||||||
{
|
{
|
||||||
var topImage = (Image)Children[0];
|
FadeOver();
|
||||||
|
}
|
||||||
Children.RemoveAt(0);
|
else
|
||||||
Children.Insert(1, topImage);
|
{
|
||||||
|
topImage.Opacity = 1d;
|
||||||
topImage.Source = image;
|
Children[0].Opacity = 0d;
|
||||||
SetBoundingBox(topImage, boundingBox);
|
|
||||||
|
|
||||||
if (MapBase.ImageFadeDuration > TimeSpan.Zero)
|
|
||||||
{
|
|
||||||
FadeOver();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
topImage.Opacity = 1d;
|
|
||||||
Children[0].Opacity = 0d;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue