关于Objective C:使用经度和纬度导航调用maps.app(Apple maps)

calling maps.app (Apple maps) with navigation using latitude and longitude

我想从我的应用程序中调用maps应用程序,并向其发送一个在源地址和目标地址上具有经度和纬度的网址(用于导航)

如何构造链接?


您应该创建MKMapItem的实例,并使用openMapsWithItems:launchOptions:方法打开地图应用。

检查此参考。

对于iOS 5(您应该考虑放弃对它的支持),我认为格式为:

1
2
3
[NSString stringWithFormat: @"http://maps.google.com/maps?saddr=%f,%f&daddr=%f,%f",
                currentLocation.latitude, currentLocation.longitude,
                destinationLocation.latitude, destinationLocation.longitude];