Class LatLong

java.lang.Object
com.dlsc.gmapsfx.javascript.JavascriptObject
com.dlsc.gmapsfx.javascript.object.LatLong

public class LatLong
extends JavascriptObject
Author:
Rob Terpilowski
  • Field Details

  • Constructor Details

    • LatLong

      public LatLong​(double latitude, double longitude)
    • LatLong

      public LatLong​(JSObject jsObject)
  • Method Details

    • getLatitude

      public double getLatitude()
    • getLongitude

      public double getLongitude()
    • distanceFrom

      public double distanceFrom​(LatLong end)
      From v3_epoly.js, calculates the distance between this LatLong point and another.
      Parameters:
      end - The end point to calculate the distance to.
      Returns:
      The distance, in metres, to the end point.
    • latToRadians

      public double latToRadians()
      Convenience method to convert the latitude of this LatLong to radians.
      Returns:
      The latitude value of this LatLong, as radians.
    • longToRadians

      public double longToRadians()
      Convenience method to convert the longitude of this LatLong to radians.
      Returns:
      The longitude of this LatLong, as radians.
    • getDestinationPoint

      public LatLong getDestinationPoint​(double bearing, double distance)
      Calculates the LatLong position of the end point of a line the specified distance from this LatLong, along the provided bearing, where North is 0, East is 90 etc.
      Parameters:
      bearing - The bearing, in degrees, with North as 0, East as 90 etc.
      distance - The distance in metres.
      Returns:
      A new LatLong indicating the end point.
    • getBearing

      public double getBearing​(LatLong end)
      Calculates the bearing, in degrees, of the end LatLong point from this LatLong point.
      Parameters:
      end - The point that the bearing is calculated for.
      Returns:
      The bearing, in degrees, of the supplied point from this point.
    • toString

      public String toString()
      Overrides:
      toString in class Object