Skip to content

Commit

Permalink
Fix legend bug (gee-community#2143)
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs authored Sep 25, 2024
1 parent 5289558 commit 665655b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
6 changes: 6 additions & 0 deletions geemap/coreutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,12 @@ def widget_template(

name = "_" + random_string() # a random attribute name

if widget_args is None:
widget_args = {}

if close_button_args is None:
close_button_args = {}

if "value" not in widget_args:
widget_args["value"] = False
if "tooltip" not in widget_args:
Expand Down
15 changes: 1 addition & 14 deletions geemap/geemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2048,20 +2048,7 @@ def close_btn_click(change):

def basemap_demo(self):
"""A demo for using geemap basemaps."""
dropdown = widgets.Dropdown(
options=list(basemaps.keys()),
value="HYBRID",
description="Basemaps",
)

def on_click(change):
basemap_name = change["new"]
old_basemap = self.layers[-1]
self.substitute_layer(old_basemap, get_basemap(basemaps[basemap_name]))

dropdown.observe(on_click, "value")
basemap_control = ipyleaflet.WidgetControl(widget=dropdown, position="topright")
self.add(basemap_control)
self.add_basemap_widget()

def add_colorbar_branca(
self,
Expand Down

0 comments on commit 665655b

Please sign in to comment.