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
| 74 | |
| 75 | |
| 76 | class 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 | |
| 98 | class Layer(Evented): |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…