WCS parsing working properly, but needs more tests; moved errorProperty down to parser, where it arguably belongs, and where it has to live to work with WCS. Also removed null error property on versionedOGC.
This commit is contained in:
@@ -45,14 +45,6 @@ OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
*/
|
||||
allowFallback: false,
|
||||
|
||||
/**
|
||||
* APIProperty: errorProperty
|
||||
* {String} Which property of the returned object to check for in order to
|
||||
* determine whether or not parsing has failed. In the case that the
|
||||
* errorProperty is undefined on the returned object, the document will be
|
||||
* run through an OGCExceptionReport parser.
|
||||
*/
|
||||
errorProperty: null,
|
||||
|
||||
/**
|
||||
* Property: name
|
||||
@@ -193,9 +185,13 @@ OpenLayers.Format.XML.VersionedOGC = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
}
|
||||
var root = data.documentElement;
|
||||
var version = this.getVersion(root);
|
||||
this.parser = this.getParser(version);
|
||||
var obj = this.parser.read(data, options);
|
||||
if (this.errorProperty !== null && obj[this.errorProperty] === undefined) {
|
||||
this.parser = this.getParser(version); // Select the parser
|
||||
var obj = this.parser.read(data, options); // Parse the data
|
||||
|
||||
var errorProperty = this.parser.errorProperty || null;
|
||||
|
||||
|
||||
if (errorProperty !== null && obj[errorProperty] === undefined) {
|
||||
// an error must have happened, so parse it and report back
|
||||
var format = new OpenLayers.Format.OGCExceptionReport();
|
||||
obj.error = format.read(data);
|
||||
|
||||
Reference in New Issue
Block a user