爲什麼Google地圖不會顯示在我的網站上,我一直在使用開發者網站?
/* This is the javascript function that makes the map load */
function initMap() {
var mapDiv = document.getElementById('map');
var map = new google.maps.Map(mapDiv, {
center: {
lat: 44.540,
lng: -78.546
},
zoom: 8
});
}
/* This is the basic css */
#map {
width: 500px;
height: 400px;
}
<!-- Javascript called into the html page -->
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="map"></div>
<script src="https://maps.googleapis.com/maps/api/js" async defer></script>
</body>
</html>
其中c嵌入Google地圖庫時會定義allback?看起來從查詢字符串 – fcalderan
中丟失了'&callback = initMap' from google api key –