如何检测 Google 地图中已达到每天 25000 个请求的限制? [英] How to detect that the 25000 request per day limit has been reached in Google Maps?

查看:26
本文介绍了如何检测 Google 地图中已达到每天 25000 个请求的限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Google Maps Javascript API v3 开发一个网站.

I'm working on a website using the Google Maps Javascript API v3.

API 的免费版本限制为每天 25000 个请求.但是如果达到这个限制会发生什么?

The free version of the API is limited by 25000 requests a day. But what happens if this limit is reached?

有没有办法检测已达到请求限制,以便显示后备 Google Maps Image API 地图?

Is there a way to detect that the request limit has been reached so a fallback Google Maps Image API map can be displayed instead?

推荐答案

使用限制基于站点或应用程序,而不是客户端 IP 地址.

The usage limit is based on site or application, not the client IP address.

如果您向每个地图请求添加 API 密钥,则可以使用 Google API 控制台来监控您的使用情况.我还没有看到以编程方式查询使用情况的方法.https://code.google.com/apis/console

You can use the Google API console to monitor your usage if you add an API key to each of your map requests. I have not seen a way to query the usage programmatically. https://code.google.com/apis/console

根据@alds 下面的评论,JS Maps API v3 和 Static Maps API 似乎是单独的服务,因此具有单独的请求限制.使用静态 Google 地图图像可能会有所帮助.

Per the comment below by @alds, it does appear that JS Maps API v3 and Static Maps API are separate services, therefore having separate request limits. Falling back to a static Google map image could help.

这也更详细地解释了使用限制:http://googlegeodevelopers.blogspot.com/2011/11/understanding-how-maps-api-usage-limits.html

This also explains the usage limits in better detail: http://googlegeodevelopers.blogspot.com/2011/11/understanding-how-maps-api-usage-limits.html

这篇关于如何检测 Google 地图中已达到每天 25000 个请求的限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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