Browse Source

报错,关闭清除无人机飞行路线

maxiaoxiao 7 months ago
parent
commit
050fe4e504

+ 8 - 1
src/views/farmlandProtection/gdzl/wrjxx.vue

@@ -192,6 +192,10 @@ export default {
     },
     lineFly(uavitem) {
       this.stopPolylineFly(uavitem);
+      img_entity.entities.values.forEach((ent) => {
+        img_entity.entities.remove(ent);
+      });
+
       if (this.flyid == uavitem.id) {
         this.flyid = "";
       } else {
@@ -271,11 +275,14 @@ export default {
   beforeDestroy() {
     // this.delatePoi("jt1");
     // this.delatePoi("dw1");flyManagers
-
+    console.log("[dc-d]");
     viewer.dataSources.remove(img_entity);
     Object.keys(flyManagers).forEach((key) => {
       flyManagers[key].stop();
+      flyManagers[key].currentRoute.isLineVisible = false;
+      flyManagers[key].currentRoute.isStopVisible = false;
     });
+    flyManagers = {};
   },
 };
 </script>

+ 3 - 3
src/views/farmlandProtection/indexNew.vue

@@ -81,7 +81,7 @@ export default {
     // Xzgd,
     Contrast,
     Fzyp,
-    Wrj
+    Wrj,
   },
   data() {
     return {
@@ -120,12 +120,12 @@ export default {
       this[name] = updata;
     },
     goContrast(dbdata) {
-      this.$refs.gdzl.sourcesshow(false);
+      if (this.$refs.gdzl) this.$refs.gdzl.sourcesshow(false);
       this.iscontrast = true;
       this.$refs.contrastModal.show(dbdata);
     },
     fly() {
-      this.$refs.gdzl.fly();
+      if (this.$refs.gdzl) this.$refs.gdzl.fly();
     },
     contrastClose() {
       this.iscontrast = false;