FusionTables query not returning anything
I'm trying to use Javascript to query a specific state so that only that state appears as a Fusion table on a Google Map. Here is the Javascript that doesn't work:
var chicago = new google.maps.LatLng(41.850033, -87.6500523);
map = new google.maps.Map(document.getElementById('map_canvas'), { center: chicago, zoom: 4, mapTypeId: 'roadmap'});
var layer = new google.maps.FusionTablesLayer(531237, { query:"select geometry from 531237 where state_abbr = 'IL'"});
layer.setMap(map);
If I r开发者_如何学编程emove the where clause from the query, all states are returned...as expected. Anyone know what I'm doing wrong when all I want to do is grab the single state?
Turns out that the columns need to be the exact case. Here's the working code:
var layer = new google.maps.FusionTablesLayer(531237, { query:"select geometry from 531237 WHERE STATE_ABBR in ('AL', 'WI', 'CT') "});
精彩评论