Reputation: 54111
I'm using the current version 1.1.2 of Google Maps SDK for iOS. The map only displays the Google logo, the current location and the added marker. But no map content whatsoever:
I correctly registered the API key:
BOOL result = [GMSServices provideAPIKey:@"<my key>"];
the result is YES
and I verified that the bundleIdentifier matches with the API console. I load the GMSMapView from a storyboard and set the camera in my -viewDidLoad
:
self.mapView.camera = [GMSCameraPosition cameraWithLatitude:0 longitude:0 zoom:2];
This is logged by GMSMapView:
Failed to make complete framebuffer object 8cd6
Failed to make complete framebuffer object 8cd6
Google Maps SDK for iOS version: 1.1.2.2533
GMSZoomTableQuadTree lacks root zoom table for tile type (mapType: 10)
GMSZoomTableQuadTree lacks root zoom table for tile type (mapType: 15)
Any idea what could cause this problem?
Upvotes: 12
Views: 14722
Reputation: 1272
If you have included both GoogleMaps.framework and GoogleMapsM4B.framework (Maps for Business) in your XCode project, remove GoogleMapsM4B.framework.
Otherwise you'll need to enable Google Maps Mobile SDK for Work through Enterprise Support portal instead of Google Maps SDK for iOS from Cloud Console.
Upvotes: 1
Reputation: 2067
This could also be caused by not having the right bundle ID entered under the API key in your Google API Console.
Upvotes: 16
Reputation: 3603
Just in case someone comes here and nothing works...
I was having this problem and got bored so I unzoomed the map and discovered I messed up with the location and my map center was in the middle of a desert! Map was working just fine.
So try to unzoom, just in case.
Upvotes: 4
Reputation:
I also had the same problem.The issue was I used two iOS Api keys in 2 different places in code.Please check whether you have used correct API Key (iOS Key) from google Api console.Use the same key through out your app.
Upvotes: 0
Reputation: 54111
Found the solution myself.
I'm using Auto Layout. Apparently, in -viewDidLoad
the Auto Layout hasn't yet done its work and my GMSMapView
still had a CGRectZero frame. GMSMapView
seems to react very picky on a zero frame.
[self.view layoutIfNeeded];
prior to setting the camera solved the problem for me.
Upvotes: 16