Add feature parsing from WFS FeatureCollection

This commit is contained in:
Bart van den Eijnden
2014-02-24 11:36:00 +01:00
parent 796e7be623
commit b2885217df
4 changed files with 278 additions and 9 deletions

View File

@@ -567,6 +567,36 @@ describe('ol.format.GML', function() {
});
describe('when parsing TOPP states GML from WFS', function() {
var features, feature;
before(function(done) {
afterLoadText('spec/ol/format/gml/topp-states-wfs.xml', function(xml) {
try {
var config = {
'featureNS': 'http://www.openplans.org/topp',
'featureType': 'states'
};
features = new ol.format.GML(config).readFeatures(xml);
} catch (e) {
done(e);
}
done();
});
});
it('creates 3 features', function() {
expect(features).to.have.length(3);
});
it('creates a polygon for Illinois', function() {
feature = features[0];
expect(feature.get('STATE_NAME')).to.equal('Illinois');
expect(feature.get('the_geom')).to.be.an(ol.geom.MultiPolygon);
});
});
});