Browse Source

山水工程销毁

maxiaoxiao 1 năm trước cách đây
mục cha
commit
ee1075edef
2 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 2 6
      src/views/LandscapeProject/index.vue
  2. 4 0
      src/views/cockpit/js/tdsy.js

+ 2 - 6
src/views/LandscapeProject/index.vue

@@ -1,7 +1,7 @@
 <!--山水工程列表-->
 <template>
   <div class="ghzc LandscapeProject">
-    <Boxcommon :islist="islist">
+    <Boxcommon :islist="islist" ref="Boxcommon">
       <template v-slot:title>
         <span class="clearBtn" @click="changeType">
           切换到工程{{ islist ? "总览" : "列表" }}
@@ -233,11 +233,7 @@ export default {
     // activeTabs(newValue) {},
   },
   beforeDestroy() {
-    store.setCockpit_vector({
-      title: "",
-      tableData: [],
-      columns: [],
-    });
+    this.$refs.Boxcommon.close();
   },
 };
 </script>

+ 4 - 0
src/views/cockpit/js/tdsy.js

@@ -38,6 +38,10 @@ export let layer = null
 export let superProvider = null
 export let layersObj = {} //添加的单个layer
 export function addLayer(obj) {
+    if (layer) {
+        viewer.imageryLayers.remove(layer);
+        layer = null
+    }
     // this.bus.$emit("checkedChange", {...obj,checked:true });
     superProvider = new Cesium.SuperMapImageryProvider({
         url: obj.url,