     }
     
     func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
-        searchBar.showsCancelButton = false
         closeSearch()
     }
     

    // MARK: - UISearchBarDelegate
    
    func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
        searchBar.showsCancelButton = true
        viewMode = .search
        deselectAllAnnotations()
        

                return
            }
            if oldValue == .search && viewMode != .search {
                UIView.animate(withDuration: 0.3) {
                    self.mapListToggle.alpha = 1
                    self.mapListToggle.isHidden = false
                    self.searchBarStackView.layoutIfNeeded()
                    self.searchBar.setShowsCancelButton(false, animated: true)
                }
            } else if oldValue != .search && viewMode == .search {
                UIView.animate(withDuration: 0.3) {
                    self.mapListToggle.isHidden = true
                    self.mapListToggle.alpha = 0
                    self.searchBarStackView.layoutIfNeeded()
                    self.searchBar.setShowsCancelButton(true, animated: true)
                }
            }
            switch traitBasedViewMode {
