| | |
| | | maximumLevel: 50, |
| | | }) |
| | | const dimension = ref(3) |
| | | const store = useMyStore() |
| | | let store = null |
| | | const _init = () => { |
| | | store = useMyStore() |
| | | |
| | | // Cesium Token |
| | | const cesiumToken = import.meta.env.VITE_CESIUM_TOKEN |
| | | Cesium.Ion.defaultAccessToken = cesiumToken |
| | |
| | | if (pick && (pick.id._id === sid || pick.id._id.includes(sid))) { |
| | | cb(click, pick, viewer, handler) |
| | | } |
| | | if (sid === '') { |
| | | cb(click, pick, viewer, handler) |
| | | } |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK) |
| | | } |
| | | // 移除左键事件 |
| | |
| | | |
| | | let rightClickHandler: Cesium.ScreenSpaceEventHandler |
| | | const addRightClick = (sid: string, cb: Function) => { |
| | | if (leftClickHandler) { |
| | | if (rightClickHandler) { |
| | | removeRightClickEvent() |
| | | } |
| | | rightClickHandler = new Cesium.ScreenSpaceEventHandler(viewer?.scene.canvas) |