浏览代码

生态修复山水工程单个定位

maxiaoxiao 9 月之前
父节点
当前提交
46fb6357e8
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. 7 6
      src/views/cockpit/common/VectorSpace/BoxCommonVector.vue
  2. 2 1
      src/views/cockpit/stxf.vue

+ 7 - 6
src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

@@ -123,10 +123,11 @@ export default {
       }
       return "";
     },
-    async draw_vector_server(jscType) {
+    async draw_vector_server(jscType, goitrem) {
       let res = await QueryOne({ jscType, id: "4602" });
       this.layersData = { ...res.data, title: this.title };
-      tdsy.addLayer(this.layersData);
+      if (goitrem) this.go(goitrem);
+      else tdsy.addLayer(this.layersData);
       // this.Getlayers(res.data.url);
     },
     async Getlayers(mapurl) {
@@ -141,7 +142,7 @@ export default {
       if (layersObj[did_v]) {
         layersObj[did_v].show = true;
         viewer.flyTo(layerSources[did_v], {
-          offset: new Cesium.HeadingPitchRange(0, -45, 5000),
+          offset: new Cesium.HeadingPitchRange(0, -45),
         });
       } else {
         tdsy.layer.show = false;
@@ -168,14 +169,14 @@ export default {
     loadGeoJSON(geojson, id) {
       let polygon = Cesium.GeoJsonDataSource.load(geojson, {
         clampToGround: true,
-        stroke: Cesium.Color.WHITE.withAlpha(0),
+        stroke: Cesium.Color.RED.withAlpha(0),
         fill: Cesium.Color.WHITE.withAlpha(0),
       });
       polygon.then(function (dataSource) {
         viewer.dataSources.add(dataSource);
         layerSources[id] = dataSource;
         viewer.flyTo(dataSource, {
-          offset: new Cesium.HeadingPitchRange(0, -45, 5000),
+          offset: new Cesium.HeadingPitchRange(0, -45),
         });
       });
     },
@@ -545,7 +546,7 @@ export default {
         this.init_vector();
       }
       if (newVal.goitem) {
-        this.go(newVal.goitem);
+        this.draw_vector_server(newVal.mapType, newVal.goitem);
       }
     },
     active_dableData(newVal, oldVal) {

+ 2 - 1
src/views/cockpit/stxf.vue

@@ -226,6 +226,7 @@ export default {
       store.setXzqh_flag(false);
       store.setCockpit_vector({
         title: "",
+        mapType: 'jsc_stxf_ssxf_layer',
         tableData: [item],
         goitem: item,
       });
@@ -238,7 +239,7 @@ export default {
         store.setCockpit_vector({
           title: "山水工程项目",
           word: "项目名称",
-          mapType:'jsc_stxf_ssxf_layer',
+          mapType: "jsc_stxf_ssxf_layer",
           tableData: store.state.cockpit_stxf.ssgc.list,
           tablejscType: `jsc_stxf_ywlx_ssxfmx`,
           columns: ['项目名称', '治理面积(公顷)','投资金额(万元)', '区县编码', '区县编码名称', '治理时间', '治理进度',  '备注'],