-
-
取消当前的飞行动作
-
-
地球自转, 默认转动轴为从南到北的极地轴, 默认转动时间为地球自转时间,也就是24小时
Name |
Type |
Default |
Description |
ys |
Object
|
|
YouScene对象 |
axis |
Object
|
{x: 0, y: 0, z: 1}
|
optional
转动轴 |
time |
Number
|
24 * 60 * 60
|
optional
转动一周所需时间,单位秒 |
direction |
Boolean
|
true
|
optional
顺时针或者逆时针旋转(true为逆时针,false为顺时针) |
callback |
Camera~Callback
|
|
飞行中的回调函数,不间断返回已经过时间 |
Returns:
返回飞行结速函数,调用此函数即可结速飞行
-
fly(longitude, latitude, altitude, second) → Promise
-
相机飞到某位置,等同flytoLonLatAlt
Name |
Type |
Description |
longitude |
Number
|
optional
相机经度,单位度 |
latitude |
Number
|
optional
相机纬度,单位度 |
altitude |
Number
|
optional
相机高程,单位米 |
second |
Number
|
optional
飞行时间,单位秒, 默认值根据到目的地的距离动态计算 |
Returns:
飞行完成会触发Promise的resolve;取消飞行会触发reject
Example:
监听飞行动作完成和取消
ys.camera.fly(100, 20, 1000, 10).then(ok => { console.log(ok); }, cancel => { console.log(cancel); });
-
-
相机绕点飞行一周
Name |
Type |
Default |
Description |
ys |
Object
|
|
YouScene对象 |
point |
Object
|
|
点的坐标{x: ,y: ,z: } |
rotate |
Number
|
20
|
optional
相机看点的角度(90是俯视看,0是平视看) |
distance |
Number
|
5000
|
optional
相机距离点的距离,单位m |
time |
Number
|
10
|
optional
飞行一周所需时间,单位s |
direction |
Boolean
|
true
|
optional
顺时针或者逆时针旋转(true为逆时针,false为顺时针) |
callback |
Camera~Callback
|
|
飞行中的回调函数,不间断返回已经过时间 |
Returns:
返回飞行结速函数,调用此函数即可结速飞行
-
-
相机飞到某位置和角度
Name |
Type |
Description |
options |
Object
|
对象有下面这些属性
Name |
Type |
Description |
lon |
Number
|
optional
相机经度,单位度 |
lat |
Number
|
optional
相机纬度,单位度 |
alt |
Number
|
optional
相机高程,单位米 |
heading |
Number
|
optional
相机方向角度, 范围[0, 360],单位度 |
pitch |
Number
|
optional
相机俯仰角度,范围[-90, 0],单位度 |
second |
Number
|
optional
飞行时间,单位秒 |
|
Returns:
飞行完成会触发Promise的resolve;取消飞行会触发reject
-
flytoLonLatAlt(longitude, latitude, altitude, second) → Promise
-
相机飞到某位置
Name |
Type |
Description |
longitude |
Number
|
optional
相机经度,单位度 |
latitude |
Number
|
optional
相机纬度,单位度 |
altitude |
Number
|
optional
相机高程,单位米 |
second |
Number
|
optional
飞行时间,单位秒 |
Returns:
飞行完成会触发Promise的resolve;取消飞行会触发reject
-
flytoRect(rectangle, second) → Promise
-
相机飞到目标视图范围
Name |
Type |
Description |
rectangle |
Rectangle
|
目标视图范围{ west: -180, south: -90, east: 180, north: 90 } |
second |
Number
|
optional
飞行时间(秒) |
Returns:
飞行完成会触发Promise的resolve;取消飞行会触发reject
-
getCameraViewRange() → Number
-
相机视图的最大宽度(角度)
Returns:
-
-
相机视图范围
Returns:
-
-
当前视图一个像素代表的经纬度
Returns:
-
getPixelWidthM() → Number
-
当前视图一个像素代表的米,未知时0
Returns:
-
getRectCameraPosition(rect) → XYZ
-
根据视角矩形范围获取相机坐标
Name |
Type |
Default |
Description |
rect |
Rectangle
|
new Rectangle(-180, -90, 180, 90)
|
optional
矩形范围 |
Returns:
相机坐标,(如果相机坐标不存在,则返回undefined)
-
getViewDistance() → Number
-
相机位置到目标(三维地球当前视图中心点)的距离
Returns:
-
-
视图中心点坐标,即十字丝坐标经纬度,单位xy是度z是米
Returns:
-
-
相机定位到某位置和角度
Name |
Type |
Description |
options |
Object
|
对象有下面这些属性
Name |
Type |
Description |
lon |
Number
|
optional
相机经度,单位度 |
lat |
Number
|
optional
相机纬度,单位度 |
alt |
Number
|
optional
相机高程,单位米 |
heading |
Number
|
optional
相机方向角度, 范围[0, 360],单位度 |
pitch |
Number
|
optional
相机俯仰角度, 范围[-90, 0],单位度 |
|
-
gotoLonLatAlt(longitude, latitude, altitude)
-
相机定位到某位置
Name |
Type |
Description |
longitude |
Number
|
optional
相机经度,单位度 |
latitude |
Number
|
optional
相机纬度,单位度 |
altitude |
Number
|
optional
相机高程,单位米 |
-
gotoLonLatHeadViewRange(longitude, latitude, heading, viewRange)
-
设置相机经纬度、方向角度、视图宽度
Name |
Type |
Description |
longitude |
Number
|
目标经度 |
latitude |
Number
|
目标纬度 |
heading |
Number
|
Z轴旋转角度 |
viewRange |
Number
|
目标视图宽度 |
-
gotoLonLatViewRange(longitude, latitude, viewRange)
-
设置相机经纬度、视图宽度
Name |
Type |
Description |
longitude |
Number
|
目标经度 |
latitude |
Number
|
目标纬度 |
viewRange |
Number
|
目标视图宽度 |
-
-
相机定位到目标视图范围
Name |
Type |
Description |
rectangle |
Rectangle
|
目标视图范围{ west: -180, south: -90, east: 180, north: 90 } |
-
lookAt(options) → Promise
-
相机飞到某位置,视线定位到目标点
Name |
Type |
Description |
options |
Object
|
对象有下面这些属性
Name |
Type |
Description |
lon |
Number
|
optional
目标点的经度,单位度 |
lat |
Number
|
optional
目标点的纬度,单位度 |
alt |
Number
|
optional
目标点的高度,单位米 |
distance |
Number
|
optional
相机和目标点之间的距离,单位米 |
heading |
Number
|
optional
相机方向角度, 即目标点相对于相机的方向角度,范围[0, 360],单位度 |
pitch |
Number
|
optional
相机俯仰角度,即目标点相对于相机的俯仰角度,范围[-90, 0],单位度 |
second |
Number
|
optional
飞行时间,单位秒,为0则直接定位 |
|
Returns:
飞行完成会触发Promise的resolve;取消飞行会触发reject
-
-
重置相机
-
rotate(axis, angle, second) → Promise
-
相机围绕某点所在的轴线旋转
Name |
Type |
Description |
axis |
XYZ
|
optional
轴点的位置,单位度 {x:180, y:90, z:0} |
angle |
Number
|
optional
旋转的角度,单位度 |
second |
Number
|
optional
飞行时间,单位秒,为0则直接定位 |
Returns:
旋转完成会触发Promise的resolve;取消旋转会触发reject
-
-
相机原地旋转一周
Name |
Type |
Default |
Description |
ys |
Object
|
|
YouScene对象 |
pitch |
Number
|
20
|
optional
相机俯仰角度, 范围[0, 90],(90是俯视,0是平视) |
second |
Number
|
10
|
optional
旋转一周时间(秒) |
direction |
Boolean
|
true
|
optional
顺时针或者逆时针旋转(true为逆时针,false为顺时针) |
callback |
Camera~Callback
|
|
飞行中的回调函数,不间断返回已经过时间 |
Returns:
返回飞行结速函数,调用此函数即可结速飞行