显示隐藏脉冲

This commit is contained in:
wzy-warehouse
2026-06-16 10:32:25 +08:00
parent 13a992a8bb
commit 863340d27c
3 changed files with 43 additions and 8 deletions
@@ -53,8 +53,7 @@
// 进行模型计算 // 进行模型计算
$api.rainfall $api.rainfall
.modelDeduction({ .modelDeduction({
disaster_name: `${Utils.formatDate('YYYYMMDDHHmmss', new Date('2025-09-16 20:00:00'))}暴雨自动推演`, disaster_name: `${Utils.formatDate('YYYYMMDDHHmmss')}暴雨自动推演`,
occurred_time: '2025-09-16 20:00:00',
operation_type: '暴雨灾害链自动推演', operation_type: '暴雨灾害链自动推演',
}) })
.then((res) => { .then((res) => {
+5 -2
View File
@@ -25,6 +25,9 @@ export const useRightHandle = () => {
// 添加图例 // 添加图例
rainstormDeduction.addLegend(); rainstormDeduction.addLegend();
// 如果有脉冲,显示脉冲
CesiumUtilsSingleton.showPulseEffects();
} else { } else {
// 关闭暴雨模拟:隐藏降雨栅格图层 // 关闭暴雨模拟:隐藏降雨栅格图层
statusStore.weatherLayers.showRainfallGrid.show = false; statusStore.weatherLayers.showRainfallGrid.show = false;
@@ -35,8 +38,8 @@ export const useRightHandle = () => {
// 隐藏步骤条 // 隐藏步骤条
statusStore.uiComponents.stepBar.show = false; statusStore.uiComponents.stepBar.show = false;
// 删除脉冲 // 隐藏脉冲
CesiumUtilsSingleton.removeAllPulses(); CesiumUtilsSingleton.hidePulseEffects();
} }
}; };
+34 -1
View File
@@ -22,6 +22,7 @@ import {
Color, Color,
JulianDate, JulianDate,
CallbackProperty, CallbackProperty,
ConstantProperty,
HeightReference, HeightReference,
VerticalOrigin, VerticalOrigin,
HorizontalOrigin, HorizontalOrigin,
@@ -674,6 +675,38 @@ export class CesiumUtils {
} }
} }
/**
* 隐藏所有脉冲效果
*/
hidePulseEffects(): void {
const viewer = this.getViewer();
if (!viewer) return;
for (const key of Object.keys(this.#pulseMap)) {
const entry = this.#pulseMap[key];
const entity = viewer.entities.getById(entry.pulseId);
if (entity && entity.billboard) {
entity.billboard.show = new ConstantProperty(false);
}
}
}
/**
* 显示所有脉冲效果
*/
showPulseEffects(): void {
const viewer = this.getViewer();
if (!viewer) return;
for (const key of Object.keys(this.#pulseMap)) {
const entry = this.#pulseMap[key];
const entity = viewer.entities.getById(entry.pulseId);
if (entity && entity.billboard) {
entity.billboard.show = new ConstantProperty(true);
}
}
}
// ===================== 私有方法 ===================== // ===================== 私有方法 =====================
/** /**
@@ -729,7 +762,7 @@ export class CesiumUtils {
viewer.entities.add({ viewer.entities.add({
id: pulseId, id: pulseId,
position: Cartesian3.fromDegrees(lon, lat), position: Cartesian3.fromDegrees(lon, lat),
properties: {pulseKey: key}, properties: { pulseKey: key },
billboard: { billboard: {
image: this.#pulseCircleImage, image: this.#pulseCircleImage,
width: new CallbackProperty((time) => { width: new CallbackProperty((time) => {