From 3667807a7b7418efc090ee3fa6a6b734bc3080bf Mon Sep 17 00:00:00 2001
From: xieb <vip_xiaobin810@163.com>
Date: Wed, 13 Sep 2023 20:36:29 +0800
Subject: [PATCH] Merge branch 'develop' of http://s16s652780.51mypc.cn:49896/r/yskj/iot_drone_web into develop

---
 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