From 00b738a3b583076757a6dbf8c78224c7c34daa36 Mon Sep 17 00:00:00 2001 From: ClemensF Date: Sat, 23 Jan 2021 09:52:45 +0100 Subject: [PATCH] Update TileImageLoader.cs --- MapControl/Shared/TileImageLoader.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MapControl/Shared/TileImageLoader.cs b/MapControl/Shared/TileImageLoader.cs index 7571e100..0db4e451 100644 --- a/MapControl/Shared/TileImageLoader.cs +++ b/MapControl/Shared/TileImageLoader.cs @@ -63,13 +63,18 @@ namespace MapControl { tileQueue.Clear(); - tileSource = source; - cacheName = Cache != null && (bool)source.UriFormat?.StartsWith("http") ? cache : null; - tiles = tiles.Where(tile => tile.Pending); + tileSource = source; + cacheName = null; + if (tiles.Any() && tileSource != null) { + if (Cache != null && tileSource.UriFormat != null && tileSource.UriFormat.StartsWith("http")) + { + cacheName = cache; + } + tileQueue.Enqueue(tiles); while (taskCount < Math.Min(tileQueue.Count, MaxLoadTasks))