瀏覽代碼

数据中心

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

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

@@ -58,8 +58,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 = []
       }
     },
@@ -132,9 +134,10 @@ export default {
     },
     //移除之前添加的点
     clearM() {
-      this.viewer.entities.removeAll()
-      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 = []
       }
     },