Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBOutlet weak var myMapView: MKMapView!
- var cord1: Double = -39.849152
- var cord2: Double = -71.943082
- var ResivedLat: String = ""
- var ResivedLong: String = ""
- func trans(){
- cord1 = Double(ResivedLat)!
- cord2 = Double(ResivedLat)!
- }
- override func viewDidLoad() {
- super.viewDidLoad()
- mapTajMahal()
- trans()
- }
- func mapTajMahal()
- {
- //Taj Mahal Coordinates: 27.175015, 78.042139
- // Coordinates
- let tajLat:CLLocationDegrees = cord1
- let tajLong:CLLocationDegrees = cord2
- let tajCoordinate = CLLocationCoordinate2D(latitude: tajLat, longitude: tajLong)
- //Span
- let latDelta:CLLocationDegrees = 0.2
- let longDelta:CLLocationDegrees = 0.2
- let tajSpan = MKCoordinateSpan(latitudeDelta: latDelta, longitudeDelta: longDelta)
- let tajRegion = MKCoordinateRegion(center: tajCoordinate, span: tajSpan)
- myMapView.setRegion(tajRegion, animated: true )
- let tajAnnotation = MKPointAnnotation()
- tajAnnotation.title = "Neltume"
- tajAnnotation.subtitle = "She walks in beauty"
- tajAnnotation.coordinate = tajCoordinate
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement