wangzhe 2 år sedan
förälder
incheckning
f7bfd69685
1 ändrade filer med 9 tillägg och 5 borttagningar
  1. 9 5
      src/components/supermap-2.5d.vue

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

@@ -74,8 +74,10 @@
       },
       //移除之前添加的点
       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 = []
         }
       },
@@ -148,8 +150,10 @@
       },
       //移除之前添加的点
       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 = []
         }
       },
@@ -536,4 +540,4 @@
     opacity: 0;
     transform: translateY(-10rem);
   }
-</style>
+</style>