WmtsTileMatrixSet.SupportedCrsId

This commit is contained in:
ClemensFischer 2025-10-30 16:33:35 +01:00
parent 8b3a12fccf
commit bec830c6ec
2 changed files with 7 additions and 7 deletions

View file

@ -201,10 +201,10 @@ namespace MapControl
var capabilities = await WmtsCapabilities.ReadCapabilitiesAsync(CapabilitiesUri, Layer);
foreach (var tileMatrixSet in capabilities.TileMatrixSets
.Where(s => !TileMatrixSets.ContainsKey(s.SupportedCrs) ||
.Where(s => !TileMatrixSets.ContainsKey(s.SupportedCrsId) ||
PreferredTileMatrixSets != null && PreferredTileMatrixSets.Contains(s.Identifier)))
{
TileMatrixSets[tileMatrixSet.SupportedCrs] = tileMatrixSet;
TileMatrixSets[tileMatrixSet.SupportedCrsId] = tileMatrixSet;
}
Layer = capabilities.Layer;

View file

@ -6,11 +6,11 @@ namespace MapControl
{
public class WmtsTileMatrixSet
{
public WmtsTileMatrixSet(string identifier, string supportedCrs, IEnumerable<WmtsTileMatrix> tileMatrixes)
public WmtsTileMatrixSet(string identifier, string supportedCrsId, IEnumerable<WmtsTileMatrix> tileMatrixes)
{
if (string.IsNullOrEmpty(supportedCrs))
if (string.IsNullOrEmpty(supportedCrsId))
{
throw new ArgumentException($"The {nameof(supportedCrs)} argument must not be null or empty.", nameof(supportedCrs));
throw new ArgumentException($"The {nameof(supportedCrsId)} argument must not be null or empty.", nameof(supportedCrsId));
}
if (tileMatrixes == null || !tileMatrixes.Any())
@ -19,12 +19,12 @@ namespace MapControl
}
Identifier = identifier;
SupportedCrs = supportedCrs;
SupportedCrsId = supportedCrsId;
TileMatrixes = tileMatrixes.OrderBy(m => m.Scale).ToList();
}
public string Identifier { get; }
public string SupportedCrs { get; }
public string SupportedCrsId { get; }
public IList<WmtsTileMatrix> TileMatrixes { get; }
}
}