Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix legend bug #2143

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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