Code: Select all
private func initGoogleMap() {
// Load the map at set latitude/longitude and zoom level
let camera: GMSCameraPosition = GMSCameraPosition.camera(
withLatitude: 37.574187,
longitude: 126.976882,
zoom: 15
)
self.mapView = GMSMapView()
self.mapView.camera = camera
// mapView를 googleMapContainer에 추가
self.googleMapContainer.addSubview(self.mapView)
// SnapKit을 사용하여 mapView의 제약조건 설정
self.mapView.snp.makeConstraints {
$0.edges.equalToSuperview()
}
self.mapView.delegate = self
}