diff --git a/src/coastseg/coastseg_map.py b/src/coastseg/coastseg_map.py index 6703c99d..e9aa5c71 100644 --- a/src/coastseg/coastseg_map.py +++ b/src/coastseg/coastseg_map.py @@ -137,39 +137,6 @@ def find_shorelines_directory(path, roi_id): return None -def find_shorelines_directory(path, roi_id): - # List the contents of the specified path - contents = os.listdir(path) - - # Check for extracted shorelines geojson file in the specified path - extracted_shorelines_file = [ - file - for file in contents - if "extracted_shorelines" in file and file.endswith(".geojson") - ] - if extracted_shorelines_file: - return path - - # If the file is not found, check for a directory with the ROI ID - roi_directory = [ - directory - for directory in contents - if os.path.isdir(os.path.join(path, directory)) and roi_id in directory - ] - if roi_directory: - roi_path = os.path.join(path, roi_directory[0]) - roi_contents = os.listdir(roi_path) - extracted_shorelines_file = [ - file - for file in roi_contents - if "extracted_shorelines" in file and file.endswith(".geojson") - ] - if extracted_shorelines_file: - return roi_path - - return None - - def delete_extracted_shorelines_files(session_path: str, selected_items: List): """ Delete the extracted shorelines from the session directory for all the relevant files. @@ -278,7 +245,7 @@ def _init_info_boxes(self): self.map.add(self.warning_widget) self.roi_html = HTML("""""") - self.roi_box = common.create_hover_box(title="ROI", feature_html=self.roi_html) + self.roi_box = common.create_hover_box(title="ROI", feature_html=self.roi_html,default_msg="Hover over a ROI") self.roi_widget = WidgetControl(widget=self.roi_box, position="topright") self.map.add(self.roi_widget) diff --git a/src/coastseg/common.py b/src/coastseg/common.py index 4c665dea..ce07a00d 100644 --- a/src/coastseg/common.py +++ b/src/coastseg/common.py @@ -1704,7 +1704,7 @@ def mount_google_drive(name: str = "CoastSeg") -> None: print("Not running in Google Colab.") -def create_hover_box(title: str, feature_html: HTML = HTML("")) -> VBox: +def create_hover_box(title: str, feature_html: HTML = HTML(""),default_msg: str = "Hover over a feature") -> VBox: """ Creates a box with a title and optional HTML containing information about the feature that was last hovered over. @@ -1720,26 +1720,28 @@ def create_hover_box(title: str, feature_html: HTML = HTML("")) -> VBox: Returns: container (VBox): Box with the given title and details about the feature given by feature_html """ - padding = "0px 0px 0px 5px" # upper, right, bottom, left + padding = "0px 0px 4px 0px" # upper, right, bottom, left # create title - title = HTML(f"