import MapKit
import CoreLocation
@IBOutlet weak var myMap: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
var point = MKPointAnnotation()
point.coordinate = CLLocationCoordinate2DMake(25.0305, 121.5360)
point.title = "Taipei"
point.subtitle = "Taiwan"
myMap.addAnnotation(point)
myMap.centerCoordinate = point.coordinate
//Span of the map
myMap.setRegion(MKCoordinateRegionMake(point.coordinate, MKCoordinateSpanMake(7,7)), animated: true)
}
Related Tutorial:
http://rshankar.com/get-your-current-address-in-swift/ error with Xcode beta 6
http://www.johnmullins.co/blog/2014/08/14/location-tracker-with-maps/
Excellent Tutorial
No comments:
Post a Comment