gpt4 book ai didi

iPhone MapView 获取路线

转载 作者:行者123 更新时间:2023-12-03 20:15:07 26 4
gpt4 key购买 nike

我想找到一种简单的方法来获取路线。有没有办法用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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com