From 575429031e6d2b90394e047b4ff38b541935c1b5 Mon Sep 17 00:00:00 2001 From: wujingjing <gersonwu@qq.com> Date: 星期三, 15 一月 2025 18:02:14 +0800 Subject: [PATCH] OLMap --- src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue | 39 ++++++++++++++++++++++----------------- 1 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue index cd110df..d278978 100644 --- a/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue +++ b/src/components/chat/chatComponents/summaryCom/components/recordSetTable/map/Map.vue @@ -46,7 +46,7 @@ <!-- Teleport 鍏ㄥ睆鍦板浘 --> <Teleport to=".layout-parent"> <Transition name="fullscreen"> - <div v-if="isFullscreen" class="absolute inset-0 z-50 w-full h-full"> + <div v-show="isFullscreen" class="absolute inset-0 z-50 w-full h-full"> <div ref="fullscreenContainerRef" class="w-full h-full"></div> <div class="absolute right-2 top-2 cursor-pointer" @click="toggleFullScreen"> <el-tooltip content="閫�鍑哄叏灞忥紙Esc锛�" placement="top"> @@ -160,22 +160,6 @@ }, }); }; - -// 鍒囨崲鍏ㄥ睆 -const toggleFullScreen = async () => { - isFullscreen.value = !isFullscreen.value; - - // 绛夊緟 DOM 鏇存柊瀹屾垚 - await nextTick(); - // 閲嶆柊鍒濆鍖栧湴鍥� - if (isFullscreen.value) { - closeInfoWindow(); - await initMap(fullscreenContainerRef.value); - } else { - // await initMap(containerRef.value); - } -}; - // 鍒濆鍖栧湴鍥� const initMap = async (container: HTMLDivElement) => { olMap = new OLMap({ @@ -185,6 +169,27 @@ infoWindowOverlay = olMap.createEleOverlay(infoWindowRef.value); olMap.map.addOverlay(infoWindowOverlay); }; +let hasInitFullscreen = false; +// 鍒囨崲鍏ㄥ睆 +const toggleFullScreen = async () => { + isFullscreen.value = !isFullscreen.value; + + // 绛夊緟 DOM 鏇存柊瀹屾垚 + await nextTick(); + // 閲嶆柊鍒濆鍖栧湴鍥� + if (isFullscreen.value) { + closeInfoWindow(); + if (!hasInitFullscreen) { + await initMap(fullscreenContainerRef.value); + hasInitFullscreen = true; + } else { + olMap.map.addOverlay(infoWindowOverlay); + } + } else { + olMap.map.addOverlay(infoWindowOverlay); + } +}; + //#region ====================== 璁惧鏇茬嚎 ====================== const chartDlgIsShow = ref(false); const equipCurveMapRow = ref(null); -- Gitblit v1.9.3