问题
How to select user defined column using drop down box from fusion table which has around 50 columns.That column should be used for further queries.Is there any way to do it.I am new to Google map API.
回答1:
Are you saying you don't want to hard-code the column names in your html? You want to get the columns names via javascript? If so you'll need to use the JSONP API. I've posted several examples which could be modified to just retrieve the column names from a FT. Change the query to:
var query = "SELECT * FROM " + table_id + " LIMIT 1";
Your JSONP callback (called example_dataHandler(d) in those examples) will get an array of column names:
var colnames = [];
colnames = d.table.cols;
来源:https://stackoverflow.com/questions/9925682/drop-down-fusion-table