google.maps.LatLng 对象

Constructor Description
LatLng(lat:number, lng:number, noWrap?:boolean) Creates a LatLng object representing a geographic point. Latitude is specified in degrees within the range [-90, 90]. Longitude is specified in degrees within the range [-180, 180]. Set noWrap to true to enable values outside of this range. Note the ordering of latitude and longitude.

Methods

Methods Return Value Description
equals(other:LatLng) boolean 比较函数
lat() number 返回纬度
lng() number 返回经度
toString() string Converts to string representation.
toUrlValue(precision?:number) string 返回"纬度,经度"的字符串,并且默认保留6位小数

 

属性 类型 描述
lat number 纬度值,界于-90到90之间

如果超过范围,则小于-90调为-90,大于90设为90.

lng number 经度值,界于-180到180之间.

如果超过范围,则自动调整到范围内,如-190转到170.