Class DragEndEvent
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
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
ConstructorsConstructorDescriptionDragEndEvent(LeafletMap source, boolean fromClient, String layerId, double lat, double lng, double distance) Creates a new drag end event. -
Method Summary
Modifier and TypeMethodDescriptiondoubleThe distance in pixels the draggable element was moved by.The coordinates of the layer after the drag operation finished.toString()Methods inherited from class org.vaadin.addons.componentfactory.leaflet.layer.events.LeafletEvent
getLayerId, getTypeMethods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, getUI, isFromClient, unregisterListener
-
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 eventfromClient-trueif the event originated from the client sidelayerId- the identifier of the layer that was draggedlat- the latitude of the final coordinateslng- the longitude of the final coordinatesdistance- 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
The coordinates of the layer after the drag operation finished.- Returns:
- the final coordinates
-
toString
- Overrides:
toStringin classLeafletEvent
-