I'm trying to get my MapKit to zoom to the centre 2 or more points on the map and have them all visible. I managed to successfully get the centre correctly but I can't figure out how to get to fit them all into my region.
This is what I have so far
let center = middlePointOfListMarkers(listCoords: [location.coordinate,location2.coordinate)
center.latitude
let region = MKCoordinateRegionMake(center, MKCoordinateSpan(latitudeDelta: 0.025, longitudeDelta: 0.025))
self.mapView.setRegion(region, animated: true)
I'm trying to use MKCoordinateRegionMake but there might be an easier way to do this. Please let me know if you guys have any ideas.