Permalink
Browse files

updated fusiontips.js to use FT API v1

  • Loading branch information...
Derek Eder
Derek Eder committed Jan 12, 2013
1 parent 6324205 commit 7e86b0bfba411584e0a305560d07444648835a0c
Showing with 8 additions and 9 deletions.
  1. +8 −9 public/javascripts/fusiontips.js
@@ -21,7 +21,7 @@
FusionTipOverlay.prototype.onAdd = function() {
var div = document.createElement('DIV');
div.style.border = "1px solid #999999";
div.style.opacity = ".85";
div.style.opacity = ".85";
div.style.position = "absolute";
div.style.whiteSpace = "nowrap";
div.style.backgroundColor = "#ffffff";
@@ -228,9 +228,9 @@
function queryFusionJson(latlng, queryText) {
var script = document.createElement('script');
// Note that a simplified geometry and the NAME column are being requested
//http://www.google.com/fusiontables/api/query?sql=
var sid = 'query_' + scriptid++;
script.setAttribute('src', 'http://fusiontables.googleusercontent.com/fusiontables/api/query?sql=' + queryText + '&jsonCallback=fusiontips.' + sid);
script.setAttribute('src', 'https://www.googleapis.com/fusiontables/v1/query?sql=' + queryText + '&callback=fusiontips.' + sid + '&key=' + opts.googleApiKey + "&typed=false");
//script.setAttribute('src', 'http://fusiontables.googleusercontent.com/fusiontables/api/query?sql=' + queryText + '&jsonCallback=fusiontips.' + sid);
window.fusiontips[sid] = function(json) {
delete window.fusiontips[sid];
queryPending = false;
@@ -241,24 +241,23 @@
function processFusionJson(json, latlng) {
//{table:{cols:[col1,col2], rows:[[val11,val12],[val21,val22]]}};
var data = json.table;
var data = json;
html = "";
var row = null;
if (data) {
var numRows = data.rows.length;
var numCols = data.cols.length;
var numCols = data.columns.length;
if (numRows > 0) {
row = {};
html += ZoningDict[data.rows[0][0] - 1] + "<br/>";
html += "Zoned: " + data.rows[0][1];
html += "House District " + data.rows[0][0];
for (i = 0; i < numCols; i++) {
var cell = {
columnName: data.cols[i],
columnName: data.columns[i],
value: data.rows[0][i]
};
row[data.cols[i]] = cell;
row[data.columns[i]] = cell;
}
}

0 comments on commit 7e86b0b

Please sign in to comment.