【问题标题】:Using current location to show directions to a destination using an in app MapView ios 6使用应用程序 MapView ios 6 使用当前位置显示前往目的地的路线
【发布时间】:2013-01-02 20:19:33
【问题描述】:

我正在尝试查找如何使用应用内的 MapView 提供前往某个位置的路线。我希望我的应用程序拉取用户当前位置(我已经完成),然后我希望 MapView 使用该信息来提供到某个目的地的转弯方向。这在 iOS SDK 6.0 和 xcode 4.5 上是否可行?

【问题讨论】:

  • 你还没有开始做这个吗?或者你已经完成了一些开发并且在某个时候被卡住了?

标签: iphone xcode4.5 ios6-maps


【解决方案1】:

你可以使用GoogleDirectional映射api.simply实现

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

}

【讨论】:

    猜你喜欢
    • 2023-03-28
    • 1970-01-01
    • 2015-10-01
    • 1970-01-01
    • 2011-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多