我按照 Google 教程了解如何为浏览器生成 API key ,但由于 key 无效错误,我无法加载 map 。
针对相关问题发布的解决方案均不适用于我的案例。
这是我的代码:
<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>
网络控制台日志:
"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
最佳答案
您是否使用一些库,例如地点库或地理编码?
删除 API key 并尝试。
如果使用,请尝试此-:
<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>
关于javascript - 由于错误代码 : InvalidKeyOrUnauthorizedURLMapError,提供的 Google API key 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31731367/