IOS 经纬度 转换地理位置信息

-(NSString*)latitudeStr:(NSString*)LatitudeLongitudeStr:(NSString*)Longitude

{

staticNSString* addstroing =@"";

NSString* A = Latitude;

NSString* B = Longitude;

floata = [AfloatValue];

floatb = [BfloatValue];

CLLocation* location = [[CLLocationalloc]initWithLatitude:alongitude:b];

//位置反编码, IOS5.0之后

CLGeocoder*geocoder = [[CLGeocoderalloc]init];

[geocoderreverseGeocodeLocation:locationcompletionHandler:^(NSArray*placemarks,NSError*error) {

for(CLPlacemark*placemark in placemarks) {

//CLPlacemark 地标

//            NSLog(@"位置:%@", placemark.name);

//            NSLog(@"街道:%@", placemark.thoroughfare);

//            NSLog(@"子街道:%@", placemark.subThoroughfare);

//            NSLog(@"市:%@", placemark.locality);

//            NSLog(@"区\\县:%@", placemark.subLocality);

//            NSLog(@"行政区:%@", placemark.administrativeArea);

//            NSLog(@"国家:%@", placemark.country);

addstroing = [NSStringstringWithFormat:@"%@%@%@%@",placemark.administrativeArea,placemark.locality,placemark.subLocality,placemark.thoroughfare];

addressLabel.text= placemark.name;

}

}];

returnaddstroing;

}

你可能感兴趣的:(IOS 经纬度 转换地理位置信息)