New function createOrUpdateCustomSketchLine_

This commit is contained in:
mike-000
2020-11-25 12:06:34 +00:00
committed by GitHub
parent 8898d540fa
commit 919c711756
+2 -6
View File
@@ -841,9 +841,7 @@ class Draw extends PointerInteraction {
geometry.getType() === GeometryType.POLYGON && geometry.getType() === GeometryType.POLYGON &&
this.mode_ !== Mode.POLYGON this.mode_ !== Mode.POLYGON
) { ) {
this.createOrUpdateCustomSketchLine_( this.createOrUpdateCustomSketchLine_(/** @type {Polygon} */ (geometry));
/** @type {Polygon} */ (geometry)
);
} else if (this.sketchLineCoords_) { } else if (this.sketchLineCoords_) {
const sketchLineGeom = this.sketchLine_.getGeometry(); const sketchLineGeom = this.sketchLine_.getGeometry();
sketchLineGeom.setCoordinates(this.sketchLineCoords_); sketchLineGeom.setCoordinates(this.sketchLineCoords_);
@@ -919,9 +917,7 @@ class Draw extends PointerInteraction {
} }
this.geometryFunction_(coordinates, geometry, projection); this.geometryFunction_(coordinates, geometry, projection);
if (geometry.getType() === GeometryType.POLYGON && this.sketchLine_) { if (geometry.getType() === GeometryType.POLYGON && this.sketchLine_) {
this.createOrUpdateCustomSketchLine_( this.createOrUpdateCustomSketchLine_(/** @type {Polygon} */ (geometry));
/** @type {Polygon} */ (geometry)
);
} }
} else if (this.mode_ === Mode.POLYGON) { } else if (this.mode_ === Mode.POLYGON) {
coordinates = /** @type {PolyCoordType} */ (this.sketchCoords_)[0]; coordinates = /** @type {PolyCoordType} */ (this.sketchCoords_)[0];