From 23d82568652341b5dbff33b65362a35681f289a4 Mon Sep 17 00:00:00 2001 From: ClemensF Date: Sun, 12 Apr 2020 13:26:25 +0200 Subject: [PATCH] Update TileImageLoader.cs --- MapControl/Shared/TileImageLoader.cs | 32 +++------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/MapControl/Shared/TileImageLoader.cs b/MapControl/Shared/TileImageLoader.cs index 533068af..7e294d29 100644 --- a/MapControl/Shared/TileImageLoader.cs +++ b/MapControl/Shared/TileImageLoader.cs @@ -19,9 +19,9 @@ namespace MapControl public partial class TileImageLoader : ITileImageLoader { /// - /// Maximum number of parallel tile loading tasks. The default value is 4. + /// Maximum number of parallel tile loading tasks. The default value is 8. /// - public static int MaxLoadTasks { get; set; } = 4; + public static int MaxLoadTasks { get; set; } = 8; /// /// Default expiration time for cached tile images. Used when no expiration time @@ -29,16 +29,6 @@ namespace MapControl /// public static TimeSpan DefaultCacheExpiration { get; set; } = TimeSpan.FromDays(1); - /// - /// Minimum expiration time for cached tile images. The default value is one day. - /// - public static TimeSpan MinCacheExpiration { get; set; } = TimeSpan.FromDays(1); - - /// - /// Maximum expiration time for cached tile images. The default value is one week. - /// - public static TimeSpan MaxCacheExpiration { get; set; } = TimeSpan.FromDays(7); - /// /// Format string for creating cache keys from the sourceName argument passed to LoadTilesAsync, /// the ZoomLevel, XIndex, and Y properties of a Tile, and the image file extension. @@ -146,23 +136,7 @@ namespace MapControl private static DateTime GetExpiration(TimeSpan? maxAge) { - var expiration = DefaultCacheExpiration; - - if (maxAge.HasValue) - { - expiration = maxAge.Value; - - if (expiration < MinCacheExpiration) - { - expiration = MinCacheExpiration; - } - else if (expiration > MaxCacheExpiration) - { - expiration = MaxCacheExpiration; - } - } - - return DateTime.UtcNow.Add(expiration); + return DateTime.UtcNow.Add(maxAge ?? DefaultCacheExpiration); } } }