Skip to content

Instantly share code, notes, and snippets.

Last active March 29, 2017 15:54
What would you like to do?
<!DOCTYPE html>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Simple markers</title>
/* 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;
<div id="map"></div>
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 async defer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment