From ae5f9eb13c2b24fddda49288f26274d99b7a085a Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 06 Aug 2025 00:11:35 +0800
Subject: [PATCH] 地图增加周边检索
---
src/store/map.js | 73 +++++++++++++++++++++++-------------
1 files changed, 47 insertions(+), 26 deletions(-)
diff --git a/src/store/map.js b/src/store/map.js
index 0788449..5b32919 100644
--- a/src/store/map.js
+++ b/src/store/map.js
@@ -2,7 +2,7 @@
* @Author: shuishen 1109946754@qq.com
* @Date: 2024-10-28 18:24:16
* @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2025-02-12 18:21:51
+ * @LastEditTime: 2025-07-31 20:29:37
* @FilePath: \bigScreen\src\store\map.js
* @Description:
*
@@ -12,36 +12,57 @@
import { defineStore } from 'pinia'
export const useMap = defineStore('map', {
- // 存储状态的地方,相当于 Vuex 的 state
- state: () => ({
- loadMap: false,
- pointHeight: 64,
- editPoint: false,
- startCustomWx: false,
- showPreLevel: false,
- }),
+ // 存储状态的地方,相当于 Vuex 的 state
+ state: () => ({
+ loadMap: false,
+ pointHeight: 64,
+ editPoint: false,
+ startCustomWx: false,
+ showPreLevel: false,
- // 相当于 Vuex 的 getters,用于计算状态
- getters: {
+ rimPosition: {
+ lng: '',
+ lat: '',
+ alt: ''
+ }
+ }),
- },
+ // 相当于 Vuex 的 getters,用于计算状态
+ getters: {
- // 相当于 Vuex 的 mutations 和 actions,用于同步或异步地修改状态
- actions: {
- setLoadMap (flag) {
- this.loadMap = flag
},
- setEditPoint (flag) {
- this.editPoint = flag
+ // 相当于 Vuex 的 mutations 和 actions,用于同步或异步地修改状态
+ actions: {
+ setLoadMap (flag) {
+ this.loadMap = flag
+ },
+
+ setEditPoint (flag) {
+ this.editPoint = flag
+ },
+
+ setStartCustomWx (flag) {
+ this.startCustomWx = flag
+ },
+
+ setShowPreLevel (flag) {
+ this.showPreLevel = flag
+ },
+
+ setRimPosition (rimPosition) {
+ this.rimPosition = rimPosition
+ }
},
- setStartCustomWx (flag) {
- this.startCustomWx = flag
- },
-
- setShowPreLevel (flag) {
- this.showPreLevel = flag
- },
- }
+ persist: {
+ enabled: true,
+ strategies: [
+ {
+ key: 'rimPosition',
+ paths: ['rimPosition'],
+ storage: localStorage,
+ }
+ ]
+ }
})
--
Gitblit v1.9.3