             height: self.view.frame.size.height / 2)
     }
 
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Release any cached data, images, etc that aren't in use.
-    }
-
     @objc func updateUserLocation() {
-        if let currentLocation = sceneLocationView.currentLocation() {
-            DispatchQueue.main.async {
-
-                if let bestEstimate = self.sceneLocationView.bestLocationEstimate(),
-                    let position = self.sceneLocationView.currentScenePosition() {
-                    print("")
-                    print("Fetch current location")
-                    print("best location estimate, position: \(bestEstimate.position), location: \(bestEstimate.location.coordinate), accuracy: \(bestEstimate.location.horizontalAccuracy), date: \(bestEstimate.location.timestamp)")
-                    print("current position: \(position)")
-
-                    let translation = bestEstimate.translatedLocation(to: position)
-
-                    print("translation: \(translation)")
-                    print("translated location: \(currentLocation)")
-                    print("")
-                }
-
-                if self.userAnnotation == nil {
-                    self.userAnnotation = MKPointAnnotation()
-                    self.mapView.addAnnotation(self.userAnnotation!)
-                }
-
-                UIView.animate(withDuration: 0.5, delay: 0, options: UIViewAnimationOptions.allowUserInteraction, animations: {
-                    self.userAnnotation?.coordinate = currentLocation.coordinate
-                }, completion: nil)
-
-                if self.centerMapOnUserLocation {
-                    UIView.animate(withDuration: 0.45, delay: 0, options: UIViewAnimationOptions.allowUserInteraction, animations: {
-                        self.mapView.setCenter(self.userAnnotation!.coordinate, animated: false)
-                    }, completion: { _ in
-                        self.mapView.region.span = MKCoordinateSpan(latitudeDelta: 0.0005, longitudeDelta: 0.0005)
-                    })
-                }
-
-                if self.displayDebugging {
-                    let bestLocationEstimate = self.sceneLocationView.bestLocationEstimate()
-
-                    if bestLocationEstimate != nil {
-                        if self.locationEstimateAnnotation == nil {
-                            self.locationEstimateAnnotation = MKPointAnnotation()
-                            self.mapView.addAnnotation(self.locationEstimateAnnotation!)
-                        }
-
-                        self.locationEstimateAnnotation!.coordinate = bestLocationEstimate!.location.coordinate
-                    } else {
-                        if self.locationEstimateAnnotation != nil {
-                            self.mapView.removeAnnotation(self.locationEstimateAnnotation!)
-                            self.locationEstimateAnnotation = nil
-                        }
+        guard let currentLocation = sceneLocationView.currentLocation() else {
+            return
+        }
+
+        DispatchQueue.main.async {
+            if let bestEstimate = self.sceneLocationView.bestLocationEstimate(),
+                let position = self.sceneLocationView.currentScenePosition() {
+                print("")
+                print("Fetch current location")
+                print("best location estimate, position: \(bestEstimate.position), location: \(bestEstimate.location.coordinate), accuracy: \(bestEstimate.location.horizontalAccuracy), date: \(bestEstimate.location.timestamp)")
+                print("current position: \(position)")
+
+                let translation = bestEstimate.translatedLocation(to: position)
+
+                print("translation: \(translation)")
+                print("translated location: \(currentLocation)")
+                print("")
+            }
+
+            if self.userAnnotation == nil {
+                self.userAnnotation = MKPointAnnotation()
+                self.mapView.addAnnotation(self.userAnnotation!)
+            }
+
+            UIView.animate(withDuration: 0.5, delay: 0, options: UIViewAnimationOptions.allowUserInteraction, animations: {
+                self.userAnnotation?.coordinate = currentLocation.coordinate
+            }, completion: nil)
+
+            if self.centerMapOnUserLocation {
+                UIView.animate(withDuration: 0.45, delay: 0, options: UIViewAnimationOptions.allowUserInteraction, animations: {
+                    self.mapView.setCenter(self.userAnnotation!.coordinate, animated: false)
+                }, completion: { _ in
+                    self.mapView.region.span = MKCoordinateSpan(latitudeDelta: 0.0005, longitudeDelta: 0.0005)
+                })
+            }
+
+            if self.displayDebugging {
+                let bestLocationEstimate = self.sceneLocationView.bestLocationEstimate()
+
+                if bestLocationEstimate != nil {
+                    if self.locationEstimateAnnotation == nil {
+                        self.locationEstimateAnnotation = MKPointAnnotation()
+                        self.mapView.addAnnotation(self.locationEstimateAnnotation!)
+                    }
+
+                    self.locationEstimateAnnotation!.coordinate = bestLocationEstimate!.location.coordinate
+                } else {
+                    if self.locationEstimateAnnotation != nil {
+                        self.mapView.removeAnnotation(self.locationEstimateAnnotation!)
+                        self.locationEstimateAnnotation = nil
                     }
                 }
             }


    func sceneLocationViewDidUpdateLocationAndScaleOfLocationNode(sceneLocationView: SceneLocationView, locationNode: LocationNode) {

    }
}


            sceneLocationView.showFeaturePoints = true
        }

        buildDemoData().forEach { sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: $0) }

        view.addSubview(sceneLocationView)

