2025-02-27 18:46:32 +01:00
|
|
|
|
using System;
|
2020-03-20 18:12:56 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public class WmtsTileMatrixSet
|
|
|
|
|
|
{
|
2025-09-19 18:49:12 +02:00
|
|
|
|
public WmtsTileMatrixSet(string identifier, string supportedMapProjection, IEnumerable<WmtsTileMatrix> tileMatrixes)
|
2020-03-20 18:12:56 +01:00
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(identifier))
|
|
|
|
|
|
{
|
2025-02-28 16:25:12 +01:00
|
|
|
|
throw new ArgumentException($"The {nameof(identifier)} argument must not be null or empty.", nameof(identifier));
|
2020-03-20 18:12:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-09-19 18:49:12 +02:00
|
|
|
|
if (string.IsNullOrEmpty(supportedMapProjection))
|
2020-03-20 18:12:56 +01:00
|
|
|
|
{
|
2025-09-19 18:49:12 +02:00
|
|
|
|
throw new ArgumentException($"The {nameof(supportedMapProjection)} argument must not be null or empty.", nameof(supportedMapProjection));
|
2020-03-20 18:12:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-11 23:34:37 +01:00
|
|
|
|
if (tileMatrixes == null || !tileMatrixes.Any())
|
2020-03-20 18:12:56 +01:00
|
|
|
|
{
|
2025-02-28 16:25:12 +01:00
|
|
|
|
throw new ArgumentException($"The {nameof(tileMatrixes)} argument must not be null or an empty collection.", nameof(tileMatrixes));
|
2020-03-20 18:12:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Identifier = identifier;
|
2025-09-19 18:49:12 +02:00
|
|
|
|
SupportedMapProjection = supportedMapProjection;
|
2020-03-20 18:12:56 +01:00
|
|
|
|
TileMatrixes = tileMatrixes.OrderBy(m => m.Scale).ToList();
|
|
|
|
|
|
}
|
2022-12-01 23:01:06 +01:00
|
|
|
|
|
|
|
|
|
|
public string Identifier { get; }
|
2025-09-19 18:49:12 +02:00
|
|
|
|
public string SupportedMapProjection { get; }
|
2022-12-01 23:01:06 +01:00
|
|
|
|
public IList<WmtsTileMatrix> TileMatrixes { get; }
|
2020-03-20 18:12:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|