mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-07 01:00:43 +01:00
Simplify SupportedCrsIds
This commit is contained in:
parent
ce7c33f6e4
commit
8b3a12fccf
|
|
@ -125,7 +125,10 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public double LoadingProgress => (double)GetValue(LoadingProgressProperty);
|
||||
|
||||
public abstract IReadOnlyCollection<string> SupportedCrsIds { get; }
|
||||
/// <summary>
|
||||
/// Gets a collection of all CRSs supported by a MapImageLayer.
|
||||
/// </summary>
|
||||
public IReadOnlyCollection<string> SupportedCrsIds { get; protected set; }
|
||||
|
||||
protected override void SetParentMap(MapBase map)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -73,13 +73,6 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public IReadOnlyCollection<string> AvailableLayers { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a collection of all CRSs supported by a WMS.
|
||||
/// </summary>
|
||||
public override IReadOnlyCollection<string> SupportedCrsIds => supportedCrsIds;
|
||||
|
||||
private List<string> supportedCrsIds;
|
||||
|
||||
private bool HasLayer =>
|
||||
RequestLayers != null ||
|
||||
AvailableLayers?.Count > 0 ||
|
||||
|
|
@ -120,19 +113,17 @@ namespace MapControl
|
|||
var ns = capabilities.Name.Namespace;
|
||||
var capability = capabilities.Element(ns + "Capability");
|
||||
|
||||
supportedCrsIds = capability
|
||||
SupportedCrsIds = capability
|
||||
.Descendants(ns + "Layer")
|
||||
.Descendants(ns + "CRS")
|
||||
.Select(e => e.Value)
|
||||
.ToList();
|
||||
|
||||
var layerNames = capability
|
||||
AvailableLayers = capability
|
||||
.Descendants(ns + "Layer")
|
||||
.Select(e => e.Element(ns + "Name")?.Value)
|
||||
.Where(n => !string.IsNullOrEmpty(n))
|
||||
.ToList();
|
||||
|
||||
AvailableLayers = layerNames;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue