MCPcopy Create free account
hub / github.com/python-visualization/folium / Evented

Class Evented

folium/map.py:76–95  ·  view source on GitHub ↗

The base class for Layer and Map Adds the `on` and `once` methods for event handling capabilities. See https://leafletjs.com/reference.html#evented for more in depth documentation. Please note that we have only added the `on( eventMap)` variant of this method using pyth

Source from the content-addressed store, hash-verified

74
75
76class Evented(Class):
77 """The base class for Layer and Map
78
79 Adds the `on` and `once` methods for event handling capabilities.
80
81 See https://leafletjs.com/reference.html#evented for
82 more in depth documentation. Please note that we have
83 only added the `on(<Object> eventMap)` variant of this
84 method using python keyword arguments.
85 """
86
87 def on(self, **event_map: JsCode):
88 self._add(once=False, **event_map)
89
90 def once(self, **event_map: JsCode):
91 self._add(once=True, **event_map)
92
93 def _add(self, once: bool, **event_map: JsCode):
94 for event_type, handler in event_map.items():
95 self.add_child(EventHandler(event_type, handler, once))
96
97
98class Layer(Evented):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…