mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-02-14 11:44:14 +01:00
SupportedCrs
This commit is contained in:
parent
39de6d664b
commit
7da0f7f9af
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue