From ddd6bd55557b059cb78d820be03cf8149cba68c5 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Wed, 09 Apr 2025 10:02:01 +0800
Subject: [PATCH] feat: 返回当前定位

---
 src/views/Home/useMapAggregation/useMapAggregation.js |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/views/Home/useMapAggregation/useMapAggregation.js b/src/views/Home/useMapAggregation/useMapAggregation.js
index 432d330..7cf680d 100644
--- a/src/views/Home/useMapAggregation/useMapAggregation.js
+++ b/src/views/Home/useMapAggregation/useMapAggregation.js
@@ -208,9 +208,22 @@
     const outlineGJson = await getOutLine(jsonPathPre, hierarchy)
     scalingJudgment.forEach(item => item.show && (item.outline = outlineGJson))
     const [longitude, latitude] = outlineGJson.features[0].properties.centroid
-    flyTo({ longitude, latitude }, 0, scalingJudgment[(hierarchy.length - 3) * (-1)].height)
+    const height = scalingJudgment[(hierarchy.length - 3) * (-1)].height
+    setCenterPosition({longitude, latitude,height})
+    flyTo({ longitude, latitude }, 0, height)
   }
 
+  const userAreaPosition = computed(() => store.state.home.userAreaPosition);
+
+  const setCenterPosition = (position) => {
+    store.commit('setCurrentAreaPosition', position)
+		if (!userAreaPosition.value.longitude){
+			store.commit('setUserAreaPosition', position)
+		}
+  }
+
+
+
   watch(
     selectedAreaCode,
     async (newValue, oldValue) => {

--
Gitblit v1.9.3