diff --git a/fastkml/base.py b/fastkml/base.py index 64e78887..197f4a98 100644 --- a/fastkml/base.py +++ b/fastkml/base.py @@ -143,6 +143,8 @@ def _get_kwargs( strict: bool, ) -> Dict[str, Any]: """Returns a dictionary of kwargs for the class constructor.""" + name_spaces = name_spaces or {} + name_spaces = {**config.NAME_SPACES, **name_spaces} kwargs: Dict[str, Any] = {"ns": ns, "name_spaces": name_spaces} return kwargs diff --git a/fastkml/gx.py b/fastkml/gx.py index 5a81c8b7..b40a07b4 100644 --- a/fastkml/gx.py +++ b/fastkml/gx.py @@ -448,7 +448,7 @@ def _get_kwargs( strict=strict, ) kwargs["tracks"] = cls._get_track_kwargs_from_element( - ns=config.GXNS, + ns=kwargs["name_spaces"].get("gx", ""), element=element, strict=strict, )