forked from drone/command-center-dashboard

shuishen
2025-04-08 56731d7e2e96ba549a88aca0ebd89a8fc3e98f01
feat:行政区加高度
1 files modified
21 ■■■■■ changed files
src/views/Home/useMapAggregation/useMapAggregation.js 21 ●●●●● patch | view | raw | blame | history
src/views/Home/useMapAggregation/useMapAggregation.js
@@ -339,6 +339,7 @@
      item.dataSource = dataSource // 保存数据源以便后续删除
      // 获取数据源中的实体
      const entities = dataSource.entities.values
      entities.forEach(entity => {
        let material = new PolyGradientMaterial({
          color: Cesium.Color.fromCssColorString(getColor()),
@@ -346,18 +347,20 @@
          alphaPower: 1.3
        })
        entity.polygon.extrudedHeight = (entity.propertyNames.length || 1) * 500
        entity.polygon.material = material
        entity.polygon.outline = false // 显示边框
      })
      flyTo &&
        viewer.flyTo(dataSource, {
          offset: new Cesium.HeadingPitchRange(
            0, // heading: 0 (朝向不变)
            Cesium.Math.toRadians(-90), // pitch: -90° (垂直向下)
            0 // range: 0 (默认距离)
          ),
          duration: 0.5,
        })
      flyTo && viewer.flyTo(dataSource, {
        offset: new Cesium.HeadingPitchRange(
          0, // heading: 0 (朝向不变)
          Cesium.Math.toRadians(-60), // pitch: -90° (垂直向下)
          0 // range: 0 (默认距离)
        ),
        duration: 0.5,
      })
    })
  }