feat:baidumap

pull/794/head
alwayssuper 2025-07-19 17:44:48 +08:00
parent ea3fa161ec
commit 46561f05a7
3 changed files with 9 additions and 5 deletions

2
.env
View File

@ -24,5 +24,5 @@ VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码
VITE_APP_DEFAULT_LOGIN_USERNAME = admin
VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123
# 高德地图
# 百度地图
VITE_BAIDU_MAP_KEY = 'efHIw2qmH8RzHPxK0z0rbCgzDVLup9LD'

View File

@ -227,7 +227,11 @@ const regeoCode = (lonLat: string) => {
emits('locateChange', lnglat)
emits('update:center', lonLat)
//
//
const point = new window.BMapGL.Point(lnglat[0], lnglat[1])
state.map.centerAndZoom(point, 16)
//
setMarker(lnglat)
getAddress(lnglat)
}
@ -246,7 +250,7 @@ const getAddress = (lnglat: any) => {
})
}
// 使访
/** 显式暴露方法,使其可以被父组件访问 */
defineExpose({ regeoCode })
onMounted(() => {

View File

@ -93,14 +93,14 @@
@blur="updateLocationFromCoordinates"
/>
</el-form-item>
<div class="pl-0 w-full ml-[-18px]" v-if="showMap">
<div class="pl-0 h-[400px] w-full ml-[-18px]" v-if="showMap">
<Map
:isWrite="true"
:clickMap="true"
:center="formData.location"
@locateChange="handleLocationChange"
ref="mapRef"
class="h-[400px] w-full"
class="h-full w-full"
/>
</div>
</template>