简体   繁体   English

使用应用程序内的MapView iOS 6使用当前位置显示前往目的地的路线

[英]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.

相关问题 使用 iphone 的 mapview 或谷歌地图到目的地的当前位置 iOS Xcode 4 - Current Location to destination using mapview or google maps for the iphone iOS Xcode 4 如何使用MKMapView显示从当前位置到附近地点的路线 - How to show directions to neares places from current location using MKMapView iOS 8 Mapview当前位置不会激发 - iOS 8 Mapview Current Location not fire MapKit-如何使用MapKit在我的iPhone应用程序中实现从源和目标的指示? - MapKit - How can I implement directions from Source and Destination in my iphone app using MapKit? 使用IOS中的CLLocation获取用户当前位置 - Get User Current location using CLLocation in IOS iOS-用户是否允许使用其当前位置 - iOS - if user allow using his current location or not 如何在iOS中使用CLLocationManager获取当前位置 - How to get current location using CLLocationManager in iOS 在iPhone MapView上显示当前位置和所需位置之间的路线 - Show route between current and desired location on iPhone MapView iPhone开发人员-无法在mapView上显示用户的当前位置 - iPhone dev - Can't show user's current location on mapView iPhone使用字符串“当前位置”而非satdr的经纬度链接到地图方向 - iPhone link to map directions using string “current location” not lat and lng for saddr
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM