Skip to content

Commit

Permalink
Fix pixel inspector layer name issue (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Dec 1, 2024
1 parent 510a162 commit d30474e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions leafmap/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d30474e

Please sign in to comment.