Fusion Tables layers

by Boyke Ferdinandes

HTML

<div id="map"></div>
<!-- Replace the value of the key parameter with your own API key. -->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCkUOdZ5y7hMm0yrcCQoCvLwzdM6M8s5qk&callback=initMap">
</script>

CSS

/* Always set the map height explicitly to define the size of the div
 * element that contains the map. */
#map {
  height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

JavaScript

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    center: {lat: 46.82, lng: 8},
    zoom: 8,
    mapTypeId: google.maps.MapTypeId.HYBRID
  });

  var layer = new google.maps.FusionTablesLayer({
    query: {
    select: 'geometry',
    /*from: '1N2LBk4JHwWpOY4d9fobIn27lfnZ5MDy-NoqqRpk',*/
    /*from: '1uL8KJV0bMb7A8-SkrIe0ko2DMtSypHX52DatEE4',*/
    /*where: "ISO_2DIGIT NOT IN ('CH')"*/
    from : '1foc3xO9DyfSIF6ofvN0kp2bxSfSeKog5FbdWdQ',
    where: "iso_a2 NOT IN ('CH')"
    /*select: 'name, kml_4326',
    from: '19lLpgsKdJRHL2O4fNmJ406ri9JtpIIk8a-AchA'*/
    //where: "iso IN ('CH')"    
    },
    strokeColor: '#cccc99',
    strokeOpacity: 0,
    strokeWeight: 1,
    fillColor: '#cccc99',
    fillOpacity: 0.3,
    map: map,
  suppressInfoWindows: true
  });
  layer.setMap(map);
}