2026-04-21 19:50:57 +08:00
|
|
|
import { useStatusStore } from '@/stores/useStatusStore.ts';
|
|
|
|
|
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils.ts';
|
2026-04-18 17:34:46 +08:00
|
|
|
import config from '@/config/config.json';
|
2026-04-21 19:50:57 +08:00
|
|
|
import { useButtonSelectedIdStore } from '@/stores/useButtonSelectedIdStore';
|
2026-04-18 17:34:46 +08:00
|
|
|
|
|
|
|
|
export const useRightHandle = () => {
|
|
|
|
|
/**
|
|
|
|
|
* 重置场景
|
|
|
|
|
*/
|
|
|
|
|
const resetScene = () => {
|
|
|
|
|
CesiumUtilsSingleton.clearAllResources('custom');
|
|
|
|
|
useStatusStore().resetScene();
|
2026-04-21 19:50:57 +08:00
|
|
|
useButtonSelectedIdStore().resetId();
|
2026-04-18 17:34:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 重置视角
|
|
|
|
|
*/
|
|
|
|
|
const resetView = () => {
|
|
|
|
|
CesiumUtilsSingleton.flyToTarget(
|
|
|
|
|
config.defaultPosition as [number, number, number]
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return { resetScene, resetView };
|
|
|
|
|
};
|