From 0cbb85c7db26857fbddc8127985eacdd1ac96029 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Fri, 21 Nov 2025 13:36:29 +0100 Subject: [PATCH] Updated ImageTileList --- MapControl/Shared/ImageTileList.cs | 4 ++-- MapControl/WPF/BitmapTileMatrixLayer.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/MapControl/Shared/ImageTileList.cs b/MapControl/Shared/ImageTileList.cs index 94ecf28b..5ac6ebf6 100644 --- a/MapControl/Shared/ImageTileList.cs +++ b/MapControl/Shared/ImageTileList.cs @@ -9,7 +9,7 @@ namespace MapControl { } - public ImageTileList(ImageTileList source, TileMatrix tileMatrix, int columnCount) + public ImageTileList(IEnumerable source, TileMatrix tileMatrix, int columnCount) { FillMatrix(source, tileMatrix.ZoomLevel, tileMatrix.XMin, tileMatrix.YMin, tileMatrix.XMax, tileMatrix.YMax, columnCount); } @@ -17,7 +17,7 @@ namespace MapControl /// /// Adds existing ImageTile from the source collection or newly created ImageTile to fill the specified tile matrix. /// - public void FillMatrix(ImageTileList source, int zoomLevel, int xMin, int yMin, int xMax, int yMax, int columnCount) + public void FillMatrix(IEnumerable source, int zoomLevel, int xMin, int yMin, int xMax, int yMax, int columnCount) { for (var y = yMin; y <= yMax; y++) { diff --git a/MapControl/WPF/BitmapTileMatrixLayer.cs b/MapControl/WPF/BitmapTileMatrixLayer.cs index 395ca8d8..b6d4708d 100644 --- a/MapControl/WPF/BitmapTileMatrixLayer.cs +++ b/MapControl/WPF/BitmapTileMatrixLayer.cs @@ -128,14 +128,13 @@ namespace MapControl { for (var x = TileMatrix.XMin; x <= TileMatrix.XMax; x++) { - var tile = Tiles.FirstOrDefault(t => t.ZoomLevel == TileMatrix.ZoomLevel && t.X == x && t.Y == y); + var tile = Tiles.FirstOrDefault(t => t.X == x && t.Y == y); if (tile == null) { tile = new BitmapTile(TileMatrix.ZoomLevel, x, y, WmtsTileMatrix.MatrixWidth, WmtsTileMatrix.TileWidth, WmtsTileMatrix.TileHeight); - var equivalentTile = Tiles.FirstOrDefault( - t => t.PixelBuffer != null && t.ZoomLevel == tile.ZoomLevel && t.Column == tile.Column && t.Row == tile.Row); + var equivalentTile = Tiles.FirstOrDefault(t => t.PixelBuffer != null && t.Column == tile.Column && t.Row == tile.Row); if (equivalentTile != null) {