make OWSCommon v1 support constraints in Get and Post nodes
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user