Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. super.viewDidLoad()
  2.  
  3. locationManager = CLLocationManager()
  4. locationManager.desiredAccuracy = kCLLocationAccuracyBest
  5. locationManager.requestWhenInUseAuthorization()
  6. locationManager.distanceFilter = 50
  7. locationManager.startUpdatingLocation()
  8. locationManager.delegate = self
  9.  
  10. placesClient = GMSPlacesClient.shared()
  11.  
  12. guard let location = locationManager.location else {
  13. return
  14. }
  15.  
  16.  
  17.  
  18. let camera = GMSCameraPosition.camera(withTarget: location.coordinate,
  19. zoom: zoomLevel)
  20. mapView = GMSMapView.map(withFrame: view.bounds, camera: camera)
  21. mapView.settings.myLocationButton = true
  22. mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
  23. //mapView.isMyLocationEnabled = true
  24.  
  25. // Add the map to the view, hide it until we've got a location update.
  26. view.addSubview(mapView)
  27. mapView.isHidden = true
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement