我正在尝试使用反向地理编码从用户的当前位置获取区域或区域。我正在使用 GMSGeocoding 但无法获取区域名称或区域
[[GMSGeocoder geocoder] reverseGeocodeCoordinate:CLLocationCoordinate2DMake(lat, lng) completionHandler:^(GMSReverseGeocodeResponse* response, NSError* error) {
NSLog(@"reverse geocoding results:");
GMSAddress * address=[response firstResult];
NSLog(@"coordinate.latitude=%f", address.coordinate.latitude);
NSLog(@"coordinate.longitude=%f", address.coordinate.longitude);
NSLog(@"thoroughfare=%@", address.thoroughfare);
NSLog(@"locality=%@", address.locality);
NSLog(@"subLocality=%@", address.subLocality);
NSLog(@"administrativeArea=%@", address.administrativeArea);
NSLog(@"postalCode=%@", address.postalCode);
NSLog(@"country=%@", address.country);
NSLog(@"lines=%@", address.lines);
locationName=address.thoroughfare;
_txtFromLocation.text= [[locationName stringByAppendingString:[NSString stringWithFormat:@",%@",address.locality]]stringByAppendingString:[NSString stringWithFormat:@",%@",address.country]];
}];
请告诉我从用户当前位置获取区域或区域的方式。