哎呀!出了些问题。此页面未正确加载Google地图。查看JavaScript控制台了解技术细节 [英] Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details
问题描述
糟糕!出了些问题。
此页面未正确加载Google地图。
我不知道为什么
API错误:RefererNotAllowedMapError
<!DOCTYPE html>< html> < HEAD> < title>简易地图< /标题> < meta name =viewportcontent =initial-scale = 1.0> < meta charset =utf-8> <风格> html,body {height:100%;保证金:0;填充:0; } #map {height:100%; }< / style> < /头> <身体GT; < div id =map>< / div> <脚本> var map;函数initMap(){map = new google.maps.Map(document.getElementById('map'),{center:{lat:-34.397,lng:150.644},zoom:8}); }< / script> < script src =https://maps.googleapis.com/maps/api/js?key=myAPI&callback=initMapasync defer>< / script> < / body>< / html>
请查看Google maps api教程:
https://developers.google.com/maps/documentation/javascript/tutorials/adding-a-google-map
当仔细阅读时,您会发现需要一个键,YOUR_API_KEY
< script async defer
SRC = https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap >
< / script>
让您的钥匙到这里: https://developers.google.com/maps/documentation/javascript/tutorials/adding-a-google-map #key
Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details.
i don't know why
API error: RefererNotAllowedMapError
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=myAPI&callback=initMap"
async defer></script>
</body>
</html>
Please take a look at Google maps api tutorial: https://developers.google.com/maps/documentation/javascript/tutorials/adding-a-google-map
When reading carefully, you will see that a key, YOUR_API_KEY, is needed
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
</script>
To get your key go here: https://developers.google.com/maps/documentation/javascript/tutorials/adding-a-google-map#key
这篇关于哎呀!出了些问题。此页面未正确加载Google地图。查看JavaScript控制台了解技术细节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!