为什么我的Google Maps API密钥无效? [英] Why has my Google Maps API key become invalid?

查看:718
本文介绍了为什么我的Google Maps API密钥无效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的第一个问题,我在我的研究中没有找到答案。



我的google map API密钥有问题,旧的网站(不是我的)。 tao-yin.com(法国奇琼协会)。有2个月,我为这个网站做了一个地图(2个地方)。



这里: http://www.tao-yin.com/arts_classiques_tao/liste_associations.html



和这里: http://www.tao-yin.com/pratique-qi -gong / Cours_stages.htm



一切都很好,一段时间。这是一个在UI事件中使用访问参数的地图。
现在,我了解到,(因为你可以看到它),因为密钥是无效的,所以2映射出去了。
英文错误消息:


Google禁止在此应用中使用Maps API。所提供的
密钥不是有效的Google API密钥,或者对于此网站上的Google Maps JavaScript API v3,未授权
。如果您是此应用程序的
所有者,则可以在此处了解如何获取有效密钥

https://developers.google.com/maps/documentation/javascript/tutorial#Obtaining_Key


我很惊讶。为什么钥匙不再有效,但以前可以吗?
我读到v2自5月19日以来不再有效,但它是v3key(已激活)。对于代码(我不是专家),我在互联网上为v3做了一个例子。


  1. 我尝试更改密钥并清除旧密码:同样的问题

  2. (一个用于地图):同样的问题

  3. 我尝试用另一个(google例子)更改代码javascript:同样的问题

  4. 试图做出更好的html代码:同样的问题

我不知道发生了什么。我想我打破了一条规则,但是最重要的是?这是一个朋友,一个协会。这是免费的。



有人有想法吗?

我不知道该怎么做:怎么可以我把googlemap放在这个网站上?我读到可以直接使用googlemap和iframe,但我需要特定的事件。不仅仅是一个地址。

解决方案

我找到了解决方案,它非常简单:

问题在于API key中的网站声明。



在声明的窗口中,我们有这样的例子来跟踪底部。


示例: .example.com /

但在此处: https://developers.google .com / console / help /?hl = fr#restricttingusage
URL模式:不错的选择。
这是逻辑。



之前,我有:.tao-yin.com /
,它工作(所以我不问更多),但它不是逻辑,因为它不在一个子域名。



现在一切正常:www.tao-yin.com



所以:不要效仿谷歌的例子;-)正确地遵循指令。
感谢所有人。


It's my first question here and I didn't found an answer in my research.

I've got a probleme with my google map API key, on a old site (not mine). tao-yin.com ( French associations of Qiqong). There's 2 months, i did a map for this website (in 2 places).

Here : http://www.tao-yin.com/arts_classiques_tao/liste_associations.html

and here : http://www.tao-yin.com/pratique-qi-gong/Cours_stages.htm

Everything was ok, for a while. It's a map with Accessing Arguments in UI Events. Now, I learned that, (as you can see it) the 2 map are out because the key is invalid. The English error message:

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#Obtaining_Key

I'm suprised. Why is the key no longer valid but was ok before ? I read that the v2 is not more valid since the 19 may, but it's a v3key (activatedd). And for the code (i'm not an expert) I took an exemple for v3 on the internet.

  1. I tried to change the key and erase the old : same problem
  2. I tried 2 key ( one for map) : same problem
  3. I tried to change the code javascript with a another one ( a google example) : same problem
  4. I tried to make a better html code : same probleme

I don't know what happened. I think i break a rule , but wich one ? It's for a friend, for an association. It's for free.

Somebody have an idea ?

I don't not what to do: how can i put a googlemap on this website ? I read that it's possible directly with googlemap and an iframe, but i need specific event. Not just an address.

解决方案

I found the solution, it's very simple:

the problem was in the declaration of the website in the API key.

In the windows of declaration we have this exemple to followon the bottom.

Example: .example.com/.

But, here : https://developers.google.com/console/help/?hl=fr#restrictingusage URL Pattern : the good choice. It's logic.

Before i had : ".tao-yin.com/" and it was working (so i don't ask more) but it's not logic because its not on a subdomains.

Now everything is ok with : "www.tao-yin.com"

So : don't follow the example of Google ;-) juste follow the instruction. Thank's to everybody.

这篇关于为什么我的Google Maps API密钥无效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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