[iOS/Swift] MKMapKit, CLCoreLocation 으로 지도앱 만들기- 소스코드 제공
MKMapKit과 CoreLocation을 활용해 간단한 앱 만들기 GitHub - AnnaBaeTofuMom/MapKitPlay: 맵킷을 처음 사용하시는 분들의 이해를 돕는 간단한 지도앱 맵킷을 처음 사용하시는 분들의 이해를 돕는 간단한 지도
ios-developer-storage.tistory.com
https://kokojong.tistory.com/m/7
[iOS/Swift] Custom Annotation 만들어보기, Annotation image resizing하기
안녕하세요? 코코종입니다!! 오늘은 annotation을 커스텀해서 적용하는 방법을 들고왔습니다. 너무 오래전에 배웠던 MapKit에 대한 내용이라서 복습하는데 시간을 많이 소요했네요..^^ 여담이지만 현
kokojong.tistory.com
MapKit Annotations 전부 지우는 방법
self.mapView.removeAnnotations(self.mapView.annotations)
MapKit과제하다가 깨달은 점:
region 과 annotation은 항상 함께 따라다닌다 (따로쓰니깐 안됨)
func setRegionAndAnnotation(center: CLLocationCoordinate2D, brand: String, location: String) {
//지도 중심 기반으로 보여질 범위
let region = MKCoordinateRegion(center: center, latitudinalMeters: 20000, longitudinalMeters: 20000)
mapView.setRegion(region, animated: true)
//annotation 핀 고정
let annotation = MKPointAnnotation()
annotation.coordinate = center
annotation.title = location
mapView.addAnnotation(annotation)
}
'iOS > iOS SeSAC 2기 TIL' 카테고리의 다른 글
iOS swift Http 접근 허용하기 (0) | 2022.08.15 |
---|---|
iOS swift 현재 위치 가져오기 (0) | 2022.08.14 |
CoreLocation (0) | 2022.08.13 |
iOS swift 카메라 관련 (0) | 2022.08.12 |
TIL 08.10 (0) | 2022.08.10 |