Constructor
new Navigation(viewer)
- Description:
构造函数
- Source:
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Object | 地图场景对象 |
Members
(readonly) cameraStatus :CameraStatus
- Description:
当前相机状态
- Source:
当前相机状态
Type:
homeCamera :CameraStatus
- Description:
获取/设置初始视角
- Source:
获取/设置初始视角
Type:
(readonly) scale :Number
- Description:
获取比例尺,页面1px的距离,单位m
- Source:
获取比例尺,页面1px的距离,单位m
Type:
- Number
(readonly) viewExtent :ViewExtent
- Description:
获取地图四至,最小和最大经纬度
- Source:
获取地图四至,最小和最大经纬度
Type:
Methods
aroundPoint(pos, angle, amount, distance) → {AroundPoint}
- Description:
绕点旋转
- Source:
Parameters:
Name | Type | Description |
---|---|---|
pos |
DegreePosZ | 位置点,WGS84坐标 |
angle |
Number | 观察角度,-90为垂直正视,建议值区间[-30,-40] |
amount |
Number | 旋转360度所需要时间,单位:秒(s) |
distance |
Number | 点距离相机距离,单位:米(m) |
Returns:
绕点旋转对象
- Type
- AroundPoint
flyToDegree(pos, timeopt, callbackopt)
- Description:
跳转到指定坐标
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos |
DegreePosZ | 待跳转坐标,WGS84坐标 |
||
time |
Number |
<optional> |
2.0
|
跳转时间,默认2秒 |
callback |
function |
<optional> |
null
|
回调函数,可以在其中写入跳转完成后执行方法 |
flyToExtent(extent, timeopt, callbackopt)
- Description:
跳转到指定四至
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
extent |
Array.<Number> | 四至范围,格式:[west,south,east,north],单位经纬度 |
||
time |
Number |
<optional> |
2.0
|
跳转时间,单位s,默认2秒 |
callback |
function |
<optional> |
null
|
回调函数,可以在其中写入跳转完成后执行方法 |
flyToItem(item)
- Description:
跳转到指定对象
- Source:
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | 待跳转对象,理论支持界面加载的所有对象 |
flyToPos(viewStatus, timeopt, degreeopt, callbackopt)
- Description:
跳转到指定视角
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
viewStatus |
ViewStatus | 待跳转视角对象 |
||
time |
Number |
<optional> |
2.0
|
跳转时间,单位秒(s),默认2秒 |
degree |
Boolean |
<optional> |
false
|
传参类型,欧拉角是否位经纬度。 若degree=false,则ViewStatus的position为笛卡尔坐标,欧拉角单位为弧度; 若degree=true,则ViewStatus的position为WGS84坐标,欧拉角单位为度 |
callback |
function |
<optional> |
null
|
回调函数,可以在其中写入跳转完成后执行方法 |
homeView(timeopt)
- Description:
跳转到初始视角,即homeCamera参数
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
time |
Number |
<optional> |
2.0
|
(可选)跳转时间,以秒为单位,默认2秒 |
zoomToDegree(pos, callbackopt)
- Description:
定位到指定坐标
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pos |
DegreePosZ | 待跳转坐标,WGS84坐标 |
||
callback |
function |
<optional> |
null
|
回调函数,可以在其中写入跳转完成后执行方法 |
zoomToItem(item)
- Description:
定位到指定对象
- Source:
Parameters:
Name | Type | Description |
---|---|---|
item |
Object | 待定位对象,理论支持界面加载的所有对象 |
zoomToPos(cameraStatus)
- Description:
定位到指定视角,仅限笛卡尔坐标和弧度参数
- Source:
Parameters:
Name | Type | Description |
---|---|---|
cameraStatus |
ViewStatus |