Skip to content

Instantly share code, notes, and snippets.

@leantony
Created August 13, 2015 06:36
Show Gist options
  • Save leantony/f5142610bda794f5c568 to your computer and use it in GitHub Desktop.
Save leantony/f5142610bda794f5c568 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
html,
body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
// callback function which will be triggerd when the gmap script finishes loading
function displayMap() {
// location
var loc = {
lat: 36.870755,
lng: -1.234250
};
map = new google.maps.Map(document.getElementById('map'), {
center: loc,
zoom: 8
});
var marker = new google.maps.Marker({
position: loc,
map: map,
title: 'Thats the place!'
});
marker.setAnimation(google.maps.Animation.BOUNCE);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?callback=displayMap" async defer></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment