maxiaoxiao há 11 meses atrás
pai
commit
a15ea8797a
2 ficheiros alterados com 14 adições e 9 exclusões
  1. 8 9
      src/components/mapView/range.vue
  2. 6 0
      src/views/siteselection/index.vue

+ 8 - 9
src/components/mapView/range.vue

@@ -47,6 +47,9 @@ export default {
     activeTabs: {
       type: String,
     },
+    type: {
+      type: String,
+    },
   },
   data() {
     return {
@@ -139,9 +142,12 @@ export default {
     },
     // 加载GeoJSON数据
     addPolygon() {
-      // let geojson = CX_geojeson;
+      let geojson =
+        this.$props.type == "hegxfx"
+          ? "/static/data/ghss/导入.geojson"
+          : "staticdatadraw.geojson";
       let polygon = Cesium.GeoJsonDataSource.load(
-        "/static/data/ghss/导入.geojson"
+        geojson
         // { clampToGround: true }
       );
       polygon.then(function (dataSource) {
@@ -202,13 +208,6 @@ export default {
       return this.model;
     },
   },
-
-  // watch(
-  //     () => prop.activeTabs,
-  //     (newValue, oldValue) => {
-  //       this.getXzq();
-  //     }
-  //   );
 };
 </script>
 

+ 6 - 0
src/views/siteselection/index.vue

@@ -78,6 +78,12 @@ export default {
       this.activeTabs = evt.name;
     },
   },
+  watch: {
+    activeTabs(newValue) {
+       if (newValue != "lsju")
+        viewer.dataSources.removeAll();
+    },
+  },
 };
 </script>