private var mapView: MKMapView
mapView.setRegion(region: MKCoordinateRegion, animated: Bool)
특정 위도와 경도를 중심으로 하는 직사각형 지리적 지역.
var center: CLLocationCoordinate2D
WGS 84 참조 프레임을 사용하여 지정된 위치와 관련된 위도와 경도.
CLLocationCoordinate2D(latitude: CLLocationDegrees, longitude: CLLocationDegrees)
var latitude: CLLocationDegrees
var longitude: CLLocationDegrees
CLLocationDegrees -> Double 타입이다.
var span: MKCoordinateSpan
표시할 지도의 양을 나타내는 수평 및 수직 스팬.
var span: MKCoordinateSpan
지도 영역의 너비와 높이.
MKCoordinateSpan(latitudeDelta: CLLocationDegrees, longitudeDelta: CLLocationDegrees)
CLLocationDegrees -> Double 타입이다.
import UIKit
import MapKit
import Then
private var mapView: MKMapView = MKMapView().then {
let location = CLLocationCoordinate2D(latitude: 37.49812745816443, longitude: 126.72430597470574)
let span = MKCoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1)
let region = MKCoordinateRegion(center: location, span: span)
$0.setRegion(region, animated: true)
}
let span = MKCoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1) // before
let span = MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005) // after