From a0d7f21d4b1d343c19ec3f67a80afe98af327655 Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Fri, 3 Nov 2023 23:17:44 -0400 Subject: [PATCH] Fix set css cell output error (#1819) --- geemap/map_widgets.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/geemap/map_widgets.py b/geemap/map_widgets.py index fd073112af..ae3b3f292f 100644 --- a/geemap/map_widgets.py +++ b/geemap/map_widgets.py @@ -14,7 +14,7 @@ from traceback import format_tb -def _set_css_in_cell_output(): +def _set_css_in_cell_output(info): display( HTML( """ @@ -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.") @@ -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) @@ -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