问题
With much help, I have created this Map with data from Queries to a Fusion Table.
http://www.vciregionmap.com
I am now being asked to add a brand filter into the map that filters and persists the filtered value that is selected, as the user chooses new Regions and Districts.
So if I choose - Region > NorthEast and then select Bentley, only those Bentley locations would be shown and if I then switched to Region SouthEast, District 61, it would still show only Bentley locations, until I reset the map.
I have the brand filter in a select menu and have the filter working, but not by current location or values and I dont know how to reset the brand select to return all brands. I had a version of this working with different code here: http://vciregionmap.com/_old/
This is the function I am using now:
function filterBrand(term) {
layer.setOptions({query:{select:'Brand',
from:FT_TableID,
where:"Brand = '"+term+"'"
}
});
var queryStr = "SELECT 'Brand', 'Brand' FROM "+FT_TableID+" WHERE Brand = '"+term+"'";
}
google.maps.event.addDomListener(document.getElementById('brand-select'),
'change', function() {
updateMap(layer, tableId, Brand);
});
google.maps.event.addDomListener(window, 'load', initialize);
来源:https://stackoverflow.com/questions/11696084/filter-current-value-of-a-fusion-table-query