WMTS tile handling

This commit is contained in:
ClemensFischer 2022-11-22 19:15:34 +01:00
parent 6d359a5a91
commit 0e27e95c6f
11 changed files with 100 additions and 71 deletions

View file

@ -24,25 +24,19 @@ namespace MapControl
{
public partial class Tile
{
public Tile(int zoomLevel, int x, int y)
public Tile(int zoomLevel, int x, int y, int columnCount)
{
ZoomLevel = zoomLevel;
X = x;
Y = y;
Column = ((x % columnCount) + columnCount) % columnCount;
}
public int ZoomLevel { get; }
public int X { get; }
public int Y { get; }
public int XIndex
{
get
{
var numTiles = 1 << ZoomLevel;
return ((X % numTiles) + numTiles) % numTiles;
}
}
public int Column { get; }
public int Row => Y;
public Image Image { get; } = new Image
{