From 5bba4d6a1bc14c4b3f7a8577fc0fa150c8036263 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Fri, 19 Sep 2025 20:22:10 +0200 Subject: [PATCH] SupportedCrsIds --- MapControl/Shared/MapBase.MapLayer.cs | 2 +- MapControl/Shared/MapImageLayer.cs | 6 +++--- MapControl/Shared/MapTileLayer.cs | 4 ++-- MapControl/Shared/MapTileLayerBase.cs | 2 +- MapControl/Shared/WmsImageLayer.cs | 6 +++--- MapControl/Shared/WmtsTileLayer.cs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/MapControl/Shared/MapBase.MapLayer.cs b/MapControl/Shared/MapBase.MapLayer.cs index 8922f974..c336a200 100644 --- a/MapControl/Shared/MapBase.MapLayer.cs +++ b/MapControl/Shared/MapBase.MapLayer.cs @@ -22,7 +22,7 @@ namespace MapControl { Brush MapBackground { get; } Brush MapForeground { get; } - IReadOnlyCollection SupportedMapProjections { get; } + IReadOnlyCollection SupportedCrsIds { get; } } public partial class MapBase diff --git a/MapControl/Shared/MapImageLayer.cs b/MapControl/Shared/MapImageLayer.cs index e46e3624..ec8b9b08 100644 --- a/MapControl/Shared/MapImageLayer.cs +++ b/MapControl/Shared/MapImageLayer.cs @@ -127,7 +127,7 @@ namespace MapControl /// public double LoadingProgress => (double)GetValue(LoadingProgressProperty); - public abstract IReadOnlyCollection SupportedMapProjections { get; } + public abstract IReadOnlyCollection SupportedCrsIds { get; } protected override void SetParentMap(MapBase map) { @@ -189,8 +189,8 @@ namespace MapControl if (ParentMap != null && ParentMap.ActualWidth > 0d && ParentMap.ActualHeight > 0d && - SupportedMapProjections != null && - SupportedMapProjections.Contains(ParentMap.MapProjection.CrsId)) + SupportedCrsIds != null && + SupportedCrsIds.Contains(ParentMap.MapProjection.CrsId)) { var width = ParentMap.ActualWidth * RelativeImageSize; var height = ParentMap.ActualHeight * RelativeImageSize; diff --git a/MapControl/Shared/MapTileLayer.cs b/MapControl/Shared/MapTileLayer.cs index 333eea7b..8b29e185 100644 --- a/MapControl/Shared/MapTileLayer.cs +++ b/MapControl/Shared/MapTileLayer.cs @@ -48,7 +48,7 @@ namespace MapControl Description = "© [OpenStreetMap Contributors](http://www.openstreetmap.org/copyright)" }; - public override IReadOnlyCollection SupportedMapProjections { get; } = ["EPSG:3857"]; + public override IReadOnlyCollection SupportedCrsIds { get; } = ["EPSG:3857"]; public TileMatrix TileMatrix { get; private set; } @@ -117,7 +117,7 @@ namespace MapControl protected override void UpdateTileLayerAsync(bool resetTiles) { - if (ParentMap == null || !SupportedMapProjections.Contains(ParentMap.MapProjection.CrsId)) + if (ParentMap == null || !SupportedCrsIds.Contains(ParentMap.MapProjection.CrsId)) { TileMatrix = null; Children.Clear(); diff --git a/MapControl/Shared/MapTileLayerBase.cs b/MapControl/Shared/MapTileLayerBase.cs index 12a47acb..16b67097 100644 --- a/MapControl/Shared/MapTileLayerBase.cs +++ b/MapControl/Shared/MapTileLayerBase.cs @@ -189,7 +189,7 @@ namespace MapControl } } - public abstract IReadOnlyCollection SupportedMapProjections { get; } + public abstract IReadOnlyCollection SupportedCrsIds { get; } protected bool IsBaseMapLayer => parentMap != null && parentMap.Children.Count > 0 && parentMap.Children[0] == this; diff --git a/MapControl/Shared/WmsImageLayer.cs b/MapControl/Shared/WmsImageLayer.cs index 20836ec7..cca09341 100644 --- a/MapControl/Shared/WmsImageLayer.cs +++ b/MapControl/Shared/WmsImageLayer.cs @@ -81,7 +81,7 @@ namespace MapControl /// /// Gets a collection of all CRSs supported by a WMS. /// - public override IReadOnlyCollection SupportedMapProjections => mapProjections; + public override IReadOnlyCollection SupportedCrsIds => supportedCrsIds; /// /// Loads an XElement from the URL returned by GetCapabilitiesRequestUri(). @@ -342,7 +342,7 @@ namespace MapControl return uri.Replace(" ", "%20"); } - private List mapProjections; + private List supportedCrsIds; private async void OnLoaded(object sender, RoutedEventArgs e) { @@ -357,7 +357,7 @@ namespace MapControl var ns = capabilities.Name.Namespace; var capability = capabilities.Element(ns + "Capability"); - mapProjections = capability + supportedCrsIds = capability .Element(ns + "Layer") .Descendants(ns + "CRS") .Select(e => e.Value) diff --git a/MapControl/Shared/WmtsTileLayer.cs b/MapControl/Shared/WmtsTileLayer.cs index b1c9dc51..d0eb144d 100644 --- a/MapControl/Shared/WmtsTileLayer.cs +++ b/MapControl/Shared/WmtsTileLayer.cs @@ -76,7 +76,7 @@ namespace MapControl /// /// Gets a collection of all CRSs supported by a WMTS. /// - public override IReadOnlyCollection SupportedMapProjections => TileMatrixSets.Keys; + public override IReadOnlyCollection SupportedCrsIds => TileMatrixSets.Keys; protected IEnumerable ChildLayers => Children.Cast();