|
楼主 |
发表于 2018-1-12 11:16:38
|
显示全部楼层
<!DOCTYPE html>
<html>
<head>
<style>
#map {
height: 400px;
width: 100%;
}
</style>
</head>
<body>
<h3>My Google Maps Demo -- BeiJing</h3>
<div id="map"></div>
<script>
function initMap() {
var uluru = {lat: 39.9, lng: 116.3};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: uluru
});
var marker = new google.maps.Marker({
position: uluru,
map: map
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key='密钥'&callback=initMap">
</script>
</body>
</html> |
|