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 = []
       }
     },