MCPcopy
hub / github.com/python-visualization/folium / __init__

Method __init__

folium/map.py:440–464  ·  view source on GitHub ↗
(
        self,
        location: Optional[Sequence[float]] = None,
        popup: Union["Popup", str, None] = None,
        tooltip: Union["Tooltip", str, None] = None,
        icon: Optional[Union[Icon, "CustomIcon", "DivIcon"]] = None,
        draggable: bool = False,
        **kwargs: TypeJsonValue,
    )

Source from the content-addressed store, hash-verified

438 self.icon = icon
439
440 def __init__(
441 self,
442 location: Optional[Sequence[float]] = None,
443 popup: Union["Popup", str, None] = None,
444 tooltip: Union["Tooltip", str, None] = None,
445 icon: Optional[Union[Icon, "CustomIcon", "DivIcon"]] = None,
446 draggable: bool = False,
447 **kwargs: TypeJsonValue,
448 ):
449 super().__init__()
450 self._name = "Marker"
451 self.location = validate_location(location) if location is not None else None
452 self.options = remove_empty(
453 draggable=draggable or None, autoPan=draggable or None, **kwargs
454 )
455 # this attribute is not used by Marker, but by GeoJson
456 self.icon = None
457 if icon is not None:
458 self.set_icon(icon)
459 if popup is not None:
460 self.add_child(popup if isinstance(popup, Popup) else Popup(str(popup)))
461 if tooltip is not None:
462 self.add_child(
463 tooltip if isinstance(tooltip, Tooltip) else Tooltip(str(tooltip))
464 )
465
466 def _get_self_bounds(self) -> TypeBoundsReturn:
467 """Computes the bounds of the object itself.

Callers

nothing calls this directly

Calls 7

set_iconMethod · 0.95
add_childMethod · 0.95
validate_locationFunction · 0.90
remove_emptyFunction · 0.90
PopupClass · 0.85
TooltipClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected