You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB

6 years ago
  1. //
  2. // AgentLocation.swift
  3. // GMERemittance
  4. //
  5. // Created by Sujal on 12/28/17.
  6. // Copyright © 2017 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. import UIKit
  10. import MapKit
  11. class AgentLocation: UIViewController {
  12. @IBOutlet weak var map: MKMapView!
  13. var latitude: CLLocationDegrees?
  14. var longitude: CLLocationDegrees?
  15. override func viewDidLoad() {
  16. super.viewDidLoad()
  17. setUpNavBar(id: 201, title: "Agent")
  18. let latDelta: CLLocationDegrees = 0.01
  19. let lonDelta: CLLocationDegrees = 0.01
  20. let span: MKCoordinateSpan = MKCoordinateSpanMake(latDelta, lonDelta)
  21. let location: CLLocationCoordinate2D = CLLocationCoordinate2DMake(latitude!, longitude!)
  22. let region: MKCoordinateRegion = MKCoordinateRegionMake(location, span)
  23. map.setRegion(region, animated: true)
  24. // map.addAnnotation(CLLocationCoordinate2D(latitude: latitude!, longitude: longitude!) as! MKAnnotation)
  25. let annotation = MKPointAnnotation()
  26. annotation.coordinate = location
  27. annotation.title = "GME Agent"
  28. annotation.subtitle = ""
  29. map.addAnnotation(annotation)
  30. }
  31. }