Support multiple featureTypes with a different featureNS

This commit is contained in:
Bart van den Eijnden
2015-03-04 15:02:04 +01:00
parent b05ead4056
commit b698fe9968
5 changed files with 152 additions and 17 deletions
+48
View File
@@ -1150,6 +1150,54 @@ describe('ol.format.GML3', function() {
});
describe('when parsing multiple feature types / namespaces', function() {
var features;
before(function(done) {
var url = 'spec/ol/format/gml/multiple-typenames-ns.xml';
afterLoadText(url, function(xml) {
try {
features = new ol.format.GML({
featureNS: {
'topp': 'http://www.openplans.org/topp',
'sf': 'http://www.openplans.org/spearfish'
},
featureType: ['topp:states', 'sf:roads']
}).readFeatures(xml);
} catch (e) {
done(e);
}
done();
});
});
it('reads all features', function() {
expect(features.length).to.be(2);
});
});
describe('when parsing multiple feature types / namespaces', function() {
var features;
before(function(done) {
var url = 'spec/ol/format/gml/multiple-typenames-ns.xml';
afterLoadText(url, function(xml) {
try {
features = new ol.format.GML().readFeatures(xml);
} catch (e) {
done(e);
}
done();
});
});
it('reads all features with autoconfigure', function() {
expect(features.length).to.be(2);
});
});
});