From 98d1cebd208a65142eca753beade582a96f37528 Mon Sep 17 00:00:00 2001 From: cirry <812852553@qq.com> Date: Thu, 25 Jun 2026 14:01:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useAmap.ts | 5 +++++ src/config/amap.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/src/composables/useAmap.ts b/src/composables/useAmap.ts index 76bc182..300d8b5 100644 --- a/src/composables/useAmap.ts +++ b/src/composables/useAmap.ts @@ -100,6 +100,11 @@ export function useAmap(options: AMap.MapOptions = {}) { ...options, }) + // 添加缩放工具条(右上角) + mapInstance.value.addControl(new AMap.ToolBar({ + position: 'RT', + })) + return mapInstance.value } catch (err: any) { error.value = err.message || '地图初始化失败' diff --git a/src/config/amap.ts b/src/config/amap.ts index e59b43f..5570593 100644 --- a/src/config/amap.ts +++ b/src/config/amap.ts @@ -23,4 +23,5 @@ export const AMAP_PLUGINS = [ 'AMap.Geolocation', // 定位 'AMap.MarkerClusterer', // 点聚合 'AMap.Driving', // 驾车路线规划 + 'AMap.ToolBar', // 缩放工具条 ] as const