I\'m struggling with this problem!
I want to add a google maps GMSMapView
into a UIView
that is only a portion of the main UIView
of m
Following the google tutorial for Swift in Sep-2017
I fixed by putting the code in viewDidLoad like this
var mapView: GMSMapView!
override func viewDidLoad() {
super.viewDidLoad()
// Create a GMSCameraPosition to display the initial center of the map
let camera = GMSCameraPosition.camera(withLatitude: 23.885942, longitude: 45.079162, zoom: 5.1)
// Set the frame size , don't forget to replace "" with the required frame size
mapView = GMSMapView.map(withFrame: "", camera: camera)
// Add the map to any view here
view.addSubview(mapView) //or customView.addSubview(mapView)
}