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
|
|
@ -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}"))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue