2025-11-26 23:49:12 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
#if WPF
|
2020-03-20 18:12:56 +01:00
|
|
|
|
using System.Windows;
|
2025-08-19 19:43:02 +02:00
|
|
|
|
#elif AVALONIA
|
|
|
|
|
|
using Avalonia;
|
2020-03-20 18:12:56 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
2025-09-15 17:46:31 +02:00
|
|
|
|
public class WmtsTileMatrix(
|
2025-10-29 18:59:19 +01:00
|
|
|
|
string identifier, double scale, Point topLeft,
|
2025-09-15 17:46:31 +02:00
|
|
|
|
int tileWidth, int tileHeight, int matrixWidth, int matrixHeight)
|
2020-03-20 18:12:56 +01:00
|
|
|
|
{
|
2025-11-26 23:34:22 +01:00
|
|
|
|
public string Identifier => identifier;
|
|
|
|
|
|
public double Scale => scale;
|
|
|
|
|
|
public Point TopLeft => topLeft;
|
|
|
|
|
|
public int TileWidth => tileWidth;
|
|
|
|
|
|
public int TileHeight => tileHeight;
|
|
|
|
|
|
public int MatrixWidth => matrixWidth;
|
|
|
|
|
|
public int MatrixHeight => matrixHeight;
|
|
|
|
|
|
|
2025-11-26 23:49:12 +01:00
|
|
|
|
// Indicates if the total width in meters matches the earth circumference.
|
2025-11-26 23:34:22 +01:00
|
|
|
|
//
|
|
|
|
|
|
public bool HasFullHorizontalCoverage { get; } =
|
2025-11-26 23:49:12 +01:00
|
|
|
|
Math.Abs(matrixWidth * tileWidth / scale - 360d * MapProjection.Wgs84MeterPerDegree) < 1e-3;
|
2020-03-20 18:12:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|