必要なポイントの2つの注釈(ソース、宛先)をドロップできます。しかし、今、私はそれらの間の距離を決定したいと思います。私は解決策を探して、1つに出くわしました: 2点間の距離の計算
しかし、解決策:
CLLocationDistance distance = [location1 getDistanceFrom:location2];
getDistanceFrom:
iOS 5では廃止されました。GoogleMapsAPIを使用してポイント間の実際の距離を見つける方法を誰かに提案してもらえますか?
オプションを探しているときに、別の解決策に出くわしました。
CLLocation *locA = [[CLLocation alloc] initWithLatitude:coordinate.latitude longitude:coordinate.longitude];
CLLocation *locB = [[CLLocation alloc] initWithLatitude:coordinate2.latitude longitude:coordinate2.longitude];
CLLocationDistance distance = [locA distanceFromLocation:locB];
NSLog(@"DISTANCE : %f", distance/1000);
しかし、この解決策が正しいかどうかはわかりません。それが返す距離は、道路による出発地と目的地の間の実際の距離ですか?グーグルマップで比較してみましたが、ほぼ一致しています。正しいアプローチかどうかを確認してください。
前もって感謝します