mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-05-07 13:37:47 +00:00
WMTS tile handling
This commit is contained in:
parent
6d359a5a91
commit
0e27e95c6f
11 changed files with 100 additions and 71 deletions
|
|
@ -8,18 +8,18 @@ namespace MapControl
|
|||
{
|
||||
public class BingMapsTileSource : TileSource
|
||||
{
|
||||
public override Uri GetUri(int x, int y, int zoomLevel)
|
||||
public override Uri GetUri(int column, int row, int zoomLevel)
|
||||
{
|
||||
Uri uri = null;
|
||||
|
||||
if (UriTemplate != null && Subdomains != null && Subdomains.Length > 0 && zoomLevel > 0)
|
||||
{
|
||||
var subdomain = Subdomains[(x + y) % Subdomains.Length];
|
||||
var subdomain = Subdomains[(column + row) % Subdomains.Length];
|
||||
var quadkey = new char[zoomLevel];
|
||||
|
||||
for (var z = zoomLevel - 1; z >= 0; z--, x /= 2, y /= 2)
|
||||
for (var z = zoomLevel - 1; z >= 0; z--, column /= 2, row /= 2)
|
||||
{
|
||||
quadkey[z] = (char)('0' + 2 * (y % 2) + (x % 2));
|
||||
quadkey[z] = (char)('0' + 2 * (row % 2) + (column % 2));
|
||||
}
|
||||
|
||||
uri = new Uri(UriTemplate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue