From ab1695b10799559f915e1fd4770aa37c1af48101 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Mon, 1 Dec 2025 19:55:04 +0100 Subject: [PATCH] Updated WmtsTileLayer --- MapControl/Shared/WmtsTileLayer.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MapControl/Shared/WmtsTileLayer.cs b/MapControl/Shared/WmtsTileLayer.cs index e5bf723f..fd9d846b 100644 --- a/MapControl/Shared/WmtsTileLayer.cs +++ b/MapControl/Shared/WmtsTileLayer.cs @@ -129,7 +129,7 @@ namespace MapControl Children.Clear(); CancelLoadTiles(); } - else if (UpdateChildLayers(tileMatrixSet)) + else if (UpdateChildLayers(tileMatrixSet.TileMatrixes)) { var tileSource = new WmtsTileSource(UriTemplate, tileMatrixSet); var cacheName = SourceName; @@ -151,13 +151,13 @@ namespace MapControl } } - private bool UpdateChildLayers(WmtsTileMatrixSet tileMatrixSet) + private bool UpdateChildLayers(IList tileMatrixSet) { // Multiply scale by 1.001 to avoid floating point precision issues // and get all WmtsTileMatrixes with Scale <= maxScale. // var maxScale = 1.001 * ParentMap.ViewTransform.Scale; - var tileMatrixes = tileMatrixSet.TileMatrixes.Where(matrix => matrix.Scale <= maxScale).ToList(); + var tileMatrixes = tileMatrixSet.Where(matrix => matrix.Scale <= maxScale).ToList(); if (tileMatrixes.Count == 0) { @@ -189,10 +189,10 @@ namespace MapControl foreach (var tileMatrix in tileMatrixes) { - // Pass index of tileMatrix in tileMatrixSet.TileMatrixes as zoom level to WmtsTileMatrixLayer ctor. + // Pass index of tileMatrix in tileMatrixSet as zoom level to WmtsTileMatrixLayer ctor. // var layer = layers.FirstOrDefault(layer => layer.WmtsTileMatrix == tileMatrix) ?? - new WmtsTileMatrixLayer(tileMatrix, tileMatrixSet.TileMatrixes.IndexOf(tileMatrix)); + new WmtsTileMatrixLayer(tileMatrix, tileMatrixSet.IndexOf(tileMatrix)); if (layer.UpdateTiles(ParentMap.ViewTransform, ParentMap.ActualWidth, ParentMap.ActualHeight)) {