Class LocationEvent
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.LocationEvent
- All Implemented Interfaces:
Serializable
Represents the leaflet LocationEvent
- Since:
- 2020-03-11
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionLocationEvent(LeafletMap source, boolean fromClient, String layerId, double latitude, double longitude, double northEastLatitude, double northEastLongitude, double southWestLatitude, double southWestLongitude, double accuracy, double altitude, double altitudeAccuracy, double heading, double speed, double timestamp) Creates a new location event carrying the located position and its accuracy details. -
Method Summary
Modifier and TypeMethodDescriptiondoubleAccuracy of location in meters.doubleHeight of the position above the WGS84 ellipsoid in meters.doubleAccuracy of altitude in meters.Geographical bounds of the area user is located in (with respect to the accuracy of location).doubleThe direction of travel in degrees counting clockwise from true North.Detected geographical location of the user.doublegetSpeed()Current velocity in meters per second.doubleThe time when the position was acquired.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
-
LocationEvent
public LocationEvent(LeafletMap source, boolean fromClient, @EventData("event.detail.target.options.uuid") String layerId, @EventData("event.detail.latlng.lat") double latitude, @EventData("event.detail.latlng.lng") double longitude, @EventData("event.detail.bounds._northEast.lat") double northEastLatitude, @EventData("event.detail.bounds._northEast.lng") double northEastLongitude, @EventData("event.detail.bounds._southWest.lat") double southWestLatitude, @EventData("event.detail.bounds._southWest.lng") double southWestLongitude, @EventData("event.detail.accuracy") double accuracy, @EventData("event.detail.altitude") double altitude, @EventData("event.detail.altitudeAccuracy") double altitudeAccuracy, @EventData("event.detail.heading") double heading, @EventData("event.detail.speed") double speed, @EventData("event.detail.timestamp") double timestamp) Creates a new location event carrying the located position and its accuracy details.- Parameters:
source- the source componentfromClient-trueif the event originated on the client sidelayerId- the identifier of the layer the event relates tolatitude- the latitude of the detected locationlongitude- the longitude of the detected locationnorthEastLatitude- the latitude of the north-east corner of the location boundsnorthEastLongitude- the longitude of the north-east corner of the location boundssouthWestLatitude- the latitude of the south-west corner of the location boundssouthWestLongitude- the longitude of the south-west corner of the location boundsaccuracy- the accuracy of the location in metersaltitude- the height of the position above the WGS84 ellipsoid in metersaltitudeAccuracy- the accuracy of the altitude in metersheading- the direction of travel in degrees counting clockwise from true Northspeed- the current velocity in meters per secondtimestamp- the time when the position was acquired
-
-
Method Details
-
getLatlng
Detected geographical location of the user.- Returns:
- the latlng
-
getBounds
Geographical bounds of the area user is located in (with respect to the accuracy of location).- Returns:
- the bounds
-
getAccuracy
public double getAccuracy()Accuracy of location in meters.- Returns:
- the accuracy
-
getAltitude
public double getAltitude()Height of the position above the WGS84 ellipsoid in meters.- Returns:
- the altitude
-
getAltitudeAccuracy
public double getAltitudeAccuracy()Accuracy of altitude in meters.- Returns:
- the altitudeAccuracy
-
getHeading
public double getHeading()The direction of travel in degrees counting clockwise from true North.- Returns:
- the heading
-
getSpeed
public double getSpeed()Current velocity in meters per second.- Returns:
- the speed
-
getTimestamp
public double getTimestamp()The time when the position was acquired.- Returns:
- the timestamp
-
toString
- Overrides:
toStringin classLeafletEvent
-