-
-
-
+
次季节台风预报系统
-
-
-
-
-
-
-
- 地图设置
-
- 选择日期和渲染方式
-
-
-
-
-
-
diff --git a/src/pages/map.vue b/src/pages/map.vue
index c113107..47cd03f 100644
--- a/src/pages/map.vue
+++ b/src/pages/map.vue
@@ -14,7 +14,7 @@ const previousLayer = ref
(null)
const apiKey = import.meta.env.VITE_AMAP_API_KEY
-const { options } = useOptions()
+const { options, currentFocus } = useOptions()
watch(options, async () => {
if (!map.value || !amapInstance.value) {
@@ -26,6 +26,16 @@ watch(options, async () => {
updateMap()
})
+watch(currentFocus, (newFocus) => {
+ if (!newFocus) {
+ return
+ }
+ const [lat, lon] = newFocus()
+ // debugger
+ map.value?.setCenter([lat, lon - 35])
+ map.value?.setZoom(4)
+})
+
function updateMap() {
if (!map.value || !amapInstance.value) {
return