瀏覽代碼

数据中心

wangzhe 2 年之前
父節點
當前提交
a69809572e
共有 1 個文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/components/supermap-2.5d.vue

+ 8 - 4
src/components/supermap-2.5d.vue

@@ -73,8 +73,10 @@ export default {
     },
     //移除之前添加的点
     clearMRadius() {
-      if (this.markerboxEntityRadius != null) {
-        this.viewer.entities.remove(this.markerboxEntityRadius)
+      if (this.markerboxEntityRadius != null && this.markerboxEntityRadius.length>0) {
+        for (let i = 0; i < this.markerboxEntityRadius.length; i++) {
+          this.viewer.entities.remove(this.markerboxEntityRadius[i])
+        }
         this.markerboxEntityRadius = []
       }
     },
@@ -147,8 +149,10 @@ export default {
     },
     //移除之前添加的点
     clearM() {
-      if (this.markerboxEntity != null) {
-        this.viewer.entities.remove(this.markerboxEntity)
+      if (this.markerboxEntity != null && this.markerboxEntity.length>0) {
+        for (let i = 0; i < this.markerboxEntity.length; i++) {
+          this.viewer.entities.remove(this.markerboxEntity[i])
+        }
         this.markerboxEntity = []
       }
     },