Skip to content

Instantly share code, notes, and snippets.

@dodyw
Created January 14, 2012 01:18
Show Gist options
  • Save dodyw/1609727 to your computer and use it in GitHub Desktop.
Save dodyw/1609727 to your computer and use it in GitHub Desktop.
google map v3 start code
<html>
<head>
<style type="text/css">
div#map{ width:750px; height:500px; }
</style>
</head>
<body>
<div id="map"></div>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
window.onload = function() {
var settings = {
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 15,
center: new google.maps.LatLng(-7.267543, 112.793925)
};
var map = new google.maps.Map(document.getElementById("map"), settings);
var marker = new google.maps.Marker({
position: new google.maps.LatLng(-7.267543, 112.793925),
map: map
});
var infowindow = new google.maps.InfoWindow({
content: 'Hello world'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment