Reputation: 1901
My code:
var camera = GMSCameraPosition.cameraWithLatitude(currentLocation.latitude, longitude: currentLocation.longitude, zoom: 12)
//latitude, longitude like :31.230416 and 121.473701.
let map = GMSMapView(frame: CGRectZero)
map.delegate = self
map.camera = camera
self.view = map
It work fine! like this:
But when I create new View: @IBOutlet weak var mapView: UIView!
Then change this line: self.view = map
to self.mapView = map
It not work for me, I get a blank view.
Upvotes: 6
Views: 2922
Reputation: 1901
I fixed it by go to my view (view display map), then change class my view to GMSMapView.
Upvotes: 11