All Superinterfaces:
Evented
All Known Implementing Classes:
Circle, CircleMarker, FeatureGroup, ImageOverlay, InteractiveLayer, LeafletMap, Marker, MarkerClusterGroup, MultiPolygon, MultiPolyline, Path, Polygon, Polyline, Rectangle

public interface SupportsMouseEvents extends Evented
Mixin interface adding default methods to register listeners for mouse related Leaflet events on the implementing component.
  • Method Details

    • onClick

      default void onClick(LeafletEventListener<MouseEvent> listener)
      Fired when the user clicks (or taps) the layer.
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onDoubleClick

      default void onDoubleClick(LeafletEventListener<MouseEvent> listener)
      Fired when the user double-clicks (or double-taps) the layer.
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onMouseDown

      default void onMouseDown(LeafletEventListener<MouseEvent> listener)
      Fired when the user pushes the mouse button on the layer.
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onMouseOver

      default void onMouseOver(LeafletEventListener<MouseEvent> listener)
      Fired when the mouse enters the layer
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onMouseUp

      default void onMouseUp(LeafletEventListener<MouseEvent> listener)
      Fired when the user releases the mouse button pushed on the layer.
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onMouseOut

      default void onMouseOut(LeafletEventListener<MouseEvent> listener)
      Fired when the mouse leaves the layer.
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onMouseMove

      default void onMouseMove(LeafletEventListener<MouseEvent> listener)
      Fired while the mouse moves over the layeyr.
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onContextMenuOpened

      default void onContextMenuOpened(LeafletEventListener<MouseEvent> listener)
      Fired when the user right-clicks on the layer, prevents default browser context menu from showing if there are listeners on this event. Also fired on mobile when the user holds a single touch for a second (also called long press).
      Parameters:
      listener - the listener to call when the event occurs, not null