From d30474ecf5655ddd141777fa742aa2eb5add9acd Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Sat, 30 Nov 2024 22:33:00 -0500 Subject: [PATCH] Fix pixel inspector layer name issue (#1007) --- leafmap/toolbar.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/leafmap/toolbar.py b/leafmap/toolbar.py index 7c32015897..4dbcc598d0 100644 --- a/leafmap/toolbar.py +++ b/leafmap/toolbar.py @@ -2866,8 +2866,8 @@ def handle_interaction(**kwargs): with output: output.clear_output() print(e) - bounds = m.cog_layer_dict[m.inspector_dropdown.value]["bounds"] - m.zoom_to_bounds(bounds) + # bounds = m.cog_layer_dict[m.inspector_dropdown.value]["bounds"] + # m.zoom_to_bounds(bounds) m.default_style = {"cursor": "crosshair"} @@ -6981,8 +6981,9 @@ def button_clicked(change): da = da.fillna(nodata) image = array_to_image(da) setattr(m, "_NASA_DATA_IMAGE", image) - name_prefix = dataset.value.split("_")[4][:8] - name_suffix = layer.value.split(".")[0] + name_prefix = layer.value.split(".")[0] + items = dataset.value.split("_") + name_suffix = items[3] + "_" + items[4][:8] + "_" + items[6] layer_name = f"{name_prefix}_{name_suffix}" m.add_raster( image,