diff --git a/examples/data/WMTSCapabilities.xml b/examples/data/WMTSCapabilities.xml
new file mode 100644
index 0000000000..11701a5f6f
--- /dev/null
+++ b/examples/data/WMTSCapabilities.xml
@@ -0,0 +1,508 @@
+
+
+
+ Web Map Tile Service
+ OGC WMTS
+ 1.0.0
+ none
+ http://data.wien.gv.at/nutzungsbedingungen
+
+
+ Magistrat Wien
+
+
+ Gerhard Sommer
+
+
+
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+ RESTful
+
+
+
+
+
+
+
+
+
+ Luftbild
+
+ 16.17 48.10
+ 16.58 48.33
+
+ lb
+
+ image/jpeg
+
+ google3857
+
+
+
+
+
+
+
+
+ MZK Flächen
+
+ 16.17 48.10
+ 16.58 48.33
+
+ fmzk
+
+ image/jpeg
+
+ google3857
+
+
+
+
+
+
+
+
+ Flächenwidmungs- und Bebauungsplan
+
+ 16.17 48.10
+ 16.58 48.33
+
+ flwbplmzk
+
+ image/jpeg
+
+ google3857
+
+
+
+
+
+
+
+
+ Beschriftung
+
+ 16.17 48.10
+ 16.58 48.33
+
+ beschriftung
+
+ image/png
+
+ google3857
+
+
+
+
+
+
+
+
+ viennagis31256
+
+ -11500 330500
+ 18500 354000
+
+ urn:ogc:def:crs:EPSG::31256
+
+ 0
+ 500000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 2
+ 1
+
+
+ 1
+ 250000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 3
+ 2
+
+
+ 2
+ 125000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 5
+ 3
+
+
+ 3
+ 64000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 9
+ 6
+
+
+ 4
+ 32000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 17
+ 12
+
+
+ 5
+ 16000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 33
+ 24
+
+
+ 6
+ 8000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 66
+ 47
+
+
+ 7
+ 5000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 105
+ 74
+
+
+ 8
+ 4000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 132
+ 93
+
+
+ 9
+ 3000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 175
+ 124
+
+
+ 10
+ 2000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 263
+ 185
+
+
+ 11
+ 1500.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 350
+ 247
+
+
+ 12
+ 1000.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 525
+ 370
+
+
+ 13
+ 500.0
+ 355000.0 -13500.0
+ 256
+ 256
+ 1049
+ 739
+
+
+
+
+ google3857
+
+ 1799448.394855 6124949.747770
+ 1848250.442089 6162571.828177
+
+ urn:ogc:def:crs:EPSG:6.18:3:3857
+ urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible
+
+ 0
+ 559082264.029
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 1
+ 1
+
+
+ 1
+ 279541132.015
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 2
+ 2
+
+
+ 2
+ 139770566.007
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 4
+ 4
+
+
+ 3
+ 69885283.0036
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 8
+ 8
+
+
+ 4
+ 34942641.5018
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 16
+ 16
+
+
+ 5
+ 17471320.7509
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 32
+ 32
+
+
+ 6
+ 8735660.37545
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 64
+ 64
+
+
+ 7
+ 4367830.18773
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 128
+ 128
+
+
+ 8
+ 2183915.09386
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 256
+ 256
+
+
+ 9
+ 1091957.54693
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 512
+ 512
+
+
+ 10
+ 545978.773466
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 1024
+ 1024
+
+
+ 11
+ 272989.386733
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 2048
+ 2048
+
+
+ 12
+ 136494.693366
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 4096
+ 4096
+
+
+ 13
+ 68247.3466832
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 8192
+ 8192
+
+
+ 14
+ 34123.6733416
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 16384
+ 16384
+
+
+ 15
+ 17061.8366708
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 32768
+ 32768
+
+
+ 16
+ 8530.91833540
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 65536
+ 65536
+
+
+ 17
+ 4265.45916770
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 131072
+ 131072
+
+
+ 18
+ 2132.72958385
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 262144
+ 262144
+
+
+ 19
+ 1066.36479193
+ -20037508.3428 20037508.3428
+ 256
+ 256
+ 524288
+ 524288
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/wmts-capabilities.html b/examples/wmts-capabilities.html
new file mode 100644
index 0000000000..64602befe6
--- /dev/null
+++ b/examples/wmts-capabilities.html
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+ WMTS Capabilities parsing example
+
+
+
+
+
+
+
+
+
+
+
WMTS Capabilities parsing example
+
Example of parsing a WMTS Capabilities document.
+
+
wmts, WMTSCapabilities
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/wmts-capabilities.js b/examples/wmts-capabilities.js
new file mode 100644
index 0000000000..5b5bf4c954
--- /dev/null
+++ b/examples/wmts-capabilities.js
@@ -0,0 +1,26 @@
+goog.require('ol.parser.ogc.WMTSCapabilities');
+goog.require('ol.projection.addCommonProjections');
+
+ol.projection.addCommonProjections();
+Proj4js.defs['EPSG:31256'] = '+proj=tmerc +lat_0=0 ' +
+ '+lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel ' +
+ '+towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 ' +
+ '+units=m +no_defs';
+var parser = new ol.parser.ogc.WMTSCapabilities(), result;
+var url = 'data/WMTSCapabilities.xml';
+
+var xhr = new XMLHttpRequest();
+xhr.open('GET', url, true);
+
+
+/**
+ * onload handler for the XHR request.
+ */
+xhr.onload = function() {
+ if (xhr.status == 200) {
+ result = parser.read(xhr.responseXML);
+ document.getElementById('log').innerHTML =
+ window.JSON.stringify(result, undefined, 2);
+ }
+};
+xhr.send();
diff --git a/src/ol/parser/ogc/owscommon_v1.js b/src/ol/parser/ogc/owscommon_v1.js
index ae01b4ec93..97a800b48d 100644
--- a/src/ol/parser/ogc/owscommon_v1.js
+++ b/src/ol/parser/ogc/owscommon_v1.js
@@ -178,7 +178,7 @@ ol.parser.ogc.OWSCommon_v1 = function() {
// LowerCorner = "min_x min_y"
// UpperCorner = "max_x max_y"
// It should normally depend on the projection
- var readers = this.readers['http://www.opengis.net/ows'];
+ var readers = this.readers[node.namespaceURI];
readers['WGS84BoundingBox'].apply(this, [node, obj]);
},
'LowerCorner': function(node, obj) {
diff --git a/src/ol/projection/epsg3857.js b/src/ol/projection/epsg3857.js
index 1e3c709f39..e1e41e6a2c 100644
--- a/src/ol/projection/epsg3857.js
+++ b/src/ol/projection/epsg3857.js
@@ -57,7 +57,8 @@ ol.projection.EPSG3857.CODES = [
'EPSG:3857',
'EPSG:102100',
'EPSG:102113',
- 'EPSG:900913'
+ 'EPSG:900913',
+ 'urn:ogc:def:crs:EPSG:6.18:3:3857'
];
diff --git a/src/ol/projection/epsg4326.js b/src/ol/projection/epsg4326.js
index bfc3dd37ec..e0ea8eba83 100644
--- a/src/ol/projection/epsg4326.js
+++ b/src/ol/projection/epsg4326.js
@@ -44,7 +44,8 @@ ol.projection.EPSG4326.PROJECTIONS = [
new ol.projection.EPSG4326('CRS:84'),
new ol.projection.EPSG4326('EPSG:4326', 'neu'),
new ol.projection.EPSG4326('urn:ogc:def:crs:EPSG:6.6:4326', 'neu'),
- new ol.projection.EPSG4326('urn:ogc:def:crs:OGC:1.3:CRS84')
+ new ol.projection.EPSG4326('urn:ogc:def:crs:OGC:1.3:CRS84'),
+ new ol.projection.EPSG4326('urn:ogc:def:crs:OGC:2:84')
];
diff --git a/src/ol/projection/projection.exports b/src/ol/projection/projection.exports
index 7d2e1680bd..107b1acb84 100644
--- a/src/ol/projection/projection.exports
+++ b/src/ol/projection/projection.exports
@@ -13,6 +13,7 @@
@exportProperty ol.ProjectionUnits.METERS
@exportSymbol ol.projection.addProjection
+@exportSymbol ol.projection.addCommonProjections
@exportSymbol ol.projection.get
@exportSymbol ol.projection.getTransform
@exportSymbol ol.projection.getTransformFromProjections
diff --git a/src/ol/projection/projection.js b/src/ol/projection/projection.js
index 2a33d8cd4c..f2f88e06d3 100644
--- a/src/ol/projection/projection.js
+++ b/src/ol/projection/projection.js
@@ -336,7 +336,6 @@ ol.projection.addProj4jsProjection_ = function(proj4jsProjection) {
ol.projection.addProjection = function(projection) {
var projections = ol.projection.projections_;
var code = projection.getCode();
- goog.asserts.assert(!goog.object.containsKey(projections, code));
projections[code] = projection;
ol.projection.addTransform(
projection, projection, ol.projection.cloneTransform);
@@ -397,8 +396,6 @@ ol.projection.addTransform = function(source, destination, transformFn) {
if (!goog.object.containsKey(transforms, sourceCode)) {
transforms[sourceCode] = {};
}
- goog.asserts.assert(
- !goog.object.containsKey(transforms[sourceCode], destinationCode));
transforms[sourceCode][destinationCode] = transformFn;
};