我想找到一种简单的方法来获取路线。有没有办法用mapview
来做到这一点?
下面是我当前的代码。
- (IBAction)goToMap:(id)sender {
[self.view addSubview:self.mapUIView];
[self.mapUIView setFrame:CGRectMake(0, 0, 320, 460)];
self.mapview.mapType = MKMapTypeStandard;
CLLocationCoordinate2D coordinate;
coordinate.latitude = [[self.find lat] floatValue];
coordinate.longitude = [[self.find lng] floatValue];
MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init];
[annotation setCoordinate:coordinate];
[annotation setTitle:[self.find name]];
//[annotation setSubtitle:@"Hello"];
[self.mapview addAnnotation:annotation];
[annotation release];
[self zoomMapViewToFitAnnotations:self.mapview animated:YES];
}
最佳答案
您不能使用 MapKit 获取行车路线。它不支持这一点。
关于iPhone MapView 获取路线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13011154/