diff --git a/src/types/amap.d.ts b/src/types/amap.d.ts index 6258309..dbc6102 100644 --- a/src/types/amap.d.ts +++ b/src/types/amap.d.ts @@ -26,6 +26,7 @@ declare namespace AMap { pitch?: number rotation?: number zoom?: number + zooms?: [number, number] center?: [number, number] mapStyle?: string features?: string[] diff --git a/src/views/map/MapView.vue b/src/views/map/MapView.vue index d654ca0..5ed6484 100644 --- a/src/views/map/MapView.vue +++ b/src/views/map/MapView.vue @@ -405,6 +405,7 @@ onMounted(async () => { pitch: 0, rotation: 0, zoom: 5, + zooms: [4, 18], center: [104.07, 30.67], mapStyle: 'amap://styles/normal', features: ['bg', 'road', 'building', 'point'], @@ -415,7 +416,7 @@ onMounted(async () => { mapInst.addControl(new AMapLib.Scale()) mapInst.addControl(new AMapLib.ToolBar({ position: 'LT' } as Record)) - mapInst.addControl(new AMapLib.ControlBar({ position: { right: '10px', top: '80px' } } as Record)) + mapInst.addControl(new AMapLib.ControlBar({ position: { right: '50px', bottom: '224px' } } as Record)) mapInst.on('click', () => { previewCloud.value = null; hideHoverCard() }) mapInst.on('zoomstart', hideHeader) mapInst.on('movestart', hideHeader) @@ -442,7 +443,7 @@ onUnmounted(() => {
-
+