Skip to content

Instantly share code, notes, and snippets.

@cchang62
Created September 14, 2017 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cchang62/5ed98e402f6268b8cb6ae5367e045ba7 to your computer and use it in GitHub Desktop.
Save cchang62/5ed98e402f6268b8cb6ae5367e045ba7 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<style>
#map {
height: 500px;
width: 100%;
}
</style>
</head>
<body lang="zh-tw">
<h3>My Google Maps Demo</h3>
<div id="map"></div>
<script>
function initMap() {
var uluru = {lat: 24.677270, lng: 121.763071}; //24.677327,121.763197
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 17,
center: uluru
});
var marker = new google.maps.Marker({
position: uluru,
map: map
});
var infowindow = new google.maps.InfoWindow({
content: "Hello World!"
});
infowindow.open(map,marker);
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDnHa8aBsakHYbYo3j5YqMCPy5No8LfMU8&callback=initMap">
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment