※ 引述《witness0828 (原PO沒有病)》之銘言:
: 想請問如下的一串原始碼
那就用兩層array吧
var points_location =
[
[24.2264, 120.5762],
[24.2256, 120.5768],
/* ... */
];
var points = new Array();
for (var i = 0; i < points_location.length; i++) {
points.push(new ULatLng(points_location[i][0], points_location[i][1]));
}
中間恕刪
: 那要如何讓JavaScript能夠讀取外部的txt檔
: 且讓程式碼不會顯示"這一大堆數字" 只顯示成"XY、[][]"之類呢?
你可以用JSON的方法來存,然後透過JSON的parser(網路上很多)來讀取資料
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.247.164
※ 編輯: ybite 來自: 140.112.247.164 (12/10 02:37)