|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.core.client.JavaScriptObject
com.google.gwt.maps.client.geom.LatLng
public class LatLng
A geographical point represented by a latitude and a longitude. Instances of this class are immutable.
Constructor Summary | |
---|---|
protected |
LatLng()
|
Method Summary | |
---|---|
double |
distanceFrom(LatLng other)
Returns the distance from another LatLng in meters. |
double |
distanceFrom(LatLng other,
double radius)
Returns the distance from another LatLng in meters. |
static LatLng |
fromUrlValue(java.lang.String value)
Converts the supplied latitude/longitude String value into a LatLng object. |
double |
getLatitude()
Returns the latitude coordinate of this point in degrees as a number between -90 and 90. |
double |
getLatitudeRadians()
Returns the latitude coordinate of this point in radians as a number between -pi/2 and pi/2. |
double |
getLongitude()
Returns the longitude coordinate of this point in degrees as a number between -180 and 180. |
double |
getLongitudeRadians()
Returns the longitude coordinate of this point in radians as a number between -pi and pi. |
boolean |
isEquals(LatLng other)
Does what equals() ought to do, but we are constrained by the JS overlay rules. |
static LatLng |
newInstance(double latitude,
double longitude)
Create a new point. |
static LatLng |
newInstance(double latitude,
double longitude,
boolean unbounded)
Create a new point. |
static com.google.gwt.core.client.JsArray<LatLng> |
toJsArray(LatLng[] points)
Convenience routine for creating a JsArray from Java array of LatLng values. |
java.lang.String |
toUrlValue()
Returns a string that represents this point in a format suitable for use as a URL parameter value. |
java.lang.String |
toUrlValue(int precision)
Returns a string that represents this point in a format suitable for use as a URL parameter value. |
Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
---|
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected LatLng()
Method Detail |
---|
public static LatLng fromUrlValue(java.lang.String value)
public static LatLng newInstance(double latitude, double longitude)
latitude
- value between -90 and +90 degrees (clamped)longitude
- value between -180 and +180 degrees (wrapped)public static LatLng newInstance(double latitude, double longitude, boolean unbounded)
latitude
- value between -90 and +90 degrees (clamped)longitude
- value between -180 and +180 degrees (wrapped)unbounded
- if true
, then numbers will not be wrapped or
clamped.public static com.google.gwt.core.client.JsArray<LatLng> toJsArray(LatLng[] points)
points
- A Java array of LatLng values
public final double distanceFrom(LatLng other)
distanceFrom(LatLng, double)
.
other
- point to measure distance to
public final double distanceFrom(LatLng other, double radius)
other
- point to measure distance toradius
- alternative radius value to use.
public final double getLatitude()
public final double getLatitudeRadians()
public final double getLongitude()
public final double getLongitudeRadians()
public final boolean isEquals(LatLng other)
other
- a point to compare
true
if the latitude and longitude match.public final java.lang.String toUrlValue()
public final java.lang.String toUrlValue(int precision)
precision
- the precision in number of digits
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |