|
@@ -434,7 +434,7 @@ export default {
|
|
|
// this.setMapImageryProvider();
|
|
|
this.initCesiumTerrain();
|
|
|
this.initCesiumBaseMapImage();
|
|
|
- this.switchWindLayer();
|
|
|
+ // this.switchWindLayer();
|
|
|
this.showAllStation(viewer, allStationJson.station);
|
|
|
this.initGeoJsonData();
|
|
|
},
|
|
@@ -1661,18 +1661,18 @@ export default {
|
|
|
|
|
|
// 展示所有风场
|
|
|
showAllStation(viewer, station) {
|
|
|
- station.forEach((e, index) => {
|
|
|
- if (e.energytype === "Wind") {
|
|
|
- this.showStationFn(viewer, e, index, fc);
|
|
|
- } else if (e.energytype === "Fire") {
|
|
|
- this.showStationFn(viewer, e, index, hd);
|
|
|
- } else if (e.energytype === "Storage") {
|
|
|
- this.showStationFn(viewer, e, index, chu);
|
|
|
- } else {
|
|
|
- this.showStationFn(viewer, e, index, gf);
|
|
|
- }
|
|
|
- });
|
|
|
- // this.resetViewport(6000000);
|
|
|
+ station.forEach((e, index) => {
|
|
|
+ if (e.energytype === "Wind") {
|
|
|
+ this.showStationFn(viewer, e, index, fc);
|
|
|
+ } else if (e.energytype === "Fire") {
|
|
|
+ this.showStationFn(viewer, e, index, hd);
|
|
|
+ } else if (e.energytype === "Storage") {
|
|
|
+ this.showStationFn(viewer, e, index, chu);
|
|
|
+ } else {
|
|
|
+ this.showStationFn(viewer, e, index, gf);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.resetViewport(6000000);
|
|
|
},
|
|
|
// 根据状态展示不同颜色风机贴图
|
|
|
async showStationFn(viewer, e, index, images) {
|
|
@@ -2038,6 +2038,7 @@ export default {
|
|
|
if (type !== "windbasic2d") {
|
|
|
this.windDrawer = true;
|
|
|
this.windDrawerHeader = val.name + "数据详情";
|
|
|
+
|
|
|
if (type === "basic") {
|
|
|
this.windDrawerTitle = "基础信息";
|
|
|
this.showBasicMsg = true;
|
|
@@ -2049,7 +2050,7 @@ export default {
|
|
|
this.showProblemMsg = true;
|
|
|
}
|
|
|
} else {
|
|
|
- this.showWindDetail = true;
|
|
|
+ // this.showWindDetail = true;
|
|
|
this.allStationentitys.forEach(({ entity, handler }) => {
|
|
|
viewer.entities.remove(entity); // 移除实体
|
|
|
if (!handler.isDestroyed()) {
|
|
@@ -2057,15 +2058,46 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.allStationentitys = [];
|
|
|
- this.showWindFromStation(viewer);
|
|
|
+ // this.showWindFromStation(viewer);
|
|
|
this.showTypeViewer = false;
|
|
|
this.cancleAllLayer();
|
|
|
+ this.getCameraPosition(viewer)
|
|
|
}
|
|
|
// else {
|
|
|
// this.windDrawerTitle = '模型解构'
|
|
|
// this.showModelMsg = true
|
|
|
// }
|
|
|
},
|
|
|
+ // 获取当前经纬度和高度并跳转风机详情
|
|
|
+ getCameraPosition(viewer) {
|
|
|
+ const camera = viewer.camera;
|
|
|
+ const ellipsoid = viewer.scene.globe.ellipsoid;
|
|
|
+
|
|
|
+ // 获取相机的笛卡尔坐标
|
|
|
+ const cartesianPosition = camera.position;
|
|
|
+
|
|
|
+ // 转换为地理坐标(弧度)
|
|
|
+ const cartographicPosition = ellipsoid.cartesianToCartographic(cartesianPosition);
|
|
|
+
|
|
|
+ if (cartographicPosition) {
|
|
|
+ const longitude = Cesium.Math.toDegrees(cartographicPosition.longitude); // 经度(度)
|
|
|
+ const latitude = Cesium.Math.toDegrees(cartographicPosition.latitude); // 纬度(度)
|
|
|
+ const height = cartographicPosition.height; // 高度(米)
|
|
|
+
|
|
|
+ // return { longitude, latitude, height };
|
|
|
+
|
|
|
+ this.$router.push({
|
|
|
+ path: "/windMap",
|
|
|
+ query: {
|
|
|
+ longitude: longitude,
|
|
|
+ latitude: latitude,
|
|
|
+ height: Math.ceil(height)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return undefined; // 相机可能在地球之外或无效位置
|
|
|
+ }
|
|
|
+ },
|
|
|
// 重置风场中所有风机视角
|
|
|
resetWindViewport() {
|
|
|
this.viewer.camera.flyTo({
|