MapAnnotation

//  ViewController.swift
//  MapAnnotation


import UIKit
import MapKit

class ViewController: UIViewController {

    @IBOutlet var mpView: MKMapView!
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        let span : MKCoordinateSpan = MKCoordinateSpanMake(0.1, 0.1)
        let loctaion : CLLocationCoordinate2D = CLLocationCoordinate2DMake(37.760122, -122.468158)
        let region : MKCoordinateRegion = MKCoordinateRegionMake(loctaion, span)
        
        mpView.setRegion(region, animated: true)
        
        let annonation = MKPointAnnotation()
        annonation.title = "me"
        annonation.subtitle = "me here"
        annonation.coordinate = loctaion
        
        mpView.addAnnotation(annonation)
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }



}

Comments