如何在iPhone应用程序中找到两个位置之间的方向?

高拉夫

我正在尝试使用iOS框架在两个位置之间找到方向,但是我找不到合适的解决方案。

AppAspect

您可以使用不同的方法来查找两个位置之间的方向。

(1)使用谷歌地图

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)使用Apple Maps:

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]]];

如果您需要任何帮助,请告诉我。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用mapView和CLLocationManager在iOS Swift中绘制两个位置之间的方向

如何在两个位置之间连续移动GameObject?

如何在两个位置之间更改文本的颜色?

如何使用GMSMapView在两个位置之间找到最短路径并绘制锯齿形路径?

如何找到两个经度位置之间的距离?

如何在两个位置之间的两种不同颜色的Google地图上绘制折线

在两个位置之间获取路径

快速计算两个位置之间的距离

bing映射两个位置之间的直线

在 Kotlin 中查找两个位置之间的距离

获取两个位置之间的路线点

Mkmapview中两个位置之间的多条路线

寻找两个位置之间的距离

如何通过道路计算两个位置之间的距离?

如何使用Android在Google Map中的两个位置之间绘制折线?

如何从用户输入获取两个位置之间的距离

如何使用谷歌距离矩阵获得两个位置之间的距离

如何在 Excel 电源查询中的两个单独查询上找到位置之间的距离?

如何在R中找到每对协调位置之间的空间距离

如何在iPhone和iPad中找到应用程序崩溃日志?

如何在android应用中找到在两个地方之间旅行所需的时间

如何在我的应用程序中找到StackOverflowException的来源

如何在Flutter上的两个地理位置之间绘制路线?

如何在Android中离线查找两个地理位置之间的道路距离

使用Google Map API计算两个位置之间的距离

bash:清除两个位置之间的字符串

给定纬度和经度,计算两个位置之间的行驶/行驶距离(必应地图)

Swift-在字符串的两个位置之间查找子字符串

无法使用ReactJS在OpenLayers中的两个位置之间绘制默认线