【发布时间】:2016-03-13 09:17:41
【问题描述】:
我想使用 Google Maps API 从德国邮政编码中获取州(下萨克森、巴伐利亚……)。
我试过了:
$get = "http://maps.googleapis.com/maps/api/geocode/json?address=" . $zip . "&sensor=true";
$result = file_get_contents($get);
但它也会返回其他匹配项。我想将比赛限制在德国(国家代码:DE)。
【问题讨论】:
-
我认为你可以添加一个区域来偏置结果,developers.google.com/maps/documentation/geocoding/… ~
http://maps.googleapis.com/maps/api/geocode/json?address=" . $zip . "&sensor=true&region=de
标签: php google-maps-api-3