收藏
回答

@markertap禁用地图中心回到自己位置

问题类型 API/组件名称 AppID 操作系统 微信版本 基础库版本
Bug map wx043810d7f5b10c2c iOS 6.5.3 2.00

// 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

}

},


回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容