Skip to content

Commit

Permalink
Fix lonboard map init bug
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Jun 30, 2024
1 parent 40cc779 commit 082ed6c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions leafmap/deckgl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(
height: int = 600,
layers: List = [],
show_tooltip: bool = True,
view_state: Optional[Dict] = {},
**kwargs,
) -> None:
"""Initialize a Map object.
Expand All @@ -37,21 +38,23 @@ def __init__(
height (int, optional): Height of the map. Defaults to 600.
layers (list, optional): List of additional layers to add to the map. Defaults to [].
show_tooltip (bool, optional): Flag to show tooltips on the map. Defaults to True.
view_state (dict, optional): The view state of the map. Defaults to {}.
**kwargs: Additional keyword arguments to pass to lonboard.Map.
Returns:
None
"""

kwargs["latitude"] = center[0]
kwargs["longitude"] = center[1]
kwargs["zoom"] = zoom
view_state["latitude"] = center[0]
view_state["longitude"] = center[1]
view_state["zoom"] = zoom
kwargs["view_state"] = view_state

super().__init__(
_height=height,
show_tooltip=show_tooltip,
layers=layers,
view_state=kwargs,
**kwargs,
)

def add_gdf(
Expand Down

0 comments on commit 082ed6c

Please sign in to comment.