Question

A fusion table has stopped being shown via the Maps API. It was working the other day (Monday or last Friday).

It works fine inside the Fusion Tables website.

Other fusion tables continue to work fine via the Maps API.

Here's a site I made showing the (actually not showing the) layer in question.

http://dl.dropboxusercontent.com/u/14878119/map/sewerlayernotshowing.html

View the source of that site for the entire code, but here's how this layer (and all the others we use) are being called:

<script>
        //initializing Google Maps              
            map = new google.maps.Map(document.getElementById('divMap'), {
                zoom: 14,
                center: {lat:33.040171488300871,lng:-97.022509084376622}
            });
        //Fusion Table (Sewer Lines) *****NOT WORKING!*****
            var _ftId = "140ge-x0HKkzrlZYOdrCxYBNlu4ta15vpHetZh_s";
            var _ft = new google.maps.FusionTablesLayer(_ftId,{query: "SELECT * FROM " + _ftId});
            _ft.setMap(map);

        //Fusion Table (Sewer Points) *****WORKING*****
            var _ftId2 = "1NsByxnFPfr20fL1MAr_zYoPdtocKqCXJg9tqLoA";
            var _ft2 = new google.maps.FusionTablesLayer(_ftId2,{query: "SELECT * FROM " + _ftId2});
            _ft2.setMap(map);
    </script>

Any ideas why the one with id 140ge-x0HKkzrlZYOdrCxYBNlu4ta15vpHetZh_s would stop working?

Was it helpful?

Solution

You are using the "old" (now undocumented) syntax for FusionTableLayer constructors. Use the new syntax and it works.

//Fusion Table (Sewer Lines) 
var _ftId = "140ge-x0HKkzrlZYOdrCxYBNlu4ta15vpHetZh_s";
var _ft = new google.maps.FusionTablesLayer({
     query: {
        select: "Shape",
        from: _ftId,
        where: ""
      },
      options: {
        styleId: 6,
        templateId: 2
      }
    });
    _ft.setMap(map);

working fiddle

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top