GPSで取得したデータ(緯度、経度)を取得して、住所を取得したい。
この事から、Yahoo! JAPANが提供する地図Web APIを使用して取得出来ることが分かった。
参考
http://www.plusmb.jp/2009/06/15/3721.html
XMLファイルにて取得が出来るようなので、下記のように取得
$fileName = “http://api.map.yahoo.co.jp/LocalSearchService/V1/LocalSearch?appid={アプリケーションID}&lat=” . $lat . “&lon=” . $lon . “&dist=1&n=1&category=address&AddressLevel=6”; $xml = simplexml_load_file($fileName); $Item = $xml->Item; echo “住所:” . $Item->Address .”<BR>”; |
現在の位置即位に追加。
Related Articles
No user responded in this post
Leave A Reply
Please Note: Comment moderation maybe active so there is no need to resubmit your comments