Skip to content

Instantly share code, notes, and snippets.

@jamesmstone
Last active March 29, 2017 15:54
Show Gist options
  • Save jamesmstone/6e99b2dc06d929bcaf91f5c7bebe9255 to your computer and use it in GitHub Desktop.
Save jamesmstone/6e99b2dc06d929bcaf91f5c7bebe9255 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
<style>
/* 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;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
function initMap() {
var myLatLng = {lat: -37.812733, lng: 144.968233};
var myotherLatLng = {lat: -37.212733, lng: 145.968233};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 8,
center: myLatLng
});
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'Hello World!'
});
var marker = new google.maps.Marker({
position: myotherLatLng,
map: map,
title: 'Hello World!'
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?callback=initMap">
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment