2010-08-20 112 views
35

我从我的应用程序访问谷歌地图时,当我从Java脚本发送超过10个请求循环时出现问题我从地理编码器服务获取异常作为OVER_QUERY_LIMIT。 有什么办法,我可以摆脱这一点,我试着给一些时间延迟使用setInterval()等..但不工作。OVER_QUERY_LIMIT使用谷歌地图时

+0

可能重复http://stackoverflow.com/questions/2419219/how-do-i-geocode-20-addresses-without-收到查询限制响应) – Gilles 2011-06-28 09:03:18

+0

在这个问题中,我提出了一个答案,它将继续发送请求,直到它们都成功:http://stackoverflow.com/questions/7649155/avoid-geocode-limit-on -custom - 谷歌地图与 - 多标记/ 7651681#7651681 – 2011-10-04 17:27:38

+0

看吧: http://stackoverflow.com/questions/16659398/google-maps-over-query-limit – user2403424 2013-05-25 22:08:51

回答

0

有一个API列表并随机使用它们为每个请求。 对于蟒

像钥匙=实施例[KEY1,KEY1,KEY3 ....]

location = Geocoder(random.choice(keys)).geocode(address) 

location = Geocoder(random.choice(keys)).reverse_geocode(Lat,Long) 

根据您的需要

3

地理编码在JavaScript API是速率受限的。当您第一次加载API时,您可以发送10个地址地址解析请求或5个反向(latlng)地理编码请求,然后获得OVER_QUERY_LIMIT响应。当你这样做时,使用“exponential backoff”来延迟你的查询。

您可能还想加入Issue 4805(gmaps-api-issues)中的讨论。

0
We can use ajax queue. 
At a time 20 ajax request will get executed and other will wait in queue. 
Create multiple geocode key and keep in array and use it randomly for each ajax request. 

Here I have loaded 2200 markers. It takes around 1 min to add 2200 locations. 
<https://jsfiddle.net/suchg/qm1pqunz/11/> 
的[我怎么地理编码20个地址没有收到OVER_QUERY_LIMIT回应?](
+0

这种解决方案可能是反对ToS,[10.4b](https://developers.goo gle.com/maps/terms#10-license-restrictions) – xomena 2016-11-07 11:05:00