wangjuncheng
10 天以前 263bf9730455a7bcc4fdc6471f8f9d0c96e47c9e
src/views/left/CitySim.vue
@@ -196,7 +196,7 @@
    }
    await simStore.addSimCheme(forms);
    // 打印拦挡坝所需要的数据
    // printDamEntities();
    printDamEntities();
    resetForm(); // 只有在保存成功后才重置表单
    EventBus.emit("close-selectArea");
  } catch (error) { }
@@ -655,9 +655,26 @@
    const entity = entities[i];
    if (entity.name && (entity.name === '栏档坝1' || entity.name === '栏档坝2')) {
      let position = entity.position?._value;
      // 如果有位置信息,就将其从笛卡尔坐标转为经纬度和高度
      let cartographic = undefined;
      if (position) {
        cartographic = Cesium.Cartographic.fromCartesian(position);
      }
      damDataList.push({
        name: entity.name,
        position: entity.position?._value,
        position: position ? {
          x: position.x,
          y: position.y,
          z: position.z
        } : null,
        cartographic: cartographic ? {
          longitude: Cesium.Math.toDegrees(cartographic.longitude), // 经度(度)
          latitude:  Cesium.Math.toDegrees(cartographic.latitude),  // 纬度(度)
          height:    cartographic.height                           // 高度(米)
        } : null,
        heading: entity.heading?._value ?? entity.heading,
        pitch: entity.pitch?._value ?? entity.pitch,
        roll: entity.roll?._value ?? entity.roll,
@@ -665,6 +682,7 @@
      });
    }
  }
  if (damDataList.length > 0) {
    console.log("【栏档坝实体数据列表】:", damDataList);
    deleteDamEntitiesAfterDelay();