forked from drone/command-center-dashboard

罗广辉
2025-04-02 e1699c4851f6ca397cd0ad1ff63f32c737654836
src/views/Home/useUavHome/useUavHome.js
@@ -246,28 +246,28 @@
  // 渲染轮廓
  const renderOutline = item => {
    item.outline &&
      Cesium.GeoJsonDataSource.load(item.outline).then(dataSource => {
        viewer.dataSources.add(dataSource);
        const entities = dataSource.entities.values;
        entities.forEach(entity => {
          // 隐藏多边形填充
          entity.polygon.material = Cesium.Color.TRANSPARENT;
          entity.polygon.outline = false; // 关闭原生轮廓
          // 创建独立折线作为轮廓
          const positions = entity.polygon.hierarchy.getValue().positions;
          viewer.entities.add({
            polyline: {
              positions: positions,
              width: 5, // 直接设置宽度
              material: new Cesium.PolylineGlowMaterialProperty({
                glowPower: 0.5,
                color: Cesium.Color.AQUA,
              }),
              clampToGround: true, // 贴地显示
            },
          });
    Cesium.GeoJsonDataSource.load(item.outline).then(dataSource => {
      viewer.dataSources.add(dataSource);
      const entities = dataSource.entities.values;
      entities.forEach(entity => {
        // 隐藏多边形填充
        entity.polygon.material = Cesium.Color.TRANSPARENT;
        entity.polygon.outline = false; // 关闭原生轮廓
        // 创建独立折线作为轮廓
        const positions = entity.polygon.hierarchy.getValue().positions;
        viewer.entities.add({
          polyline: {
            positions: positions,
            width: 5, // 直接设置宽度
            material: new Cesium.PolylineGlowMaterialProperty({
              glowPower: 0.5,
              color: Cesium.Color.AQUA,
            }),
            clampToGround: true, // 贴地显示
          },
        });
      });
    });
  };
  // 聚合机巢
@@ -334,14 +334,14 @@
        entity.polygon.outlineColor = new Cesium.ConstantProperty(Cesium.Color.AQUAMARINE);
      });
      flyTo &&
        viewer.flyTo(dataSource, {
          offset: new Cesium.HeadingPitchRange(
            0, // heading: 0 (朝向不变)
            Cesium.Math.toRadians(-90), // pitch: -90° (垂直向下)
            0 // range: 0 (默认距离)
          ),
          duration: 0.5,
        });
      viewer.flyTo(dataSource, {
        offset: new Cesium.HeadingPitchRange(
          0, // heading: 0 (朝向不变)
          Cesium.Math.toRadians(-90), // pitch: -90° (垂直向下)
          0 // range: 0 (默认距离)
        ),
        duration: 0.5,
      });
    });
  };