java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<LeafletMap>
org.vaadin.addons.componentfactory.leaflet.layer.events.LeafletEvent
org.vaadin.addons.componentfactory.leaflet.layer.events.MouseEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MouseClickEvent, MouseContextMenuEvent, MouseDoubleClickEvent, MouseDownEvent, MouseMoveEvent, MouseOutEvent, MouseOverEvent, MousePreClickEvent, MouseUpEvent

public abstract class MouseEvent extends LeafletEvent
Base class for all Leaflet mouse events. Besides the properties inherited from LeafletEvent, a mouse event also carries the geographical and pixel coordinates of the point where the interaction occurred.
See Also:
  • Constructor Details

    • MouseEvent

      public MouseEvent(LeafletMap source, boolean fromClient, String layerId, MouseEventType eventType, LatLng latLng, Point layerPoint, Point containerPoint)
      Creates a new mouse event.
      Parameters:
      source - the source component
      fromClient - true if the event originated on the client side
      layerId - the id of the layer that fired the event
      eventType - the type of the mouse event
      latLng - the geographical point where the mouse event occurred
      layerPoint - the pixel coordinates of the point where the mouse event occurred relative to the map layer
      containerPoint - the pixel coordinates of the point where the mouse event occurred relative to the map container
  • Method Details

    • getLatLng

      public LatLng getLatLng()
      The geographical point where the mouse event occured.
      Returns:
      the geographical point where the mouse event occured
    • getLayerPoint

      public Point getLayerPoint()
      Pixel coordinates of the point where the mouse event occured relative to the map layer.
      Returns:
      the pixel coordinates relative to the map layer.
    • getContainerPoint

      public Point getContainerPoint()
      Pixel coordinates of the point where the mouse event occured relative to the map сontainer.
      Returns:
      the pixel coordinates relative to the map сontainer.
    • toString

      public String toString()
      Overrides:
      toString in class LeafletEvent