Zoom in a MKMapView programmatically

后端 未结 9 1746
逝去的感伤
逝去的感伤 2020-12-04 13:27

I\'m using a MKMapView inside an iPhone app. When I click a button the zoom level must increase. This is my first approach:

MKCoordinateRegion z         


        
9条回答
  •  一整个雨季
    2020-12-04 14:23

    In Swift 4.2

    let location = mapView.userLocation
    let region = MKCoordinateRegion(center: location.coordinate, span: MKCoordinateSpan(latitudeDelta: 50, longitudeDelta: 50))
    mapView.setRegion(region, animated: true)
    

提交回复
热议问题