appinfo can be specified multiple times, so use an array instead thanks @ahocevar
This commit is contained in:
@@ -149,7 +149,10 @@ OpenLayers.Format.WFSDescribeFeatureType = OpenLayers.Class(
|
||||
this.readChildNodes(node, obj.annotation);
|
||||
},
|
||||
"appinfo": function(node, obj) {
|
||||
obj.appinfo = this.getChildValue(node);
|
||||
if (!obj.appinfo) {
|
||||
obj.appinfo = [];
|
||||
}
|
||||
obj.appinfo.push(this.getChildValue(node));
|
||||
},
|
||||
"documentation": function(node, obj) {
|
||||
if (!obj.documentation) {
|
||||
|
||||
@@ -425,7 +425,7 @@
|
||||
var format = new OpenLayers.Format.WFSDescribeFeatureType();
|
||||
var res = format.read(text);
|
||||
var property = res.featureTypes[0].properties[0];
|
||||
t.eq(property.annotation.appinfo, '{"title":{"en":"Population"}}', "appinfo read correctly");
|
||||
t.eq(property.annotation.appinfo[0], '{"title":{"en":"Population"}}', "appinfo 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