Direct Geocoding Example Using CLGeocoder

Instructions for a working example or some guidelines for using front geocoding next to Apple documentation. This is pretty general (I can't figure it out)

Please, that would be great! Also does anyone know if they use the Google APIs to achieve the same or their own?

+4
source share
1 answer

Found this to work, although I will post it here if someone finds it useful.

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]; }]; 
+11
source

Source: https://habr.com/ru/post/1402235/


All Articles