From 1a452b6708a442915899d2ddf8288e28fd63bfbc Mon Sep 17 00:00:00 2001 From: wangjuncheng <1> Date: 星期日, 20 四月 2025 17:57:09 +0800 Subject: [PATCH] change --- src/views/mnfz.vue | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/views/mnfz.vue b/src/views/mnfz.vue index c8b562d..13ba119 100644 --- a/src/views/mnfz.vue +++ b/src/views/mnfz.vue @@ -25,10 +25,10 @@ import DebuffDetail from "@/components/tools/DebuffDetail.vue"; import DebuffTable from "@/components/tools/DebuffTable.vue"; import { getMaxInfluenceArea } from "@/api/index"; - import { createPoint, geomToGeoJSON } from "@/utils/map.js"; import colors from "@/assets/img/left/colors3.png"; +import danger from "@/assets/img/left/danger.png"; import { checkedKeys } from "@/store/index"; const waterSimulateParams = ref({}); const showWaterSimulate = ref(false); @@ -49,6 +49,7 @@ waterSimulateParams.value = form; } function endSimulate() { + showDebuffDetail.value = false clearTrailLine(); removeDataSources(); @@ -60,16 +61,35 @@ const MaxInfluenceAreaList = ref([]); const dataSources = []; function getTimeMarkers() { - // 灏� list 鏁版嵁鐨� geom EPSG:4548 鍧愭爣杞崲涓� WGS84 鍧愭爣绯荤殑 GeoJSON 鏁版嵁 + // 灏� list 鏁版嵁鐨� geom EPSG:4326 鍧愭爣杞崲涓� WGS84 鍧愭爣绯荤殑 GeoJSON 鏁版嵁 const list = MaxInfluenceAreaList.value; list.forEach((item, index) => { - const geojson = geomToGeoJSON(item.geom); + const geojson = JSON.parse(item.geom); // 瑙f瀽 geom 瀛楁涓� GeoJSON 瀵硅薄 Cesium.GeoJsonDataSource.load(geojson).then((dataSource) => { // 璁剧疆鏍峰紡锛屽皢棰滆壊鏀逛负绾㈣壊 dataSource.entities.values.forEach((entity) => { - entity.polygon.material = new Cesium.Color(1.0, 0.0, 0.0, 0.6); // 绾㈣壊锛�80% 涓嶉�忔槑搴� + // entity.polygon.material = new Cesium.Color(1.0, 0.0, 0.0, 0.6); // 绾㈣壊锛�80% 涓嶉�忔槑搴� + // entity.polygon.material = new Cesium.Color.YELLOW; // 绾㈣壊锛�80% 涓嶉�忔槑搴� entity.polygon.outlineColor = Cesium.Color.YELLOW; entity.polygon.outline = true; + + // 浣跨敤鎻愪緵鐨� X, Y, Z 鍧愭爣浣滀负鍥炬爣浣嶇疆 + const position = Cesium.Cartesian3.fromDegrees(item.X, item.Y, item.Z); + + // 鍦ㄤ腑蹇冪偣涓婃柟娣诲姞涓�涓浘鏍囧疄浣� + const billboardEntity = viewer.entities.add({ + position: position, + billboard: { + image: danger, // 鍥炬爣鐨勮矾寰� + scale: 1.0, // 鍥炬爣缂╂斁姣斾緥 + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 鍥炬爣搴曢儴瀵归綈鍒颁腑蹇冪偣 + heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, // 鍥炬爣璐村湴 + distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1500), // 鎺у埗鍙璺濈鑼冨洿 (0绫冲埌1500绫�) + }, + }); + + // 灏嗗浘鏍囧疄浣撲笌褰撳墠鏁版嵁婧愬叧鑱� + dataSource.entities.add(billboardEntity); }); // 娣诲姞鏁版嵁婧愬埌 viewer -- Gitblit v1.9.3