diff --git a/leafmap/deckgl.py b/leafmap/deckgl.py index 85e41c81bc..0c168bc4e2 100644 --- a/leafmap/deckgl.py +++ b/leafmap/deckgl.py @@ -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. @@ -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(