@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.
@@ -251,25 +251,27 @@ class ExcavateFillAnalysisViewModel {
251
251
  // 判断是否添加了地形
252
252
  if (this._options.viewer.terrainProvider.availability) {
253
253
  if (this._options.viewer.terrainProvider && !this._options.viewer.terrainProvider._heightmapStructure) {
254
- this._drawManager.startDraw("polygon", { clampToGround: true }, (feature, { shape }) => {
255
- if (!shape.groupName || shape.groupName !== "ExcavateFillAnalysisDraw") return;
256
- that._drawManager.clearDrawGroup("ExcavateFillAnalysisDraw");
257
- if (shape) {
258
- if(typeof that._restrictedArea === 'number' && !isNaN(that._restrictedArea) && isFinite(that._restrictedArea)){
259
- const area = that._scenceView.computePolygonArea(shape._controlPoints);
260
- if((area / 1000000) > Number(that._restrictedArea)){
261
- (0,message/* default */.A)({
262
- message: this._language["restrictedAreaTips"],
263
- type: "warning"
264
- });
265
- return;
254
+ if(this._drawManager) {
255
+ this._drawManager.startDraw("polygon", { clampToGround: true }, (feature, { shape }) => {
256
+ if (!shape.groupName || shape.groupName !== "ExcavateFillAnalysisDraw") return;
257
+ that._drawManager.clearDrawGroup("ExcavateFillAnalysisDraw");
258
+ if (shape) {
259
+ if(typeof that._restrictedArea === 'number' && !isNaN(that._restrictedArea) && isFinite(that._restrictedArea)){
260
+ const area = that._scenceView.computePolygonArea(shape._controlPoints);
261
+ if((area / 1000000) > Number(that._restrictedArea)){
262
+ (0,message/* default */.A)({
263
+ message: this._language["restrictedAreaTips"],
264
+ type: "warning"
265
+ });
266
+ return;
267
+ }
266
268
  }
269
+ that._options.positions = that.coordinateTransform(shape._controlPoints);
270
+ that._excavateFillAnalysis = new Cesium.Kq3dCutFill(that._options);
271
+ that.callback && that.callback();
267
272
  }
268
- that._options.positions = that.coordinateTransform(shape._controlPoints);
269
- that._excavateFillAnalysis = new Cesium.Kq3dCutFill(that._options);
270
- that.callback && that.callback();
271
- }
272
- }, "ExcavateFillAnalysisDraw");
273
+ }, "ExcavateFillAnalysisDraw");
274
+ }
273
275
  } else {
274
276
  (0,message/* default */.A)({
275
277
  message: this._language["stkTerrainAnalysisTips"],
@@ -286,7 +288,8 @@ class ExcavateFillAnalysisViewModel {
286
288
 
287
289
  //清除全部结果
288
290
  clear() {
289
- this._drawManager.stopDraw();
291
+ this._drawManager?.clearDrawGroup("ExcavateFillAnalysisDraw");
292
+ this._drawManager?.stopDraw();
290
293
  this._excavateFillAnalysis && this._excavateFillAnalysis.removeAll();
291
294
  }
292
295