关闭自动推演时候清除脉冲实体
This commit is contained in:
@@ -34,6 +34,9 @@ export const useRightHandle = () => {
|
|||||||
|
|
||||||
// 隐藏步骤条
|
// 隐藏步骤条
|
||||||
statusStore.uiComponents.stepBar.show = false;
|
statusStore.uiComponents.stepBar.show = false;
|
||||||
|
|
||||||
|
// 删除脉冲
|
||||||
|
CesiumUtilsSingleton.removeAllPulses();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ export class CesiumUtils {
|
|||||||
this.clearAllPrimitives(clearType);
|
this.clearAllPrimitives(clearType);
|
||||||
this.clearAllLayers(clearType);
|
this.clearAllLayers(clearType);
|
||||||
this.clearAllGeoJsonLayers(clearType);
|
this.clearAllGeoJsonLayers(clearType);
|
||||||
this.#removeAllPulses();
|
this.removeAllPulses();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===================== getter 和 setter函数 =====================
|
// ===================== getter 和 setter函数 =====================
|
||||||
@@ -637,7 +637,7 @@ export class CesiumUtils {
|
|||||||
if (!viewer) return;
|
if (!viewer) return;
|
||||||
|
|
||||||
// 移除已有脉冲
|
// 移除已有脉冲
|
||||||
this.#removeAllPulses();
|
this.removeAllPulses();
|
||||||
|
|
||||||
// 生成圆形贴图
|
// 生成圆形贴图
|
||||||
if (!this.#pulseCircleImage) {
|
if (!this.#pulseCircleImage) {
|
||||||
@@ -665,6 +665,15 @@ export class CesiumUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除所有脉冲实体
|
||||||
|
*/
|
||||||
|
removeAllPulses(): void {
|
||||||
|
for (const key of Object.keys(this.#pulseMap)) {
|
||||||
|
this.#deletePulseEntity(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===================== 私有方法 =====================
|
// ===================== 私有方法 =====================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -720,7 +729,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) => {
|
||||||
@@ -751,15 +760,6 @@ export class CesiumUtils {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 移除所有脉冲实体
|
|
||||||
*/
|
|
||||||
#removeAllPulses(): void {
|
|
||||||
for (const key of Object.keys(this.#pulseMap)) {
|
|
||||||
this.#deletePulseEntity(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除单个脉冲实体
|
* 删除单个脉冲实体
|
||||||
* @param key - 脉冲映射 key
|
* @param key - 脉冲映射 key
|
||||||
|
|||||||
Reference in New Issue
Block a user