Simple, self-containted Google Maps JavaScript API v3 example, takend from Code Samples.
Last active
August 29, 2015 14:09
-
-
Save juliaogris/627174bf33812dae174e to your computer and use it in GitHub Desktop.
GMaps JS API v3 - Hello World!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>Simple markers</title> | |
<style> | |
html, body, #map-canvas { | |
height: 100%; | |
margin: 0px; | |
padding: 0px | |
} | |
</style> | |
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script> | |
<script> | |
function initialize() { | |
var myLatlng = new google.maps.LatLng(-25.363882,131.044922); | |
var mapOptions = { | |
zoom: 4, | |
center: myLatlng | |
}; | |
var mapCanvas = document.getElementById('map-canvas'); | |
var map = new google.maps.Map(mapCanvas, mapOptions); | |
var marker = new google.maps.Marker({ | |
position: myLatlng, | |
map: map, | |
title: 'Hello World!' | |
}); | |
} | |
google.maps.event.addDomListener(window, 'load', initialize); | |
</script> | |
</head> | |
<body> | |
<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