谷歌地图错误:InvalidKeyOrUnauthorizedURLMapError [英] Google Map error: InvalidKeyOrUnauthorizedURLMapError
问题描述
我正在用 JavaScript/HTML/CSS 开发一个使用 Google 地图的应用.我收到以下警告对话框:
I am developing in JavaScript/HTML/CSS an app that uses Google Maps. I am getting the following alert dialog box:
此页面无法显示 Google 地图元素.提供的 Google API 密钥无效或此站点无权使用它.错误代码:InvalidKeyOrUnauthorizedURLMapError"
"This page was unable to display a Google Maps element. The provided Google API key is invalid or this site is not authorized to use it. Error Code: InvalidKeyOrUnauthorizedURLMapError"
应用确实实际显示地图元素;警报不是问题,除非它根本不应该出现.地图显示正常.
The app does actually display the map element; the alert is not a problem except it should not appear at all. The map displays properly.
我已进入 Google 开发者控制台,并在凭据"部分将允许的引用者"编辑为 mydomain.com/*
I have gone in to the Google Developer's Console and, in the "Credentials" section, have "edited allowed referrers" to be mydomain.com/*
我还进入了 API 部分的 Google Developer's Console,并启用了 11 个 Google Maps API.
I have also gone in to the Google Developer's Console in the APIs section and enabled 11 Google Maps APIs.
推荐答案
经过多次引用组合、删除和重新创建凭据后,我意识到我没有启用Google Maps JavaScript API".真可惜.:)
After lots of referrer combinations, deleting and re-creating credentials i realized that i didn't enabled "Google Maps JavaScript API". What a shame. :)
对于无法使用 google maps api 的任何人,请先检查是否启用了 API.
For anyone who is having trouble to get google maps api work please check if the API enabled first.
这篇关于谷歌地图错误:InvalidKeyOrUnauthorizedURLMapError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!