:center="center" //中心
:zoom="zoom" //缩放等级
:scroll-wheel-zoom='true' //允许滚轮缩放
>
anchor="BMAP_ANCHOR_BOTTOM_RIGHT" //控件的位置
:showAddressBar="true" //定位信息面板
:autoLocation="true"
:locationIcon="{url: require('../assets/logo.png'), size: {width: 46, height: 46},opts: {imageSize: {width: 46, height: 46}, }}" //自定义定位中心点的Icon样式
@locationSuccess='locationSuccess' //定位成功后调用的方法 返回值有 point, AddressComponent, marker 可拿到当前位置信息
export default {
data () {
return {
center: {lng: 0, lat: 0},
zoom: 15,
}
}
}
.bm-view {
width: 100%; height: 300px;
}