From aec00ecc093be803860c8675cbe1c4c776a7cb4e Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Tue, 19 Mar 2024 17:49:21 +0800
Subject: [PATCH] update: 新建航线、事件编辑、kmz文件问题修改
---
src/store/map.ts | 37 ++++++++++++++++++++++++++++++++++---
1 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/src/store/map.ts b/src/store/map.ts
index cf6b163..e20f151 100644
--- a/src/store/map.ts
+++ b/src/store/map.ts
@@ -1,5 +1,36 @@
-const map = {
- state: {
-
+import { MutationTree } from 'vuex'
+interface longitude {
+ longitude:number
+ latitude: number
+}
+const state = () => ({
+ // 项目中心点设置
+ centerConfig: {
+ // true为开启在地图中获取坐标
+ type: false,
+ latitude: null as number | null,
+ longitude: null as number | null,
+ },
+ // 项目列表中在地图中展示中心点
+ pointList: [] as longitude[] | [],
+})
+export type RootStateType = ReturnType<typeof state>
+const mutations: MutationTree<RootStateType> = {
+ // 开启设置地图坐标标识
+ SET_CENTER_CONFIG_TYPE (state, type: boolean) {
+ state.centerConfig.type = type
+ },
+ // 设置经纬度
+ SET_CENTER_CONFIG_LATITUDE (state, data:longitude) {
+ state.centerConfig.longitude = data.longitude
+ state.centerConfig.latitude = data.latitude
+ },
+ // 设置项目列表中的中心点
+ SET_POINT_LIST (state, data: longitude[]) {
+ state.pointList = data
}
}
+export default {
+ state,
+ mutations
+}
--
Gitblit v1.9.3