forked from drone/command-center-dashboard

shuishen
2025-04-09 052669ad57543a06b73b26fffdf0c5217b9389ad
feat:行政区高度调整
1 files modified
50 ■■■■ changed files
src/views/Home/useMapAggregation/useMapAggregation.js 50 ●●●● patch | view | raw | blame | history
src/views/Home/useMapAggregation/useMapAggregation.js
@@ -199,17 +199,17 @@
    scalingJudgment.forEach(item => item.show && (item.outline = outlineGJson))
    const [longitude, latitude] = outlineGJson.features[0].properties.centroid
    const height = scalingJudgment[(hierarchy.length - 3) * (-1)].height
    setCenterPosition({longitude, latitude,height})
    setCenterPosition({ longitude, latitude, height })
    flyTo({ longitude, latitude }, 0, height)
  }
  const userAreaPosition = computed(() => store.state.home.userAreaPosition);
  const userAreaPosition = computed(() => store.state.home.userAreaPosition)
  const setCenterPosition = (position) => {
    store.commit('setCurrentAreaPosition', position)
        if (!userAreaPosition.value.longitude){
            store.commit('setUserAreaPosition', position)
        }
    if (!userAreaPosition.value.longitude) {
      store.commit('setUserAreaPosition', position)
    }
  }
@@ -261,24 +261,24 @@
  // 渲染轮廓
  const renderOutline = item => {
    item.outline &&
    Cesium.GeoJsonDataSource.load(item.outline).then(dataSource => {
      const entities = dataSource.entities.values
      entities.forEach((entity,index) => {
        // 创建独立折线作为轮廓
        const positions = entity.polygon.hierarchy.getValue().positions
        viewer.entities.add({
          id: `aggregation-outline-${index}`,
          polyline: {
            positions: positions,
            width: 5, // 直接设置宽度
            material: new Cesium.PolylineGlowMaterialProperty({
              glowPower: 0.5,
              color: Cesium.Color.AQUA,
            }),
          },
      Cesium.GeoJsonDataSource.load(item.outline).then(dataSource => {
        const entities = dataSource.entities.values
        entities.forEach((entity, index) => {
          // 创建独立折线作为轮廓
          const positions = entity.polygon.hierarchy.getValue().positions
          viewer.entities.add({
            id: `aggregation-outline-${index}`,
            polyline: {
              positions: positions,
              width: 5, // 直接设置宽度
              material: new Cesium.PolylineGlowMaterialProperty({
                glowPower: 0.5,
                color: Cesium.Color.AQUA,
              }),
            },
          })
        })
      })
    })
  }
  // 聚合机巢
@@ -296,7 +296,7 @@
    // 遍历特征并添加实体
    featuresList.forEach((feature, index) => {
      if (!feature.position) return
      const position = Cesium.Cartesian3.fromDegrees(feature.position[0], feature.position[1],12000)
      const position = Cesium.Cartesian3.fromDegrees(feature.position[0], feature.position[1], 12000)
      viewer.entities.add({
        position: position,
        id: `aggregation-name-${index}`,
@@ -345,6 +345,8 @@
    // 加载边界
    Cesium.GeoJsonDataSource.load(item.gJson).then(dataSource => {
      console.log(dataSource, item.gJson)
      viewer.dataSources.add(dataSource)
      item.BJDataSource = dataSource // 保存数据源以便后续删除
      // 获取数据源中的实体
@@ -357,7 +359,7 @@
          alphaPower: 1.3
        })
        entity.polygon.extrudedHeight = (entity.propertyNames.length || 1) * 500
        entity.polygon.extrudedHeight = (entity.properties.childrenNum._value || 1) * 500
        entity.polygon.material = material
        entity.polygon.outline = false // 显示边框
@@ -406,7 +408,7 @@
    currentEntity = entity
    const entityPosition = entity?.position?._value
    if (!entityPosition) return
    if (entityPosition){
    if (entityPosition) {
      positionC3 = entityPosition
    }
    removeLabel()