import UIKit
import MapKit

class ViewController: UIViewController {
   @IBOutlet weak var mapView: MKMapView!
   var manager: CLLocationManager!

   override func viewDidLoad() {
      super.viewDidLoad()
      manager = CLLocationManager()
      manager.requestWhenInUseAuthorization()

      mapView.mapType = .standard
      mapView.isRotateEnabled = false
      mapView.showsUserLocation = true
   }
   @IBAction func showLocation(_ sender: UIBarButtonItem) {
      let location = mapView.userLocation
      let region = MKCoordinateRegion(center: location.coordinate, latitudinalMeters: 1000, longitudinalMeters: 1000)
      mapView.setRegion(region, animated: true)
   }
}