Drop down fusion table

落爺英雄遲暮 提交于 2019-12-13 08:14:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!