I'm confused over whether the API usage limits of 2500 geocoding requests per day ( http://code.google.com/apis/maps/documentation/geocoding/#Limits ) and 25,000 Javascript maps per day ( http://code.google.com/apis/maps/faq.html#usagelimits ) are referring to the requests generated by the website visitor 开发者_运维百科or by the web server serving the page that contains the map or makes the geocoding requests?
Last time I checked (2 months ago) the geocoding requests where based per IP, so if you or a person from your same IP address (assuming you are from a corporation that connects to the internet using one IP) does geocoding requests on Google Maps, they are counted together.
I'll look up the page where is explained, EDIT found:
There are limits on the number of geocoding requests per day and the rate of geocoding requests per second that Google will service from a single IP address. By using client side geocoding you ensure that these limits apply to each user individually, rather than to the combined request volume generated by all of your users. It also ensures that the requests are made directly to Google, which will improve the performance of your application.
here the original: http://code.google.com/intl/it/apis/maps/faq.html
Geocoding strategies: http://code.google.com/apis/maps/articles/geocodestrat.html
When to Use Client-Side Geocoding
The basic answer is "almost always". As geocoding limits are per IP address, that limit counts against the consumer of your application. It's going to be very rare that someone is going to enter more than 2,500 addresses a day sitting at their computer. Therefore, running client-side geocoding, you generally don't have to worry about your quota.
Two basic architectures for client-side geocoding exist.
- Run the geocoding and display entirely in the browser. For instance, the user enters an address on your page. Your application geocodes it. Then your page uses the geocode to create a marker on the map. Or your app does some simple analysis using the geocode. No data is sent to your server. This reduces load on your server, but doesn't give you any sense of what your users are doing.
- Run the geocode in the browser and then send it to the server. For instance, the user enters an address. Your application geocodes it, in the browser. The app then sends the data to your server. The server responds with some data, such as nearby points of interest. This allows you to customize a response based on your own data, and also to cache the geocode if want. This cache allows you to optimize even more. You can even query the server with the address, see if you have a recently cached geocode for it, and if you do, use that. If you don't, then return no result to the browser, and let it geocode the result and send it back to the server to for caching.
On a cautionary note, some mobile networks share IP addresses among many phones. That can cause problems for your client side app. If a lot of people on their smart phones are looking at your map. If you anticipate heavy mobile use, you might consider having a server-side back-up as a fail-over. Try to geocode in the browser and if that doesn't work, send the address to your server for http geocoding.
It's based on IP so it's roughly per user.
This might answer it:
What constitutes a 'transaction' in the context of the transaction limits that apply to the Maps API?
A single transaction occurs when:
- the Maps JavaScript API (v2 or v3) is loaded by a web page or application;
- a SWF that loads the Maps API for Flash is loaded by a web page or application;
- or a single request is made for a map image from the Static Maps API.
The degree to which a user interacts with a map once it has been loaded has no impact on the transaction limits.
http://code.google.com/apis/maps/faq.html#tos_transaction
You are using an api key to generate the maps so I am sure they are using that to track how many times it is called and not by the user ip.
Google does track by IP and limits a user, but that is different than the applications limit.
As another data point on this, the limits are there but won't be enforced until early 2012 according to this post on the Google Geo Developers Blog. And it's true that the limits are per-site.
精彩评论