カテゴリー
SugiBlog Webデザイナー・プログラマーのためのお役立ちTips

2点間の距離を取得 – Location.distanceBetween

LocationクラスのdistanceBetweenメソッドを使って、2点間の距離を取得することができます。

書式

Location.distanceBetween(
        double startLatitude,
        double startLongitude,
        double endLatitude,
        double endLongitude,
        float[] results);
引数
startLatitude 開始地点の緯度
startLongitude 開始地点の経度
endLatitude 終了地点の緯度
endLongitude 終了地点の経度
results 結果を格納する変数

続きを読む…»

9,146 views