@kq_npm/client3d_webgl_vue 3.3.3-beta → 3.3.5-beta

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.
package/index.js CHANGED
@@ -754,7 +754,7 @@ class DrawManager {
754
754
  } //开始绘制
755
755
 
756
756
 
757
- startDraw(type, options, callback) {
757
+ startDraw(type, options, callback, groupName) {
758
758
  this._viewer.scene.globe.depthTestAgainstTerrain = true;
759
759
 
760
760
  if (type === "point") {
@@ -782,6 +782,7 @@ class DrawManager {
782
782
  if (callback) {
783
783
  var that = this;
784
784
  var removeEventListener = this.drawFinishedEvent.addEventListener(shape => {
785
+ if (groupName) shape.groupName = groupName;
785
786
  that._viewer.scene.globe.depthTestAgainstTerrain = false;
786
787
  var feature = that.shapeToGeoFeature(shape);
787
788
  callback(feature.geometry);
@@ -808,6 +809,19 @@ class DrawManager {
808
809
  } else {
809
810
  this._drawHandler.editHandler.deactivate();
810
811
  }
812
+ } //清除绘图分组
813
+
814
+
815
+ clearDrawGroup(groupName) {
816
+ let primitives = this._drawLayer._primitives;
817
+
818
+ if (primitives && primitives.length > 0) {
819
+ for (let i = primitives.length - 1; i >= 0; i--) {
820
+ if (primitives[i].groupName === groupName) {
821
+ this._drawLayer.removeById(primitives[i].guid);
822
+ }
823
+ }
824
+ }
811
825
  } //清除全部手动绘图
812
826
 
813
827
 
@@ -9035,6 +9049,8 @@ class ModelSelectViewModel {
9035
9049
  //拾取状态
9036
9050
  //高亮三维对象
9037
9051
  //高亮颜色
9052
+ // 模型属性唯一值字段集合
9053
+ // 模型属性匹配字段
9038
9054
  constructor(scenceView, pickCallFunc) {
9039
9055
  _defineProperty(this, "_viewer", null);
9040
9056
 
@@ -9046,6 +9062,10 @@ class ModelSelectViewModel {
9046
9062
 
9047
9063
  _defineProperty(this, "_highlightColor", "#FF0000");
9048
9064
 
9065
+ _defineProperty(this, "_modeFiledArray", null);
9066
+
9067
+ _defineProperty(this, "_modeFiled", "id");
9068
+
9049
9069
  this._viewer = scenceView._viewer;
9050
9070
  this._drawManager = scenceView._drawManager;
9051
9071
  this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
@@ -9053,42 +9073,44 @@ class ModelSelectViewModel {
9053
9073
 
9054
9074
  this._handler.setInputAction(function (movement) {
9055
9075
  if (that._isPick) {
9056
- that.clearHighlight();
9057
-
9058
- let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
9076
+ let pickedObject = that._viewer.scene.pick(movement.position);
9059
9077
 
9078
+ console.log(pickedObject);
9060
9079
 
9061
9080
  if (pickedObject) {
9062
9081
  if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
9063
- let properties = pickedObject.getPropertyNames() || []; // console.log(properties);
9082
+ let properties = pickedObject.getPropertyNames() || [];
9083
+ console.log(properties);
9084
+
9085
+ if (that._modeFiledArray && that._modeFiledArray.length && that._modeFiledArray.length > 0) {
9086
+ for (let val in that._modeFiledArray) {
9087
+ if (properties.indexOf(val) > -1) {
9088
+ that._modeFiled = val;
9089
+ break;
9090
+ }
9091
+ }
9092
+ }
9064
9093
 
9065
- that._highlight = {
9066
- object: pickedObject.pickId.object,
9067
- color: pickedObject.pickId.object.color
9068
- };
9069
- pickedObject.pickId.object.color = Cesium.Color.fromCssColorString(that._highlightColor);
9070
- let attrs = {};
9071
- properties.forEach(prop => {
9072
- attrs[prop] = pickedObject.getProperty(prop);
9073
- });
9074
- pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs); // if (properties.indexOf(that._modeFiled) > -1) {
9075
- // let id = pickedObject.getProperty(that._modeFiled);
9076
- // // that.clear();
9077
- // that._highlight = new Cesium.Kq3dHighlight({
9078
- // viewer: that._viewer,
9079
- // tileset: pickedObject.tileset,
9080
- // attrName: that._modeFiled,
9081
- // attrValue: [id],
9082
- // color: [Cesium.Color.RED]
9083
- // });
9084
- // let attrs = {};
9085
- // properties.forEach(prop => {
9086
- // attrs[prop] = pickedObject.getProperty(prop);
9087
- // });
9088
- // pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
9089
- // } else {
9090
- // console.log("Feature has no id attribute!");
9091
- // }
9094
+ if (properties.indexOf(that._modeFiled) > -1) {
9095
+ let id = pickedObject.getProperty(that._modeFiled); // that.clear();
9096
+
9097
+ that._highlight = new Cesium.Kq3dHighlight({
9098
+ viewer: that._viewer,
9099
+ tileset: pickedObject.tileset,
9100
+ attrName: that._modeFiled,
9101
+ attrValue: [id],
9102
+ color: [Cesium.Color.fromCssColorString(that._highlightColor)]
9103
+ });
9104
+ let attrs = {};
9105
+ properties.forEach(prop => {
9106
+ attrs[prop] = pickedObject.getProperty(prop);
9107
+ });
9108
+ pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
9109
+ } else {
9110
+ console.log("Feature has no id attribute!");
9111
+ }
9112
+ } else {
9113
+ console.log("no Cesium3DTileFeature!");
9092
9114
  }
9093
9115
  }
9094
9116
  }
@@ -9120,21 +9142,12 @@ class ModelSelectViewModel {
9120
9142
  type: "warning"
9121
9143
  });
9122
9144
  }
9123
- }
9124
-
9125
- clearHighlight() {
9126
- if (this._highlight) {
9127
- this._highlight.object.color = this._highlight.color;
9128
- }
9129
-
9130
- this._highlight = null;
9131
9145
  } //清除
9132
9146
 
9133
9147
 
9134
9148
  clear() {
9135
- this.clearHighlight(); // this._highlight && this._highlight.remove();
9136
- // this._highlight = null;
9137
-
9149
+ this._highlight && this._highlight.remove();
9150
+ this._highlight = null;
9138
9151
  this.setCursor("default");
9139
9152
  this._isPick = false;
9140
9153
  } //销毁
@@ -9181,6 +9194,13 @@ const ModelSelectvue_type_script_setup_true_lang_js_default_ = {
9181
9194
  type: String,
9182
9195
  default: "#FF0000"
9183
9196
  },
9197
+ // 模型属性唯一值字段集合
9198
+ modeFiledArray: {
9199
+ type: Array,
9200
+ default: () => {
9201
+ return null;
9202
+ }
9203
+ },
9184
9204
  // 是否显示阴影效果
9185
9205
  showShadow: {
9186
9206
  type: Boolean,
@@ -9258,6 +9278,7 @@ const ModelSelectvue_type_script_setup_true_lang_js_default_ = {
9258
9278
  language.value = scenceView._language;
9259
9279
  viewModel = new ModelSelectViewModel(scenceView, pickCallFunc);
9260
9280
  viewModel._highlightColor = props.highlightColor;
9281
+ viewModel._modeFiledArray = props.modeFiledArray;
9261
9282
  }
9262
9283
  });
9263
9284
  });
@@ -9561,12 +9582,14 @@ class SightlineAnalysisViewModel {
9561
9582
 
9562
9583
 
9563
9584
  createBillboard(pos) {
9585
+ if (this._addType == 1) this.clearBillboards("marker" + this._addType);
9586
+
9564
9587
  this._billboards.push(this._viewer.entities.add({
9565
9588
  position: pos,
9589
+ name: "marker" + this._addType,
9566
9590
  billboard: {
9567
9591
  image: this._addType === 1 ? const_image_namespaceObject.OBSERVATION_POINT : const_image_namespaceObject.TARGET_POINT,
9568
9592
  verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
9569
- scale: 0.15,
9570
9593
  disableDepthTestDistance: Number.POSITIVE_INFINITY
9571
9594
  }
9572
9595
  }));
@@ -9691,12 +9714,16 @@ class SightlineAnalysisViewModel {
9691
9714
  } // 清楚billboards
9692
9715
 
9693
9716
 
9694
- clearBillboards() {
9717
+ clearBillboards(val) {
9695
9718
  for (var i = 0; i < this._billboards.length; i++) {
9696
- this._viewer.entities.remove(this._billboards[i]);
9719
+ if (val) {
9720
+ if (this._billboards[i].name == val) this._viewer.entities.remove(this._billboards[i]);
9721
+ } else {
9722
+ this._viewer.entities.remove(this._billboards[i]);
9723
+ }
9697
9724
  }
9698
9725
 
9699
- this._billboards = [];
9726
+ if (!val) this._billboards = [];
9700
9727
  } //清除全部
9701
9728
 
9702
9729
 
@@ -185,6 +185,8 @@ class ModelSelectViewModel {
185
185
  //拾取状态
186
186
  //高亮三维对象
187
187
  //高亮颜色
188
+ // 模型属性唯一值字段集合
189
+ // 模型属性匹配字段
188
190
  constructor(scenceView, pickCallFunc) {
189
191
  (0,defineProperty/* default */.Z)(this, "_viewer", null);
190
192
 
@@ -196,6 +198,10 @@ class ModelSelectViewModel {
196
198
 
197
199
  (0,defineProperty/* default */.Z)(this, "_highlightColor", "#FF0000");
198
200
 
201
+ (0,defineProperty/* default */.Z)(this, "_modeFiledArray", null);
202
+
203
+ (0,defineProperty/* default */.Z)(this, "_modeFiled", "id");
204
+
199
205
  this._viewer = scenceView._viewer;
200
206
  this._drawManager = scenceView._drawManager;
201
207
  this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
@@ -203,42 +209,44 @@ class ModelSelectViewModel {
203
209
 
204
210
  this._handler.setInputAction(function (movement) {
205
211
  if (that._isPick) {
206
- that.clearHighlight();
207
-
208
- let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
212
+ let pickedObject = that._viewer.scene.pick(movement.position);
209
213
 
214
+ console.log(pickedObject);
210
215
 
211
216
  if (pickedObject) {
212
217
  if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
213
- let properties = pickedObject.getPropertyNames() || []; // console.log(properties);
214
-
215
- that._highlight = {
216
- object: pickedObject.pickId.object,
217
- color: pickedObject.pickId.object.color
218
- };
219
- pickedObject.pickId.object.color = Cesium.Color.fromCssColorString(that._highlightColor);
220
- let attrs = {};
221
- properties.forEach(prop => {
222
- attrs[prop] = pickedObject.getProperty(prop);
223
- });
224
- pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs); // if (properties.indexOf(that._modeFiled) > -1) {
225
- // let id = pickedObject.getProperty(that._modeFiled);
226
- // // that.clear();
227
- // that._highlight = new Cesium.Kq3dHighlight({
228
- // viewer: that._viewer,
229
- // tileset: pickedObject.tileset,
230
- // attrName: that._modeFiled,
231
- // attrValue: [id],
232
- // color: [Cesium.Color.RED]
233
- // });
234
- // let attrs = {};
235
- // properties.forEach(prop => {
236
- // attrs[prop] = pickedObject.getProperty(prop);
237
- // });
238
- // pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
239
- // } else {
240
- // console.log("Feature has no id attribute!");
241
- // }
218
+ let properties = pickedObject.getPropertyNames() || [];
219
+ console.log(properties);
220
+
221
+ if (that._modeFiledArray && that._modeFiledArray.length && that._modeFiledArray.length > 0) {
222
+ for (let val in that._modeFiledArray) {
223
+ if (properties.indexOf(val) > -1) {
224
+ that._modeFiled = val;
225
+ break;
226
+ }
227
+ }
228
+ }
229
+
230
+ if (properties.indexOf(that._modeFiled) > -1) {
231
+ let id = pickedObject.getProperty(that._modeFiled); // that.clear();
232
+
233
+ that._highlight = new Cesium.Kq3dHighlight({
234
+ viewer: that._viewer,
235
+ tileset: pickedObject.tileset,
236
+ attrName: that._modeFiled,
237
+ attrValue: [id],
238
+ color: [Cesium.Color.fromCssColorString(that._highlightColor)]
239
+ });
240
+ let attrs = {};
241
+ properties.forEach(prop => {
242
+ attrs[prop] = pickedObject.getProperty(prop);
243
+ });
244
+ pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
245
+ } else {
246
+ console.log("Feature has no id attribute!");
247
+ }
248
+ } else {
249
+ console.log("no Cesium3DTileFeature!");
242
250
  }
243
251
  }
244
252
  }
@@ -270,21 +278,12 @@ class ModelSelectViewModel {
270
278
  type: "warning"
271
279
  });
272
280
  }
273
- }
274
-
275
- clearHighlight() {
276
- if (this._highlight) {
277
- this._highlight.object.color = this._highlight.color;
278
- }
279
-
280
- this._highlight = null;
281
281
  } //清除
282
282
 
283
283
 
284
284
  clear() {
285
- this.clearHighlight(); // this._highlight && this._highlight.remove();
286
- // this._highlight = null;
287
-
285
+ this._highlight && this._highlight.remove();
286
+ this._highlight = null;
288
287
  this.setCursor("default");
289
288
  this._isPick = false;
290
289
  } //销毁
@@ -335,6 +334,13 @@ const __default__ = {
335
334
  type: String,
336
335
  default: "#FF0000"
337
336
  },
337
+ // 模型属性唯一值字段集合
338
+ modeFiledArray: {
339
+ type: Array,
340
+ default: () => {
341
+ return null;
342
+ }
343
+ },
338
344
  // 是否显示阴影效果
339
345
  showShadow: {
340
346
  type: Boolean,
@@ -412,6 +418,7 @@ const __default__ = {
412
418
  language.value = scenceView._language;
413
419
  viewModel = new ModelSelectViewModel(scenceView, pickCallFunc);
414
420
  viewModel._highlightColor = props.highlightColor;
421
+ viewModel._modeFiledArray = props.modeFiledArray;
415
422
  }
416
423
  });
417
424
  });
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.3.3-beta","homepage":"","keywords":["KQGIS","webGL","Vue"],"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"author":"KQWEB GROUP","license":"Apache-2.0","dependencies":{"colorcolor":"^1.1.1","echarts":"^5.3.3","js-cookie":"^3.0.1","omit.js":"^2.0.2","save":"^2.5.0","tinycolor2":"^1.4.2","vue-i18n":"9.2.0-beta.36","xlsx":"^0.18.5","css-vars-ponyfill":"^2.4.8","html2canvas":"^1.4.1","xe-utils":"^3.5.4"}}
1
+ {"name":"@kq_npm/client3d_webgl_vue","description":"KQGIS Client3D for Vue.js","version":"3.3.5-beta","homepage":"","keywords":["KQGIS","webGL","Vue"],"browserslist":["> 1%","last 2 versions","not dead","not ie 11"],"author":"KQWEB GROUP","license":"Apache-2.0","dependencies":{"colorcolor":"^1.1.1","echarts":"^5.3.3","js-cookie":"^3.0.1","omit.js":"^2.0.2","save":"^2.5.0","tinycolor2":"^1.4.2","vue-i18n":"9.2.0-beta.36","xlsx":"^0.18.5","css-vars-ponyfill":"^2.4.8","html2canvas":"^1.4.1","xe-utils":"^3.5.4"}}
@@ -14375,6 +14375,8 @@ class ModelSelectViewModel {
14375
14375
  //拾取状态
14376
14376
  //高亮三维对象
14377
14377
  //高亮颜色
14378
+ // 模型属性唯一值字段集合
14379
+ // 模型属性匹配字段
14378
14380
  constructor(scenceView, pickCallFunc) {
14379
14381
  (0,defineProperty/* default */.Z)(this, "_viewer", null);
14380
14382
 
@@ -14386,6 +14388,10 @@ class ModelSelectViewModel {
14386
14388
 
14387
14389
  (0,defineProperty/* default */.Z)(this, "_highlightColor", "#FF0000");
14388
14390
 
14391
+ (0,defineProperty/* default */.Z)(this, "_modeFiledArray", null);
14392
+
14393
+ (0,defineProperty/* default */.Z)(this, "_modeFiled", "id");
14394
+
14389
14395
  this._viewer = scenceView._viewer;
14390
14396
  this._drawManager = scenceView._drawManager;
14391
14397
  this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
@@ -14393,42 +14399,44 @@ class ModelSelectViewModel {
14393
14399
 
14394
14400
  this._handler.setInputAction(function (movement) {
14395
14401
  if (that._isPick) {
14396
- that.clearHighlight();
14397
-
14398
- let pickedObject = that._viewer.scene.pick(movement.position); // console.log(pickedObject);
14402
+ let pickedObject = that._viewer.scene.pick(movement.position);
14399
14403
 
14404
+ console.log(pickedObject);
14400
14405
 
14401
14406
  if (pickedObject) {
14402
14407
  if (pickedObject instanceof Cesium.Cesium3DTileFeature) {
14403
- let properties = pickedObject.getPropertyNames() || []; // console.log(properties);
14408
+ let properties = pickedObject.getPropertyNames() || [];
14409
+ console.log(properties);
14410
+
14411
+ if (that._modeFiledArray && that._modeFiledArray.length && that._modeFiledArray.length > 0) {
14412
+ for (let val in that._modeFiledArray) {
14413
+ if (properties.indexOf(val) > -1) {
14414
+ that._modeFiled = val;
14415
+ break;
14416
+ }
14417
+ }
14418
+ }
14404
14419
 
14405
- that._highlight = {
14406
- object: pickedObject.pickId.object,
14407
- color: pickedObject.pickId.object.color
14408
- };
14409
- pickedObject.pickId.object.color = Cesium.Color.fromCssColorString(that._highlightColor);
14410
- let attrs = {};
14411
- properties.forEach(prop => {
14412
- attrs[prop] = pickedObject.getProperty(prop);
14413
- });
14414
- pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs); // if (properties.indexOf(that._modeFiled) > -1) {
14415
- // let id = pickedObject.getProperty(that._modeFiled);
14416
- // // that.clear();
14417
- // that._highlight = new Cesium.Kq3dHighlight({
14418
- // viewer: that._viewer,
14419
- // tileset: pickedObject.tileset,
14420
- // attrName: that._modeFiled,
14421
- // attrValue: [id],
14422
- // color: [Cesium.Color.RED]
14423
- // });
14424
- // let attrs = {};
14425
- // properties.forEach(prop => {
14426
- // attrs[prop] = pickedObject.getProperty(prop);
14427
- // });
14428
- // pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
14429
- // } else {
14430
- // console.log("Feature has no id attribute!");
14431
- // }
14420
+ if (properties.indexOf(that._modeFiled) > -1) {
14421
+ let id = pickedObject.getProperty(that._modeFiled); // that.clear();
14422
+
14423
+ that._highlight = new Cesium.Kq3dHighlight({
14424
+ viewer: that._viewer,
14425
+ tileset: pickedObject.tileset,
14426
+ attrName: that._modeFiled,
14427
+ attrValue: [id],
14428
+ color: [Cesium.Color.fromCssColorString(that._highlightColor)]
14429
+ });
14430
+ let attrs = {};
14431
+ properties.forEach(prop => {
14432
+ attrs[prop] = pickedObject.getProperty(prop);
14433
+ });
14434
+ pickCallFunc && pickCallFunc(pickedObject.tileset.name || "LayerName", attrs);
14435
+ } else {
14436
+ console.log("Feature has no id attribute!");
14437
+ }
14438
+ } else {
14439
+ console.log("no Cesium3DTileFeature!");
14432
14440
  }
14433
14441
  }
14434
14442
  }
@@ -14460,21 +14468,12 @@ class ModelSelectViewModel {
14460
14468
  type: "warning"
14461
14469
  });
14462
14470
  }
14463
- }
14464
-
14465
- clearHighlight() {
14466
- if (this._highlight) {
14467
- this._highlight.object.color = this._highlight.color;
14468
- }
14469
-
14470
- this._highlight = null;
14471
14471
  } //清除
14472
14472
 
14473
14473
 
14474
14474
  clear() {
14475
- this.clearHighlight(); // this._highlight && this._highlight.remove();
14476
- // this._highlight = null;
14477
-
14475
+ this._highlight && this._highlight.remove();
14476
+ this._highlight = null;
14478
14477
  this.setCursor("default");
14479
14478
  this._isPick = false;
14480
14479
  } //销毁
@@ -14525,6 +14524,13 @@ const __default__ = {
14525
14524
  type: String,
14526
14525
  default: "#FF0000"
14527
14526
  },
14527
+ // 模型属性唯一值字段集合
14528
+ modeFiledArray: {
14529
+ type: Array,
14530
+ default: () => {
14531
+ return null;
14532
+ }
14533
+ },
14528
14534
  // 是否显示阴影效果
14529
14535
  showShadow: {
14530
14536
  type: Boolean,
@@ -14602,6 +14608,7 @@ const __default__ = {
14602
14608
  language.value = scenceView._language;
14603
14609
  viewModel = new ModelSelectViewModel(scenceView, pickCallFunc);
14604
14610
  viewModel._highlightColor = props.highlightColor;
14611
+ viewModel._modeFiledArray = props.modeFiledArray;
14605
14612
  }
14606
14613
  });
14607
14614
  });
@@ -20162,12 +20169,14 @@ class SightlineAnalysisViewModel {
20162
20169
 
20163
20170
 
20164
20171
  createBillboard(pos) {
20172
+ if (this._addType == 1) this.clearBillboards("marker" + this._addType);
20173
+
20165
20174
  this._billboards.push(this._viewer.entities.add({
20166
20175
  position: pos,
20176
+ name: "marker" + this._addType,
20167
20177
  billboard: {
20168
20178
  image: this._addType === 1 ? const_image_.OBSERVATION_POINT : const_image_.TARGET_POINT,
20169
20179
  verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
20170
- scale: 0.15,
20171
20180
  disableDepthTestDistance: Number.POSITIVE_INFINITY
20172
20181
  }
20173
20182
  }));
@@ -20292,12 +20301,16 @@ class SightlineAnalysisViewModel {
20292
20301
  } // 清楚billboards
20293
20302
 
20294
20303
 
20295
- clearBillboards() {
20304
+ clearBillboards(val) {
20296
20305
  for (var i = 0; i < this._billboards.length; i++) {
20297
- this._viewer.entities.remove(this._billboards[i]);
20306
+ if (val) {
20307
+ if (this._billboards[i].name == val) this._viewer.entities.remove(this._billboards[i]);
20308
+ } else {
20309
+ this._viewer.entities.remove(this._billboards[i]);
20310
+ }
20298
20311
  }
20299
20312
 
20300
- this._billboards = [];
20313
+ if (!val) this._billboards = [];
20301
20314
  } //清除全部
20302
20315
 
20303
20316
 
@@ -26058,7 +26071,7 @@ class DrawManager {
26058
26071
  } //开始绘制
26059
26072
 
26060
26073
 
26061
- startDraw(type, options, callback) {
26074
+ startDraw(type, options, callback, groupName) {
26062
26075
  this._viewer.scene.globe.depthTestAgainstTerrain = true;
26063
26076
 
26064
26077
  if (type === "point") {
@@ -26086,6 +26099,7 @@ class DrawManager {
26086
26099
  if (callback) {
26087
26100
  var that = this;
26088
26101
  var removeEventListener = this.drawFinishedEvent.addEventListener(shape => {
26102
+ if (groupName) shape.groupName = groupName;
26089
26103
  that._viewer.scene.globe.depthTestAgainstTerrain = false;
26090
26104
  var feature = that.shapeToGeoFeature(shape);
26091
26105
  callback(feature.geometry);
@@ -26112,6 +26126,19 @@ class DrawManager {
26112
26126
  } else {
26113
26127
  this._drawHandler.editHandler.deactivate();
26114
26128
  }
26129
+ } //清除绘图分组
26130
+
26131
+
26132
+ clearDrawGroup(groupName) {
26133
+ let primitives = this._drawLayer._primitives;
26134
+
26135
+ if (primitives && primitives.length > 0) {
26136
+ for (let i = primitives.length - 1; i >= 0; i--) {
26137
+ if (primitives[i].groupName === groupName) {
26138
+ this._drawLayer.removeById(primitives[i].guid);
26139
+ }
26140
+ }
26141
+ }
26115
26142
  } //清除全部手动绘图
26116
26143
 
26117
26144
 
@@ -642,12 +642,14 @@ class SightlineAnalysisViewModel {
642
642
 
643
643
 
644
644
  createBillboard(pos) {
645
+ if (this._addType == 1) this.clearBillboards("marker" + this._addType);
646
+
645
647
  this._billboards.push(this._viewer.entities.add({
646
648
  position: pos,
649
+ name: "marker" + this._addType,
647
650
  billboard: {
648
651
  image: this._addType === 1 ? const_image_.OBSERVATION_POINT : const_image_.TARGET_POINT,
649
652
  verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
650
- scale: 0.15,
651
653
  disableDepthTestDistance: Number.POSITIVE_INFINITY
652
654
  }
653
655
  }));
@@ -772,12 +774,16 @@ class SightlineAnalysisViewModel {
772
774
  } // 清楚billboards
773
775
 
774
776
 
775
- clearBillboards() {
777
+ clearBillboards(val) {
776
778
  for (var i = 0; i < this._billboards.length; i++) {
777
- this._viewer.entities.remove(this._billboards[i]);
779
+ if (val) {
780
+ if (this._billboards[i].name == val) this._viewer.entities.remove(this._billboards[i]);
781
+ } else {
782
+ this._viewer.entities.remove(this._billboards[i]);
783
+ }
778
784
  }
779
785
 
780
- this._billboards = [];
786
+ if (!val) this._billboards = [];
781
787
  } //清除全部
782
788
 
783
789