public class LatLng extends Object implements Serializable
A representation of a single point in latitude and longitude. All data is handled in degrees and will be normalized if possible to the +/- 90 latitude, +/- 180 longitude region.
Note that attempting to create a LatLng with invalid values (NaN, negative infinity, positive infinity) will throw IllegalArgumentExceptions.
| Constructor and Description |
|---|
LatLng(double latitude,
double longitude)
Creates a LatLng point.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
degreesEqual(double degree1,
double degree2)
Tests whether two angles fall within the tolerance
allowed in
LatLngConfig. |
boolean |
equals(Object obj) |
double |
getLatitude()
Get latitude for this point in degrees.
|
long |
getLatitudeInternal()
Get the internal long representation of this point's latitude
in degrees.
|
double |
getLongitude()
Get longitude for this point in degrees.
|
long |
getLongitudeInternal()
Get the internal long representation of this point's longitude
in degrees.
|
int |
hashCode() |
boolean |
isPolar() |
static LatLng |
random()
Creates a random latitude and longitude.
|
static LatLng |
random(Random r)
Creates a random latitude and longitude.
|
void |
setLatitudeLongitude(double latitude,
double longitude)
Sets the latitude and longitude for this point.
|
String |
toString() |
public LatLng(double latitude,
double longitude)
latitude - the latitude in degrees.longitude - the longitude in degrees.public static LatLng random()
public static LatLng random(Random r)
r - the random number generator to use, if you want to be
specific or are creating many LatLngs at once.public static boolean degreesEqual(double degree1,
double degree2)
LatLngConfig. Ignores
NaN and infinite values, returning false in either case.degree1 - one degree angle.degree2 - another degree angle.public double getLatitude()
public long getLatitudeInternal()
public double getLongitude()
public long getLongitudeInternal()
public void setLatitudeLongitude(double latitude,
double longitude)
latitude - the latitude in degrees.longitude - the longitude in degrees.public boolean isPolar()
Copyright © 2010-2015. All Rights Reserved.