mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 23:15:14 +00:00
WMTS tile handling
This commit is contained in:
parent
6d359a5a91
commit
0e27e95c6f
11 changed files with 100 additions and 71 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue