Created
September 14, 2017 17:37
-
-
Save cchang62/5ed98e402f6268b8cb6ae5367e045ba7 to your computer and use it in GitHub Desktop.
// source https://jsbin.com/halecutizi
This file contains hidden or 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> | |
<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