I want to display google maps in a view, which is then added to self.view , instead of drawing the map directly on self.view . So I created a view in a storyboard and changed its class to GMSMapView . I also created an output connection with this view called gmView .
I use the following code, which, unfortunately, does not display the map:
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: GMSCameraPosition.camera(withLatitude: 51.050657, longitude: 10.649514, zoom: 5.5)) gmView = mapView
In addition, I tried adding mapView to self.view as a subquery, for example:
self.view.addSubview(mapView)
... and inserting it:
self.view.insertSubview(mapView, at: 0)
Please note that I am using Auto Layout if this changes anything.
None of these approaches seem to work for me.
Any ideas?
source share