map组件,在安卓上和ios上显示的题,安卓显示居中,ios就不行,并且ios的弹出窗不在标记点上面
WXML代码:
<map id="myMap"
style="width: 100%; height: 100%;"
latitude="{{latitude}}"
longitude="{{longitude}}"
markers="{{markers}}"
show-location bindmarkertap="selectMarket"
include-points="{{markers}}"
covers="{{covers}}"
bindmarkertap="toaddress"
scale="{{scale}}"></map>
JS代码:
let callout = { content: " 车牌号:" + data[0].truckNo + " + data[0].execNo + "\r\n 司机姓名:" +
data[0].driverName + "\r\n 司机电话:" +data[0].driverTel + "\r\n 定位时间:" +
data[0].gpsTime + "\r\n 当前速度:" +data[0].direction + " " + data[0].speed + "/km" +
"\r\n 预计到达时间:" + ss + "\r\n 剩余里程:" + res + "/km" + "\r\n 当前位置:" + data[0].address,
borderColor: "#ff0000", fontSize: "13",display: "BYCLICK",
borderWidth: "0.5", padding: 10, borderRadius: 7, textAlign: 'left'
};
let marker = {
"rotate": data[0].jiaodu,
"iconPath": "../../image/huoche.png",
"id": "",
"latitude": data[0].latTwo,
"longitude": data[0].lngTwo,
"width": "40",
"height": "40",
"title": "",
"callout": callout };
markers.push(marker);
that.setData({
scale: 8,
markers: markers,
latitude: data[0].latTwo,
longitude: data[0].lngTwo
})