Adds split map. Args: left_layer (str, optional): The layer tile layer. Defaults to 'OpenTopoMap'. right_layer (str, optional): The right tile layer. Defaults to 'Esri.WorldTopoMap'. zoom_control (bool, optional): Whether to show the zoom control. Default
(
self,
left_layer="OpenTopoMap",
right_layer="Esri.WorldTopoMap",
zoom_control=True,
fullscreen_control=True,
layer_control=True,
add_close_button=False,
close_button_position="topright",
left_label=None,
right_label=None,
left_position="bottomleft",
right_position="bottomright",
widget_layout=None,
**kwargs,
)
| 1666 | setControlVisibility = set_control_visibility |
| 1667 | |
| 1668 | def split_map( |
| 1669 | self, |
| 1670 | left_layer="OpenTopoMap", |
| 1671 | right_layer="Esri.WorldTopoMap", |
| 1672 | zoom_control=True, |
| 1673 | fullscreen_control=True, |
| 1674 | layer_control=True, |
| 1675 | add_close_button=False, |
| 1676 | close_button_position="topright", |
| 1677 | left_label=None, |
| 1678 | right_label=None, |
| 1679 | left_position="bottomleft", |
| 1680 | right_position="bottomright", |
| 1681 | widget_layout=None, |
| 1682 | **kwargs, |
| 1683 | ): |
| 1684 | """Adds split map. |
| 1685 | |
| 1686 | Args: |
| 1687 | left_layer (str, optional): The layer tile layer. Defaults to 'OpenTopoMap'. |
| 1688 | right_layer (str, optional): The right tile layer. Defaults to 'Esri.WorldTopoMap'. |
| 1689 | zoom_control (bool, optional): Whether to show the zoom control. Defaults to True. |
| 1690 | fullscreen_control (bool, optional): Whether to show the full screen control. Defaults to True. |
| 1691 | layer_control (bool, optional): Whether to show the layer control. Defaults to True. |
| 1692 | add_close_button (bool, optional): Whether to add a close button. Defaults to False. |
| 1693 | close_button_position (str, optional): The position of the close button. Defaults to 'topright'. |
| 1694 | left_label (str, optional): The label for the left map. Defaults to None. |
| 1695 | right_label (str, optional): The label for the right map. Defaults to None. |
| 1696 | left_position (str, optional): The position of the left label. Defaults to 'bottomleft'. |
| 1697 | right_position (str, optional): The position of the right label. Defaults to 'bottomright'. |
| 1698 | widget_layout (str, optional): The layout of the label widget, such as ipywidgets.Layout(padding="0px 4px 0px 4px"). Defaults to None. |
| 1699 | kwargs: Other arguments for ipyleaflet.TileLayer. |
| 1700 | """ |
| 1701 | if "max_zoom" not in kwargs: |
| 1702 | kwargs["max_zoom"] = 100 |
| 1703 | if "max_native_zoom" not in kwargs: |
| 1704 | kwargs["max_native_zoom"] = 100 |
| 1705 | try: |
| 1706 | controls = self.controls |
| 1707 | layers = self.layers |
| 1708 | self.clear_controls() |
| 1709 | |
| 1710 | if zoom_control: |
| 1711 | self.add(ipyleaflet.ZoomControl()) |
| 1712 | if fullscreen_control: |
| 1713 | self.add(ipyleaflet.FullScreenControl()) |
| 1714 | |
| 1715 | if left_label is not None: |
| 1716 | left_name = left_label |
| 1717 | else: |
| 1718 | left_name = "Left Layer" |
| 1719 | |
| 1720 | if right_label is not None: |
| 1721 | right_name = right_label |
| 1722 | else: |
| 1723 | right_name = "Right Layer" |
| 1724 | |
| 1725 | if "attribution" not in kwargs: |
nothing calls this directly
no test coverage detected