Search code examples
google-mapsoverlapgoogle-fusion-tablespolygons

Google Maps - Fusion Tables with Overlapping Polygons


When using Google Maps API with Google Fusion Tables (with API), I would like to know how to allow a click event to pull my choice of information from multiple polygons in an overlapping region. How do I do this?

Let's say I have polygons A, B, and C which overlap, I want a click event to allow me to filter the data which would correspond to the intersection of data at that point.

This will allow me to merge data in the following way: A = {1,2,3,4,5}, B = {3,4,5}, C = {1,2,3,5}. Clicking the intersection will list {3,5}.

Traditionally, you can only "click" one polygon. I want to "click" multiple polygons in one shot and process the name (and any other information I need) of each polygon before displaying a custom popup window.

Can this be done for polygons within the same fusion table? Ex: Table1 = A, B, C. And can it be done for polygons in different fusion tables? Ex: Table1 = A, Table2 = B, C.

How can I get more into the nitty gritty of how the click event accesses that information?


Solution

  • This isn't possible using Fusion Tables alone.. You might be able to set a click listener on the map so that when someone clicks on the map, a query is sent to Fusion Tables to find all the Polygons that intersect with the point that was clicked (use ST_INTERSECTS with a CIRCLE and a very small radius). The returned results are basically the intersection of data at that point.