-
Notifications
You must be signed in to change notification settings - Fork 0
/
ThirdViewController.swift
67 lines (44 loc) · 2.22 KB
/
ThirdViewController.swift
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import UIKit
import MapKit
import CoreLocation
class ThirdViewController: UIViewController {
@IBOutlet var Map: MKMapView!
@IBOutlet weak var ArrowButtonTwo: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
let location1 = CLLocationCoordinate2D(latitude: 40.383988, longitude: -74.530506)
let location2 = CLLocationCoordinate2D(latitude: 40.383988, longitude: -74.530506)
let location3 = CLLocationCoordinate2D(latitude: 40.387301, longitude: -74.330506)
let location4 = CLLocationCoordinate2D(latitude: 40.383988, longitude: -74.230506)
let location5 = CLLocationCoordinate2D(latitude: 40.383988, longitude: -74.230506)
let span = MKCoordinateSpan(latitudeDelta: 0.02,longitudeDelta: 0.02)
let region = MKCoordinateRegion(center: location1, span: span)
Map.setRegion(region,animated: true)
let annotation1 = MKPointAnnotation()
annotation1.coordinate = location1
annotation1.title = "CHECKPOINT ONE"
annotation1.subtitle = "Reichler Park"
let annotation2 = MKPointAnnotation()
annotation2.coordinate = location2
annotation2.title = "CHECKPOINT TWO"
annotation2.subtitle = "South Brunswick Public Library"
let annotation3 = MKPointAnnotation()
annotation3.coordinate = location3
annotation3.title = "CHECKPOINT THREE"
annotation3.subtitle = "Crossroads South Middle School"
let annotation4 = MKPointAnnotation()
annotation4.coordinate = location4
annotation4.title = "CHECKPOINT FOUR"
annotation4.subtitle = "Crossroads North Middle School"
let annotation5 = MKPointAnnotation()
annotation5.coordinate = location5
annotation5.title = "CHECKPOINT FIVE"
annotation5.subtitle = "Pierre's Restaurant"
Map.addAnnotation(annotation1)
Map.addAnnotation(annotation2)
Map.addAnnotation(annotation3)
Map.addAnnotation(annotation4)
Map.addAnnotation(annotation5)
view.bringSubviewToFront(ArrowButtonTwo)
}
}