由于错误代码,所提供的Google API密钥无效:InvalidKeyOrUnauthorizedURLMapError

时间:2015-07-30 18:27:26

标签: javascript html google-api maps

我按照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

1 个答案:

答案 0 :(得分: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>