remove JSON parsing from format, applications should handle this, as suggested by @ahocevar
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Format/XML.js
|
* @requires OpenLayers/Format/XML.js
|
||||||
* @requires OpenLayers/Format/OGCExceptionReport.js
|
* @requires OpenLayers/Format/OGCExceptionReport.js
|
||||||
* @requires OpenLayers/Format/JSON.js
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,14 +18,6 @@
|
|||||||
OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(
|
OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(
|
||||||
OpenLayers.Format.XML, {
|
OpenLayers.Format.XML, {
|
||||||
|
|
||||||
/**
|
|
||||||
* Property: jsonFormat
|
|
||||||
* {OpenLayers.Format.JSON}
|
|
||||||
* Parser instance used to parse JSON for cross browser support. The native
|
|
||||||
* JSON.parse method will be used where available (all except IE<8).
|
|
||||||
*/
|
|
||||||
jsonFormat: null,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: regExes
|
* Property: regExes
|
||||||
* Compiled regular expressions for manipulating strings.
|
* Compiled regular expressions for manipulating strings.
|
||||||
@@ -158,10 +149,7 @@ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(
|
|||||||
this.readChildNodes(node, obj.annotation);
|
this.readChildNodes(node, obj.annotation);
|
||||||
},
|
},
|
||||||
"appinfo": function(node, obj) {
|
"appinfo": function(node, obj) {
|
||||||
if (!this.jsonFormat) {
|
obj.appinfo = this.getChildValue(node);
|
||||||
this.jsonFormat = new OpenLayers.Format.JSON();
|
|
||||||
}
|
|
||||||
obj.appinfo = this.jsonFormat.read(this.getChildValue(node));
|
|
||||||
},
|
},
|
||||||
"documentation": function(node, obj) {
|
"documentation": function(node, obj) {
|
||||||
if (!obj.documentation) {
|
if (!obj.documentation) {
|
||||||
|
|||||||
@@ -425,7 +425,7 @@
|
|||||||
var format = new OpenLayers.Format.WFSDescribeFeatureType();
|
var format = new OpenLayers.Format.WFSDescribeFeatureType();
|
||||||
var res = format.read(text);
|
var res = format.read(text);
|
||||||
var property = res.featureTypes[0].properties[0];
|
var property = res.featureTypes[0].properties[0];
|
||||||
t.eq(property.annotation.appinfo.title["en"], "Population", "appinfo read correctly");
|
t.eq(property.annotation.appinfo, '{"title":{"en":"Population"}}', "appinfo read correctly");
|
||||||
t.eq(property.annotation.documentation["en"], "Number of persons living in the state", "documentation read correctly");
|
t.eq(property.annotation.documentation["en"], "Number of persons living in the state", "documentation read correctly");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user