Skip to content

TextSourceAttribution

TextSourceAttribution #

Bases: SourceAttribution

A text source attribution displayed on the Map. For it to be displayed, it should be part of a RichAttribution.attributions list.

data #

data: Any = skip_field()

Arbitrary data of any type that can be attached to a control.

key #

key: (
    str | int | float | bool | ValueKey | ScrollKey | None
) = None

on_click #

on_click: (
    ControlEventHandler[TextSourceAttribution] | None
) = None

Fired when this attribution is clicked/pressed.

page #

page: Page | PageView | None

The page (of type Page or PageView) to which this control belongs to.

parent #

parent: BaseControl | None

The direct ancestor(parent) of this control.

It defaults to None and will only have a value when this control is mounted (added to the page tree).

The Page control (which is the root of the tree) is an exception - it always has parent=None.

prepend_copyright: bool = True

Whether to add the '©' character to the start of text automatically.

text #

text: str

The text to display as attribution, styled with text_style.

text_style #

text_style: TextStyle | None = None

Style used to display the text.

before_event #

before_event(e: ControlEvent)

before_update #

before_update()

before_update() method is called every time when the control is being updated. Make sure not to call update() method within before_update().

did_mount #

did_mount()

init #

init()

is_isolated #

is_isolated()

update #

update() -> None

will_unmount #

will_unmount()