2010-08-20 47 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