I want to display google maps on a view that\'s then added to self.view
, rather than drawing the map directly on self.view
. Therefore, I created a
You can position a blank UIView in your layout, and set its class in the inspector as a GMSMapView. You won't need to programmatically instantiate it.
Then just get a reference via outlet to the view and set your coordinates/camera.
We can use zPosition in iOS.
If we have a view named salonDetailView, eg:
@IBOutlet weak var salonDetailView: UIView!
in my case see the image
and have UIView for GMSMapView, eg:
@IBOutlet weak var mapViewUI: GMSMapView!
To show salonDetailView upper of the mapViewUI use zPosition as below:
salonDetailView.layer.zPosition = 1