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,希望能在地圖點擊獲取坐標后存入數(shù)組。按照上面的代碼數(shù)組一直只有最新的坐標
js數(shù)組插入問題
zetro
2016-10-11 23:40:46