Google Maps API警告:NoApiKeys [英] Google Maps API warning: NoApiKeys

查看:583
本文介绍了Google Maps API警告:NoApiKeys的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Google Maps API v3,但没有API密钥,并且运行良好。

它仍然有效,但我在控制台中收到警告:


Google Maps API警告:NoApiKeys
https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys


我包含脚本的标准方式:

 < script src =https://maps.googleapis.com/maps/api/js?libraries=places>< / script> 

google.maps.version 表示我在使用3.24.2。



在Google文档中,我只能看到获取密钥的不同方法,但没有指示是否需要密钥。我今天注意到了这个警告,我很确定它几周前没有出现。



现在一切正常,但恐怕地图没有API密钥的访问将在未来停止。我不愿意注册一个密钥,如果我不绝对需要。



我应该担心吗?

解决方案

创建和使用密钥是最好的选择。
在您的应用程序在连续90天内每天达到25000次电话的情况下,这种用法是免费的。

BTW .:在Google开发者文档中, api key作为选项{key:yourKey}调用API创建新实例时。
然而,这不会甩掉控制台警告。
您必须在包含api时添加该键作为参数。

 < script src =https: //maps.googleapis.com/maps/api/js?key=yourKEYhere\"></script> 

在此获取密钥: GoogleApiKey Generation site


I've been using Google Maps API v3 for some time without an API key, and it worked well.
It still works, but I get a warning in the console:

Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys

I include the script the standard way:

<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>

And google.maps.version indicates that I'm using 3.24.2.

In the Google documentation I can only see the different ways to obtain a key, but there is no indication if it's required or not. I noticed the warning today and I'm quite sure it didn't appear a few weeks ago.

Everything is working fine for now, but I'm afraid that maps access without an API key will be ceased in the future. I'm reluctant to register for a key if I don't absolutely need to.

Should I worry about it?

解决方案

Creating and using the key is the way to go. The usage is free until your application reaches 25.000 calls per day on 90 consecutive days.

BTW.: In the google Developer documentation it says you shall add the api key as option {key:yourKey} when calling the API to create new instances. This however doesn't shush the console warning. You have to add the key as a parameter when including the api.

<script src="https://maps.googleapis.com/maps/api/js?key=yourKEYhere"></script>

Get the key here: GoogleApiKey Generation site

这篇关于Google Maps API警告:NoApiKeys的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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