Skip to content

Commit

Permalink
Add colorbar in get_image_collection_gif method (#2059)
Browse files Browse the repository at this point in the history
* overlay another layer in gif

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add colorbar in the gif animation

* vis_params as a default option on add_colorbar

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
iamtekson and pre-commit-ci[bot] authored Jun 27, 2024
1 parent 9667bfa commit 54e1998
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions geemap/cartoee.py
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ def get_image_collection_gif(
scale_bar_dict={},
overlay_layers=[],
overlay_styles=[],
colorbar_dict={},
verbose=True,
**kwargs,
):
Expand All @@ -1183,6 +1184,7 @@ def get_image_collection_gif(
scale_bar_dict (dict, optional): Parameters for the scale bar. See https://geemap.org/cartoee/#geemap.cartoee.add_scale_bar. Defaults. to {}.
overlay_layers (list, optional): A list of Earth Engine objects to overlay on the map. Defaults to [].
overlay_styles (list, optional): A list of dictionaries of visualization parameters for overlay layers. Defaults to [].
colorbar_dict (dict, optional): Parameters for the colorbar. See https://geemap.org/cartoee/#geemap.cartoee.add_colorbar. Defaults to {}.
verbose (bool, optional): Whether or not to print text when the program is running. Defaults to True.
**kwargs: Additional keyword arguments are passed to the add_layer() function.
"""
Expand Down Expand Up @@ -1262,6 +1264,10 @@ def get_image_collection_gif(
**kwargs,
)

# Add colorbar if colorbar_dict is not empty
if colorbar_dict:
add_colorbar(ax, vis_params, **colorbar_dict)

# Add grid
if grid_interval is not None:
add_gridlines(ax, interval=grid_interval, linestyle=":")
Expand Down

0 comments on commit 54e1998

Please sign in to comment.