1

我正在搜索这样的地方(如果可能,只想显示商家):

    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
    }
}];

但结果包括其他国家的结果,这是为什么呢?如果 CLLocationManager 坐标通过了这个检查,我只调用这个方法:

CLLocationCoordinate2DIsValid

谢谢!

4

0 回答 0