public class LatLng extends java.lang.Object implements ILatLng, android.os.Parcelable
Latitude and longitude are expressed as decimal degrees in the WGS84 datum. By default, altitude is 0.0, or sea level.
Mapbox GL displays maps in the Mercator Projection and projects geographical data automatically, so all data enters in the WGS84 datum.
| Modifier and Type | Field and Description |
|---|---|
static android.os.Parcelable.Creator<LatLng> |
CREATOR |
| Modifier | Constructor and Description |
|---|---|
|
LatLng()
Construct a new latitude, longitude point at (0, 0)
|
|
LatLng(double latitude,
double longitude)
Construct a new latitude, longitude point given float arguments
|
|
LatLng(double latitude,
double longitude,
double altitude)
Construct a new latitude, longitude, altitude point given float arguments
|
|
LatLng(LatLng aLatLng)
Clone an existing latitude longitude point
|
|
LatLng(android.location.Location location)
Transform a Location into a LatLng point
|
protected |
LatLng(android.os.Parcel in) |
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
double |
distanceTo(LatLng other)
Calculate distance between two points
|
boolean |
equals(java.lang.Object object) |
double |
getAltitude() |
double |
getLatitude() |
double |
getLongitude() |
int |
hashCode() |
void |
setAltitude(double altitude) |
void |
setLatitude(double latitude) |
void |
setLongitude(double longitude) |
java.lang.String |
toString() |
LatLng |
wrap()
Return a new LatLng object with a wrapped Longitude.
|
void |
writeToParcel(android.os.Parcel out,
int flags) |
public static final android.os.Parcelable.Creator<LatLng> CREATOR
public LatLng()
public LatLng(double latitude,
double longitude)
latitude - Latitude in degreeslongitude - Longitude in degreespublic LatLng(double latitude,
double longitude,
double altitude)
latitude - Latitude in degreeslongitude - Longitude in degressaltitude - Altitude in meterspublic LatLng(android.location.Location location)
location - Android Locationpublic LatLng(LatLng aLatLng)
aLatLng - LatLngprotected LatLng(android.os.Parcel in)
public void setLatitude(double latitude)
public double getLatitude()
getLatitude in interface ILatLngpublic void setLongitude(double longitude)
public double getLongitude()
getLongitude in interface ILatLngpublic void setAltitude(double altitude)
public double getAltitude()
getAltitude in interface ILatLngpublic LatLng wrap()
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int describeContents()
describeContents in interface android.os.Parcelablepublic void writeToParcel(android.os.Parcel out,
int flags)
writeToParcel in interface android.os.Parcelablepublic double distanceTo(LatLng other)
other - Other LatLng to compare to