Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- super.viewDidLoad()
- locationManager = CLLocationManager()
- locationManager.desiredAccuracy = kCLLocationAccuracyBest
- locationManager.requestWhenInUseAuthorization()
- locationManager.distanceFilter = 50
- locationManager.startUpdatingLocation()
- locationManager.delegate = self
- placesClient = GMSPlacesClient.shared()
- guard let location = locationManager.location else {
- return
- }
- let camera = GMSCameraPosition.camera(withTarget: location.coordinate,
- zoom: zoomLevel)
- mapView = GMSMapView.map(withFrame: view.bounds, camera: camera)
- mapView.settings.myLocationButton = true
- mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
- //mapView.isMyLocationEnabled = true
- // Add the map to the view, hide it until we've got a location update.
- view.addSubview(mapView)
- mapView.isHidden = true
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement