0
如果我明白谷歌错误OVER_QUERY_LIMIT的权利,因为太多的IP请求。 但如果我去浏览器并加载以下链接: http://maps.googleapis.com/maps/api/geocode/xml?address=Paris&sensor=truephp xml谷歌地理编码错误
我可以看到xml!
那么为什么呢?
我的代码有问题吗?
这就是:
$the_map = htmlspecialchars($_POST['map'], ENT_QUOTES);
error_reporting(0);
$map_query = file_get_contents('http://maps.google.com/maps/api/geocode/xml?address='.rawurlencode($the_map).'&sensor=false');
error_reporting(1);
if ($map_query){
$geo_code = simplexml_load_string(utf8_encode($map_query));
if ($geo_code){
$map_lat = $geo_code->xpath("/GeocodeResponse/result/geometry/location/lat");
$map_lng = $geo_code->xpath("/GeocodeResponse/result/geometry/location/lng");
$map_lat = $map_lat[0][0];
$map_lng = $map_lng[0][0];
}
}
作品很棒!谢谢 !!! –
好的。几天后,我有与“卷曲”相同的问题。我得到这个“OVER_QUERY_LIMIT”错误。但它没有任何意义,我没有这么多的谷歌要求。每天最多10次。那么怎么才能解决这个问题呢? –