Skip to content

Commit

Permalink
Fix set css cell output error (#1819)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Nov 4, 2023
1 parent 7be18b3 commit a0d7f21
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions geemap/map_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from traceback import format_tb


def _set_css_in_cell_output():
def _set_css_in_cell_output(info):
display(
HTML(
"""
Expand Down Expand Up @@ -141,13 +141,13 @@ def __init__(

vmin = vis_params.get("min", kwargs.pop("vmin", 0))
try:
vmin = float(vmin)
vmin = float(vmin)
except ValueError as err:
raise ValueError("The provided min value must be scalar type.")

vmax = vis_params.get("max", kwargs.pop("mvax", 1))
try:
vmax = float(vmax)
vmax = float(vmax)
except ValueError as err:
raise ValueError("The provided max value must be scalar type.")

Expand Down Expand Up @@ -872,13 +872,13 @@ def _on_layer_visibility_changed(self, change, layer):
self._host_map.add(attachment)
except:
from ipyleaflet import WidgetControl

widget = attachment.widget
position = attachment.position
control = WidgetControl(widget=widget, position=position)
self._host_map.add(control)
layer_dict["colorbar"] = control


elif not change["new"] and attachment_on_map:
self._host_map.remove_control(attachment)

Expand Down Expand Up @@ -1330,9 +1330,7 @@ def _update_stretch(self, *_):
map_bbox = ee.Geometry.BBox(west=w, south=s, east=e, north=n)
vis_bands = set((b.value for b in self._bands_hbox.children))
min_val, max_val = self._ee_layer.calculate_vis_minmax(
bounds=map_bbox,
bands=vis_bands,
**stretch_params
bounds=map_bbox, bands=vis_bands, **stretch_params
)

# Update in the correct order to avoid setting an invalid range
Expand Down

0 comments on commit a0d7f21

Please sign in to comment.