Last active
January 1, 2018 22:49
-
-
Save geog4046instructor/d15a8958afc696b6f5b3 to your computer and use it in GitHub Desktop.
Googla Maps API - Add a KML layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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