diff --git a/test/spec/ol/format/wmts/capabilities_wgs84.xml b/test/spec/ol/format/wmts/capabilities_wgs84.xml
index 67bbc0cfc9..ff9fdbf968 100644
--- a/test/spec/ol/format/wmts/capabilities_wgs84.xml
+++ b/test/spec/ol/format/wmts/capabilities_wgs84.xml
@@ -39,124 +39,10 @@
image/png
- inspire_quad
+ inspire_quad
-
- Mean depth full coverage with land coverage
-
- mean_atlas_land
-
- -36.0 15.0
- 43.0 90.0
-
-
- 14.999942759061003 -36.0
- 90.0 42.999938986416
-
-
- image/png
-
- inspire_quad
-
-
- 0
- 0
- 0
- 0
- 1
-
-
- 1
- 0
- 0
- 1
- 2
-
-
- 2
- 0
- 1
- 3
- 4
-
-
- 3
- 0
- 3
- 6
- 9
-
-
- 4
- 0
- 6
- 12
- 19
-
-
- 5
- 0
- 13
- 25
- 39
-
-
- 6
- 0
- 26
- 51
- 79
-
-
- 7
- 0
- 53
- 102
- 158
-
-
- 8
- 0
- 106
- 204
- 317
-
-
- 9
- 0
- 213
- 409
- 634
-
-
- 10
- 0
- 426
- 819
- 1268
-
-
- 11
- 0
- 853
- 1638
- 2537
-
-
- 12
- 0
- 1706
- 3276
- 5074
-
-
-
-
-
InspireCRS84Quad
inspire_quad
diff --git a/test/spec/ol/format/wmts/capabilities_with_tilematrixsetlink.xml b/test/spec/ol/format/wmts/capabilities_with_tilematrixsetlink.xml
new file mode 100644
index 0000000000..67bbc0cfc9
--- /dev/null
+++ b/test/spec/ol/format/wmts/capabilities_with_tilematrixsetlink.xml
@@ -0,0 +1,284 @@
+
+
+
+ Sample WMTS
+ OGC WMTS
+ 1.0.0
+ None
+ none
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Baselayer
+ Baselayer
+ baselayer
+
+ -180.0 -90.0
+ 180.0 90.0
+
+
+ -90.0 -180.0
+ 90.0 180.0
+
+
+ image/png
+
+ inspire_quad
+
+
+
+
+ Mean depth full coverage with land coverage
+
+ mean_atlas_land
+
+ -36.0 15.0
+ 43.0 90.0
+
+
+ 14.999942759061003 -36.0
+ 90.0 42.999938986416
+
+
+ image/png
+
+ inspire_quad
+
+
+ 0
+ 0
+ 0
+ 0
+ 1
+
+
+ 1
+ 0
+ 0
+ 1
+ 2
+
+
+ 2
+ 0
+ 1
+ 3
+ 4
+
+
+ 3
+ 0
+ 3
+ 6
+ 9
+
+
+ 4
+ 0
+ 6
+ 12
+ 19
+
+
+ 5
+ 0
+ 13
+ 25
+ 39
+
+
+ 6
+ 0
+ 26
+ 51
+ 79
+
+
+ 7
+ 0
+ 53
+ 102
+ 158
+
+
+ 8
+ 0
+ 106
+ 204
+ 317
+
+
+ 9
+ 0
+ 213
+ 409
+ 634
+
+
+ 10
+ 0
+ 426
+ 819
+ 1268
+
+
+ 11
+ 0
+ 853
+ 1638
+ 2537
+
+
+ 12
+ 0
+ 1706
+ 3276
+ 5074
+
+
+
+
+
+
+ InspireCRS84Quad
+ inspire_quad
+ urn:ogc:def:crs:EPSG::4326
+
+ 0
+ 279541132.014357
+ 90.0 -180.0
+ 256
+ 256
+ 2
+ 1
+
+
+ 1
+ 1.3977056600717938E8
+ 90.0 -180.0
+ 256
+ 256
+ 4
+ 2
+
+
+ 2
+ 6.988528300358969E7
+ 90.0 -180.0
+ 256
+ 256
+ 8
+ 4
+
+
+ 3
+ 3.4942641501794845E7
+ 90.0 -180.0
+ 256
+ 256
+ 16
+ 8
+
+
+ 4
+ 1.7471320750897422E7
+ 90.0 -180.0
+ 256
+ 256
+ 32
+ 16
+
+
+ 5
+ 8735660.375448711
+ 90.0 -180.0
+ 256
+ 256
+ 64
+ 32
+
+
+ 6
+ 4367830.187724356
+ 90.0 -180.0
+ 256
+ 256
+ 128
+ 64
+
+
+ 7
+ 2183915.093862178
+ 90.0 -180.0
+ 256
+ 256
+ 256
+ 128
+
+
+ 8
+ 1091957.546931089
+ 90.0 -180.0
+ 256
+ 256
+ 512
+ 256
+
+
+ 9
+ 545978.7734655445
+ 90.0 -180.0
+ 256
+ 256
+ 1024
+ 512
+
+
+ 10
+ 272989.3867327722
+ 90.0 -180.0
+ 256
+ 256
+ 2048
+ 1024
+
+
+ 11
+ 136494.6933663861
+ 90.0 -180.0
+ 256
+ 256
+ 4096
+ 2048
+
+
+ 12
+ 68247.34668319306
+ 90.0 -180.0
+ 256
+ 256
+ 8192
+ 4096
+
+
+
+
+
diff --git a/test/spec/ol/source/wmts.test.js b/test/spec/ol/source/wmts.test.js
index fae0de95e8..d6e47a405d 100644
--- a/test/spec/ol/source/wmts.test.js
+++ b/test/spec/ol/source/wmts.test.js
@@ -404,8 +404,26 @@ describe('ol.source.WMTS', function () {
expectDelta(extent[2], 180);
expectDelta(extent[3], 90);
});
+ });
- it('returns correct bounding box for a layer restricted by TileMatrixSetLink', function () {
+ describe('when creating options from capabilities with TileMatrixSetLink', function () {
+ const parser = new WMTSCapabilities();
+ let capabilities;
+ before(function (done) {
+ afterLoadText(
+ 'spec/ol/format/wmts/capabilities_with_tilematrixsetlink.xml',
+ function (xml) {
+ try {
+ capabilities = parser.read(xml);
+ } catch (e) {
+ done(e);
+ }
+ done();
+ }
+ );
+ });
+
+ it('returns correct bounding box for a layer', function () {
const options = optionsFromCapabilities(capabilities, {
layer: 'mean_atlas_land',
matrixSet: 'inspire_quad',