mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Version 4.12.2 Added TileQueue.
This commit is contained in:
parent
716adff1d1
commit
c6e2766d60
|
|
@ -42,7 +42,7 @@ namespace MapControl
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string CacheKeyFormat { get; set; } = "{0};{1};{2};{3}{4}";
|
public static string CacheKeyFormat { get; set; } = "{0};{1};{2};{3}{4}";
|
||||||
|
|
||||||
private readonly TileQueue pendingTiles = new TileQueue();
|
private readonly TileQueue tileQueue = new TileQueue();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads all pending tiles from the tiles collection in up to MaxLoadTasks parallel Tasks.
|
/// Loads all pending tiles from the tiles collection in up to MaxLoadTasks parallel Tasks.
|
||||||
|
|
@ -51,20 +51,20 @@ namespace MapControl
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void LoadTilesAsync(IEnumerable<Tile> tiles, TileSource tileSource, string sourceName)
|
public void LoadTilesAsync(IEnumerable<Tile> tiles, TileSource tileSource, string sourceName)
|
||||||
{
|
{
|
||||||
pendingTiles.Clear();
|
tileQueue.Clear();
|
||||||
|
|
||||||
if (tileSource != null && pendingTiles.Enqueue(tiles))
|
if (tileSource != null && tileQueue.Enqueue(tiles))
|
||||||
{
|
{
|
||||||
if (Cache != null &&
|
if (Cache != null &&
|
||||||
tileSource.UriFormat != null &&
|
tileSource.UriFormat != null &&
|
||||||
tileSource.UriFormat.StartsWith("http") &&
|
tileSource.UriFormat.StartsWith("http") &&
|
||||||
!string.IsNullOrEmpty(sourceName))
|
!string.IsNullOrEmpty(sourceName))
|
||||||
{
|
{
|
||||||
pendingTiles.RunDequeueTasks(MaxLoadTasks, tile => LoadTileImageAsync(tile, tileSource, sourceName));
|
tileQueue.RunDequeueTasks(MaxLoadTasks, tile => LoadTileImageAsync(tile, tileSource, sourceName));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pendingTiles.RunDequeueTasks(MaxLoadTasks, tile => LoadTileImageAsync(tile, tileSource));
|
tileQueue.RunDequeueTasks(MaxLoadTasks, tile => LoadTileImageAsync(tile, tileSource));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue