google mapの二点間の距離を取得する方法
google map API v2でのやり方です。おそらくv3では違うかもしれませんm(__)m Locationクラスを使って取得する方法をご紹介。
flaot[] results = {0,0,0}
のような形で初期値を設定。 以下のコードを実行すると、resultsに結果が代入されます。
Location.distanceBetween(fromLatitude, fromLongitude, toLatitude, toLongitude, results);
results[0]が距離
results[1]が現在地から目的への方位
results[2]が目的地から現在地への方位
が代入されます。
以上です。