map.addEventListener("click",function(e){
//alert(e.point.lng + "," + e.point.lat);
var points = new Array();
var point = (e.point.lng + "," + e.point.lat);
//console.log(point);
points.push(point);
console.log(points);
});
引用了百度地图的js,希望能在地图点击获开坐标后存入数组。按照上面的代码数组一直只有最新的坐标 |