map组件下marks的iconPath不支持网络图片?!!
markers: [{
iconPath: "/resources/others.png",
id: 0,
latitude: 23.099994,
longitude: 113.324520,
width: 50,
height: 50
}],
当iconPath:"https://www.hearthome520.com/up/ico.png"不起作用!
4 回复
全下载下来啊
for ( var i = 0; i < gm.length; i++) { ( function (i) { wx.downloadFile({ url: app.data.server + 'avatar/' + gm[i].openId + '.png' , success: function (res) { if (res.statusCode === 200) { buf[i].iconPath = res.tempFilePath } buf[i].latitude = gm[i].latitude buf[i].longitude = gm[i].longitude markers.push(buf[i]) page.oneDownloadFinish() } }) })(i) } |