google.maps.LatLng 类
大多数方法如果接收 LatLng类的话,同样接收 LatLngLiteral ,比如设置地图中心点:
map.setCenter(new google.maps.LatLng(30, 104));
map.setCenter({lat: 30, lng: 104});
构造器同样接收 LatLngLiteral 类,比如:
myLatLng = new google.maps.LatLng({lat: 30, lng: 104});
| 构造器 | |
|---|---|
LatLng( | 创建一个点,lat:-90到90,lng:-180到180 |
| 方法 | |
|---|---|
equals( | Return Value: 比对两个 点是否相等 |
lat() | Return Value: 返回纬度 |
lng() | Return Value: 返回经度 |
toJSON() | Return Value: 转化成JSON格式 |
toString() | Return Value: 转化成字符串格式 |
| 属性 | |
|---|---|
lat | Type: 纬度 |
lng | Type: 纬度 |
google.maps.LatLngBounds 类
| 构造函数 | |
|---|---|
LatLngBounds( | 以给定的点创建一个LatLngBounds |
| 方法 | |
|---|---|
contains( | Return Value: 判断一个点是否在LatLngBounds内 |
equals( | Return Value: 判断两个 LatLngBounds 是否相等 |
extend( | Return Value: 增加一个点 |
getCenter() | Return Value: 返回计算出的中心点 |
getNorthEast() | Return Value: 返回东北角 |
getSouthWest() | Return Value: 返回西南角 |
intersects( | Return Value: 判断两个 LatLngBounds 有无公共点 |
isEmpty() | Return Value: 返回是否空 LatLngBounds |
toJSON() | Return Value: 转化为JSON |
toSpan() | Return Value: 转化成 lat/lng span. |
toString() | Return Value: 转化成字符串 |
union( | Return Value: 合并两个 LatLngBounds |
google.maps.LatLngBoundsLiteral 对象
| 属性 | |
|---|---|
east | Type: 东经 |
north | Type: 北纬 |
south | Type: 南纬 |
west | Type: 西经 |
google.maps.Point 类
| 构造器 | |
|---|---|
Point( | 以给定的值创建点 |
| 方法 | |
|---|---|
equals( | Return Value: 对比两个点 |
toString() | Return Value: 转化为JSON |
| 属性 | |
|---|---|
x | Type: X坐标 |
y | Type: Y坐标 |
google.maps.Size 类
| 构造函数 | |
|---|---|
Size( | 创建一个Size类 |
| 方法 | |
|---|---|
equals( | Return Value: 对比两个Size类 |
toString() | Return Value: 转化为JSON |
| Properties | |
|---|---|
height | Type: 高度 |
width | Type: 宽度 |