Google maps: Reading geocode per XML

谁说我不能喝 提交于 2019-12-12 02:17:49

问题


I have the following code for converting a PHP variable (including an address) into coordinates:

$evdata_address = urlencode($evdata_address);
$mapsurl = 'http://maps.googleapis.com/maps/api/geocode/xml?address=' . $evdata_address . '&sensor=true';
  $xml = simplexml_load_file($mapsurl);
  $status = $xml->status;
  if ($status == 'OK') {
      $latitude = $xml->result->geometry->location->lat;
      $longitude = $xml->result->geometry->location->lng;
  };

For some reason it works perfectly on my own webspace/server but does not work on the remote server where the site has to be launched. Both servers are based on PHP 7.0.

I am getting OVER_QUERY_LIMIT for $xml->status

来源:https://stackoverflow.com/questions/41242620/google-maps-reading-geocode-per-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!