From 92ab617a9f80a4a4ad4ba633d728bae85142c989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Wed, 30 Oct 2024 14:31:14 +0800 Subject: [PATCH] =?UTF-8?q?leaflet.js=E5=AE=9E=E7=8E=B0=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=BB=98=E5=88=B6/=E7=BC=96=E8=BE=91=E5=A4=9A=E8=BE=B9?= =?UTF-8?q?=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/main.js | 1 + src/router/index.js | 7 +++ src/views/drawMap.vue | 137 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 src/views/drawMap.vue diff --git a/package.json b/package.json index ef3545a..66d9190 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", "leaflet": "^1.9.4", + "leaflet-draw": "^1.0.4", "moment": "^2.30.1", "nprogress": "0.2.0", "postcss-px-to-viewport": "^1.1.1", diff --git a/src/main.js b/src/main.js index b91e1c6..0fa4d53 100644 --- a/src/main.js +++ b/src/main.js @@ -27,6 +27,7 @@ L.Icon.Default.mergeOptions({ iconUrl: require("leaflet/dist/images/marker-icon.png"), shadowUrl: require("leaflet/dist/images/marker-shadow.png"), }); +import "leaflet-draw/dist/leaflet.draw.css"; import "./assets/icons"; // icon import "./permission"; // permission control diff --git a/src/router/index.js b/src/router/index.js index 4b92a3c..8c882d8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -87,6 +87,13 @@ export const constantRoutes = [ meta: { title: "商铺", icon: "dashboard", affix: false }, hidden: true, }, + { + path: "/drawMap", + component: () => import("@/views/drawMap"), + name: "drawMap", + meta: { title: "商铺", icon: "dashboard", affix: false }, + hidden: true, + }, { path: "/xiaoqu", component: () => import("@/views/xiaoqu"), diff --git a/src/views/drawMap.vue b/src/views/drawMap.vue new file mode 100644 index 0000000..f04ce3b --- /dev/null +++ b/src/views/drawMap.vue @@ -0,0 +1,137 @@ + + + + +