CLLocation *location = [[CLLocation alloc]initWithLatitude:model.latitude longitude:model.longitude];
//根据经纬度解析成位置
CLGeocoder *geocoder = [[CLGeocoder alloc]init];
[geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemark,NSError *error)
{
CLPlacemark *mark = [placemark objectAtIndex:0];
NSLog(@"city %@ subcity %@",mark.locality,mark.subLocality);
model.address = [NSString stringWithFormat:@"%@-%@-%@-%@",mark.administrativeArea,mark.locality,mark.subLocality,mark.thoroughfare];
[addressArr addObject:model.address];
if (addressArr.count == self.tableViewArr.count)
{
[self.routeLineInfoTabView reloadData];
}
}];
网友评论