Merge pull request #2742 from fredj/updatefeature

Dispatch an 'updatefeature' from the vector source
This commit is contained in:
Frédéric Junod
2014-09-25 09:20:15 +02:00
2 changed files with 21 additions and 0 deletions

View File

@@ -242,6 +242,17 @@ describe('ol.source.Vector', function() {
expect(listener).to.be.called();
});
it('fires a updatefeature event when updating a feature', function() {
var feature = new ol.Feature(new ol.geom.Point([1, 1]));
vectorSource.addFeature(feature);
var listener = sinon.spy(function(event) {
expect(event.feature).to.be(feature);
});
vectorSource.on('updatefeature', listener);
feature.setStyle(null);
expect(listener).to.be.called();
});
});
describe('#getFeatureById()', function() {