Google visualization 基于Google可视化的融合表查询 函数createBoundingBox(){ outputDiv=document.getElementById('outputDiv'); outputDiv.innerHTML=''; var queryList=[]; push(“从中选择“WEB”、“名称”、“地址”、“Lat”、“Lng”、“WEB1”); queryList.push(表); queryList.push(“WHERE”+WHERE+”和“); push(“ST_相交('GEOMETRY',”); queryList.push(“矩形(板条”); queryList.push(西南); 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="质疑",; gvizQuery.send(函数(响应){ numRow=response.getDataTable().getNumberOfRows(); var datatable=response.getDataTable(); if(datatable&&datatable.getNumberOfRows()){ //var linkList=[]; var newLinkList=[]; 对于(变量i=0;i

Google visualization 基于Google可视化的融合表查询 函数createBoundingBox(){ outputDiv=document.getElementById('outputDiv'); outputDiv.innerHTML=''; var queryList=[]; push(“从中选择“WEB”、“名称”、“地址”、“Lat”、“Lng”、“WEB1”); queryList.push(表); queryList.push(“WHERE”+WHERE+”和“); push(“ST_相交('GEOMETRY',”); queryList.push(“矩形(板条”); queryList.push(西南); 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="质疑",; gvizQuery.send(函数(响应){ numRow=response.getDataTable().getNumberOfRows(); var datatable=response.getDataTable(); if(datatable&&datatable.getNumberOfRows()){ //var linkList=[]; var newLinkList=[]; 对于(变量i=0;i,google-visualization,google-fusion-tables,Google Visualization,Google Fusion Tables,这是从融合表查询数据的代码。我想知道为什么纬度和经度显示为(30.xxx,NaN)和(-97.xxx,NaN),而它应该是30.xxx和-97.xxx。谢谢你的帮助 这是: function createBoundingBox() { outputDiv = document.getElementById('outputDiv'); outputDiv.innerHTML = ''; var queryList = []; queryList.push("SELECT 'WEB', 'NAME'

这是从融合表查询数据的代码。我想知道为什么纬度和经度显示为(30.xxx,NaN)和(-97.xxx,NaN),而它应该是30.xxx和-97.xxx。谢谢你的帮助

这是:

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;


    }



});

}
可能应该是:

 var latitude = new google.maps.LatLng(response.getDataTable().getValue(1, 3));   
 latitudeList.push(latitude);
 var longitude = new google.maps.LatLng(response.getDataTable().getValue(i, 4));
 longitudeList.push(longitude);
或者将组合的google.maps.LatLng放到单个阵列上

 var latitude =response.getDataTable().getValue(i, 3);
 latitudeList.push(latitude);
 var longitude = response.getDataTable().getValue(i, 4);
 longitudeList.push(longitude);
这:

可能应该是:

 var latitude = new google.maps.LatLng(response.getDataTable().getValue(1, 3));   
 latitudeList.push(latitude);
 var longitude = new google.maps.LatLng(response.getDataTable().getValue(i, 4));
 longitudeList.push(longitude);
或者将组合的google.maps.LatLng放到单个阵列上

 var latitude =response.getDataTable().getValue(i, 3);
 latitudeList.push(latitude);
 var longitude = response.getDataTable().getValue(i, 4);
 longitudeList.push(longitude);

猜测一下,数据中的第3列是纬度,第4列是经度,对吗?如果是这样,那么您的问题是您使用的
google.maps.LatLng
不正确。
LatLng
构造函数需要(lat,long)对作为参数,即:

 var latitude =response.getDataTable().getValue(i, 3);
 var longitude = response.getDataTable().getValue(i, 4);
 latlngList.push(new google.maps.LatLng(latitude,longitude));
它返回一个LatLng对象。所以,当你这样称呼它:

var latLng = new google.maps.LatLng(latitude, longitude);
构造器认为每次给它一个没有经度的纬度。您要做的是:

var latitude = new google.maps.LatLng(response.getDataTable().getValue(i, 3));
var longitude = new google.maps.LatLng(response.getDataTable().getValue(i, 4));

猜测一下,数据中的第3列是纬度,第4列是经度,对吗?如果是这样,那么您的问题是您使用的
google.maps.LatLng
不正确。
LatLng
构造函数需要(lat,long)对作为参数,即:

 var latitude =response.getDataTable().getValue(i, 3);
 var longitude = response.getDataTable().getValue(i, 4);
 latlngList.push(new google.maps.LatLng(latitude,longitude));
它返回一个LatLng对象。所以,当你这样称呼它:

var latLng = new google.maps.LatLng(latitude, longitude);
构造器认为每次给它一个没有经度的纬度。您要做的是:

var latitude = new google.maps.LatLng(response.getDataTable().getValue(i, 3));
var longitude = new google.maps.LatLng(response.getDataTable().getValue(i, 4));

输出(30.xxx,Nan)和(-97.xxx,Nan)的代码在哪里?输出(30.xxx,Nan)和(-97.xxx,Nan)的代码在哪里?哦,我实际上在30分钟前刚刚将其更改为“1”,以便将其输入警报函数,再次查看正在输入的内容。。。它与“i'Oh”不起作用,实际上我在30分钟前将其改为“1”,将其输入警报功能,再次查看正在输入的内容。。。“我的天啊,我想你是对的,我不知道我什么时候这么做的——把它改成了google.maps.LatLng。”。谢谢你,我要改变它,看看会发生什么。上帝,就是这样。非常感谢你。同时感谢“geocodezip”为您提供的宝贵时间!哦,我的天,我想你是对的,我不知道我什么时候做的-改成了google.maps.LatLng。谢谢你,我要改变它,看看会发生什么。上帝,就是这样。非常感谢你。同时感谢“geocodezip”为您提供的宝贵时间!