|
17 | 17 | TypeJsonValue, |
18 | 18 | escape_backticks, |
19 | 19 | parse_options, |
| 20 | + remove_empty, |
20 | 21 | validate_location, |
21 | 22 | ) |
22 | 23 |
|
@@ -131,7 +132,7 @@ def __init__( |
131 | 132 | super().__init__(name=name, overlay=overlay, control=control, show=show) |
132 | 133 | self._name = "FeatureGroup" |
133 | 134 | self.tile_name = name if name is not None else self.get_name() |
134 | | - self.options = kwargs |
| 135 | + self.options = remove_empty(**kwargs) |
135 | 136 |
|
136 | 137 |
|
137 | 138 | class LayerControl(MacroElement): |
@@ -206,7 +207,7 @@ def __init__( |
206 | 207 | ): |
207 | 208 | super().__init__() |
208 | 209 | self._name = "LayerControl" |
209 | | - self.options = dict( |
| 210 | + self.options = remove_empty( |
210 | 211 | position=position, collapsed=collapsed, autoZIndex=autoZIndex, **kwargs |
211 | 212 | ) |
212 | 213 | self.draggable = draggable |
@@ -312,7 +313,7 @@ def __init__( |
312 | 313 | f"color argument of Icon should be one of: {self.color_options}.", |
313 | 314 | stacklevel=2, |
314 | 315 | ) |
315 | | - self.options = dict( |
| 316 | + self.options = remove_empty( |
316 | 317 | marker_color=color, |
317 | 318 | icon_color=icon_color, |
318 | 319 | icon=icon, |
@@ -379,7 +380,7 @@ def __init__( |
379 | 380 | super().__init__() |
380 | 381 | self._name = "Marker" |
381 | 382 | self.location = validate_location(location) if location is not None else None |
382 | | - self.options = dict( |
| 383 | + self.options = remove_empty( |
383 | 384 | draggable=draggable or None, autoPan=draggable or None, **kwargs |
384 | 385 | ) |
385 | 386 | if icon is not None: |
@@ -481,7 +482,7 @@ def __init__( |
481 | 482 |
|
482 | 483 | self.show = show |
483 | 484 | self.lazy = lazy |
484 | | - self.options = dict( |
| 485 | + self.options = remove_empty( |
485 | 486 | max_width=max_width, |
486 | 487 | autoClose=False if show or sticky else None, |
487 | 488 | closeOnClick=False if sticky else None, |
@@ -550,7 +551,7 @@ def __init__( |
550 | 551 | self.text = str(text) |
551 | 552 |
|
552 | 553 | kwargs.update({"sticky": sticky}) |
553 | | - self.options = kwargs |
| 554 | + self.options = remove_empty(**kwargs) |
554 | 555 |
|
555 | 556 | if style: |
556 | 557 | assert isinstance( |
@@ -659,7 +660,7 @@ def __init__( |
659 | 660 | self._name = "FitOverlays" |
660 | 661 | self.method = "flyToBounds" if fly else "fitBounds" |
661 | 662 | self.fit_on_map_load = fit_on_map_load |
662 | | - self.options = dict(padding=(padding, padding), max_zoom=max_zoom) |
| 663 | + self.options = remove_empty(padding=(padding, padding), max_zoom=max_zoom) |
663 | 664 |
|
664 | 665 |
|
665 | 666 | class CustomPane(MacroElement): |
|
0 commit comments