Ejemplo n.º 1
0
def on(event, cb):
    """Subscribes for an event for all markers.

    Args:
        event (string): event name
        cb (function): callback function
    """
    if event in __ehandlers.keys():
        __ehandlers[event].append(_event.Event(cb))
    else:
        __ehandlers[event] = []
        __ehandlers[event].append(_event.Event(cb))
Ejemplo n.º 2
0
    def on(self, event, cb):
        """Subscribes for an event only for this marker.

        Args:
            event (string): event name
            cb (function): callback function
        """
        if event in self._ehandlers.keys():
            self._ehandlers[event].append(_event.Event(cb))
        else:
            self._ehandlers[event] = []
            self._ehandlers[event].append(_event.Event(cb))