Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to apply the same code as this exmaple to zoom the google map to a KML Markers loaded into Fusion Table Layer.

The example code works for KML Polygon loaded into Fusion Table Layer but not for markers. Does anyone know how to apply that to KML markers?

kml example:



query = "SELECT * FROM  1eiOWq49sR8DXdymYALNdItE0uf-f4mNRbyJOVOU";

function zoom2query(query) {
   // zoom and center map on query results
   //set the query using the parameter
   var queryText = encodeURIComponent(query);
   var query = new google.visualization.Query(''  + queryText);

    //set the callback function


  function zoomTo(response) {
    if (!response) {
      alert('no response');
    if (response.isError()) {
      alert('Error in query: ' + response.getMessage() + ' ' ++ response.getDetailedMessage());

      FTresponse = response;
      //for more information on the response object, see the documentation
      numRows = response.getDataTable().getNumberOfRows();
      numCols = response.getDataTable().getNumberOfColumns();
      var geoXml = new geoXML3.parser();
      var bounds = new google.maps.LatLngBounds();
      for (var i = 0; i < numCols; i++){
        if (FTresponse.getDataTable().getColumnLabel(i) == 'geometry') {
         var ColIndex = i;
      if (!ColIndex){
        alert('Geometry column "geometry" not found.')
      for (var i = 0; i < numRows; i++){
        var bounds = new google.maps.LatLngBounds();
        for(i = 0; i < numRows; i++) {
            var kml = FTresponse.getDataTable().getValue(i,ColIndex);
        // zoom to the bounds
share|improve this question
This post was edited and now the code above is correct. You can use it to zoom on kml markers loaded in fusion table layer. – DemarsM Mar 8 '13 at 14:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.