   let routeListSegueId = "routeListSegue"
   var routeResultTable : RouteDisplayViewController?
   var currentRouteResult: OTRRoutingResult?
-  private var routingLocale = Locale.current
+  private var routingLocale = Locale.current {
+    didSet {
+      requestRoute()
+    }
+  }
+  private var destination : OTRGeoPoint?
+
+  override func viewDidLoad() {
+    super.viewDidLoad()
+    setupSwitchLocaleBtn()
+  }
+
+  override func viewDidAppear(_ animated: Bool) {
+    super.viewDidAppear(animated)
+    if LocationManager.sharedManager.isAlwaysAuthorized() || LocationManager.sharedManager.isInUseAuthorized() {
+      LocationManager.sharedManager.startUpdatingLocation()
+      return
+    }
+    LocationManager.sharedManager.requestWhenInUseAuthorization()
+  }
 
   override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
     guard let identifier = segue.identifier else {

    }
  }

  override func viewDidLoad() {
    super.viewDidLoad()
    setupSwitchLocaleBtn()
  }

  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    if LocationManager.sharedManager.isAlwaysAuthorized() || LocationManager.sharedManager.isInUseAuthorized() {
      LocationManager.sharedManager.startUpdatingLocation()
      return
    }
    LocationManager.sharedManager.requestWhenInUseAuthorization()
  }

  func routeTo(_ point: PeliasMapkitAnnotation) {
    guard let routingController = try? MapzenRoutingController.controller() else { return }
    routingController.updateLocale(routingLocale)

    var startingPoint = OTRRoutingPoint(coordinate: OTRGeoPointMake(40.7444892, -73.9900082), type: .break)
    if let location = LocationManager.sharedManager.currentLocation {
      startingPoint = OTRRoutingPoint(coordinate: OTRGeoPointMake(location.coordinate.latitude, location.coordinate.longitude), type: .break)
    }

    let endingPoint = OTRRoutingPoint(coordinate: OTRGeoPointMake(point.coordinate.latitude, point.coordinate.longitude), type: .break)

    _ = routingController.requestRoute(withLocations: [startingPoint, endingPoint],
                                                costingModel: .auto,
                                                costingOption: nil,
                                                directionsOptions: ["units" : "miles" as NSObject]) { (routingResult, token, error) in
                                                  print("Error:\(error)")
                                                  self.currentRouteResult = routingResult
                                                  self.routeResultTable?.show(routingResult!)

    }

  }

  func selected(_ location: PeliasMapkitAnnotation) {
    print("Selected \(location.title)")
    searchBar.text = location.title
    routeTo(location)
  }

  // MARK : private

      self.dismiss(animated: true, completion: nil)
    }))
    self.navigationController?.present(actionSheet, animated: true, completion: nil)
  }

  private func requestRoute() {
    guard let routingController = try? MapzenRoutingController.controller() else { return }
    routingController.updateLocale(routingLocale)

    guard let currentLocation = LocationManager.sharedManager.currentLocation, let destination = destination else { return }
    let startingPoint = OTRRoutingPoint(coordinate: OTRGeoPointMake(currentLocation.coordinate.latitude, currentLocation.coordinate.longitude), type: .break)
    let endingPoint = OTRRoutingPoint(coordinate: destination, type: .break)

    _ = routingController.requestRoute(withLocations: [startingPoint, endingPoint],
                                       costingModel: .auto,
                                       costingOption: nil,
                                       directionsOptions: ["units" : "miles" as NSObject]) { (routingResult, token, error) in
                                        print("Error:\(error)")
                                        self.currentRouteResult = routingResult
                                        self.routeResultTable?.show(routingResult!)

    }

  }

