@kq_npm/client3d_webgl_vue 4.5.43 → 4.5.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -285,8 +285,12 @@ class WindySlicingViewModel {
285
285
  case "mode":
286
286
  this.removeInputAction();
287
287
  this.removeVolumePrimitive();
288
+ this.clearDrawGroup();
288
289
  if (this._options.mode === "point") {
289
- this._windySlicingDrawManager.stopDraw();
290
+ this._windySlicingDrawManager.startDraw("marker", { image: null }, (feature, { shape }) => {
291
+ if (!shape.groupName || shape.groupName !== "windySlicingPointDraw") return;
292
+ this._windySlicingDrawManager.clearDrawGroup("windySlicingPointDraw");
293
+ }, "windySlicingPointDraw");
290
294
  this.drawPolylineHandler();
291
295
  } else if (this._options.mode === "line") {
292
296
  this.drawPolylineHandler(function (newPositions) {
@@ -294,7 +298,10 @@ class WindySlicingViewModel {
294
298
  that.windySlicingPolylineSlicing(newPositions);
295
299
  });
296
300
  this._isDrawPolyline = true;
297
- this._windySlicingDrawManager.startDraw("polyline", { clampToGround: true }, null, "windySlicingDraw");
301
+ this._windySlicingDrawManager.startDraw("polyline", { clampToGround: true }, (feature, { shape }) => {
302
+ if (!shape.groupName || shape.groupName !== "windySlicingLineDraw") return;
303
+ this._windySlicingDrawManager.clearDrawGroup("windySlicingLineDraw");
304
+ }, "windySlicingLineDraw");
298
305
  } else if (this._options.mode === "polygon") {
299
306
  this._windySlicingDrawManager.startDraw("rectangle", { clampToGround: true }, (feature, { shape }) => {
300
307
  if (!shape.groupName || shape.groupName !== "windySlicingDraw") return;
@@ -1106,14 +1113,20 @@ class WindySlicingViewModel {
1106
1113
  var imageDataUrl = canvas.toDataURL('image/png');
1107
1114
  return imageDataUrl;
1108
1115
  }
1109
-
1116
+ clearDrawGroup() {
1117
+ if (this._windySlicingDrawManager) {
1118
+ this._windySlicingDrawManager.stopDraw();
1119
+ this._windySlicingDrawManager.clearDrawGroup("windySlicingLineDraw");
1120
+ this._windySlicingDrawManager.clearDrawGroup("windySlicingPointDraw");
1121
+ this._windySlicingDrawManager.clearDrawGroup("windySlicingDraw");
1122
+ }
1123
+ }
1110
1124
  //清除
1111
1125
  clear() {
1126
+ this.clearDrawGroup();
1112
1127
  this.removeVolumePrimitive();
1113
1128
  this.removeInputAction();
1114
1129
  this._isDrawPolyline = false;
1115
- this._windySlicingDrawManager.stopDraw();
1116
- this._windySlicingDrawManager.clearDrawGroup("windySlicingDraw");
1117
1130
  this._currentVolumePosition = null;
1118
1131
  this._currentVolumeOption = null;
1119
1132
  this.volumelines = null;