From f2a33888b1462275bf8f24aa4c66722cafb053ad Mon Sep 17 00:00:00 2001 From: lyf <2514544224@qq.com> Date: Tue, 30 Jun 2026 09:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E5=A4=96?= =?UTF-8?q?=E8=A7=82=E6=A8=A1=E5=9E=8B=E9=A6=96=E6=AC=A1=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/map/ThreeMap.vue | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/components/map/ThreeMap.vue b/src/components/map/ThreeMap.vue index d0b98ed..b05f21b 100644 --- a/src/components/map/ThreeMap.vue +++ b/src/components/map/ThreeMap.vue @@ -2248,6 +2248,19 @@ const zoomCamera = (direction: 'in' | 'out', options: { source?: ZoomCameraSourc const shouldTrackUserZoom = options.source === 'button' + if (shouldTrackUserZoom && direction === 'in' && activeView.value === 'overview') { + const now = Date.now() + if (!isOverviewEntryIntentActive(now)) { + overviewEntryIntentStartedAt = now + overviewEntryStartDistance = currentDistance + overviewEntryZoomInRounds = 0 + } + overviewEntryIntentStartedAt = now + overviewEntryZoomInRounds += 1 + overviewWheelZoomInRounds += 1 + overviewWheelZoomIntentUntil = now + 900 + } + offset.setLength(nextDistance) const nextPosition = controls.target.clone().add(offset) moveCameraTo(nextPosition, controls.target, { @@ -2255,11 +2268,39 @@ const zoomCamera = (direction: 'in' | 'out', options: { source?: ZoomCameraSourc }) if (shouldTrackUserZoom) { lastControlDistance = currentDistance + checkAutoSwitch({ + forceOverviewEntry: direction === 'in' && activeView.value === 'overview' + }) } handleControlChange() } +const loadCurrentFloorPoiMarkers = async (loadToken: number) => { + if (!shouldRenderPoiMarkers.value) return + + const floor = floorIndex.value.find((item) => item.floorId === currentFloor.value) || floorIndex.value[0] + if (!floor) return + + await loadFloorPOIs(floor, loadToken) + assertCurrentModelLoad(loadToken) +} + +const loadCurrentFloorPoiMarkersInBackground = (loadToken: number) => { + if (!shouldRenderPoiMarkers.value) return + + void loadCurrentFloorPoiMarkers(loadToken) + .then(() => { + if (!isCurrentModelLoad(loadToken)) return + refreshPoiVisibilityByDistance() + renderRoutePreview() + }) + .catch((error) => { + if (isStaleModelLoadError(error)) return + console.warn('馆内外观点位标记后台加载失败:', error) + }) +} + const loadOverview = async () => { const packageData = renderPackage.value if (!packageData || !scene) return @@ -2278,6 +2319,7 @@ const loadOverview = async () => { cacheAutoSwitchOverviewMaxDim(activeModel) targetScene.add(activeModel) fitCameraToObject(activeModel) + loadCurrentFloorPoiMarkersInBackground(loadToken) resetAutoSwitchDistanceTracking() refreshPoiVisibilityByDistance() renderRoutePreview() @@ -2304,6 +2346,7 @@ const loadOverview = async () => { cachedSharedModelUrl = packageData.overviewModelUrl targetScene.add(activeModel) fitCameraToObject(activeModel) + loadCurrentFloorPoiMarkersInBackground(loadToken) resetAutoSwitchDistanceTracking() refreshPoiVisibilityByDistance() renderRoutePreview()