XAML-Map-Control/MapControl/Shared/WmtsTileMatrix.cs

28 lines
899 B
C#
Raw Normal View History

2025-02-27 18:46:32 +01:00
#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;
// Indicates if the total width in meters covers the whole earth
// circumference (minus one millimeter for floating point precision).
//
public bool HasFullHorizontalCoverage { get; } =
matrixWidth * tileWidth / scale >= 360d * MapProjection.Wgs84MeterPerDegree - 1e-3;
2020-03-20 18:12:56 +01:00
}
}