new CloudRenderApp(config)
- Description:
- 渲染类,游戏引擎交互场景,可以通过场景设置与游戏引擎的连接方式,渲染和移除物体,也可使用场景内置方法,如:快速移动到目标位置、巡游等等
- Source:
- engine/CloudRenderApp.js, line42
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object | 配置信息
Properties
|
Extends
- EventDispatcher
Methods
Swtich3DTilesMode(options)
- Description:
- 切换指定3dtiles的渲染模式
- Source:
- engine/CloudRenderApp.js, line1935
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
参数
Properties
|
addToScene(obj)
- Description:
- 动态添加obj到场景
- Source:
- engine/CloudRenderApp.js, line2465
Parameters:
Name | Type | Description |
---|---|---|
obj |
* | 需要被添加的对象 |
buildingGrowthAnimate(options)
- Description:
- 建筑生长动画效果
- Source:
- engine/CloudRenderApp.js, line1861
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | 动画选项
Properties
|
||||||||||||||||||||||||||||||
option.ColorHeight |
number | 建筑切割区域厚度,默认为100, 单位厘米 |
changeResolution(width, height)
- Description:
- 改变分辨率
- Source:
- engine/CloudRenderApp.js, line1898
Parameters:
Name | Type | Description |
---|---|---|
width |
number | 宽度 |
height |
number | 高度 |
changeTime(hour, minute)
- Description:
- 根据目标时间修改时间
- Source:
- engine/CloudRenderApp.js, line2002
Parameters:
Name | Type | Default | Description |
---|---|---|---|
hour |
number |
8
|
24小时制,例如:22表示晚上10点 |
minute |
number |
10
|
60分钟制,例如:30表示30分 |
changeWeather(weatherType)
- Description:
- 根据传入的UDS字段来设置天气类型
- Source:
- engine/CloudRenderApp.js, line1988
Parameters:
Name | Type | Description |
---|---|---|
weatherType |
* | UDS字段 |
closeEdit()
- Description:
- 关闭编辑,关闭后通过editResult事件返回绘制信息,建议在此方法之前添加editResult事件,否则首次无法获取信息
- Source:
- engine/CloudRenderApp.js, line2678
destoryObject(obj)
- Description:
- 销毁物体,并释放内存
- Source:
- engine/CloudRenderApp.js, line2520
Parameters:
Name | Type | Description |
---|---|---|
obj |
* |
enable3DTilesByName(options)
- Description:
- 通过名称启用或禁用3dtiles
- Source:
- engine/CloudRenderApp.js, line1953
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
选项
Properties
|
enableDataLayerByName(dataLayerName, visible)
- Description:
- 开关数据层的显示根据名称
- Source:
- engine/CloudRenderApp.js, line2367
Parameters:
Name | Type | Description |
---|---|---|
dataLayerName |
string | 图层或者数据层名字 |
visible |
boolean | 显隐 |
enableEdit(drawOrMeasure, type, style)
- Description:
- 开始编辑绘制
- Source:
- engine/CloudRenderApp.js, line2550
Parameters:
Name | Type | Description |
---|---|---|
drawOrMeasure |
string | 是绘制还是量测,默认值 draw,可选measure |
type |
type | 类型。点线面,可选point,line,polygon,measurearea,measureline,locationpoint,surfaceline |
style |
object | 样式配置 |
eventListenerUpdate(obj)
- Description:
- 更新事件监听器
- Source:
- engine/CloudRenderApp.js, line355
Parameters:
Name | Type | Description |
---|---|---|
obj |
对象 |
excuteEngineConsoleCommand(command)
- Description:
- 执行UE的控制台命令
- Source:
- engine/CloudRenderApp.js, line1915
Parameters:
Name | Type | Description |
---|---|---|
command |
要执行的命令 |
exit()
- Description:
- 退出客户端系统
- Source:
- engine/CloudRenderApp.js, line2436
focusOn(object, options)
- Description:
- 移动相机和视口到给定物体的区域,会根据物体的包围盒自动计算最佳视口,也可以设置最终相机的状态和移动过程的事件,轨迹等参数,如果给了回调函数,移动过程技术后,会触发回调函数
- Source:
- engine/CloudRenderApp.js, line2169
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
object | 物体(必选) | |||||||||||||||||||||
options |
object | {duration,preload,index,rotation,flyOverLongitude,callback}
Properties
|
getAltitudeFromCoordinate(params, callback)
- Description:
- 获取指定坐标位置的高程
- Source:
- engine/CloudRenderApp.js, line2414
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
|||||||||
callback |
* | 返回结果的回调函数 |
hidden3DTilesItem(options)
- Description:
- 隐藏3dtiles中的部分元素
- Source:
- engine/CloudRenderApp.js, line1970
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
选项
Properties
|
initCamera()
- Description:
- 初始化相机,并监听相机回调
- Source:
- engine/CloudRenderApp.js, line399
initObjectBBox()
- Description:
- 初始化拾取物体的包围盒
- Source:
- engine/CloudRenderApp.js, line433
interval()
- Description:
- 定时更新
- Source:
- engine/CloudRenderApp.js, line245
moveCamera(options)
- Description:
- 移动摄像机
- Source:
- engine/CloudRenderApp.js, line2100
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | 包含以下参数:
Properties
|
moveTo(location, rotation, options)
- Description:
- 移动相机和视口到给定位置,可以设置最终相机的状态和移动过程的事件,轨迹等参数,如果给了回调函数,移动过程技术后,会触发回调函数
- Source:
- engine/CloudRenderApp.js, line2046
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
location |
object | 目标点的经纬度坐标值{x,y,z}或者Vector3,单位度,(必选) | |||||||||||||||||||||||||||||||||
rotation |
object | {roll,pitch,yaw} 翻滚角,俯仰角,平扫角,默认为{roll:0,pitch:0,yaw:0} | |||||||||||||||||||||||||||||||||
options |
object | {duration,preload,detectLength,flyOverLongitude,zoom,callback}
Properties
|
navigateByKeypoints(points, options)
- Description:
- 根据关键点进行路径巡航
- Source:
- engine/CloudRenderApp.js, line2221
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
points |
Array | 经纬度坐标点数组,[[lon,lat,alt,roll,pitch,yaw],[lon,lat,alt,roll,pitch,yaw],[lon,lat,alt,roll,pitch,yaw],[lon,lat,alt,roll,pitch,yaw]] | ||||||||||||||||||||||||||||||||||||
options |
object |
Properties
|
pauseNavigation(options)
- Description:
- 暂停巡航
- Source:
- engine/CloudRenderApp.js, line2316
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
project(vector, callback)
- Description:
- 世界坐标转屏幕坐标 world space into the camera's normalized device coordinate (NDC)
- Source:
- engine/CloudRenderApp.js, line2380
Parameters:
Name | Type | Description |
---|---|---|
vector |
object | 经纬度坐标{x:,y:,z:} |
callback |
function | 计算结果回调函数 |
removeAllEditObjects(drawOrMeasure, classes)
- Description:
- 移除所有的编辑几何体
- Source:
- engine/CloudRenderApp.js, line2710
Parameters:
Name | Type | Default | Description |
---|---|---|---|
drawOrMeasure |
string |
all
|
全部测绘还是绘制项或量测项,默认值 all,可选measure,draw,all |
classes |
string | 删除形状类型,默认值 ['point', 'line', 'polygon', 'surfaceLine'] |
removeAllFromScene()
- Description:
- 从场景中移除所有物体,并销毁
- Source:
- engine/CloudRenderApp.js, line2508
removeFromScene(obj)
- Description:
- 从场景中移除物体,并销毁
- Source:
- engine/CloudRenderApp.js, line2500
Parameters:
Name | Type | Description |
---|---|---|
obj |
* |
restartGame()
- Description:
- 回到场景初始状态
- Source:
- engine/CloudRenderApp.js, line2454
restartLevel()
- Description:
- 关卡重置,已弃用
- Source:
- engine/CloudRenderApp.js, line2443
resumeNavigation(options)
- Description:
- 继续巡航
- Source:
- engine/CloudRenderApp.js, line2332
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
rotateCamera(options)
- Description:
- 移动摄像机
- Source:
- engine/CloudRenderApp.js, line2119
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | 包含以下参数:
Properties
|
sendStringBufferData(messageType, descriptorString, total, index)
- Description:
- 将数据转成arrayBuffer发送到UE
- Source:
- engine/CloudRenderApp.js, line1610
Parameters:
Name | Type | Default | Description |
---|---|---|---|
messageType |
number | 消息类型(必选) | |
descriptorString |
string | 消息(必选) | |
total |
number |
1
|
总传输次数 |
index |
number |
1
|
当前传输次数 |
setFPS(status)
- Description:
- 设置帧率
- Source:
- engine/CloudRenderApp.js, line2695
Parameters:
Name | Type | Default | Description |
---|---|---|---|
status |
false
|
是否显示帧率,默认为false |
setWorldCenterPoint(longitude, latitude, altitude)
- Description:
- 设置场景中心点位置
- Source:
- engine/CloudRenderApp.js, line2013
Parameters:
Name | Type | Default | Description |
---|---|---|---|
longitude |
number | 经度 | |
latitude |
number | 纬度 | |
altitude |
number |
10
|
高度 |
setupModelInfo(url, body, header, staticResourceURL)
- Description:
- 获取资产管理平台所有模型信息
- Source:
- engine/CloudRenderApp.js, line3022
Parameters:
Name | Type | Description |
---|---|---|
url |
string | 地址,必须 |
body |
object | 模型信息请求体内容,必须 |
header |
object | 模型信息请求header,可选 |
staticResourceURL |
string | 静态资源地址请求url,可选 |
stopNavigation(options)
- Description:
- 终止巡航
- Source:
- engine/CloudRenderApp.js, line2349
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
unproject(vector, callback)
- Description:
- 屏幕坐标转世界坐标 the camera's normalized device coordinate (NDC) space into world space
- Source:
- engine/CloudRenderApp.js, line2396
Parameters:
Name | Type | Description |
---|---|---|
vector |
object | 屏幕坐标{x:,y:} |
callback |
function | 计算结果回调函数 |
zoomIn(multiplier)
- Description:
- 缩进
- Source:
- engine/CloudRenderApp.js, line2135
Parameters:
Name | Type | Default | Description |
---|---|---|---|
multiplier |
1
|
缩进倍数,默认为1 |
zoomOut(multiplier)
- Description:
- 缩远
- Source:
- engine/CloudRenderApp.js, line2149
Parameters:
Name | Type | Default | Description |
---|---|---|---|
multiplier |
1
|
缩小的倍数,默认为1 |