2013-12-09 2 views
0

Google Static Maps API를 사용하려고하는데 아무 것도 반환하지 않습니다. API 키가 정확하며 Google Places API를 성공적으로 사용하고 있습니다. 내가 잘못하고있는 것을 IDK. 필자는 필요한 매개 변수만을 사용하여 시도했습니다. 나는 또한 API Docs의 예제 URL을 사용해도 아무 것도 시도하지 않았다.Google Static Maps API에서 데이터를 반환하지 않습니다.

NSString *url = [NSString stringWithFormat:@"http://maps.googleapis.com/maps/api/staticmap?zoom=18&size=320x120&visual_refresh=true&markers=size:mid|color:0x00AB8B|%f,%f&key=AIzaSyDbg7wrSq-USEJWUqf5TOPepbtGRwbYtg8", [LocationController sharedSingleton].locationManager.location.coordinate.latitude, [LocationController sharedSingleton].locationManager.location.coordinate.longitude]; 

NSURL *googleURL = [NSURL URLWithString:[url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]]; 

     dispatch_async(kBgQueue, ^{ 
      NSData* data = [NSData dataWithContentsOfURL: googleURL]; 
      NSLog(@"data size: %lu", (unsigned long)[data length]); 
      if (data.length != 0){ 
       [mapViewArray addObject:data]; 
      } 
     }); 

답변

0

알아 냈어. 필요한 "센서"매개 변수가 누락되었습니다.