这是我的代码:
工作:
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/