From 0c92fd00fae033a2aa04bb65b2d32bd2c8f9fd4a Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Wed, 04 Feb 2026 15:48:34 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
applications/task-work-order/src/components/map-container/common-cesium-map.vue | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/applications/task-work-order/src/components/map-container/common-cesium-map.vue b/applications/task-work-order/src/components/map-container/common-cesium-map.vue
index 02eb8e5..47d6ad1 100644
--- a/applications/task-work-order/src/components/map-container/common-cesium-map.vue
+++ b/applications/task-work-order/src/components/map-container/common-cesium-map.vue
@@ -66,6 +66,22 @@
let initialized = false
let removeCameraListener = null
+
+const preventDefault = event => {
+ event.preventDefault()
+ return
+}
+
+const cesiumContextMenu = (isAdd = true) => {
+ let cesium = document.getElementById(mapId)
+ if (!cesium) return
+ if (isAdd) {
+ cesium.addEventListener('contextmenu', preventDefault)
+ } else {
+ cesium.removeEventListener('contextmenu', preventDefault)
+ }
+}
+
const initMap = async () => {
if (initialized) return
initialized = true
@@ -77,9 +93,9 @@
boundary: props.boundary,
contour: props.contour,
})
+ cesiumContextMenu(true)
viewer.value = viewInstance.value.getViewer()
if (props.showAdminBoundary) {
- console.log(props.zoomToBoundary,'props.zoomToBoundary')
adminBoundarySources = await loadJaAdminBoundary(viewer.value, {
zoomTo: props.zoomToBoundary,
})
@@ -119,13 +135,15 @@
if (removeCameraListener) removeCameraListener()
removeJaAdminBoundary(viewer.value, adminBoundarySources)
viewInstance.value?.viewerDestroy?.()
+ cesiumContextMenu(false)
})
const getMap = () => ({ viewer: viewer.value, publicCesium: viewInstance.value })
const getViewer = () => viewer.value
const getPublicCesium = () => viewInstance.value
+const flyBoundary = () => adminBoundarySources.flyBoundary()
-defineExpose({ getMap, getViewer, getPublicCesium })
+defineExpose({ getMap, getViewer, getPublicCesium,flyBoundary })
</script>
<style scoped lang="scss">
--
Gitblit v1.9.3