mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Updated ImageTileList
This commit is contained in:
parent
f24131415a
commit
0cbb85c7db
|
|
@ -9,7 +9,7 @@ namespace MapControl
|
|||
{
|
||||
}
|
||||
|
||||
public ImageTileList(ImageTileList source, TileMatrix tileMatrix, int columnCount)
|
||||
public ImageTileList(IEnumerable<ImageTile> source, TileMatrix tileMatrix, int columnCount)
|
||||
{
|
||||
FillMatrix(source, tileMatrix.ZoomLevel, tileMatrix.XMin, tileMatrix.YMin, tileMatrix.XMax, tileMatrix.YMax, columnCount);
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ namespace MapControl
|
|||
/// <summary>
|
||||
/// Adds existing ImageTile from the source collection or newly created ImageTile to fill the specified tile matrix.
|
||||
/// </summary>
|
||||
public void FillMatrix(ImageTileList source, int zoomLevel, int xMin, int yMin, int xMax, int yMax, int columnCount)
|
||||
public void FillMatrix(IEnumerable<ImageTile> source, int zoomLevel, int xMin, int yMin, int xMax, int yMax, int columnCount)
|
||||
{
|
||||
for (var y = yMin; y <= yMax; y++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue