我的代码:
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
工作正常!像这样:
但是当我创建新视图时:@IBOutlet weak var mapView: UIView!
然后将此行:self.view = map
更改为self.mapView = map
这对我不起作用,我的观点一片空白。