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) 而应该只是 30.xxx 和 -97.xxx。感谢您的帮助!