Add feature parsing from WFS FeatureCollection
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user