Google Maps V3 API密钥无效 - 但我的个人开发密钥有效 [英] Google Maps V3 API Key Invalid - but my personal dev key works
问题描述
我最近一直在开发升级我们的地图到v3,在开发过程中我使用了我自己的个人密钥。一切工作正常。当到了生产的时候,我有人通过公司的谷歌帐户生成一个密钥,现在它不起作用。我已经坐在他们旁边,确保他们正在生成浏览器密钥,并且我非常确定在推荐人部分中匹配的两个域名是正确的:
.mydomain.com /
mydomain.com / *
我已验证我们正在将Key用于浏览器应用。
我已验证Google Maps API v3是通过服务面板开启的。一切都和我用钥匙做的一样。我认为唯一的区别是他们已经在公司账户中启用了账单,因为我的账户没有。我们希望将这一点从我的关键视图中移除,因为它是如何获得我帐户中超过25k个观看次数/天的限制的。
使用公司API密钥加载地图,然后非常快速地获得一个警告框,其中显示如下内容:Google禁止在此应用程序中使用Maps API。如果您是该应用程序的所有者,您可以在此处了解如何获取有效的密钥: https://developers.google.com/maps/documentation/javascript/tutorial#api_key
如果我用自己的密钥替换密钥,使用相同的推荐人设置,它就可以工作..
任何帮助将不胜感激。
我能够通过简单地生成新的浏览器密钥来解决此问题。我生成,扔在浏览器中,地图加载。然后我进入并从前一个密钥复制我的推荐人。保存。装修一新。它仍然有效。我诚实地认为这是Google的一个漏洞,我们正在生成原始密钥的那一天,它正在吐出无效的密钥。
I've recently been doing development upgrading our maps to v3 and during development I was using my own personal key. Everything was working fine. When it was time to go to production I had someone generate a key through the company's google account and now it doesn't work. I've sat next to them making sure they were generating a browser key, and I'm pretty sure the domains are correct under the "Referrer's" section matching both: .mydomain.com/ mydomain.com/*
I've verified that we are using Key for browser apps.
I've verified that the Google Maps API v3 is turned ON via the services panel. Everything is identical to the way I was doing it with my key. I think the only difference is that they've enabled Billing on the company account where as my key doesn't. We'd like to get this moved off of my key seeing as how it's receiving more than the 25k views/day limit on my account.
When using the company API key the map loads and then very quickly I get an alert box which reads: "Google has disabled use of the Maps API for this application. The provided key is not a valid Google API Key, or it is not authorized for the Google Maps Javascript API v3 on this site. If you are the owner of this application, you can learn about obtaining a valid key here: https://developers.google.com/maps/documentation/javascript/tutorial#api_key"
If I then replace the key with my own key, with the same referrers settings, it works..
Any help would be greatly appreciated.
I was able to resolve this issue by simply generating a new browser key. I generated, threw it in the browser, the map loaded. Then I went in and copied my referrers over from the previous key. Saved. Refreshed. And it still worked. I honestly think it was a bug on Google's end and the day we were generating the original keys it was spitting out invalid keys.
这篇关于Google Maps V3 API密钥无效 - 但我的个人开发密钥有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!