rewrite WMS GetCapabilities parser, tests now pass in IE, r=ahocevar (closes #2283)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9883 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
bartvde
2009-12-13 15:43:15 +00:00
parent e6f4a27b93
commit e9264d89eb
4 changed files with 425 additions and 676 deletions

View File

@@ -33,14 +33,23 @@ OpenLayers.Format.WMSCapabilities.v1_1_0 = OpenLayers.Class(
},
/**
* Method: read_cap_SRS
* Property: readers
* Contains public functions, grouped by namespace prefix, that will
* be applied when a namespaced node is found matching the function
* name. The function will be applied in the scope of this parser
* with two arguments: the node being read and a context object passed
* from the parent.
*/
read_cap_SRS: function(layer, node) {
var srs = this.getChildValue(node);
var values = srs.split(/ +/);
for (var i=0, len=values.length; i<len; i++) {
layer.srs[values[i]] = true;
}
readers: {
"wms": OpenLayers.Util.applyDefaults({
"SRS": function(node, obj) {
var srs = this.getChildValue(node);
var values = srs.split(/ +/);
for (var i=0, len=values.length; i<len; i++) {
obj.srs[values[i]] = true;
}
}
}, OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers["wms"])
},
CLASS_NAME: "OpenLayers.Format.WMSCapabilities.v1_1_0"