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

@ -9,17 +9,17 @@ namespace MapControl
{
public class BoundingBoxTileSource : 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)
{
var tileSize = 360d / (1 << zoomLevel); // tile width in degrees
var west = MapProjection.Wgs84MeterPerDegree * (x * tileSize - 180d);
var east = MapProjection.Wgs84MeterPerDegree * ((x + 1) * tileSize - 180d);
var south = MapProjection.Wgs84MeterPerDegree * (180d - (y + 1) * tileSize);
var north = MapProjection.Wgs84MeterPerDegree * (180d - y * tileSize);
var west = MapProjection.Wgs84MeterPerDegree * (column * tileSize - 180d);
var east = MapProjection.Wgs84MeterPerDegree * ((column + 1) * tileSize - 180d);
var south = MapProjection.Wgs84MeterPerDegree * (180d - (row + 1) * tileSize);
var north = MapProjection.Wgs84MeterPerDegree * (180d - row * tileSize);
if (UriTemplate.Contains("{bbox}"))
{