From e50fb1c03992a7f816e14a04462430b79d39699b Mon Sep 17 00:00:00 2001 From: ClemensF Date: Sat, 23 Jan 2021 09:52:53 +0100 Subject: [PATCH] Update WmtsTileLayer.cs --- MapControl/Shared/WmtsTileLayer.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/MapControl/Shared/WmtsTileLayer.cs b/MapControl/Shared/WmtsTileLayer.cs index 52ef5fd8..942a2553 100644 --- a/MapControl/Shared/WmtsTileLayer.cs +++ b/MapControl/Shared/WmtsTileLayer.cs @@ -154,6 +154,7 @@ namespace MapControl private void UpdateTiles(WmtsTileMatrixSet tileMatrixSet) { var tiles = new List(); + var cacheName = SourceName; foreach (var layer in ChildLayers) { @@ -161,14 +162,11 @@ namespace MapControl tiles.AddRange(layer.Tiles); } - var tileSource = TileSource as WmtsTileSource; - var cacheName = SourceName; - - if (tileSource != null && tileMatrixSet != null) + if (tileMatrixSet != null && TileSource is WmtsTileSource tileSource) { tileSource.TileMatrixSet = tileMatrixSet; - if (cacheName != null) + if (!string.IsNullOrEmpty(cacheName)) { cacheName += "/" + tileMatrixSet.Identifier .Replace(':', '_')