vue-baidu-map的vue3版本(支持百度地图api2,百度地图api3和百度地图WebGl)。Baidu Map Component for Vue 3.0
Baidu Map components for Vue 3.x
https://yangjianfei.github.io/vue-baidu-map-3x/
npm i --save vue-baidu-map-3x
import Vue from 'vue'
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {
/* Visit http://lbsyun.baidu.com/apiconsole/key for details about app key. */
ak: 'YOUR_APP_KEY',
// v:'2.0', // default 3.0
// type: 'WebGL' // ||API defaultAPI (BMap=BMapGL)
})
<template>
<baidu-map class="map" :center="{lng: 118.454, lat: 32.955}" :zoom="5" @ready="ready" >
</baidu-map>
</template>
<script setup>
const ready = ({Bmap,map})=>{
// custom operate
};
</script>
<style>
/* The container of BaiduMap must be set width & height. */
.map {
width: 100%;
height: 300px;
}
</style>
install pluginnpm i vue-baidu-map-offline contact me wechart:yjf163163|[email protected]
BmView
abandonBmViewcomponent
copyright © 2016~now, YangJianFei [email protected]
wechart:yjf163163 wechart group:scan me