java.lang.Object
org.vaadin.addons.componentfactory.leaflet.types.LatLng
All Implemented Interfaces:
Serializable, BasicType

public class LatLng extends Object implements 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
    Constructor
    Description
    Creates a new point at latitude and longitude zero.
    LatLng(double lat, double lng)
    Creates a new point with the given latitude and longitude.
    LatLng(double lat, double lng, double altitude)
    Creates a new point with the given latitude, longitude and altitude.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the altitude in meters.
    Returns the latitude in degrees.
    Returns the longitude in degrees.
    static LatLng
    latlng(double lat, double lng)
    Creates a new point with the given latitude and longitude.
    static LatLng
    latlng(double lat, double lng, double altitude)
    Creates a new point with the given latitude, longitude and altitude.
    void
    setAltitude(double altitude)
    Sets the altitude in meters.
    void
    Sets the latitude in degrees.
    void
    Sets the longitude in degrees.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods 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 degrees
      lng - 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 degrees
      lng - the longitude in degrees
      altitude - the altitude in meters
  • Method Details

    • getLng

      public Double getLng()
      Returns the longitude in degrees.
      Returns:
      the longitude
    • setLng

      public void setLng(Double lng)
      Sets the longitude in degrees.
      Parameters:
      lng - the longitude to set
    • getLat

      public Double getLat()
      Returns the latitude in degrees.
      Returns:
      the latitude
    • setLat

      public void setLat(Double lat)
      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

      public String toString()
      Overrides:
      toString in class Object
    • latlng

      public static LatLng latlng(double lat, double lng)
      Creates a new point with the given latitude and longitude.
      Parameters:
      lat - the latitude in degrees
      lng - the longitude in degrees
      Returns:
      a new point at the given coordinates
    • latlng

      public static LatLng latlng(double lat, double lng, double altitude)
      Creates a new point with the given latitude, longitude and altitude.
      Parameters:
      lat - the latitude in degrees
      lng - the longitude in degrees
      altitude - the altitude in meters
      Returns:
      a new point at the given coordinates