3
A
回答
9
使用谷歌API
$lat="54.1456123";
$long = "10.413456";
$url = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$long&sensor=false";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_ENCODING, "");
$curlData = curl_exec($curl);
curl_close($curl);
$address = json_decode($curlData);
print_r($address);
6
沒有curl
也不API密鑰需要:
function geo2address($lat,$long) {
$url = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$long&sensor=false";
$curlData=file_get_contents( $url);
$address = json_decode($curlData);
$a=$address->results[0];
return explode(",",$a->formatted_address);
}
相關問題
- 1. 將捕獲的GPS座標轉換爲地址爲PHP
- 2. 如何將地址(作爲文本)轉換爲GPS座標?
- 3. 如何將gps座標轉換爲地址?
- 4. 將GPS座標轉換爲Swift中的城市名稱/地址
- 5. 將地址轉換爲地理座標
- 6. iOS如何在2015年將地址轉換爲GPS座標(地理編碼)?
- 7. GPS座標轉換 - PHP
- 8. 將地址轉換爲座標swift
- 9. 將地址轉換爲座標
- 10. 將座標轉換爲地址
- 11. 如何將GPS座標轉換爲地方
- 12. 從GPS座標轉換爲windows phone中的地址
- 13. 將gps座標轉換爲AR
- 14. OpenLayers:將GPS座標轉換爲EPSG:25832
- 15. 將GPS座標轉換爲3D模型
- 16. 將投影的座標轉換爲常規的GPS座標android
- 17. 將GPS座標轉換爲ENU座標的功能?
- 18. 將iPhone GPS轉換爲地址
- 19. 將GPS座標轉換爲PDF地圖上的位置
- 20. 將GPS座標轉換爲座標平面
- 21. 如何將GPS座標轉換爲十進制的Lua?
- 22. 將GPS座標轉換爲地圖瓷磚狀結構
- 23. 將座標轉換爲地址的反向地理編碼?
- 24. 將地址轉換爲Python中的地理座標
- 25. 如何將本地對象座標轉換爲世界座標?
- 26. 如何將GPS Lat Lng座標轉換爲Arcgis X,Y值?
- 27. 如何在Oracle Spatial中將XY座標轉換爲GPS?
- 28. 將地理座標列表轉換爲地址
- 29. 將本地(=旋轉後的)座標轉換爲全局座標
- 30. python - 將座標數量轉換成地址或城市地址
嘗試谷歌地圖API [參考此帖] [1] [1]: http://stackoverflow.com/questions/10441521/get-address-from-google-map-api-v3-in-english – limovala 2013-05-06 09:10:43
這不是重複的:這裏我問如何實現t他用PHP。 – rubo77 2013-05-07 12:31:31