티스토리 뷰





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//ViewController
 
import UIKit
import MapKit
import CoreLocation
 
class ViewController: UIViewController {
 
    @IBOutlet weak var maps: MKMapView!
    override func viewDidLoad() {
        super.viewDidLoad()
        // location 값과 span(얼마나 확대할거냐) 지정
        
        var location = CLLocationCoordinate2DMake(48.87146,    2.35500)
        var span = MKCoordinateSpan(latitudeDelta: 0.02,longitudeDelta: 0.02)
        var region = MKCoordinateRegion(center: location, span : span)
        
        var annotation = MKPointAnnotation()
        annotation.coordinate = location
        annotation.title = "My Office"
        annotation.subtitle = "Check for Alert"
        
        maps.setRegion(region, animated: true)
        maps.addAnnotation(annotation)
        
        
    }
 
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
 
 
}
cs



댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함