#1 大幅改进页面显示效果 #1
Vendored
+1
@@ -26,6 +26,7 @@ declare namespace AMap {
|
|||||||
pitch?: number
|
pitch?: number
|
||||||
rotation?: number
|
rotation?: number
|
||||||
zoom?: number
|
zoom?: number
|
||||||
|
zooms?: [number, number]
|
||||||
center?: [number, number]
|
center?: [number, number]
|
||||||
mapStyle?: string
|
mapStyle?: string
|
||||||
features?: string[]
|
features?: string[]
|
||||||
|
|||||||
@@ -405,6 +405,7 @@ onMounted(async () => {
|
|||||||
pitch: 0,
|
pitch: 0,
|
||||||
rotation: 0,
|
rotation: 0,
|
||||||
zoom: 5,
|
zoom: 5,
|
||||||
|
zooms: [4, 18],
|
||||||
center: [104.07, 30.67],
|
center: [104.07, 30.67],
|
||||||
mapStyle: 'amap://styles/normal',
|
mapStyle: 'amap://styles/normal',
|
||||||
features: ['bg', 'road', 'building', 'point'],
|
features: ['bg', 'road', 'building', 'point'],
|
||||||
@@ -415,7 +416,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
mapInst.addControl(new AMapLib.Scale())
|
mapInst.addControl(new AMapLib.Scale())
|
||||||
mapInst.addControl(new AMapLib.ToolBar({ position: 'LT' } as Record<string, unknown>))
|
mapInst.addControl(new AMapLib.ToolBar({ position: 'LT' } as Record<string, unknown>))
|
||||||
mapInst.addControl(new AMapLib.ControlBar({ position: { right: '10px', top: '80px' } } as Record<string, unknown>))
|
mapInst.addControl(new AMapLib.ControlBar({ position: { right: '50px', bottom: '224px' } } as Record<string, unknown>))
|
||||||
mapInst.on('click', () => { previewCloud.value = null; hideHoverCard() })
|
mapInst.on('click', () => { previewCloud.value = null; hideHoverCard() })
|
||||||
mapInst.on('zoomstart', hideHeader)
|
mapInst.on('zoomstart', hideHeader)
|
||||||
mapInst.on('movestart', hideHeader)
|
mapInst.on('movestart', hideHeader)
|
||||||
@@ -442,7 +443,7 @@ onUnmounted(() => {
|
|||||||
<div class="relative h-[100dvh] min-h-screen">
|
<div class="relative h-[100dvh] min-h-screen">
|
||||||
<div ref="mapEl" class="w-full h-full"></div>
|
<div ref="mapEl" class="w-full h-full"></div>
|
||||||
|
|
||||||
<div class="absolute bottom-6 right-4 flex flex-col items-end gap-2 z-20">
|
<div class="absolute bottom-6 right-7 z-20 flex w-10 flex-col items-center gap-2">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="w-10 h-10 bg-white rounded-lg shadow-md flex items-center justify-center hover:bg-gray-50"
|
class="w-10 h-10 bg-white rounded-lg shadow-md flex items-center justify-center hover:bg-gray-50"
|
||||||
@@ -642,6 +643,11 @@ onUnmounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
:deep(.amap-controlbar) {
|
||||||
|
transform: translateX(50%) scale(1);
|
||||||
|
transform-origin: bottom right;
|
||||||
|
}
|
||||||
|
|
||||||
.map-archive-button.map-archive-button {
|
.map-archive-button.map-archive-button {
|
||||||
border-radius: 9999px !important;
|
border-radius: 9999px !important;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user