我的代码:
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
to self.mapView = map
它对我不起作用,我得到一个空白视图。
I fixed it by go to my view (view display map), then change class my view to GMSMapView.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)