feat: 增加是否加载底图参数

This commit is contained in:
nightdays 2025-11-19 14:02:42 +08:00
parent 4eb9e3cd97
commit c7b8ddd2f1
2 changed files with 12 additions and 2 deletions

View File

@ -8,6 +8,14 @@ import { onMounted, onBeforeUnmount } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import useMapStore from '@/map/stores/mapStore' import useMapStore from '@/map/stores/mapStore'
const props = defineProps({
//
isLoadDefaultBaseMap: {
type: Boolean,
default: true
}
})
const mapStore = useMapStore() const mapStore = useMapStore()
const route = useRoute() const route = useRoute()
let viewer = null let viewer = null
@ -90,8 +98,10 @@ async function initViewer() {
} else if (!skipInitialView) { } else if (!skipInitialView) {
await applyInitialCameraView() await applyInitialCameraView()
} }
if (props.isLoadDefaultBaseMap) {
await loadBaseMap()
}
await loadBaseMap()
} }
async function applyInitialCameraView() { async function applyInitialCameraView() {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="map-center"> <div class="map-center">
<div class="map-container"> <div class="map-container">
<MapViewport /> <MapViewport :isLoadDefaultBaseMap="false"/>
<MapControls /> <MapControls />
</div> </div>
<!-- 顶部功能按钮 --> <!-- 顶部功能按钮 -->