[android] 2つのLatLng間での距離を算出する

2つのLatLng間での距離を算出する

LatLng aLocation = new LatLng(1.3, 103.5);
LatLng bLocation = new LatLng(1.2, 103.1);
float[] results = new float[1];
Location.distanceBetween(aLocation.latitude, aLocation.longitude,bLocation.latitude, bLocation.longitude, results);

int distance = (int)results[0];

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です