Skip to content

Instantly share code, notes, and snippets.

@ammist
Created March 1, 2013 20:24
Show Gist options
  • Save ammist/5067485 to your computer and use it in GitHub Desktop.
Save ammist/5067485 to your computer and use it in GitHub Desktop.
Google Map with Two Markers
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Google Maps JavaScript API v3 Example: Marker Simple</title>
<link href="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet">
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var myLatlng2 = new google.maps.LatLng(-25.363883,132.044925);
var mapOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng2,
map: map,
title: 'Hello World!'
});
var marker2 = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World, also!'
});
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment