WCS 1.1.0 parsing correctlyy; error property still not correctly set so parsing reports errors.
This commit is contained in:
@@ -18,21 +18,19 @@
|
||||
OpenLayers.Format.WCSCapabilities.v1_1_0 = OpenLayers.Class(
|
||||
OpenLayers.Format.WCSCapabilities.v1, {
|
||||
|
||||
|
||||
/**
|
||||
* Property: regExes
|
||||
* Compiled regular expressions for manipulating strings.
|
||||
* Property: namespaces
|
||||
* {Object} Mapping of namespace aliases to namespace URIs.
|
||||
*/
|
||||
regExes: {
|
||||
trimSpace: (/^\s*|\s*$/g),
|
||||
removeSpace: (/\s*/g),
|
||||
splitSpace: (/\s+/),
|
||||
trimComma: (/\s*,\s*/g)
|
||||
namespaces: {
|
||||
wcs: "http://www.opengis.net/wcs/1.1",
|
||||
xlink: "http://www.w3.org/1999/xlink",
|
||||
xsi: "http://www.w3.org/2001/XMLSchema-instance",
|
||||
ows: "http://www.opengis.net/ows/1.1"
|
||||
},
|
||||
|
||||
|
||||
errorProperty: "Contents", // <== Not sure if this is strictly required by standard... maybe better to set to NULL?
|
||||
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Format.WCSCapabilities.v1_1_0
|
||||
* Create a new parser for WCS capabilities version 1.1.0.
|
||||
@@ -52,44 +50,56 @@ OpenLayers.Format.WCSCapabilities.v1_1_0 = OpenLayers.Class(
|
||||
*/
|
||||
readers: {
|
||||
"wcs": OpenLayers.Util.applyDefaults({
|
||||
|
||||
"Capabilities": function(node, obj) { // In 1.0.0, this was WCS_Capabilties, in 1.1.0, it's just Capabilities
|
||||
this.readChildNodes(node, obj);
|
||||
},
|
||||
|
||||
"Contents": function(node, request) {
|
||||
request.featureTypeList = {
|
||||
contents: []
|
||||
};
|
||||
this.readChildNodes(node, request.contents);
|
||||
var contents = [];
|
||||
this.readChildNodes(node, contents);
|
||||
|
||||
request.contents = contents;
|
||||
},
|
||||
|
||||
"CoverageSummary": function(node, request) {
|
||||
request.featureTypeList = {
|
||||
coverageSummary: []
|
||||
};
|
||||
this.readChildNodes(node, request.coverageSummary);
|
||||
"CoverageSummary": function(node, contents) {
|
||||
contents.coverageSummary = {};
|
||||
this.readChildNodes(node, contents.coverageSummary);
|
||||
},
|
||||
|
||||
"Identifier": function(node, obj) {
|
||||
obj.identifier = this.getChildValue(node);
|
||||
"Identifier": function(node, coverageSummary) {
|
||||
coverageSummary.identifier = this.getChildValue(node);
|
||||
},
|
||||
|
||||
"SupportedCRS": function(node, obj) {
|
||||
"Title": function(node, coverageSummary) {
|
||||
coverageSummary.title = this.getChildValue(node);
|
||||
},
|
||||
|
||||
"Abstract": function(node, coverageSummary) {
|
||||
coverageSummary.abstract = this.getChildValue(node);
|
||||
},
|
||||
|
||||
"SupportedCRS": function(node, coverageSummary) {
|
||||
var crs = this.getChildValue(node);
|
||||
if(crs) {
|
||||
if(!obj["supportedCRS"]) {
|
||||
obj["supportedCRS"] = [];
|
||||
if(!coverageSummary["supportedCRS"]) {
|
||||
coverageSummary["supportedCRS"] = [];
|
||||
}
|
||||
obj["supportedCRS"].push(crs);
|
||||
coverageSummary["supportedCRS"].push(crs);
|
||||
}
|
||||
},
|
||||
|
||||
"DefaultSRS": function(node, obj) {
|
||||
var defaultSRS = this.getChildValue(node);
|
||||
if (defaultSRS) {
|
||||
obj.srs = defaultSRS;
|
||||
"SupportedFormat": function(node, coverageSummary) {
|
||||
var format = this.getChildValue(node);
|
||||
if(format) {
|
||||
if(!coverageSummary["supportedFormat"]) {
|
||||
coverageSummary["supportedFormat"] = [];
|
||||
}
|
||||
coverageSummary["supportedFormat"].push(format);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}, OpenLayers.Format.WCSCapabilities.v1.prototype.readers["wcs"]),
|
||||
"ows": OpenLayers.Format.OWSCommon.v1.prototype.readers["ows"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user