Do not draw sketch line for circles
This commit is contained in:
@@ -57,6 +57,12 @@ const Draw = function(options) {
|
|||||||
*/
|
*/
|
||||||
this.downPx_ = null;
|
this.downPx_ = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
this.downTimeout_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
@@ -333,7 +339,7 @@ Draw.handleEvent = function(event) {
|
|||||||
this.freehand_ = this.mode_ !== Draw.Mode_.POINT && this.freehandCondition_(event);
|
this.freehand_ = this.mode_ !== Draw.Mode_.POINT && this.freehandCondition_(event);
|
||||||
let move = event.type === MapBrowserEventType.POINTERMOVE;
|
let move = event.type === MapBrowserEventType.POINTERMOVE;
|
||||||
let pass = true;
|
let pass = true;
|
||||||
if (!this.freehand_ && this.lastDragTime_ && event.type === MapBrowserEventType.POINTERDRAG) {
|
if (this.lastDragTime_ && event.type === MapBrowserEventType.POINTERDRAG) {
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
if (now - this.lastDragTime_ >= 500) {
|
if (now - this.lastDragTime_ >= 500) {
|
||||||
this.downPx_ = event.pixel;
|
this.downPx_ = event.pixel;
|
||||||
@@ -547,9 +553,6 @@ Draw.prototype.startDrawing_ = function(event) {
|
|||||||
this.sketchLineCoords_ = this.sketchCoords_[0];
|
this.sketchLineCoords_ = this.sketchCoords_[0];
|
||||||
} else {
|
} else {
|
||||||
this.sketchCoords_ = [start.slice(), start.slice()];
|
this.sketchCoords_ = [start.slice(), start.slice()];
|
||||||
if (this.mode_ === Draw.Mode_.CIRCLE) {
|
|
||||||
this.sketchLineCoords_ = this.sketchCoords_;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (this.sketchLineCoords_) {
|
if (this.sketchLineCoords_) {
|
||||||
this.sketchLine_ = new Feature(
|
this.sketchLine_ = new Feature(
|
||||||
|
|||||||
Reference in New Issue
Block a user