Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

javascript - How to detect that the 25000 request per day limit has been reached in Google Maps?

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

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...