diff --git a/lib/OpenLayers/Format/WMTSCapabilities.js b/lib/OpenLayers/Format/WMTSCapabilities.js index 3ad1f72ba8..157042cb55 100644 --- a/lib/OpenLayers/Format/WMTSCapabilities.js +++ b/lib/OpenLayers/Format/WMTSCapabilities.js @@ -153,7 +153,7 @@ OpenLayers.Format.WMTSCapabilities = OpenLayers.Class(OpenLayers.Format.XML.Vers } var projection = config.projection || matrixSet.supportedCRS.replace( - /urn:ogc:def:crs:(\w+):.+:(\w+)$/, "$1:$2"); + /urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/, "$1:$3"); var units = config.units || projection === "EPSG:4326" ? "degrees" : "m" diff --git a/tests/Format/WMTSCapabilities/v1_0_0.html b/tests/Format/WMTSCapabilities/v1_0_0.html index 99dbcda238..81686b1fff 100644 --- a/tests/Format/WMTSCapabilities/v1_0_0.html +++ b/tests/Format/WMTSCapabilities/v1_0_0.html @@ -495,7 +495,7 @@ http://schemas.opengis.net/wmts/1.0/examples/wmtsGetCapabilities_response.xml 21781 - urn:ogc:def:crs:EPSG:21781 + urn:ogc:def:crs:EPSG::21781 0 14285750.5715