从Google Fusion Table中检索列值

时间:2014-02-11 23:46:22

标签: javascript google-fusion-tables

我正在尝试从Google的FusionTable(FT)中的列中检索所有值(相关的郊区名称)。 我可以使用jQuery的ajax调用来访问列本身:

$.ajax({
    url: 'https://www.googleapis.com/fusiontables/v1/tables/'+ tableID +'/columns/Suburb?key=' + key,
    success: function(data) {
        console.log(data);
        suburbs_list = data;
    },
    error: function(data) {
        console.error(['error', data]);
    }
});

返回

suburbs_list
Object {kind: "fusiontables#column", columnId: 0, name: "Suburb", type: "LOCATION"}

但我找不到访问此列中值的方法。有没有办法或者我必须遍历每一行并获得每行的第一列值?

我一直在阅读文档,但没有任何关于此的说法。 https://developers.google.com/fusiontables/docs/v1/reference/column

感谢任何建议

1 个答案:

答案 0 :(得分:0)

您需要使用查询来获取行。您可以指定SELECT子句中要获取的列。有关详细信息,请参阅此帮助页面:https://developers.google.com/fusiontables/docs/v1/using#WorkingRows