From 28b8ef059bb0940434c63529163f356970ceeff0 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Thu, 13 Feb 2025 11:02:29 +0100 Subject: [PATCH] Update WmtsCapabilities.cs --- MapControl/Shared/WmtsCapabilities.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MapControl/Shared/WmtsCapabilities.cs b/MapControl/Shared/WmtsCapabilities.cs index 22f3c0d4..7f327897 100644 --- a/MapControl/Shared/WmtsCapabilities.cs +++ b/MapControl/Shared/WmtsCapabilities.cs @@ -220,11 +220,13 @@ namespace MapControl throw new ArgumentException($"No SupportedCRS element found in TileMatrixSet \"{identifier}\"."); } - const string urnPrefix = "urn:ogc:def:crs:EPSG:"; + const string urnPrefix = "urn:ogc:def:crs:"; if (supportedCrs.StartsWith(urnPrefix)) // e.g. "urn:ogc:def:crs:EPSG:6.18:3857") { - supportedCrs = "EPSG:" + supportedCrs.Substring(urnPrefix.Length).Split(':').Last(); + var crsComponents = supportedCrs.Substring(urnPrefix.Length).Split(':'); + + supportedCrs = crsComponents.First() + ":" + crsComponents.Last(); } var tileMatrixes = new List();