From aca5e39d1882ef572a9858d5ca3330185d587664 Mon Sep 17 00:00:00 2001 From: TimSpan Date: Wed, 16 Oct 2024 15:02:31 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + package-lock.json | 9 + package.json | 1 + src/main.ts | 8 +- src/types/leaflet.d.ts | 1 - src/views/page/offLineMap.vue | 401 +++++++++++++++++++++++++--------- tsconfig.json | 3 + 7 files changed, 320 insertions(+), 104 deletions(-) delete mode 100644 src/types/leaflet.d.ts diff --git a/.gitignore b/.gitignore index 334d93ba..bf7300cd 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ target/ *.ipr ### VS Code ### +public/roadmap *.log npm-debug.log* yarn-debug.log* diff --git a/package-lock.json b/package-lock.json index 3058c687..2d737d22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "js-md5": "^0.8.3", "jwt-decode": "^3.1.2", "leaflet": "^1.9.4", + "leaflet.markercluster": "^1.5.3", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "nprogress": "^0.2.0", @@ -3035,6 +3036,14 @@ "resolved": "https://registry.npmmirror.com/leaflet/-/leaflet-1.9.4.tgz", "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==" }, + "node_modules/leaflet.markercluster": { + "version": "1.5.3", + "resolved": "https://registry.npmmirror.com/leaflet.markercluster/-/leaflet.markercluster-1.5.3.tgz", + "integrity": "sha512-vPTw/Bndq7eQHjLBVlWpnGeLa3t+3zGiuM7fJwCkiMFq+nmRuG3RI3f7f4N4TDX7T4NpbAXpR2+NTRSEGfCSeA==", + "peerDependencies": { + "leaflet": "^1.3.1" + } + }, "node_modules/less": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/less/-/less-4.2.0.tgz", diff --git a/package.json b/package.json index 7b534904..b8c16367 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "js-md5": "^0.8.3", "jwt-decode": "^3.1.2", "leaflet": "^1.9.4", + "leaflet.markercluster": "^1.5.3", "lodash": "^4.17.21", "lodash-es": "^4.17.21", "nprogress": "^0.2.0", diff --git a/src/main.ts b/src/main.ts index c7fbda94..e808a485 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,7 +11,7 @@ import lodasha from 'lodash'; import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' import zhCn from 'element-plus/dist/locale/zh-cn.mjs'; - +// import '@types/leaflet' // 高德地图typescript支持 import "@amap/amap-jsapi-types"; // vue Router @@ -35,13 +35,13 @@ import "@/assets/iconfont/iconfont.css"; //自定义指令 import vCopy from "@/directives/copy"; const vueApp = createApp(App); -vueApp.config.globalProperties.day=dayjs//全局挂载 -vueApp.config.globalProperties.lodash=lodasha//全局挂载 +vueApp.config.globalProperties.day = dayjs//全局挂载 +vueApp.config.globalProperties.lodash = lodasha//全局挂载 vueApp.directive('copy', vCopy) import * as ElementPlusIconsVue from '@element-plus/icons-vue' for (const [key, component] of Object.entries(ElementPlusIconsVue)) { - vueApp.component(key, component) + vueApp.component(key, component) } vueApp diff --git a/src/types/leaflet.d.ts b/src/types/leaflet.d.ts deleted file mode 100644 index 8b8ee732..00000000 --- a/src/types/leaflet.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'leaflet'; \ No newline at end of file diff --git a/src/views/page/offLineMap.vue b/src/views/page/offLineMap.vue index 0fbe38de..c441c5e2 100644 --- a/src/views/page/offLineMap.vue +++ b/src/views/page/offLineMap.vue @@ -370,8 +370,13 @@