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

26 lines
784 B
C#
Raw Normal View History

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
2026-04-13 17:14:49 +02:00
namespace MapControl;
public class WmtsTileMatrix(
string identifier, double scale, Point topLeft, int tileWidth, int tileHeight, int matrixWidth, int matrixHeight)
2020-03-20 18:12:56 +01:00
{
2026-04-13 17:14:49 +02: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:34:22 +01:00
2026-04-13 17:14:49 +02:00
// Indicates if the total width in meters matches the earth circumference.
//
public bool HasFullHorizontalCoverage { get; } =
Math.Abs(matrixWidth * tileWidth / scale - 360d * MapProjection.Wgs84MeterPerDegree) < 1e-3;
2020-03-20 18:12:56 +01:00
}