Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func centerMapOnLocation(location:CLLocation){
- let coordinateRegion = MKCoordinateRegionMakeWithDistance(location.coordinate, regionRadius * 2 , regionRadius * 2)
- map.setRegion(coordinateRegion, animated: true)
- }
- func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation){
- if let loc = userLocation.location {
- centerMapOnLocation(location: loc)
- locationManager.stopUpdatingLocation()
- }
- }
Add Comment
Please, Sign In to add comment