我想找到使用iOS框架的兩個位置之間的方向,但我無法找到適當的解決方案。如何在iPhone應用程序中的兩個位置之間找到方向?
1
A
回答
3
您可以使用不同的方法找到兩個位置之間的方向。使用谷歌地圖
NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f", currentLatitude, currentLongitude, destinationLatitude, destinationLongitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
(2)使用蘋果地圖
(1):
NSString *urlString = [NSString stringWithFormat:@"http://maps.apple.com/maps?saddr=%f,%f&daddr=%f,%f", currentLatitude, currentLongitude, destinationLatitude, destinationLongitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
請讓我知道如果你需要任何幫助。
2
你的問題不是很清楚,但我認爲你的意思是兩個位置之間的方位。 看到這個問題: Calculating bearing between two CLLocationCoordinate2Ds
0
如果你的觀點很接近,就用三角函數。這將足夠接近。如果他們距離較遠,那麼你想要一個大圈子的課程,使用Haversine公式。
相關問題
- 1. 如何找到兩個地方之間的位置?
- 2. 如何在iPhone中的兩個位置之間繪製路線?
- 3. 找到其他兩個位置之間的位置
- 4. 在模板中的兩個應用程序之間進行反向ForeignKey查找
- 5. 在iphone上,如何向地圖應用程序添加位置?
- 6. android - 我如何獲得兩個位置之間的方位度?
- 7. 得到iphone上的兩個位置之間的距離
- 8. 找到android中兩個位置之間的距離?
- 9. 兩個iphone應用程序之間的數據共享
- 10. 獲取兩個位置之間的路線方向
- 11. 如何在iphone中的應用程序之間共享數據
- 12. 在兩個應用程序之間共享配置的技巧?
- 13. 如何查找兩個經度位置之間的距離?
- 14. 我如何在我的iPhone應用程序中獲得方向
- 15. 如何在兩個ASP.NET應用程序之間共享應用程序緩存
- 16. 如何在應用程序被殺後找到用戶位置?
- 17. 如何在iOS應用程序中使用Bing Map API在兩個位置之間繪製路線?
- 18. Android:在兩個應用程序之間設置依賴關係
- 19. 在兩個Web項目之間共享應用程序設置
- 20. 如何在兩個python應用程序之間交換數據?
- 21. 如何在兩個應用程序之間共享Sqlite?
- 22. MSMQ - 如何在兩個應用程序之間進行溝通
- 23. 如何在兩個應用程序之間進行通信?
- 24. 如何在兩個Chrome應用程序之間傳遞數據?
- 25. 如何在兩個winform應用程序之間共享數據?
- 26. Codeigniter - 如何在兩個應用程序之間共享模型
- 27. 試圖找到兩個位置之間的相對變換 - XNA
- 28. 找到兩個位置之間的夾角
- 29. 如何找到兩個向量之間的角度?
- 30. 蟒蛇找到兩個3D點之間的矢量方向
這是教程。 http://www.devfright.com/mkdirections-tutorial/ – Bejibun 2014-09-12 13:29:33