car*_*onr 4 iphone xcode objective-c ios clgeocoder
有关如何在Apple文档旁边使用正向地理编码的工作示例或指导的说明.多数民众赞成在一般(我不明白)
请这太好了!也有人知道他们是否使用Google API实现相同或自己的?
car*_*onr 11
发现这个工作,虽然我会在这里发布,如果其他人发现它有用.
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressString:PlaceName.text completionHandler:^(NSArray *placemarks, NSError *error) {
//Error checking
CLPlacemark *placemark = [placemarks objectAtIndex:0];
MKCoordinateRegion region;
region.center.latitude = placemark.region.center.latitude;
region.center.longitude = placemark.region.center.longitude;
MKCoordinateSpan span;
double radius = placemark.region.radius / 1000; // convert to km
NSLog(@"Radius is %f", radius);
span.latitudeDelta = radius / 112.0;
region.span = span;
[mapView setRegion:region animated:YES];
}];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7017 次 |
| 最近记录: |