I am trying to figure out how to use the new Fusion Table API v1 to query a table, from within a Javascript function. I want to be able to loop through the result, row by row, and do something else (in this case geocoding addresses) as I go.
I have the syntax for the query working OK. When I paste the http it into a browser it returns the correct result.
What I can’t figure out is how to make the request in the first place, and get the result where I can use it.
This post is close to what I’d like to do, but it uses the old API: http://www.reddmetrics.com/2011/08/10/fusion-tables-javascript-query-maps.html
function getData() {
// Builds a Fusion Tables SQL query and hands the result to dataHandler
var queryUrlHead = 'https://www.googleapis.com/fusiontables/v1/query?sql=';
var queryUrlTail = '&key={my key}';
Table = {my table id};
// write your SQL as normal, then encode it
var query = "SELECT Address, Name FROM " + Table + " LIMIT 5";
var queryurl = encodeURI(queryUrlHead + query + queryUrlTail);
var jqxhr = $.get(queryurl, dataHandler, "jsonp");
}
Maybe jquery is not needed with the new api?