本地主机的Googlemaps API密钥 [英] Googlemaps API Key for Localhost
问题描述
我如何获得googlemaps API key在localhost上工作?
我已经创建了一个API密钥,并且在查阅者之下添加了以下内容:
接受来自这些HTTP引用者(网站)的请求(可选)
使用通配符的星号。如果您将此项留空,则会向任何推荐人接受
的请求。请务必在生产中使用此关键字
之前添加引用链接。
localhost
这不起作用,如果我排除api键,工作吗?
<1>首先到这个地址:
https://console.developers.google.com/apis
2-创建您的项目的api键,
3-点击库和
4-点击任何api您想要的,
5-点击启用(右上),
6-点击凭证,点击编辑密钥
7-在密钥限制中选择HTTP引用者(网站)
然后在文本框中输入您的网站地址或本地主机(用于在本地主机中测试),然后输入以添加到列表中,(添加localhost,127.0.0.1,localhost:port等)
9-然后在您的项目中使用键。
How do I get googlemaps api key to work on localhost?
I've created an API key and under referers I add the following:
Accept requests from these HTTP referrers (websites) (Optional)
Use asterisks for wildcards. If you leave this blank, requests will be
accepted from any referrer. Be sure to add referrers before using this key
in production.
localhost
This doesnt work and if I exclude the api key it doesnt work either?
1- first go to this address: https://console.developers.google.com/apis
2- create a api key for your project,
3- click on Library and
4- click on any api that you want,
5- click on Enable (top right),
6- click on Credentials, click edit key
7- in "Key restriction" select "HTTP referrers (web sites)"
8- then type your website address or "localhost"(for test in localhost) in textbox field and enter for add to list, (add "localhost", "127.0.0.1", "localhost:port" and etc)
9- then use key in your project..
这篇关于本地主机的Googlemaps API密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!