Search code examples
google-mapskmlpolygongoogle-fusion-tables

Polygon layer in google maps from kml data in a fusion table


I have a fusion table that contains kml data in one column which shows up as the boundaries of buildings. I would like to use that data in my own dynamic google map. So far this is the code I have written:

function initialize() {
 var mapOptions = {
    center: new google.maps.LatLng(41.558, -72.651),
    zoom: 14,
    mapTypeId: google.maps.MapTypeId.HYBRID
 };
 map = new google.maps.Map(document.getElementById("map_canvas"), 
                mapOptions);

 layer = new google.maps.FusionTablesLayer({
    query: {
       select: 'geometry',
       from: '5336096'//'1ZhE_f12VDQ5zr82cbftVn1Jpff_TK5ZQmC3h52Y'
    },
    heatmap: {
       enabled: true
    },
    styles: [{
       polygonOptions: {
      fillColor: "#00FFFF",
      opacity: 0.3
       }
    }]
 });

 layer.setMap(map);


  }

what it does so far is puts a small green dot on each of the buildings, but not the entire polygon. Any idea what I'm doing wrong?


Solution

  • Remove the heatmap: { enabled: true }

    This version works.