Do not draw circle when pointer not moved
This commit is contained in:
@@ -355,6 +355,7 @@ ol.interaction.Draw.handleUpEvent_ = function(event) {
|
||||
var shouldHandle = this.freehand_ ?
|
||||
squaredDistance > this.squaredClickTolerance_ :
|
||||
squaredDistance <= this.squaredClickTolerance_;
|
||||
var circleMode = this.mode_ === ol.interaction.Draw.Mode.CIRCLE;
|
||||
if (shouldHandle) {
|
||||
this.handlePointerMove_(event);
|
||||
if (!this.finishCoordinate_) {
|
||||
@@ -362,7 +363,7 @@ ol.interaction.Draw.handleUpEvent_ = function(event) {
|
||||
if (this.mode_ === ol.interaction.Draw.Mode.POINT) {
|
||||
this.finishDrawing();
|
||||
}
|
||||
} else if (this.freehand_ || this.mode_ === ol.interaction.Draw.Mode.CIRCLE) {
|
||||
} else if (this.freehand_ || circleMode) {
|
||||
this.finishDrawing();
|
||||
} else if (this.atFinish_(event)) {
|
||||
if (this.finishCondition_(event)) {
|
||||
@@ -372,6 +373,8 @@ ol.interaction.Draw.handleUpEvent_ = function(event) {
|
||||
this.addToDrawing_(event);
|
||||
}
|
||||
pass = false;
|
||||
} else if (circleMode) {
|
||||
this.finishCoordinate_ = null;
|
||||
}
|
||||
return pass;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user