Adam Adam - 10 months ago 77
Swift Question

Swift span zoom

Need simple coding for the span to zoom on the users location when the button is pressed. It follows the user but need span coding help.

i use this atm

@IBAction func Refreshbutton(sender: AnyObject) {

Mapview.userTrackingMode = .Follow


Answer Source

This code may help you.

let span = MKCoordinateSpanMake(0.075, 0.075)
let region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude:lat, longitude: long), span: span)
mapView.setRegion(region, animated: true)