Make sure that #clear() keeps the collection in sync

This commit is contained in:
Andreas Hocevar
2015-06-09 13:26:12 +02:00
parent 53d5d8c1d9
commit 57e1dda5f1
3 changed files with 27 additions and 15 deletions

View File

@@ -678,7 +678,7 @@ ol.interaction.Draw.prototype.abortDrawing_ = function() {
this.sketchFeature_ = null;
this.sketchPoint_ = null;
this.sketchLine_ = null;
this.overlay_.getSource().clear();
this.overlay_.getSource().clear(true);
}
return sketchFeature;
};
@@ -706,7 +706,7 @@ ol.interaction.Draw.prototype.updateSketchFeatures_ = function() {
sketchFeatures.push(this.sketchPoint_);
}
var overlaySource = this.overlay_.getSource();
overlaySource.clear();
overlaySource.clear(true);
overlaySource.addFeatures(sketchFeatures);
};