SupportedCrs

This commit is contained in:
ClemensFischer 2025-09-19 18:57:54 +02:00
parent 39de6d664b
commit 7da0f7f9af
2 changed files with 7 additions and 7 deletions

View file

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

View file

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