// marker
createMarkers (parkLotList) {
this.markers = parkLotList.map((item, index) => {
return {
id: index + 1,
width: 45,
height: 50,
iconPath: '/static/img/parkLot.png',
...item
}
})
console.log(this.markers);
},
// marker 点击事件
onMarkerTab ({ mp }) {
this.visbleparking = true;
// this.location=[];
this.target = this.markers.filter(marker => marker.id === mp.markerId)[0];
if (!this.target.distance) {
let distance = calculateDistance(this.location, this.target)
distance = distance >= 1000 ? (distance / 1000).toFixed(1) + 'km' : distance + 'm'
this.target.distance = distance
}
},
微信小程序开发问题解答
微信小程序开发者回答:
你好,是企业微信小程序。麻烦给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题
本文网址:http://www.91bianli.com/weixinxiaochengxu/383.html