Merge pull request #12917 from mike-000/removeFeature-2

Make removeFeature consistent with other remove methods
This commit is contained in:
Tim Schaub
2021-10-27 14:20:10 -06:00
committed by GitHub
2 changed files with 32 additions and 4 deletions

View File

@@ -339,6 +339,19 @@ describe('ol.source.Vector', function () {
vectorSource.removeFeature(features[0]);
expect(listener.called).to.be(true);
});
it('accepts features that are not in the source', function () {
const changeListener = sinon.spy();
listen(vectorSource, 'change', changeListener);
const removeFeatureListener = sinon.spy();
listen(vectorSource, 'removefeature', removeFeatureListener);
const feature = new Feature(new Point([0, 0]));
vectorSource.removeFeature(feature);
expect(changeListener.called).to.be(false);
expect(removeFeatureListener.called).to.be(false);
});
});
describe("modifying a feature's geometry", function () {