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.DragEndEvent
All Implemented Interfaces:
Serializable

@DomEvent("dragend") public class DragEndEvent extends LeafletEvent
Event fired when a draggable layer has finished being dragged, carrying the final coordinates and the distance moved.
See Also:
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Constructor Summary

    Constructors
    Constructor
    Description
    DragEndEvent(LeafletMap source, boolean fromClient, String layerId, double lat, double lng, double distance)
    Creates a new drag end event.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    The distance in pixels the draggable element was moved by.
    The coordinates of the layer after the drag operation finished.
     

    Methods inherited from class org.vaadin.addons.componentfactory.leaflet.layer.events.LeafletEvent

    getLayerId, getType

    Methods inherited from class com.vaadin.flow.component.ComponentEvent

    getSource, getUI, isFromClient, unregisterListener

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DragEndEvent

      public DragEndEvent(LeafletMap source, boolean fromClient, @EventData("event.detail.target.options.uuid") String layerId, @EventData("event.detail.target.getLatLng().lat") double lat, @EventData("event.detail.target.getLatLng().lng") double lng, @EventData("event.detail.distance") double distance)
      Creates a new drag end event.
      Parameters:
      source - the component that fired the event
      fromClient - true if the event originated from the client side
      layerId - the identifier of the layer that was dragged
      lat - the latitude of the final coordinates
      lng - the longitude of the final coordinates
      distance - the distance in pixels the draggable element was moved by
  • Method Details

    • getDistance

      public double getDistance()
      The distance in pixels the draggable element was moved by.
      Returns:
      the distance in pixels.
    • getLatLng

      public LatLng getLatLng()
      The coordinates of the layer after the drag operation finished.
      Returns:
      the final coordinates
    • toString

      public String toString()
      Overrides:
      toString in class LeafletEvent