Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GMSMapView show blank map

I add GMSMapView into my screen but I only can see my position icon and the marker i added. Why i cant see the road, building, etc?

Here is my code :

let camera = GMSCameraPosition.cameraWithLatitude(latitude,
longitude: longitude, zoom: 11.5)
let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)

mapView.myLocationEnabled = true
mapView.settings.myLocationButton = true

self.view = mapView

var marker = GMSMarker()
marker.position = CLLocationCoordinate2DMake(location.latitude, location.longitude)
marker.title = location.name
marker.snippet = location.address
marker.map = mapView

Any suggestion?

like image 468
F. Suyuti Avatar asked Jan 08 '23 04:01

F. Suyuti


1 Answers

One of the main reason to have a blank map is that the key is not set properly

Did you set the API key correctly.

[GMSServices provideAPIKey:yourAPIKey];
like image 146
ipraba Avatar answered Jan 16 '23 21:01

ipraba