我只想使用邮政编码和 Google 地图 API 获取纬度和经度。
我正在使用 PHP 进行开发。
我怎样才能做到这一点?
邮政编码可以来自世界任何地方。
您可以使用谷歌地图地理编码 API 来完成此操作。请查找下面的示例,但要更正纬度/经度和地址,您需要传递完整地址和邮政编码。
欲了解更多详情,请点击以下链接:
http://code.google.com/apis/maps/documentation/geocoding/ 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);
?>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)