为什么我的 Google Maps API 密钥无效?
这是我在这里提出的第一个问题,我在研究中没有找到答案.
It's my first question here and I didn't found an answer in my research.
在旧网站(不是我的)上,我的谷歌地图 API 密钥有问题.tao-yin.com(法国旗琼协会).有 2 个月了,我为这个网站做了一张地图(在 2 个地方).
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).
这里:http://www.tao-yin.com/arts_classiques_tao/liste_associations.html
这里:http://www.tao-yin.com/pratique-qi-gong/Cours_stages.htm
一切都很好,有一段时间了.这是一张在 UI 事件中访问参数的地图.现在,我了解到,(如您所见)由于密钥无效,2 个地图已失效.英文错误提示:
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 已禁止为此应用程序使用 Maps API.这提供的密钥不是有效的 Google API 密钥,或者未经授权用于本网站上的 Google Maps Javascript API v3.如果你是此应用程序的所有者,您可以了解如何获取有效密钥这里:https://developers.google.com/maps/documentation/javascript/tutorial#Obtaining_Key
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
我很惊讶.为什么密钥不再有效但之前还可以?我读到 v2 自 5 月 19 日起不再有效,但它是一个 v3key (activatedd).对于代码(我不是专家),我在互联网上举了一个 v3 的例子.
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.
- 我尝试更改密钥并删除旧密钥:同样的问题
- 我尝试了 2 个键(一个用于地图):同样的问题
- 我尝试用另一个(谷歌示例)更改代码 javascript:同样的问题
- 我试图编写一个更好的 html 代码:同样的问题
我不知道发生了什么.我想我违反了规则,但哪一个?这是给朋友的,是给协会的.这是免费的.
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.
有人有想法吗?
我不知道该怎么办:我怎样才能在这个网站上放一个谷歌地图?我读到可以直接使用 googlemap 和 iframe,但我需要特定的事件.不仅仅是地址.
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:
问题出在 API 密钥中网站的声明中.
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.com/.
但是,这里:https://developers.google.com/console/help/?hl=fr#restrictingusageURL 模式:不错的选择.这是逻辑.
But, here : https://developers.google.com/console/help/?hl=fr#restrictingusage URL Pattern : the good choice. It's logic.
在我之前:.tao-yin.com/"它正在工作(所以我不会问更多)但这不是逻辑,因为它不在子域上.
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.
现在一切正常:www.tao-yin.com"
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.