I currently have a UIView in my View Controller which I have changed to a GMSMapView in the Interface Builder, but nothing shows up, as shown in the picture below:
Here is the code that I am using
let lat = 47.07903
let long = -122.961283
let camera = GMSCameraPosition.cameraWithLatitude(lat, longitude: long, zoom: 10)
let map = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
map.myLocationEnabled = true
map.delegate = self
self.mapView.addSubview(map)
let marker = GMSMarker()
marker.position = CLLocationCoordinate2DMake(lat, long)
marker.map = self.mapView
I have declared mapView
as such using drag and drop:
@IBOutlet var mapView: GMSMapView!
Any help here would be much appreciated. I have tried a lot of different things! Thanks!