显示隐藏脉冲
This commit is contained in:
@@ -53,8 +53,7 @@
|
||||
// 进行模型计算
|
||||
$api.rainfall
|
||||
.modelDeduction({
|
||||
disaster_name: `${Utils.formatDate('YYYYMMDDHHmmss', new Date('2025-09-16 20:00:00'))}暴雨自动推演`,
|
||||
occurred_time: '2025-09-16 20:00:00',
|
||||
disaster_name: `${Utils.formatDate('YYYYMMDDHHmmss')}暴雨自动推演`,
|
||||
operation_type: '暴雨灾害链自动推演',
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
@@ -25,6 +25,9 @@ export const useRightHandle = () => {
|
||||
|
||||
// 添加图例
|
||||
rainstormDeduction.addLegend();
|
||||
|
||||
// 如果有脉冲,显示脉冲
|
||||
CesiumUtilsSingleton.showPulseEffects();
|
||||
} else {
|
||||
// 关闭暴雨模拟:隐藏降雨栅格图层
|
||||
statusStore.weatherLayers.showRainfallGrid.show = false;
|
||||
@@ -35,8 +38,8 @@ export const useRightHandle = () => {
|
||||
// 隐藏步骤条
|
||||
statusStore.uiComponents.stepBar.show = false;
|
||||
|
||||
// 删除脉冲
|
||||
CesiumUtilsSingleton.removeAllPulses();
|
||||
// 隐藏脉冲
|
||||
CesiumUtilsSingleton.hidePulseEffects();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
Color,
|
||||
JulianDate,
|
||||
CallbackProperty,
|
||||
ConstantProperty,
|
||||
HeightReference,
|
||||
VerticalOrigin,
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ===================== 私有方法 =====================
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user