Webサービスから82のアドレスを取得しており、フォワードジオコーダーを使用しています。次に、マップビューに一度に82個のアドレスすべてを表示する方法を説明します。コードをforループに入れましたが、「このAPIキーに対して行われたクエリが多すぎます」というエラーがスローされます。すべてのアドレスを送信し、すべてのアドレスの場所を取得する方法はありますか?これはforループの私のコードです...
NSMutableDictionary *dictLoc = [[self.arrObjects objectAtIndex:indexValue]valueForKey:@"object_location"];
NSString *searchString = [NSString stringWithFormat:@"%@,%@,%@,%@",[dictLoc valueForKey:@"object_location_number"],[dictLoc valueForKey:@"object_location_street"],[dictLoc valueForKey:@"object_location_city"],[dictLoc valueForKey:@"object_location_zip"]];
// if (self.forwardGeocoder == nil) {
BSForwardGeocoder *forwardGeocoder = [[[BSForwardGeocoder alloc] initWithDelegate:self] autorelease];
// }
CLLocationCoordinate2D southwest, northeast;
southwest.latitude = 34.172684;
southwest.longitude = -118.604794;
northeast.latitude = 34.236144;
northeast.longitude = -118.500938;
BSForwardGeocoderCoordinateBounds *bounds = [BSForwardGeocoderCoordinateBounds boundsWithSouthWest:southwest northEast:northeast];
// Forward geocode!
#if NS_BLOCKS_AVAILABLE
[forwardGeocoder forwardGeocodeWithQuery:searchString regionBiasing:nil viewportBiasing:bounds success:^(NSArray *results) {
[self forwardGeocodingDidSucceed:forwardGeocoder withResults:results withIndexValue:indexValue];
} failure:^(int status, NSString *errorMessage) {
if (status == G_GEO_NETWORK_ERROR) {
[self forwardGeocoderConnectionDidFail:forwardGeocoder withErrorMessage:errorMessage];
}
else {
[self forwardGeocodingDidFail:forwardGeocoder withErrorCode:status andErrorMessage:errorMessage];
}
}];
#else
[self.forwardGeocoder forwardGeocodeWithQuery:searchString regionBiasing:nil viewportBiasing:nil];
#endif
前もって感謝します.. :)