加载Google Maps API JavaScript时出现不同的错误(配额,禁用,错误的API密钥或无) [英] Different errors (quota, disabled, bad API key, or none) when loading Google Maps API JavaScript

查看:92
本文介绍了加载Google Maps API JavaScript时出现不同的错误(配额,禁用,错误的API密钥或无)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将我们的网站移植到Google地图上,但是当使用JavaScript Maps API加载地图时(当然是v3),我们会遇到不同的错误。其他时候地图加载正确。两个最突出的错误是:


Google禁止在此应用中使用Maps API。服务获取更多信息
http://www.google.com/intl/zh-CN/ /en_US/help/terms_maps.html 。 (JS Alert)

和:


该网站已超过每日地图配额,如果您是该网站的
创建者,请访问文档以了解更多信息。
(这是一个DOM叠加层)


实例最少的示例
这代码还没有生效,但这里有一个简单的例子: http://mappat.com/maptest.php 。这只是Google自己的Hello World例子,我们的关键字填写了,甚至出现问题。



网络流量检测
I注意到'AuthenticationService.Authenticate'失败时返回第一个错误(返回[0,5,0]),第二个错误在'QuotaService.recordEvent'返回[0,null,0]时显示。这些是来自SDK内部的远程调用,我不知道这些细节是否相关。



我们尝试过
通过这种方式启用结算功能,我们保持低于配额限制。我已经尝试了很多东西,新密钥,等待几天,关闭Maps API并在控制台中再次打开,等等。我填入了允许的引用链,但也将其打开以允许其他链接。



我不敢在开发控制台启动一个新项目,因为当我真的这样做时,整个事情开始了,因为我有(不同的)问题与服务器密钥。这个服务器部分现在工作完美顺便,有点讽刺。
$ b

[编辑):我只是试图在加载JS maps文件时忽略API密钥,这似乎有效。但是现在服务器端对places / searchtext的调用开始随机给出提供的API密钥已过期。错误,再次(我们创建新项目的原因相同)。巧合?另外,我不喜欢这个选项,特别是关于未来(达到25K,超越和去商业帐户)]。

所以,我卡住了。因此,我的第一个SO问题。难道我们被列入黑名单?也许是因为重复项目?有没有办法找到并/或让我们重置?或者我只是俯视一些东西?



任何帮助的赞赏,因为直到我们解决这个问题,这是一个破坏交易。



旁注:我又提出了错误报告,因为我觉得自己给随机误差不是预期的行为。由开发团队决定是否同意。如果不是这样,我们仍然有问题,所以这是一个问题。

解决方案

这个问题在一个星期左右后神奇地消失了。



我没有收到Google的任何回应,但当然,他们可能会在幕后更改/重置某些内容。顺便提一句,这个bug仍然标记为'new'。



我对这个问题的其他人的建议是首先检查一些基本的东西,因为我得到的个别错误可能也来自于你做错的实际事情(即允许查阅者错误)。如果在三重检查后一切似乎都没有问题,只需从请求中删除API密钥,然后像这样测试一段时间,然后在几天内重试。


We ported our site to Google maps, but we get different errors when loading a map using the JavaScript Maps API (v3 of course). Other times the map loads correctly. The two most prominent errors are:

"Google has disabled use of the Maps API for this application. See the Terms of Service for more information http://www.google.com/intl/en_US/help/terms_maps.html." (JS Alert)

And:

"This site has exceeded its daily quota for maps. If you are the creator of this site, please visit the documentation to learn more." (this is a DOM overlay)

Live minimal example: This code is not yet live but there's a minimal example here: http://mappat.com/maptest.php. It is simply Google's own Hello World example with our key filled in and even that gives problems.

Network traffic inspection: I noticed the first error is shown when 'AuthenticationService.Authenticate' fails (returns [0,5,0]), the second when 'QuotaService.recordEvent' returns [0,null,0]. These are remote calls from within the SDK and I don't know if these details are relevant.

What we tried: Billing is enabled by the way and we stay way below our quota limits. I tried a lot of things already, new key, waiting a few days, turning the Maps API off and on again in the console, etc. I filled in the allowed referrers but also left it open to allow others. No difference.

I don't dare to start a new project in de dev console because this whole thing started when I did actually just that because I had (different) problems with the server-key. That server part is now working flawlessly btw, kind of ironically.

[Edit: I just tried to leave out the API key when loading the JS maps file, which, fingers crossed, seems to work. But now the server-side calls to places/searchtext start to give random "The provided API key is expired." errors, again (same reason we created the new project). Coincidence? Also, I don't like this option, especially with regards to the future (reaching 25k, going beyond and going Business Account)].

So, I'm stuck. Hence my first SO question ever. Could it be that we are blacklisted? Perhaps because of the duplicate project? Is there a way to find that out and/or to get us 'reset'? Or am I simply overlooking something?

Any help is appreciated because until we solve this, this is a deal-breaker.

Sidenote: I also filed a bug report because I think giving random errors on itself is not expected behaviour. It's up to the dev team to decide if they agree. If not, we still have a problem, hence this SO question.

解决方案

This issue magically disappeared after a week or so.

I didn't get any response from Google, but they may have change/reset something behind the scenes, of course. The bug is still marked 'new', by the way.

My advice to others having this issue is to first check some basic things, since the individual errors I got could also result from actual things you're doing wrong (ie mistake in allowed-referers). If all seems okay after triple checking, just remove the API key from the request, test along like that for a while and retry in a couple of days.

这篇关于加载Google Maps API JavaScript时出现不同的错误(配额,禁用,错误的API密钥或无)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆