[英]Using current location to show directions to a destination using an in app MapView ios 6
I am trying to find how to provide directions to a certain location using the in app MapView. 我正在尝试找到如何使用应用程序MapView提供前往特定位置的路线。 I want my app to pull the users current location(which I have accomplished), then I want the MapView to use that information to provide turn by turn directions to a certain destination.
我希望我的应用将用户的当前位置拉出(已完成),然后我希望MapView使用该信息来提供前往特定目的地的转弯路线。 Is this even possible with iOS SDK 6.0 and xcode 4.5?
iOS SDK 6.0和xcode 4.5甚至可以实现吗?
U can Use Google
Directional
Map api
.simply Implement 您可以使用
Google
Directional
Map api
只需实现
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake([_iLat doubleValue],[_iLong doubleValue]);
MKPlacemark* placeMark = [[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:nil];
MKMapItem *destination = [[MKMapItem alloc] initWithPlacemark:placeMark];
if([destination respondsToSelector:@selector(openInMapsWithLaunchOptions:)])
{
//using iOS6 native maps app
[destination openInMapsWithLaunchOptions:@{MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving}];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.