-1

I have a problem with my new map, combination of fusion table layer and jquery tabs. The problem is that I want to show only markers from column DONOR/col6 for example Austria and it;s showing me all records. I was trying add where query after FT ID but it's now working

where: "col6 = 'Austria'"

That's main script to query FT

<SCRIPT type="text/javascript"> //Fisrt script to query Table and get data
var FT_TableID = 'FT_ID';// Fusion Table data ID
google.load('visualization', '1', {'packages':['corechart', 'table', 'geomap']});

function  createSidebar() { //This line is important, change Table ID and column names
  var queryText = encodeURIComponent("SELECT 'col6' FROM "+'FT_ID');
  var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq='  + queryText);

query.send(getData);//set the callback function

}

  google.setOnLoadCallback(createSidebar);// Set a callback to run when the Google Visualization API is loaded.
</SCRIPT>

And here is live example CLICK

PiotrK
  • 357
  • 3
  • 13
  • You have a javascript error in your [example](http://serwer1478551.home.pl/jpo/google_maps/index.html), this line `var queryText = encodeURIComponent("SELECT 'col6' FROM "+'1fyV8b5Cqrdp_kN_2mnuORzXz0XTzocHkXLR9Yz0x''|sc:col9|sg:col6%20%3D%20'Austria'");` (mismatched single "ticks") – geocodezip Aug 01 '14 at 23:03

1 Answers1

1

The FusionTablesLayer is displaying the markers and you are using the "old" FusionTablesLayer syntax, which doesn't work with encrypted ids.

Your existing call to the FusionTablesLayer constructor (old):

layer = new google.maps.FusionTablesLayer(tableid, {
    suppressInfoWindows: true,
    map: map
});

working fiddle

Use the new syntax for the FusionTablesLayer with the query if you want the displayed markers to be based on the query.

layer = new google.maps.FusionTablesLayer({
    suppressInfoWindows: true,
    query: {
        where: "'DONOR' = 'Austria'", // query
        from: tableid,                // encrypted table id
        select: 'DUTY STATION'        // location column
    },
    map: map
});
geocodezip
  • 158,664
  • 13
  • 220
  • 245