如何使用生成的“密钥”在谷歌地图 [英] How to use generated "Key" in google maps

查看:124
本文介绍了如何使用生成的“密钥”在谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为从2个月开始,我正在尝试实施谷歌地图。但仍然没有完成。

问题1 问题2 问题3 是我以前的疑问。



经过长时间的研究后,我得知: -



Google只接受10个请求/秒。如果收到更多请求,它会生成一个状态'OVER QUERY LIMIT'。解决方案是购买该API(完全不确定)或者使用Google地图生成密钥,每天接受25000个请求(适合我的要求)。



现在我有一把钥匙了。问题是这是用法 。



代码片段:

<1>


 < meta charset =UTF-8/> 
< script src =http://maps.google.com/maps/api/js?key=AIz********************* ***************>< /脚本>
< script src =http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js>< / script>
< script>

$(function(){
//要连接的点列表

<?php
******* ****

这会提醒您:

提供的Google API密钥无效或本网站无权使用它

2。

 < meta charset =UTF-8/> 
< script src =http://maps.google.com/maps/api/js ?传感器=真实密钥= AIZ ************************************>?< /脚本>
< script src =http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js>< / script>
< ;脚本>

$(function(){
//要连接的点列表

<?php
**** *******

传感器的使用消除了警报,但它仍然给出状态'OVER QUERY LIMIT'。



如上所述, 我>尝试编辑凭证,但没有任何结果。



工作小提琴



请帮助我解决这个问题。如果可能的话,请给出任何直接的步骤,而不是这么多的链接和间接指示/评论。



谢谢

解决方案

我想我应该停止使用SO ...
这个答案适用于像我这样的初学者。



1。 Google API V3不需要传感器



2.使用浏览器键 - < script src =http://maps.google的.com /地图/ API / JS?键= AIZ ************************************> ;< / c>



3. 编辑允许引用 c $ c> credentials 给出完整的路径。
在此答案中解释


Since from 2 months I am trying to implement google maps.But still am not done with it.

Question 1,Question 2,Question 3 were my previous doubts.

After a long research I got to know that:-

"Google accepts only 10 requests/sec.If it receives more, then it generates a status 'OVER QUERY LIMIT'.Solutions are to buy that API(not sure about it completely) OR Generate a key with Google Maps which will accept 25000 req/day(Suitable for my requirement)".

Now I have a key.The issue is "It's usage".

Code snippet:

1.

<meta charset="UTF-8" />
    <script src="http://maps.google.com/maps/api/js?key=AIz************************************"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script>

$(function () {
    //The list of points to be connected

<?php
***********

This gives an alert:

"The provided Google API key is invalid or this site is not authorized to use it"

2.

<meta charset="UTF-8" />
    <script src="http://maps.google.com/maps/api/js?sensor=true?key=AIz************************************"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script>

$(function () {
    //The list of points to be connected

<?php
***********

Usage of sensor removes the alert but it still gives the status 'OVER QUERY LIMIT'.

As mentioned here I've tried editing the credentials and all but nothing works out.

Working fiddle

Kindly help me out in solving this. If possible give any direct steps, instead of so many links and indirect instruction/comments.

Thank you

解决方案

I think I should stop using SO... This answer is for the beginners like me.

1.No need of sensor in Google API V3

2.Use browser key like this - <script src="http://maps.google.com/maps/api/js?key=AIz************************************"></script>

3.In Edit allowed references under credentials give the complete path. Explained in this Answer

这篇关于如何使用生成的“密钥”在谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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