Class LatLng
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.types.LatLng
- All Implemented Interfaces:
Serializable,BasicType
Represents a geographical point with a certain latitude and longitude.
- Since:
- 2020-03-21
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the altitude in meters.getLat()Returns the latitude in degrees.getLng()Returns the longitude in degrees.static LatLnglatlng(double lat, double lng) Creates a new point with the given latitude and longitude.static LatLnglatlng(double lat, double lng, double altitude) Creates a new point with the given latitude, longitude and altitude.voidsetAltitude(double altitude) Sets the altitude in meters.voidSets the latitude in degrees.voidSets the longitude in degrees.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.vaadin.addons.componentfactory.leaflet.types.BasicType
getLeafletType
-
Constructor Details
-
LatLng
public LatLng()Creates a new point at latitude and longitude zero. -
LatLng
public LatLng(double lat, double lng) Creates a new point with the given latitude and longitude.- Parameters:
lat- the latitude in degreeslng- the longitude in degrees
-
LatLng
public LatLng(double lat, double lng, double altitude) Creates a new point with the given latitude, longitude and altitude.- Parameters:
lat- the latitude in degreeslng- the longitude in degreesaltitude- the altitude in meters
-
-
Method Details
-
getLng
Returns the longitude in degrees.- Returns:
- the longitude
-
setLng
Sets the longitude in degrees.- Parameters:
lng- the longitude to set
-
getLat
Returns the latitude in degrees.- Returns:
- the latitude
-
setLat
Sets the latitude in degrees.- Parameters:
lat- the latitude to set
-
getAltitude
public double getAltitude()Returns the altitude in meters.- Returns:
- the altitude
-
setAltitude
public void setAltitude(double altitude) Sets the altitude in meters.- Parameters:
altitude- the altitude to set
-
toString
-
latlng
Creates a new point with the given latitude and longitude.- Parameters:
lat- the latitude in degreeslng- the longitude in degrees- Returns:
- a new point at the given coordinates
-
latlng
Creates a new point with the given latitude, longitude and altitude.- Parameters:
lat- the latitude in degreeslng- the longitude in degreesaltitude- the altitude in meters- Returns:
- a new point at the given coordinates
-