From 36e7064e303670cf1c9dbc0e3987939e469cbc3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E5=BC=80=E5=8D=8A=E4=BA=A9=E5=9C=B0?= <2572468699@qq.com> Date: Tue, 12 Apr 2022 00:01:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 28 +-- src/components/baidu-map/index.vue | 24 +- src/components/control/bm-control/index.vue | 12 +- .../control/bm-navigation3d/index.vue | 4 +- src/components/control/bm-zoom/index.vue | 3 + src/components/overlay/bm-circle/index.vue | 26 ++- src/components/overlay/bm-label/index.vue | 27 ++- src/components/overlay/bm-marker/index.vue | 55 +++-- src/components/overlay/bm-polygon/index.vue | 46 ++-- src/components/overlay/bm-polyline/index.vue | 46 ++-- src/utils/bindEvents.ts | 2 +- src/utils/eventsList.ts | 205 +++++++++--------- 12 files changed, 272 insertions(+), 206 deletions(-) diff --git a/src/App.vue b/src/App.vue index 7d8db84f..55bed943 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,15 +4,10 @@ mapType="BMAP_NORMAL_MAP" :enable-keyboard="false" :zoom="zoom" - @initd="ready1" enableDragging :minZoom="10" - @dblclick="handleClick" > - - - - + /> + + + + - - diff --git a/src/components/control/bm-control/index.vue b/src/components/control/bm-control/index.vue index 3795c087..53f6447d 100644 --- a/src/components/control/bm-control/index.vue +++ b/src/components/control/bm-control/index.vue @@ -29,16 +29,16 @@ offset: () => ({ x: 83, y: 18 }) }) defineEmits(['initd', 'unload']) - useBaseMapEffect((mapInstance: BMapGL.Map) => { + useBaseMapEffect((map: BMapGL.Map) => { if (!controlContainer.value) return const customControl = new window.BMapGL.Control() customControl.defaultAnchor = window[props.anchor] customControl.defaultOffset = new window.BMapGL.Size(props.offset!.x, props.offset!.y) - customControl.initialize = (map: BMapGL.Map) => { - return map.getContainer().appendChild(controlContainer.value as Node) as HTMLElement + customControl.initialize = (_map: BMapGL.Map) => { + return _map.getContainer().appendChild(controlContainer.value as Node) as HTMLElement } - mapInstance.addControl(customControl) - ready(mapInstance) - return () => mapInstance.removeControl(customControl) + map.addControl(customControl) + ready(map) + return () => map.removeControl(customControl) }) diff --git a/src/components/control/bm-navigation3d/index.vue b/src/components/control/bm-navigation3d/index.vue index 68532837..6d5c9f86 100644 --- a/src/components/control/bm-navigation3d/index.vue +++ b/src/components/control/bm-navigation3d/index.vue @@ -5,6 +5,7 @@ diff --git a/src/components/control/bm-zoom/index.vue b/src/components/control/bm-zoom/index.vue index 592e93fc..c882bda7 100644 --- a/src/components/control/bm-zoom/index.vue +++ b/src/components/control/bm-zoom/index.vue @@ -5,6 +5,7 @@ diff --git a/src/components/overlay/bm-circle/index.vue b/src/components/overlay/bm-circle/index.vue index 8a58171c..75ecd73c 100644 --- a/src/components/overlay/bm-circle/index.vue +++ b/src/components/overlay/bm-circle/index.vue @@ -4,6 +4,8 @@