How can I zoom a Google Maps control to fit the contents of a Fusion Table layer?
The layer only contains pushpin / marker point data.
One method is to perform a REST query on the Fusion Table and to calculate the bounds, and zoom to these (i.e. as illustrated here: http://gmaps-samples.googlecode.com/svn/trunk/fusiontables/fitbounds.html ). However this seems very inefficient – especially for larger datasets, because all of the table data has to be sent to the client and compared.
This question appears to ask the same query, but the answer does not apply. The answer simply queries the data for the current map extents. Nice and efficient, but the opposite of what I want. I want to zoom to display all available data.
Best Answer
You can get your all your table data and find the bounds from the response:
This comes from a good example:
http://www.geocodezip.com/www_vciregionmap_comC.html and view source