我的谷歌地图JavaScript API不再工作了。看起来谷歌屏蔽了我。看看this link吧。在控制台中,我得到以下错误:
Google Maps JavaScript API error: RefererDeniedMapError
https://developers.google.com/maps/documentation/javascript/error-messages#referer-denied-map-error
_.Ic @ js?key=AIzaSyDyECNnY4HOjiGu7m0f43yvlNe7Y9AgRcs&callback=initMap:53
以下是我的google控制台屏幕截图:
下面是我的代码:
<!DOCTYPE html>
<html>
<head>
<style>
/* Set the size of the div element that contains the map */
#map {
height: 400px; /* The height is 400 pixels */
width: 100%; /* The width is the width of the web page */
}
</style>
</head>
<body>
<h3>My Google Maps Demo</h3>
<!--The div element for the map -->
<div id="map"></div>
<script>
// Initialize and add the map
function initMap() {
// The location of Uluru
var uluru = {lat: -25.344, lng: 131.036};
// The map, centered at Uluru
var map = new google.maps.Map(
document.getElementById('map'), {zoom: 4, center: uluru});
// The marker, positioned at Uluru
var marker = new google.maps.Marker({position: uluru, map: map});
}
</script>
<!--Load the API from the specified URL
* The async attribute allows the browser to render the page while the API loads
* The key parameter will contain your own API key (which is not needed for this tutorial)
* The callback parameter executes the initMap() function
-->
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDyECNnY4HOjiGu7m0f43yvlNe7Y9AgRcs&callback=initMap">
</script>
</body>
</html>
我怎么才能修复它呢?!
发布于 2018-10-13 03:22:52
https://developers.google.com/maps/documentation/javascript/error-messages#referer-denied-map-error
在收到几封电子邮件通知后,您的应用程序因违反谷歌地图平台服务条款而被阻止。
因此,要解除对网站的封锁,唯一的选择就是按照文档中提到的那样向Google提交一份web表单。
我希望这能帮到你!
https://stackoverflow.com/questions/52785374
复制相似问题