Using the same google fusion table, one query selection works and the other doesn't -


full code question @ test application

i attempting use google fusion table queries display subsets of database. code project type (handleprjtypekey) produces expected results; however, code select city not (no project shows). have spent fair bit of time trying figure out why , @ loss. have confirmed can manually query table in google fusion tables same query string used in following functions , expected results, program version isn't working.

any assistance or suggestions appreciated!

    function handleprjtypekey(querystring)     {     // google fusion pointfeat table     var pntlayer = new google.maps.fusiontableslayer({           query: {         select: 'projecttype',         from: pntcitytableid,             where: querystring       },           map: globalmap         });      // google fusion linefeat table     var linlayer = new google.maps.fusiontableslayer({         query: {         select: 'projecttype',         from: lincitytableid,         where: querystring         },         styles: [{             polylineoptions: {             strokecolor: "#ff0000",             strokeweight: "2"             }         }],           map: globalmap         });      // google fusion areafeat table     var arealayer = new google.maps.fusiontableslayer({         query: {             select: 'projecttype',         from: arecitytableid,             where: querystring           },           map: globalmap         });  }  function handlecitykey(querystring) {     // google fusion pointfeat table     var pntlayer = new google.maps.fusiontableslayer({           query: {         select: 'cityname',         from: pntcitytableid,             where: querystring       },           map: globalmap         });      // google fusion linefeat table     var linlayer = new google.maps.fusiontableslayer({         query: {         select: 'cityname',         from: lincitytableid,         where: querystring         },         styles: [{             polylineoptions: {             strokecolor: "#ff0000",             strokeweight: "2"             }         }],           map: globalmap         });      // google fusion areafeat table     var arealayer = new google.maps.fusiontableslayer({         query: {             select: 'cityname',         from: arecitytableid,             where: querystring           },           map: globalmap         }); } 

the table id's defined in right.html file shown

  // simplify life decided use couple of global variables instead of passing parameters!   // these 3 tables have project geometry merged project data   var pnttableid = '16uileonqiionp6jxsopkdxzt1s391pp9bz-rnvq'; // fusiontables table id, encrypted form, needed access project data   var lintableid = '1ehx68debtb4-ucow1kdjhv6n_40qymnq3vcwgji';   var aretableid = '1mp2pix-c3s9y3kqzicl0xrczzydnas78th04ayc';   // these 3 tables have project geometry merged project data , cities impacted   var pntcitytableid = '1lv4c5hf4tgei9o90jge3guhzj5ydvvmjiogqi0w'; // fusiontables table id, encrypted form, needed access project data   var lincitytableid = '1zq9xgr8mnebzgbpjwyu16ppdxzohkpxjli9jtdk';   var arecitytableid = '1xyorrqbvvjq30jeut0fc68t4rv5prz9cfxu4fqk';   var datalink = null;   var globalmap = null; 

the query invalid. returning error: "could not parse query", table encrypted id 1mp2pix-c3s9y3kqzicl0xrczzydnas78th04ayc doesn't seem exist.

https://www.google.com/fusiontables/data?docid=1mp2pix-c3s9y3kqzicl0xrczzydnas78th04ayc

all queries in queryfusiontables returning errors because "datalink" variable null (at least on municipality/city page).

if don't need functionality, perhaps should removed. should @ least add error handling it.

the reason no data showing on fusion table layer querystiring "cityname = 'coconut+creek'" doesn't match rows, data in cityname column "coconut creek". need translate "+" " " (space) (or change space in column "+").

the "select" should geometry column, the documentation

select | string | column, containing geographic features displayed on map. see fusion tables setup in maps api documentation information valid columns.

change:

var pntlayer = new google.maps.fusiontableslayer({       query: {     select: 'cityname',     from: pntcitytableid,         where: querystring   },       map: globalmap     }); 

to:

var pntlayer = new google.maps.fusiontableslayer({       query: {     select: 'geometry',     from: pntcitytableid,         where: querystring   },       map: globalmap     }); 

Comments