Google Maps SDK for iOS doesn't display map content

…衆ロ難τιáo~ 提交于 2019-11-30 12:55:13

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.

This could also be caused by not having the right bundle ID entered under the API key in your Google API Console.

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.

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!