【发布时间】:2011-10-27 21:39:19
【问题描述】:
我只想使用带有 Google 地图 API 的邮政编码来获取纬度和经度。
我正在使用 PHP 进行开发。
我该怎么做?
邮政编码可以来自世界上任何地方。
【问题讨论】:
标签: php google-maps google-maps-api-3 geolocation
我只想使用带有 Google 地图 API 的邮政编码来获取纬度和经度。
我正在使用 PHP 进行开发。
我该怎么做?
邮政编码可以来自世界上任何地方。
【问题讨论】:
标签: php google-maps google-maps-api-3 geolocation
您可以使用谷歌地图地理编码 API 来做到这一点。请在下面找到示例,但要更正纬度/经度和地址,您需要传递完整地址和邮政编码。
更多详情请点击以下链接:
http://code.google.com/apis/maps/documentation/geocoding/
<?php
$url ="http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false";
$result = simplexml_load_file($url);
print"<pre>";
print_r($result);
?>
【讨论】:
https://maps.googleapis.com/maps/api/geocode/json?address=SW5+0RQ&sensor=false&components=country:UK