From 1fde5e322ec590b27602de8fa890a4c1fafe769d Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Fri, 17 Jan 2025 08:25:26 +0100 Subject: [PATCH] Update WmtsTileLayer.cs --- MapControl/Shared/WmtsTileLayer.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/MapControl/Shared/WmtsTileLayer.cs b/MapControl/Shared/WmtsTileLayer.cs index 32b56631..2614591e 100644 --- a/MapControl/Shared/WmtsTileLayer.cs +++ b/MapControl/Shared/WmtsTileLayer.cs @@ -106,21 +106,18 @@ namespace MapControl } else if (UpdateChildLayers(tileMatrixSet)) { + ((WmtsTileSource)TileSource).TileMatrixSet = tileMatrixSet; + var cacheName = SourceName; - if (TileSource is WmtsTileSource tileSource) + if (!string.IsNullOrEmpty(cacheName)) { - tileSource.TileMatrixSet = tileMatrixSet; - - if (!string.IsNullOrEmpty(cacheName)) + if (!string.IsNullOrEmpty(Layer)) { - if (!string.IsNullOrEmpty(Layer)) - { - cacheName += "/" + Layer.Replace(':', '_'); - } - - cacheName += "/" + tileMatrixSet.Identifier.Replace(':', '_'); + cacheName += "/" + Layer.Replace(':', '_'); } + + cacheName += "/" + tileMatrixSet.Identifier.Replace(':', '_'); } var tiles = ChildLayers.SelectMany(layer => layer.Tiles);