我想對地址解析超過1,000個地址並將值存儲在XML文件中。問題是我在第十個地址後收到OVER_QUERY_LIMIT錯誤。 我已經看到其他帖子提示每個地理編碼之間等待X秒,但這似乎不適用於我。下面是一段我的代碼:地址解析結束查詢限制解決方法
<div id="locations"></div>
$(xml).find('marker').each(function (i)
{
var storeName = $(this).attr('name');
var address = $(this).attr('address');
setTimeout(function(){
g.geocode(address, function(data)
{
if(data != null)
{
olat = data.latitude;
olng = data.longitude;
var marker = "<marker name='" + storeName + "' lat='" + olat + "' lng='" + olng + "' />";
$('#locations').append(marker);
}
else
{
//Unable to geocode
alert('ERROR! Unable to geocode address');
}
});
}, 1000);
});
可能重複的[我如何Geocode 20地址沒有收到OVER_QUERY_LIMIT響應?](http://stackoverflow.com/questions/2419219/how-do-i-geocode-20-addresses-without-receiving-an -over-query-limit-response) – 2012-08-10 16:42:14