MKLocalSearch returning results from outside region

200 Views Asked by At

I'm searching for places (would like to only show businesses if possible) like this:

    CLLocationCoordinate2D currentCenter = CLLocationCoordinate2DMake(self.locationManager.location.coordinate.latitude, self.locationManager.location.coordinate.longitude);
MKCoordinateRegion currentRegion = MKCoordinateRegionMakeWithDistance(currentCenter, 15000, 15000);

MKLocalSearchRequest *localSearchRequest = [[MKLocalSearchRequest alloc] init];
localSearchRequest.naturalLanguageQuery = identifier;
[localSearchRequest setRegion:currentRegion];
MKLocalSearch *localSearch = [[MKLocalSearch alloc] initWithRequest:localSearchRequest];
[localSearch startWithCompletionHandler:^(MKLocalSearchResponse *respone, NSError *error) {
    if (!error)
    {
        // Result handling
    }
}];

but the results include results from other countries, why is this? I only call this method if the CLLocationManager coordinate passes this check:

CLLocationCoordinate2DIsValid

Thanks!

0

There are 0 best solutions below