java.lang.Object
com.dlsc.gmapsfx.javascript.JavascriptObject
com.dlsc.gmapsfx.javascript.object.LatLong
public class LatLong extends JavascriptObject
- Author:
- Rob Terpilowski
-
Field Summary
Fields Modifier and Type Field Description static doubleEarthRadiusMetersFields inherited from class com.dlsc.gmapsfx.javascript.JavascriptObject
jsObject, objectCounter, peerRegistry, runtime, variableName -
Constructor Summary
-
Method Summary
Modifier and Type Method Description doubledistanceFrom(LatLong end)From v3_epoly.js, calculates the distance between this LatLong point and another.doublegetBearing(LatLong end)Calculates the bearing, in degrees, of the end LatLong point from this LatLong point.LatLonggetDestinationPoint(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.doublegetLatitude()doublegetLongitude()doublelatToRadians()Convenience method to convert the latitude of this LatLong to radians.doublelongToRadians()Convenience method to convert the longitude of this LatLong to radians.StringtoString()Methods inherited from class com.dlsc.gmapsfx.javascript.JavascriptObject
checkBoolean, checkInteger, checkUndefined, getJSObject, getNextVariableName, getProperty, getProperty, getVariableName, invokeJavascript, invokeJavascript, invokeJavascriptReturnValue, invokeJavascriptReturnValue, isMemberDefined, setProperty, setProperty, setProperty
-
Field Details
-
EarthRadiusMeters
public static final double EarthRadiusMeters- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
getLatitude
public double getLatitude() -
getLongitude
public double getLongitude() -
distanceFrom
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
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
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
-