ImageTileList constructor

This commit is contained in:
ClemensFischer 2025-11-20 00:14:52 +01:00
parent d513ea249e
commit 722408645b
2 changed files with 11 additions and 5 deletions

View file

@ -5,6 +5,15 @@ namespace MapControl
{ {
public class ImageTileList : List<ImageTile> public class ImageTileList : List<ImageTile>
{ {
public ImageTileList()
{
}
public ImageTileList(ImageTileList source, TileMatrix tileMatrix, int columnCount)
{
FillMatrix(source, tileMatrix.ZoomLevel, tileMatrix.XMin, tileMatrix.YMin, tileMatrix.XMax, tileMatrix.YMax, columnCount);
}
/// <summary> /// <summary>
/// Adds existing ImageTile from the source collection or newly created ImageTile to fill the specified tile matrix. /// Adds existing ImageTile from the source collection or newly created ImageTile to fill the specified tile matrix.
/// </summary> /// </summary>

View file

@ -83,14 +83,11 @@ namespace MapControl
} }
TileMatrix = new TileMatrix(TileMatrix.ZoomLevel, xMin, yMin, xMax, yMax); TileMatrix = new TileMatrix(TileMatrix.ZoomLevel, xMin, yMin, xMax, yMax);
Tiles = new ImageTileList(Tiles, TileMatrix, WmtsTileMatrix.MatrixWidth);
var tiles = new ImageTileList();
tiles.FillMatrix(Tiles, TileMatrix.ZoomLevel, xMin, yMin, xMax, yMax, WmtsTileMatrix.MatrixWidth);
Tiles = tiles;
Children.Clear(); Children.Clear();
foreach (var tile in tiles) foreach (var tile in Tiles)
{ {
Children.Add(tile.Image); Children.Add(tile.Image);
} }