Class MouseEvent
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
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:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionMouseEvent(LeafletMap source, boolean fromClient, String layerId, MouseEventType eventType, LatLng latLng, Point layerPoint, Point containerPoint) Creates a new mouse event. -
Method Summary
Modifier and TypeMethodDescriptionPixel coordinates of the point where the mouse event occured relative to the map сontainer.The geographical point where the mouse event occured.Pixel coordinates of the point where the mouse event occured relative to the map layer.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
-
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 componentfromClient-trueif the event originated on the client sidelayerId- the id of the layer that fired the eventeventType- the type of the mouse eventlatLng- the geographical point where the mouse event occurredlayerPoint- the pixel coordinates of the point where the mouse event occurred relative to the map layercontainerPoint- the pixel coordinates of the point where the mouse event occurred relative to the map container
-
-
Method Details
-
getLatLng
The geographical point where the mouse event occured.- Returns:
- the geographical point where the mouse event occured
-
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
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
- Overrides:
toStringin classLeafletEvent
-