简体   繁体   中英

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. 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. Is this even possible with iOS SDK 6.0 and xcode 4.5?

U can Use Google Directional Map api .simply Implement

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

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM