|
@@ -108,7 +108,7 @@ import { WindLayer } from "cesium-wind";
|
|
|
import windGridData from "./windGridData.json";
|
|
import windGridData from "./windGridData.json";
|
|
|
import { HeightReference } from "cesium";
|
|
import { HeightReference } from "cesium";
|
|
|
|
|
|
|
|
-import AdvancedBillboardGenerator from "@/tools/lightsign.js"
|
|
|
|
|
|
|
+import AdvancedBillboardGenerator from "@/tools/lightsign.js";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "windMap3D",
|
|
name: "windMap3D",
|
|
@@ -606,36 +606,36 @@ export default {
|
|
|
|
|
|
|
|
this.dixingAdd = true;
|
|
this.dixingAdd = true;
|
|
|
|
|
|
|
|
- const btn = document.getElementById("windBtn")
|
|
|
|
|
|
|
+ const btn = document.getElementById("windBtn");
|
|
|
|
|
|
|
|
- btn.addEventListener('click', function(event) {
|
|
|
|
|
|
|
+ btn.addEventListener("click", function (event) {
|
|
|
entityxy.show = !entityxy.show;
|
|
entityxy.show = !entityxy.show;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- // viewer.camera.moveEnd.addEventListener(() => {
|
|
|
|
|
- // // 获取相机的笛卡尔3D坐标
|
|
|
|
|
- // const position = viewer.camera.position;
|
|
|
|
|
-
|
|
|
|
|
- // // 将笛卡尔坐标转换为地理坐标(弧度)
|
|
|
|
|
- // const cartographic = Cesium.Cartographic.fromCartesian(position);
|
|
|
|
|
-
|
|
|
|
|
- // // 高度(以米为单位)
|
|
|
|
|
- // // 注意:这个高度是相对于WGS84椭球体的高度,不是海拔高度(MSL)
|
|
|
|
|
- // const height = Cesium.Math.toDegrees(cartographic.height);
|
|
|
|
|
- // if (height > 3000000) {
|
|
|
|
|
- // entityxy.show = false;
|
|
|
|
|
- // console.log("entityxy false", entityxy.show);
|
|
|
|
|
- // }
|
|
|
|
|
- // if (height < 3000000) {
|
|
|
|
|
- // entityxy.show = true;
|
|
|
|
|
- // console.log("entityxy true", entityxy.show);
|
|
|
|
|
- // }
|
|
|
|
|
- // // 强制请求一次场景重绘
|
|
|
|
|
- // if (viewer && viewer.scene) {
|
|
|
|
|
- // viewer.scene.requestRender();
|
|
|
|
|
- // }
|
|
|
|
|
- // console.log("相机高度 (椭球体高):", height, "米");
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ // viewer.camera.moveEnd.addEventListener(() => {
|
|
|
|
|
+ // // 获取相机的笛卡尔3D坐标
|
|
|
|
|
+ // const position = viewer.camera.position;
|
|
|
|
|
+
|
|
|
|
|
+ // // 将笛卡尔坐标转换为地理坐标(弧度)
|
|
|
|
|
+ // const cartographic = Cesium.Cartographic.fromCartesian(position);
|
|
|
|
|
+
|
|
|
|
|
+ // // 高度(以米为单位)
|
|
|
|
|
+ // // 注意:这个高度是相对于WGS84椭球体的高度,不是海拔高度(MSL)
|
|
|
|
|
+ // const height = Cesium.Math.toDegrees(cartographic.height);
|
|
|
|
|
+ // if (height > 3000000) {
|
|
|
|
|
+ // entityxy.show = false;
|
|
|
|
|
+ // console.log("entityxy false", entityxy.show);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (height < 3000000) {
|
|
|
|
|
+ // entityxy.show = true;
|
|
|
|
|
+ // console.log("entityxy true", entityxy.show);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // // 强制请求一次场景重绘
|
|
|
|
|
+ // if (viewer && viewer.scene) {
|
|
|
|
|
+ // viewer.scene.requestRender();
|
|
|
|
|
+ // }
|
|
|
|
|
+ // console.log("相机高度 (椭球体高):", height, "米");
|
|
|
|
|
+ // });
|
|
|
|
|
|
|
|
// 创建事件处理器
|
|
// 创建事件处理器
|
|
|
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
|
|
const handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
|