feat: 添加工具插件

This commit is contained in:
2026-06-25 14:01:48 +08:00
parent 882aa21cb3
commit 98d1cebd20
2 changed files with 6 additions and 0 deletions

View File

@@ -100,6 +100,11 @@ export function useAmap(options: AMap.MapOptions = {}) {
...options, ...options,
}) })
// 添加缩放工具条(右上角)
mapInstance.value.addControl(new AMap.ToolBar({
position: 'RT',
}))
return mapInstance.value return mapInstance.value
} catch (err: any) { } catch (err: any) {
error.value = err.message || '地图初始化失败' error.value = err.message || '地图初始化失败'

View File

@@ -23,4 +23,5 @@ export const AMAP_PLUGINS = [
'AMap.Geolocation', // 定位 'AMap.Geolocation', // 定位
'AMap.MarkerClusterer', // 点聚合 'AMap.MarkerClusterer', // 点聚合
'AMap.Driving', // 驾车路线规划 'AMap.Driving', // 驾车路线规划
'AMap.ToolBar', // 缩放工具条
] as const ] as const