この形式のテキスト ファイルから行を読み込もうとしています。34.925,150.977 35.012,151.034 34.887,150.905
私は現在、この方法論を使用しようとしていますが、明らかに機能していません。どんな助けでも大歓迎です。
var ltlng = [];
var txtFile = new XMLHttpRequest();
txtFile.open("GET", "C:\Gmap\LatLong\Coordinates.txt", true);
txtFile.onreadystatechange = function() {
if (txtFile.readyState === 4) {
if (txtFile.status === 200) { // Makes sure it's found the file.
lines = txtFile.responseText.split("\n"); // separate each line into an array
ltlng.push(new google.maps.LatLng(lines.split(",")[0],lines.split(",")[1]); //create the marker icons latlong array
}
}
}