vue-baidu-map Add a point of a custom icon but how to make the custom picture displayed in the center (full display)
Since I go to the question column to ask questions, no matter how I modify it, it shows that there are illegal characters that cannot be published, so I will ask questions here, and I will give you some comments. Thank you
<baidu-map class="mapDemo"
:scroll-wheel-zoom="true"
:center="center"
:zoom="zoom"
@ready="handler"
ak="UvaCE1b5u2LGdxZwLtvSTtjj7Q3KdXja">
<bm-marker
:position="{lng: 116.404, lat: 39.915}"
:dragging="true"
:icon="{url:require('../../assets/img/a.jpg'),backgroundPosition:center, size: {width: 150, height: 300}}"
animation="BMAP_ANIMATION_BOUNCE">
</bm-marker>
</baidu-map>
<script>
import {BaiduMap ,BmMarker,BmLabel} from 'vue-baidu-map';
export default {
name: "my",
components:{
BaiduMap,
BmMarker,
BmLabel
},
data() {
return {
center: {lng: 116.404, lat: 39.915},
zoom: 15,
labelStyle:{color: 'red', fontSize : '24px'}
};
},
mounted() {
},
methods: {
//地图
handler ({BMap, map}) {
console.log(BMap, map)
}
}
};
</script>
The effect is like this: The
actual picture
looks like this: Ask the big guys to answer and enlighten me!
After the subsequent research, it was concluded:
{
url: String,
size: Size,
opts: {
anchor: Size,
imageOffset: Size,
imageSize: Size,
infoWindowAnchor: Size,
printImageUrl: String
}
}
//bm-marker里的icon属性共有以上几个,其中imageSize属性就可以实现