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

40 lines
1.3 KiB
C#
Raw Normal View History

2020-03-20 18:12:56 +01:00
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
2024-02-03 21:01:53 +01:00
// Copyright © 2024 Clemens Fischer
2020-03-20 18:12:56 +01:00
// Licensed under the Microsoft Public License (Ms-PL)
using System;
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
}
}