guonan
2025-04-18 d0272e6a4e5b68c4e82e7356849f6ceb402a1055
修改避险点
已修改5个文件
88 ■■■■■ 文件已修改
src/components/menu/Function.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/monifangzhen/ResultAssess.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tools/LayerTree.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/area.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mnfz.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/menu/Function.vue
@@ -118,6 +118,8 @@
                },
                multiple: 1.0,
                scale: new SmartEarth.Cesium.Cartesian3(20, 20, 20),
                color: "#00FF00"
            })
            console.log("point", point)
            emergencyAreaList.push(point)
src/components/monifangzhen/ResultAssess.vue
@@ -110,10 +110,10 @@
        return
    }
    const dataSourcePromise = Cesium.GeoJsonDataSource.load('/json/fxArea.json', {
        stroke: Cesium.Color.YELLOW,
        fill: Cesium.Color.YELLOW.withAlpha(0.5),
    })
    // const dataSourcePromise = Cesium.GeoJsonDataSource.load('/json/fxArea.json', {
    //     stroke: Cesium.Color.YELLOW,
    //     fill: Cesium.Color.YELLOW.withAlpha(0.5),
    // })
    dataSourcePromise.then(data => {
        dataSource = data
        viewer.dataSources.add(data)
src/components/tools/LayerTree.vue
@@ -38,7 +38,7 @@
        label: "综合监测设备信息",
      },
      {
        label: "孙胡沟仿真标注地物",
        label: "孙胡沟断面",
      },
      {
        label: "避险点",
@@ -72,8 +72,8 @@
    case "综合监测设备信息":
      console.log("综合监测设备信息", checked, indeterminate);
      break;
    case "孙胡沟仿真标注地物":
      console.log("孙胡沟仿真标注地物", checked, indeterminate);
    case "孙胡沟断面":
      console.log("孙胡沟断面", checked, indeterminate);
      break;
    case "避险点":
      addTetrahedron();
@@ -91,10 +91,17 @@
  //     sourceType: "tms",
  //     url: "http://106.120.22.26:9103/gisserver/tmsserver/sunhugoudom",
  // })
  let TerrainLayer = earthCtrl.factory.createTerrainLayer({
    sourceType: "ctb",
    url: "http://106.120.22.26:9103/gisserver/ctsserver/llmbdem",
  })
  // let TerrainLayer = earthCtrl.factory.createTerrainLayer({
  //   sourceType: "ctb",
  //   // url: "http://106.120.22.26:9103/gisserver/ctsserver/llmbdem",
  //   url: "http://106.120.22.26:9103/gisserver/ctsserver/sunhugoudem",
  // })
    let TerrainLayer = earthCtrl.factory.createTerrainLayer({
      sourceType: "ctb",
      url: "http://106.120.22.26:9103/gisserver/ctsserver/sungugoudem",
    });
  // let TerrainLayer = earthCtrl.factory.createTerrainLayer({
  //   sourceType: "ctb",
  //   url: "https://tiles1.geovisearth.com/base/v1/terrain?token=486dac3bec56d7d7c2a581c150be2bd937462f1e8f3bc9c78b5658b396122405",
@@ -964,7 +971,7 @@
      divPointList.push(divPoint.item);
    });
    treeMap.set("孙胡沟仿真标注地物", list);
    treeMap.set("孙胡沟断面", list);
  });
}
@@ -983,18 +990,18 @@
      latitude: 40.568391,
      altitude: 528.45,
    },
    {
      name: "范振江家",
      longitude: 116.591059,
      latitude: 40.574068,
      altitude: 528,
    },
    {
      name: "后坡",
      longitude: 116.597975,
      latitude: 40.558199,
      altitude: 528,
    },
    // {
    //   name: "范振江家",
    //   longitude: 116.591059,
    //   latitude: 40.574068,
    //   altitude: 528,
    // },
    // {
    //   name: "后坡",
    //   longitude: 116.597975,
    //   latitude: 40.558199,
    //   altitude: 528,
    // },
  ];
  list.forEach((item) => {
    let point = earthCtrl.factory.addTetrahedron({
@@ -1004,7 +1011,8 @@
        height: item.altitude,
      },
      multiple: 1.0,
      scale: new SmartEarth.Cesium.Cartesian3(20, 20, 20),
      scale: new SmartEarth.Cesium.Cartesian3(80, 80, 80),
      color:"#00ff00"
    });
    console.log("point", point);
    emergencyAreaList.push(point);
@@ -1048,7 +1056,7 @@
      treeRef.value.setCheckedKeys(defaultKeys.concat("孙胡沟隐患点"), true);
      toggleLayerVisible("孙胡沟隐患点", true);
      toggleLayerVisible("综合监测设备信息", false);
      toggleLayerVisible("孙胡沟仿真标注地物", false);
      toggleLayerVisible("孙胡沟断面", false);
    } else if (path == "/zhjc") {
      treeRef.value.setCheckedKeys(
        defaultKeys.concat("综合监测设备信息"),
@@ -1056,13 +1064,13 @@
      );
      toggleLayerVisible("综合监测设备信息", true);
      toggleLayerVisible("孙胡沟隐患点", false);
      toggleLayerVisible("孙胡沟仿真标注地物", false);
      toggleLayerVisible("孙胡沟断面", false);
    } else if (path == "/mnfz") {
      treeRef.value.setCheckedKeys(
        defaultKeys.concat("孙胡沟仿真标注地物"),
        defaultKeys.concat("孙胡沟断面"),
        true
      );
      toggleLayerVisible("孙胡沟仿真标注地物", true);
      toggleLayerVisible("孙胡沟断面", true);
      toggleLayerVisible("孙胡沟隐患点", false);
      toggleLayerVisible("综合监测设备信息", false);
    } else {
src/utils/area.js
@@ -4,7 +4,7 @@
export function loadAreaPolygon(url, isPolluted = false) {
    let color = new Cesium.Color(1.0, 0.0, 0.0, 0.1)
    if (isPolluted) {
        color = Cesium.Color.SKYBLUE
        color = Cesium.Color.GREEN
    }
    // 使用 GeoJsonDataSource 加载 GeoJSON 数据
    const dataSourcePromise = Cesium.GeoJsonDataSource.load(url, {
src/views/mnfz.vue
@@ -59,15 +59,19 @@
const MaxInfluenceAreaList = ref([]);
const dataSources = [];
function getTimeMarkers() {
  // 将改 list数据的 gemo EPSG:4548 坐标 转为 wgs84 坐标系的 geojson 数据
  // 将 list 数据的 geom EPSG:4548 坐标转换为 WGS84 坐标系的 GeoJSON 数据
  const list = MaxInfluenceAreaList.value;
  list.forEach((item, index) => {
    const geosjon = geomToGeoJSON(item.geom);
    Cesium.GeoJsonDataSource.load(geosjon, {
      stroke: Cesium.Color.RED, // 边框颜色
      strokeWidth: 2, // 边框宽度
      fill: Cesium.Color.RED.withAlpha(0.5), // 填充颜色(带透明度)
    }).then((dataSource) => {
    const geojson = geomToGeoJSON(item.geom);
    Cesium.GeoJsonDataSource.load(geojson).then((dataSource) => {
      // 设置样式,将颜色改为红色
      dataSource.entities.values.forEach((entity) => {
        entity.polygon.material = new Cesium.Color(1.0, 0.0, 0.0, 0.6); // 红色,80% 不透明度
        entity.polygon.outlineColor = Cesium.Color.YELLOW; // 设置轮廓颜色为红色(如果需要)
        entity.polygon.outline = true; // 显示轮廓(如果需要)
      });
      // 添加数据源到 viewer
      viewer.dataSources.add(dataSource);
      dataSources.push(dataSource);
    });