public class LatLng
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
double |
altitude
海拔
|
static android.os.Parcelable.Creator<LatLng> |
CREATOR |
double |
latitude
纬度
|
double |
longitude
经度
|
Constructor and Description |
---|
LatLng()
创建一个(0,0)坐标
|
LatLng(double latitude,
double longitude)
创建一个指定经纬度的坐标
|
LatLng(double latitude,
double longitude,
double altitude)
创建一个指定经纬度和海拔的坐标
|
LatLng(LatLng latLng)
创建一个来自其他坐标数据的坐标
|
LatLng(android.location.Location location)
创建一个定位数据的坐标
Location |
LatLng(android.os.Parcel in)
通过Parcel构造坐标
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
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()
返回一个复制当前数据的新坐标对象
|
void |
writeToParcel(android.os.Parcel out,
int flags) |
public static final android.os.Parcelable.Creator<LatLng> CREATOR
public double latitude
public double longitude
public double altitude
public LatLng()
public LatLng(double latitude, double longitude)
latitude
- 纬度longitude
- 经度public LatLng(double latitude, double longitude, double altitude)
latitude
- 纬度longitude
- 经度altitude
- 海拔public LatLng(android.location.Location location)
Location
location
- Android定位对象public LatLng(LatLng latLng)
latLng
- LatLng to be cloned.public LatLng(android.os.Parcel in)
in
- Parcel对象public void setLatitude(double latitude)
取值范围为 [-90, 90],查看 GeometryConstants.MIN_LATITUDE
和
GeometryConstants.MAX_LATITUDE
latitude
- 纬度GeometryConstants.MIN_LATITUDE
,
GeometryConstants.MAX_LATITUDE
public double getLatitude()
取值范围为 [-90, 90],查看 GeometryConstants.MIN_LATITUDE
和
GeometryConstants.MAX_LATITUDE
GeometryConstants.MIN_LATITUDE
,
GeometryConstants.MAX_LATITUDE
public void setLongitude(double longitude)
取值范围为 [-180, 180],查看 GeometryConstants.MIN_LONGITUDE
和
GeometryConstants.MAX_LONGITUDE
longitude
- 经度值GeometryConstants.MIN_LONGITUDE
,
GeometryConstants.MAX_LONGITUDE
public double getLongitude()
取值范围为 [-180, 180],查看 GeometryConstants.MIN_LONGITUDE
和
GeometryConstants.MAX_LONGITUDE
GeometryConstants.MIN_LONGITUDE
,
GeometryConstants.MAX_LONGITUDE
public void setAltitude(double altitude)
altitude
- 海拔值public double getAltitude()
public LatLng wrap()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel out, int flags)
writeToParcel
in interface android.os.Parcelable