diff --git a/leafmap/foliumap.py b/leafmap/foliumap.py index dbb0a2523..f33e986be 100644 --- a/leafmap/foliumap.py +++ b/leafmap/foliumap.py @@ -1449,6 +1449,10 @@ def add_geojson( raise Exception(e) # interchangeable parameters between ipyleaflet and folium. + + if "style_callback" in kwargs: + kwargs["style_function"] = kwargs.pop("style_callback") + style_dict = {} if "style_function" not in kwargs: if "style" in kwargs: @@ -1456,7 +1460,7 @@ def add_geojson( if isinstance(kwargs["style"], dict) and len(kwargs["style"]) > 0: kwargs["style_function"] = lambda x: style_dict kwargs.pop("style") - else: + elif "fill_colors" not in kwargs: style_dict = { # "stroke": True, "color": "#3388ff", @@ -1470,9 +1474,6 @@ def add_geojson( } kwargs["style_function"] = lambda x: style_dict - if "style_callback" in kwargs: - kwargs.pop("style_callback") - if "hover_style" in kwargs: kwargs.pop("hover_style")