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

36 lines
1.2 KiB
C#
Raw Normal View History

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
{
public WmtsTileMatrixSet(string identifier, string supportedCrs, IEnumerable<WmtsTileMatrix> tileMatrixes)
{
if (string.IsNullOrEmpty(identifier))
{
2021-02-11 23:34:37 +01:00
throw new ArgumentException("The identifier argument must not be null or empty.", nameof(identifier));
2020-03-20 18:12:56 +01:00
}
if (string.IsNullOrEmpty(supportedCrs))
{
2021-02-11 23:34:37 +01:00
throw new ArgumentException("The supportedCrs argument must not be null or empty.", nameof(supportedCrs));
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
{
2021-02-11 23:34:37 +01:00
throw new ArgumentException("The tileMatrixes argument must not be null or an empty collection.", nameof(tileMatrixes));
2020-03-20 18:12:56 +01:00
}
Identifier = identifier;
SupportedCrs = supportedCrs;
TileMatrixes = tileMatrixes.OrderBy(m => m.Scale).ToList();
}
2022-12-01 23:01:06 +01:00
public string Identifier { get; }
public string SupportedCrs { get; }
public IList<WmtsTileMatrix> TileMatrixes { get; }
2020-03-20 18:12:56 +01:00
}
}