我知道 Google 将每天的请求上限限制为 2,500 个...但是我今天不可能发出这么多请求,而且我一直收到“OVER_QUERY_LIMIT”
$street_no = get_post_meta($prop->ID, 'street_no', true);
$street = get_post_meta($prop->ID, 'street', true);
$street_suffix = get_post_meta($prop->ID, 'street_suffix', true);
$addr = urlencode( $street_no." ".$street." ".$street_suffix." BC Canada" );
$url = 'http://maps.googleapis.com/maps/api/geocode/json?address='.$addr.'&sensor=true';
$json_result = json_decode(file_get_contents($url));
if ( $json_result->status === "OVER_QUERY_LIMIT" ) :
sleep(2);
$json_result = json_decode(file_get_contents($url));
endif;
正如你所看到的,如果我得到的状态OVER_QUERY_LIMIT
我告诉脚本休眠 2 秒,然后继续...这似乎在今天早上的某个时候起作用,但现在我什至无法对单个地址进行地理编码。
我现在不知道该怎么办......这使我的应用程序完全无用。
也许您每秒发送太多查询?
查看此线程:
使用 Google 地图时超过 OVER_QUERY_LIMIT https://stackoverflow.com/questions/3529746/over-query-limit-while-using-google-maps
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)