Skip to content

Instantly share code, notes, and snippets.

@geog4046instructor
Last active January 1, 2018 22:49
Show Gist options
  • Save geog4046instructor/d15a8958afc696b6f5b3 to your computer and use it in GitHub Desktop.
Save geog4046instructor/d15a8958afc696b6f5b3 to your computer and use it in GitHub Desktop.
Googla Maps API - Add a KML layer
/* Add layer(s) from an online KML or KMZ file
*
* function: google.maps.KmlLayer
* documentation: https://developers.google.com/maps/documentation/javascript/examples/layer-kml
*/
let kml = new google.maps.KmlLayer({
url: 'http://example.com/layer1.kmz',
preserveViewport: true // setting to true will prevent the map from zooming to this layer
});
kml.setMap( map );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment