首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在谷歌地图JavaScript API上修复RefererDeniedMapError?

如何在谷歌地图JavaScript API上修复RefererDeniedMapError?
EN

Stack Overflow用户
提问于 2018-10-13 02:41:23
回答 1查看 701关注 0票数 -1

我的谷歌地图JavaScript API不再工作了。看起来谷歌屏蔽了我。看看this link吧。在控制台中,我得到以下错误:

代码语言:javascript
复制
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控制台屏幕截图:

下面是我的代码:

代码语言:javascript
复制
<!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>

我怎么才能修复它呢?!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-13 03:22:52

https://developers.google.com/maps/documentation/javascript/error-messages#referer-denied-map-error

在收到几封电子邮件通知后,您的应用程序因违反谷歌地图平台服务条款而被阻止。

因此,要解除对网站的封锁,唯一的选择就是按照文档中提到的那样向Google提交一份web表单。

我希望这能帮到你!

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52785374

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档