function createBoundingBox() {
outputDiv = document.getElementById('outputDiv');
outputDiv.innerHTML = '';
var queryList = [];
queryList.push("SELECT 'WEB', 'NAME', 'ADDRESS', 'Lat', 'Lng', 'WEB1' FROM ");
queryList.push(Table);
queryList.push(" WHERE " + where + " AND ");
queryList.push("ST_INTERSECTS('GEOMETRY', ");
queryList.push("RECTANGLE(LATLNG");
queryList.push(sw);
queryList.push(", LATLNG");
queryList.push(ne);
queryList.push("))");
var query = encodeURIComponent(queryList.join(''));
var gvizQuery = new google.visualization.Query(
'http://www.google.com/fusiontables/gvizdata?tq=' + query);
gvizQuery.send(function(response) {
numRow = response.getDataTable().getNumberOfRows();
var datatable = response.getDataTable();
if (datatable && datatable.getNumberOfRows()) {
// var linkList = [];
var newLinkList = [];
for (var i = 0; i < numRow; i++) {
var name = response.getDataTable().getValue(i, 1);
nameList.push(name);
var address = response.getDataTable().getValue(i, 2);
addressList.push(address);
var latitude = new google.maps.LatLng(response.getDataTable().getValue(i, 3)); alert(latitude)
latitudeList.push(latitude);
var longitude = new google.maps.LatLng(response.getDataTable().getValue(i, 4));
longitudeList.push(longitude);
var newLink = response.getDataTable().getValue(i, 5);
newLinkList.push("<a name = 'link' id="+"'" + i + "'" + "onmouseover='getId(this)' href=" + newLink + " target='_blank'>" + name + "</a>");
infoContent.push("name" + name + "<br>address: "+address);
// var link = response.getDataTable().getValue(i, 0);
// linkList.push(link);
}
names = newLinkList.join("<br>") ;
outputDiv.innerHTML = numRow+ " results nearby " + sAddress + "<br><br>";
outputDiv.innerHTML += names;
}
});
}
これは、Fusion Table からデータをクエリするコードです。緯度と経度が (30.xxx, NaN) と (-97.xxx, NaN) のように表示されるのはなぜでしょうか。ご協力ありがとうございました!