Remove the vertex on ol.interaction.Modify deactivation

This commit is contained in:
Frederic Junod
2016-10-14 11:21:40 +02:00
parent 1311f65ece
commit e853f1ed2a
2 changed files with 28 additions and 0 deletions

View File

@@ -534,4 +534,20 @@ describe('ol.interaction.Modify', function() {
});
});
describe('#setActive', function() {
it('removes the vertexFeature of deactivation', function() {
var modify = new ol.interaction.Modify({
features: new ol.Collection(features)
});
map.addInteraction(modify);
expect(modify.vertexFeature_).to.be(null);
simulateEvent('pointermove', 10, -20, false, 0);
expect(modify.vertexFeature_).to.not.be(null);
modify.setActive(false);
expect(modify.vertexFeature_).to.be(null);
});
});
});