ios - map View 中两个位置的 Mapkit 路线不适用于印度经纬度?

标签 ios objective-c mapkit mkpolyline

这是我的代码:

工作:

CLLocationCoordinate2D sourceCoords = CLLocationCoordinate2DMake(37.7833, -122.4167);//san fransisco
MKPlacemark *sourcePlacemark = [[MKPlacemark alloc] initWithCoordinate:sourceCoords addressDictionary:nil];
MKMapItem *source = [[MKMapItem alloc] initWithPlacemark:sourcePlacemark];

// Make the destination location
CLLocationCoordinate2D destinationCoords = CLLocationCoordinate2DMake(34.0500, -118.2500);//los angeles
MKPlacemark *destinationPlacemark = [[MKPlacemark alloc] initWithCoordinate:destinationCoords addressDictionary:nil];
MKMapItem *destination = [[MKMapItem alloc] initWithPlacemark:destinationPlacemark];

不工作:

CLLocationCoordinate2D sourceCoords = CLLocationCoordinate2DMake(13.0441, +80.1831);
MKPlacemark *sourcePlacemark = [[MKPlacemark alloc] initWithCoordinate:sourceCoords addressDictionary:nil];
MKMapItem *source = [[MKMapItem alloc] initWithPlacemark:sourcePlacemark];


 Make the destination location   CLLocationCoordinate2D destinationCoords = CLLocationCoordinate2DMake(13.0545, +80.2114);
 MKPlacemark *destinationPlacemark = [[MKPlacemark alloc] initWithCoordinate:destinationCoords addressDictionary:nil];
 MKMapItem *destination = [[MKMapItem alloc] initWithPlacemark:destinationPlacemark];

map View 中未显示折线。

最佳答案

Apple map 在印度不支持路线。在印度,您必须使用谷歌地图才能找到方向。 you can check map feature availability here

关于ios - map View 中两个位置的 Mapkit 路线不适用于印度经纬度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37965343/

相关文章:

ios - 使用 xcodebuild 运行单个测试配置

objective-c - SpriteNode 视角?

ios - MapKit map 中的标注是透明的

ios - 带有 NavigationBarHidden 的导航 Controller

iphone - 如何制作带列的 UITable?

swift - didUpdateLocation 什么时候被调用?

ios - 如何在 Swift 中扩展 NSManagedObject 以包含 MKAnnotation?

objective-c - 检查 NSNumber 是否为小数

ios - 如果应用程序未在 Swift iOS 中运行,如何读取一个信号通知

ios - UICollectionViewCell 宽度大于我在 sizeForItemAt 中设置的宽度