Skip to content

Instantly share code, notes, and snippets.

@ZachMoreno
Last active November 15, 2016 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZachMoreno/1a62d94398ad9f060e27e6cb2a03316a to your computer and use it in GitHub Desktop.
Save ZachMoreno/1a62d94398ad9f060e27e6cb2a03316a to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<title>Google Map Example</title>
<style>
html,
body,
#my-map {
height: 100vh;
width: 100vw;
}
</style>
</head>
<body>
<div id="my-map"></div>
</body>
<!-- ADD YOU API KEY BELOW -->
<script src="https://maps.googleapis.com/maps/api/js?key=<YOUR-API-KEY>&callback=initMaps" async defer></script>
<script>
var myMap,
myMarker,
myCoords = {lat: 37.823779, lng: -122.230583};
function initMaps() {
myMap = new google.maps.Map(document.getElementById('my-map'), {
center: myCoords,
zoom: 11,
mapTypeId: 'terrain',
zoomControl: true,
scrollwheel: false,
mapTypeControl: false,
scaleControl: false,
streetViewControl: false,
rotateControl: false,
fullscreenControl: false,
styles: []
});
myMarker = new google.maps.Marker({
position: myCoords,
// icon: '',
map: myMap
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment