Skip to content

Commit

Permalink
Improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Jul 18, 2023
1 parent b7ac24a commit 248ce2c
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions geemap/geemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2794,6 +2794,8 @@ def add_layer_manager(
Args:
position (str, optional): The position of the Layer Manager. Defaults to "topright".
opened (bool, optional): Whether the control is opened. Defaults to True.
show_close_button (bool, optional): Whether to show the close button. Defaults to True.
"""
from .toolbar import layer_manager_gui

Expand All @@ -2806,7 +2808,11 @@ def update_layer_manager(self):
self.layer_manager_widget.children = layer_manager_gui(self, return_widget=True)

def add_draw_control(self, position="topleft"):
"""Add a draw control to the map"""
"""Add a draw control to the map
Args:
position (str, optional): The position of the draw control. Defaults to "topleft".
"""

draw_control = ipyleaflet.DrawControl(
marker={"shapeOptions": {"color": "#3388ff"}},
Expand Down Expand Up @@ -2865,7 +2871,11 @@ def handle_draw(target, action, geo_json):
self.draw_control = draw_control

def add_draw_control_lite(self, position="topleft"):
"""Add a lite version draw control to the map for the plotting tool."""
"""Add a lite version draw control to the map for the plotting tool.
Args:
position (str, optional): The position of the draw control. Defaults to "topleft".
"""

draw_control_lite = ipyleaflet.DrawControl(
marker={},
Expand All @@ -2881,6 +2891,12 @@ def add_draw_control_lite(self, position="topleft"):
self.draw_control_lite = draw_control_lite

def add_toolbar(self, position="topright", **kwargs):
"""Add a toolbar to the map.
Args:
position (str, optional): The position of the toolbar. Defaults to "topright".
"""

from .toolbar import main_toolbar

main_toolbar(self, position, **kwargs)
Expand All @@ -2899,6 +2915,14 @@ def add_plot_gui(self, position="topright", **kwargs):
def add_gui(
self, name, position="topright", opened=True, show_close_button=True, **kwargs
):
"""Add a GUI to the map.
Args:
name (str): The name of the GUI. Options include "layer_manager", "inspector", "plot", and "timelapse".
position (str, optional): The position of the GUI. Defaults to "topright".
opened (bool, optional): Whether the GUI is opened. Defaults to True.
show_close_button (bool, optional): Whether to show the close button. Defaults to True.
"""
name = name.lower()
if name == "layer_manager":
self.add_layer_manager(position, opened, show_close_button, **kwargs)
Expand Down

0 comments on commit 248ce2c

Please sign in to comment.