     }
     
     @IBAction func onClearDirections(_ sender: Any) {
+        // Remove all annotations related to directions
         clearARDirections()
         clear2DMapDirections()
+        
+        // Restore the number of Places pins depending on 10 or 20 selected in MoreControl
+        //changeNumPins()
+        
+        // Perform first search since the user may have changed locations
+        performFirstSearch()
+        
         clearDirectionsButton.isHidden = true
     }
 

        if let existingAnnotations = mapView.annotations {
            mapView.removeAnnotations(existingAnnotations)
        }
    }
    
    // MARK: - Directions

    
    func mapViewDidFinishLoadingMap(_ mapView: MGLMapView) {
        annotationManager.originLocation = currentLocation
        
        // Add our own gesture recognizer to handle taps on our AR annotations.
        sceneView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(onMapTap(recognizer:))))

        performFirstSearch()
    }
    
