From 8f3e9ba9cc85dd8453c3053bf22af164a6716e3b Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Sat, 15 Nov 2025 10:08:23 -0500 Subject: [PATCH 1/2] Update sidebar flag --- leafmap/maplibregl.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/leafmap/maplibregl.py b/leafmap/maplibregl.py index 3a863768da..5684596770 100644 --- a/leafmap/maplibregl.py +++ b/leafmap/maplibregl.py @@ -97,8 +97,8 @@ def __init__( }, projection: str = "mercator", use_message_queue: bool = None, - add_sidebar: bool = False, - add_floating_sidebar: bool = True, + add_sidebar: bool = None, + add_floating_sidebar: bool = None, sidebar_visible: bool = False, sidebar_width: int = 360, sidebar_args: Optional[Dict] = None, @@ -260,6 +260,14 @@ def __init__( ] ) + if add_sidebar is None and add_floating_sidebar is None: + add_sidebar = False + add_floating_sidebar = True + elif add_sidebar: + add_floating_sidebar = False + elif add_floating_sidebar: + add_sidebar = False + if sidebar_args is None: sidebar_args = {} if "sidebar_visible" not in sidebar_args: From 8b96d0c9c1e4ac6f2c12e50fe47187ae57ab9a4d Mon Sep 17 00:00:00 2001 From: Qiusheng Wu Date: Sat, 15 Nov 2025 10:18:20 -0500 Subject: [PATCH 2/2] Fix type hints --- leafmap/maplibregl.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/leafmap/maplibregl.py b/leafmap/maplibregl.py index 5684596770..8e6141a171 100644 --- a/leafmap/maplibregl.py +++ b/leafmap/maplibregl.py @@ -97,8 +97,8 @@ def __init__( }, projection: str = "mercator", use_message_queue: bool = None, - add_sidebar: bool = None, - add_floating_sidebar: bool = None, + add_sidebar: Optional[bool] = None, + add_floating_sidebar: Optional[bool] = None, sidebar_visible: bool = False, sidebar_width: int = 360, sidebar_args: Optional[Dict] = None, @@ -267,6 +267,9 @@ def __init__( add_floating_sidebar = False elif add_floating_sidebar: add_sidebar = False + else: + add_sidebar = False + add_floating_sidebar = False if sidebar_args is None: sidebar_args = {}