MCPcopy Index your code
hub / github.com/python-visualization/folium / __init__

Method __init__

folium/vector_layers.py:273–290  ·  view source on GitHub ↗
(
        self,
        bounds: TypeLine,
        popup: Union[Popup, str, None] = None,
        tooltip: Union[Tooltip, str, None] = None,
        **kwargs: TypePathOptions,
    )

Source from the content-addressed store, hash-verified

271 )
272
273 def __init__(
274 self,
275 bounds: TypeLine,
276 popup: Union[Popup, str, None] = None,
277 tooltip: Union[Tooltip, str, None] = None,
278 **kwargs: TypePathOptions,
279 ):
280 super().__init__()
281 self._name = "rectangle"
282 self.options = path_options(line=True, radius=None, **kwargs)
283 self.locations = validate_locations(bounds)
284 assert len(self.locations) == 2, "Need two lat/lon pairs"
285 if popup is not None:
286 self.add_child(popup if isinstance(popup, Popup) else Popup(str(popup)))
287 if tooltip is not None:
288 self.add_child(
289 tooltip if isinstance(tooltip, Tooltip) else Tooltip(str(tooltip))
290 )
291
292 def _get_self_bounds(self) -> List[List[Optional[float]]]:
293 """Compute the bounds of the object itself."""

Callers

nothing calls this directly

Calls 6

validate_locationsFunction · 0.90
PopupClass · 0.90
TooltipClass · 0.90
path_optionsFunction · 0.85
__init__Method · 0.45
add_childMethod · 0.45

Tested by

no test coverage detected