I have the below in a Google Map which allows me to query a Fusion Table for a given name as searched by the user. How do I set up Google Maps to pan/zoom based on the search results returned?
//Text based search
function changeSearch() {
var searchSearch = document.getElementById('searchSearch').value.replace("'", "\\'");
layer.setQuery("SELECT 'lat' FROM " + tableid + " WHERE 'Name' CONTAINS IGNORING CASE '" + searchSearch + "'");
}
FusionTablesLayer does not give you enough information to pan and zoom the map based on the result.
The best solution is to query the Fusion Tables SQL API (using a server) for the same data, and calculate the bounding box which includes all the results returned by the SQL API. You could do this, for example, with a PHP script running on your server, which you can call from Javascript using AJAX.