Class WGoogleMap.Coordinate

  • Enclosing class:
    WGoogleMap

    public static class WGoogleMap.Coordinate
    extends java.lang.Object
    A geographical coordinate (latitude/longitude)
    • Constructor Summary

      Constructors 
      Constructor Description
      Coordinate()
      Default constructor.
      Coordinate​(double lat, double lon)
      Creates with given latitude and longitude.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double distanceTo​(WGoogleMap.Coordinate rhs)
      Calculates the distance between two points in km (approximate).
      double getLatitude()
      Returns the latitude.
      double getLongitude()
      Returns the longitude.
      void setLatitude​(double latitude)
      Sets the latitude.
      void setLongitude​(double longitude)
      Sets the longitude.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Coordinate

        public Coordinate()
        Default constructor.
      • Coordinate

        public Coordinate​(double lat,
                          double lon)
        Creates with given latitude and longitude.
    • Method Detail

      • setLatitude

        public void setLatitude​(double latitude)
        Sets the latitude.
      • setLongitude

        public void setLongitude​(double longitude)
        Sets the longitude.
      • getLatitude

        public double getLatitude()
        Returns the latitude.
      • getLongitude

        public double getLongitude()
        Returns the longitude.
      • distanceTo

        public double distanceTo​(WGoogleMap.Coordinate rhs)
        Calculates the distance between two points in km (approximate).

        The calculation uses a sphere. Results can be out by 0.3%.