From 722408645b66ec091f2e1bb32dab3caddb6212a1 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Thu, 20 Nov 2025 00:14:52 +0100 Subject: [PATCH] ImageTileList constructor --- MapControl/Shared/ImageTileList.cs | 9 +++++++++ MapControl/Shared/WmtsTileMatrixLayer.cs | 7 ++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/MapControl/Shared/ImageTileList.cs b/MapControl/Shared/ImageTileList.cs index 9366fe32..94ecf28b 100644 --- a/MapControl/Shared/ImageTileList.cs +++ b/MapControl/Shared/ImageTileList.cs @@ -5,6 +5,15 @@ namespace MapControl { public class ImageTileList : List { + public ImageTileList() + { + } + + public ImageTileList(ImageTileList source, TileMatrix tileMatrix, int columnCount) + { + FillMatrix(source, tileMatrix.ZoomLevel, tileMatrix.XMin, tileMatrix.YMin, tileMatrix.XMax, tileMatrix.YMax, columnCount); + } + /// /// Adds existing ImageTile from the source collection or newly created ImageTile to fill the specified tile matrix. /// diff --git a/MapControl/Shared/WmtsTileMatrixLayer.cs b/MapControl/Shared/WmtsTileMatrixLayer.cs index f3e23355..abeda5ba 100644 --- a/MapControl/Shared/WmtsTileMatrixLayer.cs +++ b/MapControl/Shared/WmtsTileMatrixLayer.cs @@ -83,14 +83,11 @@ namespace MapControl } TileMatrix = new TileMatrix(TileMatrix.ZoomLevel, xMin, yMin, xMax, yMax); - - var tiles = new ImageTileList(); - tiles.FillMatrix(Tiles, TileMatrix.ZoomLevel, xMin, yMin, xMax, yMax, WmtsTileMatrix.MatrixWidth); - Tiles = tiles; + Tiles = new ImageTileList(Tiles, TileMatrix, WmtsTileMatrix.MatrixWidth); Children.Clear(); - foreach (var tile in tiles) + foreach (var tile in Tiles) { Children.Add(tile.Image); }