根据经纬度拿反向地理编码(地址)

CLLocation *c = [[CLLocation alloc] initWithLatitude:lat longitude:lng];
        //创建位置
        CLGeocoder *revGeo = [[CLGeocoder alloc] init];
        //反向地理编码
        [revGeo reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) {
            if (!error && [placemarks count] > 0)
            {
                NSDictionary *dict = [[placemarks objectAtIndex:0] addressDictionary];
                NSLog(@"street address: %@",[dict objectForKey:@"Street"]);
                
            }
            else
            {
                NSLog(@"ERROR: %@", error);
            }
        }];

你可能感兴趣的:(根据经纬度拿反向地理编码(地址))