Some rows/polygons getting dropped from query...only last week or two

28 views
Skip to first unread message

Randy Majors

unread,
Aug 3, 2011, 7:35:43 AM8/3/11
to google-map...@googlegroups.com
I have a google map that is using Google Maps API v3 and a FusionTablesLayer.

Just in the last week or two, the map is suddenly dropping many of the polygons/rows from a fusiontableslayer query.
I had made no changes to the code, and the strange thing is that the query works fine from within the Fusion Tables interface (
http://www.google.com/fusiontables/Home?pli=1).  But when I use the same query from the google maps code on my page ( http://randymajors.com/p/worldmap.html ) many of the polygons simply are not appearing.

To see an example of this behavior, on my map page http://randymajors.com/p/worldmap.html , type Belgrade and 1955, and note for example that Germany, France, Spain, Yugoslavia, UK, etc and many many other countries are dropping from the query inexplicably.  Their borders do not appear; yet they appeared just a week or two ago with no changes to my code and no changes to the underlying fusion table.  (Similar bahavior is happening with any year on this table, which is 1946 to 2008)

The table can be visualized correctly from within the Fusion Tables interface.  Tableid is 1149713
To see the correct behavior, go to http://www.google.com/fusiontables/DataSource?dsrcid=1149713 and then Visualize, Map.  Add three filters:

geometry contains Polygon
COWSYEAR <= 1955
COWEYEAR >= 1955


Notice that the same above countries that were disappearing on my maps page  http://randymajors.com/p/worldmap.html  are appearing just fine within the Fusion Tables Interface.
Here's my code and the query structure on my maps page...which worked great up until sometime in the last week or two:

     layer = new google.maps.FusionTablesLayer({
             suppressInfoWindows: true,
             query: {
                 select: 'geometry',
                 from: 1149713,
                 where: "geometry CONTAINS 'Polygon' AND COWSYEAR <=
'" + yearvar + "' AND COWEYEAR >= '" + yearvar + "'"
             },
             styles: [{
                 polygonOptions: {
                     fillColor: "#4c1130",
                     fillOpacity: "0.01",
                     strokeColor: "#4c1130",
                     strokeOpacity: "0.35",
                     strokeWeight: "5"
                     }
             }]
     });

   layersArray.push(layer); // put into array to keep track of layer
to get rid of it later

   layer.setMap(map);


What in the world is happening to cause this, and how can it be fixed.  I'm at a complete loss as to how to even begin to debug this issue.
Randy

(I have posted this on the Fusion Tables Users Group as well, but no response yet)

Randy Majors

unread,
Aug 3, 2011, 8:17:21 AM8/3/11
to google-map...@googlegroups.com
I have found the culprit!!

Although I'm completely baffled as to why this stopped working and had to be changed....


In the where clause,
I changed      geometry CONTAINS 'Polygon' AND       
to         geometry DOES NOT CONTAIN 'Point' AND     


That's it.  This fixes the issue of some polygons being dropped from the query.

I have used the fixed code on this page http://randymajors.com/p/worldmap.html and left the old code that still uses " geometry CONTAINS 'Polygon' "  here for testing purposes:  http://randymajors.com/p/test_03.html

Reply all
Reply to author
Forward
0 new messages