Class: LngLat

LngLat

以经度和纬度表示的地理坐标点。 继承: - GeoGlobe.LngLat

new LngLat()

Source:
View2D/geo/Lng_Lat_geo.js

Members


lon :number

地图上的经度(X轴坐标)。
Type:
  • number
Default Value:
  • null
Source:
View2D/geo/Lng_Lat_geo.js

Methods


convert(arr)

将一个数组转换为坐标对象。
Parameters:
Name Type Description
arr array 数组坐标。
Source:
View2D/geo/Lng_Lat_geo.js
Returns:
LngLat - 数组转成的坐标对象。
Type
GeoGlobe.LngLat
Example
var arr = [-73.9749, 40.7736];
var ll = GeoGlobe.LngLat.convert(arr);
alert(ll);

initialize(options)

GeoGlobe.LngLat构造函数。
Parameters:
Name Type Description
options Object LngLat相关选项设置。
Source:
View2D/geo/Lng_Lat_geo.js
Example
var var ll = new GeoGlobe.LngLat(-73.9749, 40.7736);

toArray()

返回坐标的一个数组。
Source:
View2D/geo/Lng_Lat_geo.js
Returns:
array - 坐标的一个数组。
Type
array
Example
var ll = new GeoGlobe.LngLat(286.0251, 40.7736);
ll.toArray(); // = [-73.9749, 40.7736]

toBounds(radius)

返回坐标为字符串。
Parameters:
Name Type Description
radius Number 半径。
Source:
View2D/geo/Lng_Lat_geo.js
Returns:
string - 返回一个经纬度范围对象。
Type
string
Example
var ll = new GeoGlobe.LngLat(-73.9749, 40.7736);
ll.toBounds(100).toArray(); // = [[-73.97501862141328, 40.77351016847229], [-73.97478137858673, 40.77368983152771]]

toString()

返回坐标为字符串。
Source:
View2D/geo/Lng_Lat_geo.js
Returns:
string - 坐标为字符串。
Type
string
Example
var ll = new GeoGlobe.LngLat(286.0251, 40.7736);
ll.toString(); // = "LngLat(-73.9749, 40.7736)"

wrap()

返回新经纬度对象,其经度范围(-180,180)。
Source:
View2D/geo/Lng_Lat_geo.js
Returns:
LngLat - 新经纬度对象。
Type
GeoGlobe.LngLat
Example
var ll = new GeoGlobe.LngLat(286.0251, 40.7736);
var wrapped = ll.wrap();
wrapped.lng; // = -73.9749