规范化操作
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils';
|
||||
import { useRiskPoint } from '@/hooks/rain-earthquake/useRiskPoint';
|
||||
import { LoadingResource } from '@/types/common/LoadingResourceType';
|
||||
import { useLoadingResourceStore } from '@/stores/useLoadingResourceStore';
|
||||
|
||||
const riskPoints = ref<Point[]>([]);
|
||||
|
||||
@@ -88,6 +89,26 @@
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听显示隐藏风险点
|
||||
watch(
|
||||
() => useStatusStore().mapLayers.riskPointShow.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(
|
||||
LoadingResource.RISK_POINT
|
||||
)
|
||||
);
|
||||
} else {
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(
|
||||
LoadingResource.RISK_POINT
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user