【发布时间】:2010-10-20 14:55:01
【问题描述】:
我目前有一个应用程序,可以将大头针放到地图上的各个兴趣点上,所有这些都是在 iPhone 上以编程方式完成的。
我现在的目标是让用户导航到该位置,并通过调用 iPhone 上的内置导航工具获得转弯路线。
无论如何我可以做到这一点吗?我已经搜索了开发者中心并搜索了谷歌和这里,但找不到任何关于此的内容。
【问题讨论】:
标签: iphone objective-c xcode maps
我目前有一个应用程序,可以将大头针放到地图上的各个兴趣点上,所有这些都是在 iPhone 上以编程方式完成的。
我现在的目标是让用户导航到该位置,并通过调用 iPhone 上的内置导航工具获得转弯路线。
无论如何我可以做到这一点吗?我已经搜索了开发者中心并搜索了谷歌和这里,但找不到任何关于此的内容。
【问题讨论】:
标签: iphone objective-c xcode maps
您不得在应用中使用 Google 路线。您可以这样做的唯一方法是将它们发送到谷歌地图应用程序:
- (void)getDirections {
CLLocationCoordinate2D start = { (startLatitude), (startLongitude) };
CLLocationCoordinate2D end = { (endLatitude), (endLongitude) };
NSString *googleMapsURLString = [NSString stringWithFormat:@"http://maps.google.com/?saddr=%1.6f,%1.6f&daddr=%1.6f,%1.6f", start.latitude, start.longitude, end.latitude, end.longitude];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:googleMapsURLString]];
}
【讨论】: