mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-14 04:30:11 +01:00
Update Tile class
This commit is contained in:
parent
5c17a1c36f
commit
44ba57e92b
|
|
@ -235,7 +235,7 @@ namespace MapControl
|
|||
tile = new Tile(z, x, y);
|
||||
|
||||
var equivalentTile = Tiles.FirstOrDefault(
|
||||
t => !t.Pending && t.ZoomLevel == z && t.Y == y && t.XIndex == tile.XIndex);
|
||||
t => t.IsLoaded && t.ZoomLevel == z && t.Y == y && t.XIndex == tile.XIndex);
|
||||
|
||||
if (equivalentTile != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,11 +51,11 @@ namespace MapControl
|
|||
IsHitTestVisible = false // avoid touch capture issues
|
||||
};
|
||||
|
||||
public bool Pending { get; set; } = true;
|
||||
public bool IsLoaded { get; set; }
|
||||
|
||||
public void SetImageSource(ImageSource image, bool animateOpacity = true)
|
||||
{
|
||||
Pending = false;
|
||||
IsLoaded = true;
|
||||
Image.Source = image;
|
||||
|
||||
if (image != null && animateOpacity && MapBase.ImageFadeDuration > TimeSpan.Zero)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace MapControl
|
|||
private class TileQueue : ConcurrentStack<Tile>
|
||||
{
|
||||
public TileQueue(IEnumerable<Tile> tiles)
|
||||
: base(tiles.Where(tile => tile.Pending).Reverse())
|
||||
: base(tiles.Where(tile => !tile.IsLoaded).Reverse())
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ namespace MapControl
|
|||
return false;
|
||||
}
|
||||
|
||||
tile.Pending = false;
|
||||
tile.IsLoaded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace MapControl
|
|||
|
||||
if (!tile.Image.DispatcherQueue.TryEnqueue(DispatcherQueuePriority.Low, callback))
|
||||
{
|
||||
tile.Pending = true;
|
||||
tile.IsLoaded = false;
|
||||
tcs.TrySetResult();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue