Ortwin Gentz Ortwin Gentz - 5 months ago 28
iOS Question

Google Maps SDK for iOS doesn't display map content

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:

enter image description here

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?

Answer

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.