【发布时间】:2017-05-15 20:53:08
【问题描述】:
我想在 iOS 默认地图应用中的两个位置之间实现获取方向功能,我已经尝试过了
Class itemClass = [MKMapItem class];
if (itemClass && [itemClass respondsToSelector:@selector(openMapsWithItems:launchOptions:)]) {
// Use iOS 6 maps
NSString *latString = @"23.0300";
NSString *longString = @"72.5800";
CLLocationCoordinate2D ctrpoint;
ctrpoint.latitude = [latString doubleValue];
ctrpoint.longitude = [longString doubleValue];
MKPlacemark *placemark2 = [[MKPlacemark alloc] initWithCoordinate:ctrpoint addressDictionary:nil];
MKMapItem *mapItem = [[MKMapItem alloc] initWithPlacemark:placemark2];
[mapItem openInMapsWithLaunchOptions:nil];
}
但它显示的方向错误如下:
我什至打开了地图应用,找到了我当前的位置,在地图上添加了一个离我最近的位置最近的图钉,但仍然无法获取方向。
还有“简而言之,即使在本机应用程序中,Get Direction 也不能完全正常工作”任何人都可以帮助我实现这一目标吗?
【问题讨论】:
-
你在哪里?
-
在印度古吉拉特邦拉杰科特。我现在的纬度是:22.3000, 70.7833
-
您可以在常规地图应用中获取路线吗?
-
没有人我没有!!! :(
标签: ios iphone mkmapview mapkit