All Known Subinterfaces:
SupportsDragEvents, SupportsKeyboardEvents, SupportsLayerEvents, SupportsLocationEvents, SupportsMapEvents, SupportsMouseEvents
All Known Implementing Classes:
Circle, CircleMarker, DivOverlay, DynamicMapLayer, EsriLeafletLayer, FeatureGroup, GridLayer, HeatLayer, ImageOverlay, InteractiveLayer, KmzLayer, Layer, LayerGroup, LeafletMap, Marker, MarkerClusterGroup, MultiPolygon, MultiPolyline, Path, Polygon, Polyline, Popup, Rectangle, TiledMapLayer, TileLayer, Tooltip, VectorBasemapLayer

public interface Evented
A set of methods shared between event-powered classes (like Map and Marker). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire 'click' event).
Since:
2020-02-06
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
  • Method Details

    • addEventListener

      <T extends LeafletEvent> void addEventListener(LeafletEventType eventType, LeafletEventListener<T> listener)
      Adds a listener function (fn) to a particular event type of the object.
      Type Parameters:
      T - the generic type of the leaflet object
      Parameters:
      eventType - type of the event to be listening
      listener - the event listener
    • on

      default <T extends LeafletEvent> void on(LeafletEventType eventType, LeafletEventListener<T> listener)
      Alias to addEventListener(…)
      Type Parameters:
      T - the generic type of the leaflet object
      Parameters:
      eventType - type of the event to be listening
      listener - the event listener
    • removeEventListener

      void removeEventListener(LeafletEventType eventType)
      Alias to off(…)
      Parameters:
      eventType - the event type
    • off

      default void off(LeafletEventType eventType)
      Removes a previously added listener function.
      Parameters:
      eventType - the event type
    • clearAllEventListeners

      void clearAllEventListeners()
      Alias to off()
    • off

      default void off()
      Removes all listeners to all events on the object. This includes implicitly attached events.
    • hasEventListeners

      boolean hasEventListeners(LeafletEventType eventType)
      Alias to listens(…)
      Parameters:
      eventType - the event type
      Returns:
      true if a particular event type has any listeners attached to it
    • listens

      default boolean listens(LeafletEventType eventType)
      Returns true if a particular event type has any listeners attached to it.
      Parameters:
      eventType - the event type
      Returns:
      true if a particular event type has any listeners attached to it