Map中的marker onclick方法中怎么传参数?用for循环传参数传不了
for(var i = 0; i < len; i++) {
arrLat[i] = dataList[i].sbwd;
arrLng[i] = dataList[i].sbjd;
arrLL[i] = dataList[i].sbjd + "," + dataList[i].sbwd;
//处理marker
marker[i] = new plus.maps.Marker(new plus.maps.Point(dataList[i].sbjd, dataList[i].sbwd));
marker[i].setIcon("../position1.png");
marker[i].setLabel(dataList[i].sbmc);
var data1 = dataList[i];
console.log(JSON.stringify(data1));
marker[i].onclick = function() {
console.log(JSON.stringify(data1));
createSubview_bottom(wsub_b);
}
map.addOverlay(marker[i]);
}
0 个回复