diff --git a/lib/OpenLayers/Format/OWSCommon/v1.js b/lib/OpenLayers/Format/OWSCommon/v1.js index 7ee97593ce..0202dc2277 100644 --- a/lib/OpenLayers/Format/OWSCommon/v1.js +++ b/lib/OpenLayers/Format/OWSCommon/v1.js @@ -173,10 +173,22 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, { "Get": function(node, http) { http.get = this.getAttributeNS(node, this.namespaces.xlink, "href"); + if (!http.constraints) { + http.constraints = {}; + } + var obj = {}; + this.readChildNodes(node, obj); + http.constraints.get = obj.constraints; }, "Post": function(node, http) { http.post = this.getAttributeNS(node, this.namespaces.xlink, "href"); + if (!http.constraints) { + http.constraints = {}; + } + var obj = {}; + this.readChildNodes(node, obj); + http.constraints.post = obj.constraints; }, "Parameter": function(node, operation) { if (!operation.parameters) { @@ -186,6 +198,14 @@ OpenLayers.Format.OWSCommon.v1 = OpenLayers.Class(OpenLayers.Format.XML, { operation.parameters[name] = {}; this.readChildNodes(node, operation.parameters[name]); }, + "Constraint": function(node, obj) { + if (!obj.constraints) { + obj.constraints = {}; + } + var name = node.getAttribute("name"); + obj.constraints[name] = {}; + this.readChildNodes(node, obj.constraints[name]); + }, "Value": function(node, allowedValues) { allowedValues[this.getChildValue(node)] = true; }, diff --git a/tests/Format/WMTSCapabilities/v1_0_0.html b/tests/Format/WMTSCapabilities/v1_0_0.html index 9ed58b3580..ff30f51998 100644 --- a/tests/Format/WMTSCapabilities/v1_0_0.html +++ b/tests/Format/WMTSCapabilities/v1_0_0.html @@ -4,7 +4,7 @@