         //        self.mapView.setVisibleMapRect(polyline.boundingMapRect, animated: true)
         self.mapView.addOverlay(polyline)
         self.mapView.region = mapRegion()
-        
     }
     
     func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOverlayRenderer{

            self.dismissViewControllerAnimated(true, completion: nil)
        }
    }
    
}

        gradient.frame = self.view.frame
        gradient.colors = [topGradient, bottomGradient]
        self.view.layer.insertSublayer(gradient, atIndex: 0)
    }
}

// MARK: - View LifeCycle
extension BikeAnalysisViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        mapView.delegate = self
        mapView.layer.cornerRadius = 4
        setNavigation()
        setupBackground()
        setLabel()
        addPolyLineToMap()
    }
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        TrackingManager.sharedManager.createTrackingScreenView("view_in_record_result")
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
}

// MARK: - Map
extension BikeAnalysisViewController {
    func mapRegion() -> MKCoordinateRegion {
        let initialLoc = routes.first!
        
