Search code examples
google-fusion-tables

Filtered Data from Fusion Table in another FT infowindow using the FT UI


Is it possible to embed an iframe with filtered data coming from a FT? I have two Fusion Tables, one Parent and one Child. They have a matching ID column. What I need to do is to be able to show filtered data from Child Table into every infowindow of the Parent Table according to their matching ID column (sort of one-to-many connection).

Building on the link generated from the Child FT UI, I could generate a unique "filtering" link utilizing the matching ID column of the Parent Table inside the Custom Card panel.

Is it possible?


Solution

  • It's possible, but not with a template, because <iframe/>'s will be removed.

    Modify the infoWindowHtml-property of the FusionTablesMouseEvent

    google.maps.event.addListener(layer,'click',function(e){
    
      e.infoWindowHtml+=
        '<iframe width="100%" src="https://www.google.com/fusiontables/embedviz?'+
        'viz=CARD&amp;q=select+*+from+childTableId+where+ID+%3D+'+
        e.row.ID.value+'&cpr=1"></iframe>';
    
    });