Add finishDrawing to API
This makes it posssible to programmatically finish drawing.
This commit is contained in:
@@ -286,7 +286,7 @@ ol.interaction.Draw.prototype.handlePointerUp = function(event) {
|
|||||||
this.startDrawing_(event);
|
this.startDrawing_(event);
|
||||||
} else if (this.mode_ === ol.interaction.DrawMode.POINT ||
|
} else if (this.mode_ === ol.interaction.DrawMode.POINT ||
|
||||||
this.atFinish_(event)) {
|
this.atFinish_(event)) {
|
||||||
this.finishDrawing_();
|
this.finishDrawing();
|
||||||
} else {
|
} else {
|
||||||
this.addToDrawing_(event);
|
this.addToDrawing_(event);
|
||||||
}
|
}
|
||||||
@@ -481,9 +481,9 @@ ol.interaction.Draw.prototype.addToDrawing_ = function(event) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stop drawing and add the sketch feature to the target layer.
|
* Stop drawing and add the sketch feature to the target layer.
|
||||||
* @private
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.interaction.Draw.prototype.finishDrawing_ = function() {
|
ol.interaction.Draw.prototype.finishDrawing = function() {
|
||||||
var sketchFeature = this.abortDrawing_();
|
var sketchFeature = this.abortDrawing_();
|
||||||
goog.asserts.assert(!goog.isNull(sketchFeature));
|
goog.asserts.assert(!goog.isNull(sketchFeature));
|
||||||
var coordinates;
|
var coordinates;
|
||||||
|
|||||||
Reference in New Issue
Block a user