【问题标题】:The provided Google API key is invalid due to Error Code: InvalidKeyOrUnauthorizedURLMapError由于错误代码,提供的 Google API 密钥无效:InvalidKeyOrUnauthorizedURLMapError
【发布时间】:2015-07-30 18:27:25
【问题描述】:

我按照 Google 教程介绍了如何为浏览器生成 API 密钥,但是由于密钥无效错误,我无法加载地图。

发布到相关问题的解决方案均不适用于我的情况。

这是我的代码:

    <head> 
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
  <title>myTitle</title> 

<script src="https://maps.googleapis.com/maps/api/js?key=MYKEY"
  type="text/javascript"></script>

</head> 

Web 控制台日志:

    "ApiNotActivatedMapError: https://developers.google.com/maps/documentation/javascript/tutorial#api_key" main.js line 61 > eval:50:381
Nr/this.j</<() main.js line 61 > eval:50
as</<() main.js line 61 > eval:54
Ar/d() main.js line 61 > eval:43
<anonymous> AuthenticationService.Authenticate:1

【问题讨论】:

    标签: javascript html google-api maps


    【解决方案1】:

    您是否在使用一些库,例如地点库或地理编码?

    删除 API 密钥并尝试。

    如果使用那么试试这个 -:

        <script src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
    

    如果不使用,那么试试这个 -:

        <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-19
      • 1970-01-01
      • 2020-10-13
      • 2019-04-30
      • 2023-03-30
      • 1970-01-01
      相关资源
      最近更新 更多