MKLocalSearch in MapKit from iOS6.1
MKLocalSearch provides a simple way to find local points of interest within a geographic region. Because of its no-hassle webservice integration and tight integration with MapKit, any location-based app would do well to take advantage of it.
Usage :
MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery = @"Hospitals";
request.region = mapView.region;
MKLocalSearch *search = [[MKLocalSearch alloc] initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) {
NSLog(@"Map Items: %@", response.mapItems);
}];
Usage :
MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery = @"Hospitals";
request.region = mapView.region;
MKLocalSearch *search = [[MKLocalSearch alloc] initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) {
NSLog(@"Map Items: %@", response.mapItems);
}];
Comments