function setallcar(data, point) {
var map2 = new plus.maps.Map("map");
map2.centerAndZoom(point, 15);
map2.showUserLocation(true);
map2.clearOverlays();
for (var i = 0; i < data.length; i++) {
var p = new plus.maps.Point(data[i]['location_y'], data[i]['location_x']);
//添加覆盖物和圆圈
var marker = new plus.maps.Marker(p);
marker.setIcon("images/car.png");
/*var bubble = new plus.maps.Bubble(data[i]['car_name']);
marker.setBubble(bubble);
marker.onclick = function(marker) {
var txtCar = document.getElementById("local");
txtCar.innerHTML = data[i]['car_name'];
isChoose = true;
}*/
/*var c = new plus.maps.Circle(p, 1000);
c.setStrokeOpacity(0);
c.setFillColor("#00BFFF");
c.setFillOpacity(0.2);
map2.addOverlay(c);*/
map2.addOverlay(marker);
console.log(JSON.stringify(map2));
}
xpolars
- 发布:2015-08-27 21:21
- 更新:2015-08-27 21:43
- 阅读:1938
1 个回复
xpolars (作者) - 程序员
var p = new plus.maps.Point(parseFloat(data[i]['location_y']), parseFloat(data[i]['location_x']));
这里错了 坑爹啊