new RealTimePath(map, options)
实时路径仿真类构造函数
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
map |
Glodon.CIMCube | CIMCube实例 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object | 实时路径仿真配置参数
Properties
|
Example
modelIdCallBack: function(indices, attribute) {
// 设备属性值转换为模型ID,理论值通过服务请求获取对应列表
const index = indices.indexOf("aoc_class_name");
if(index == -1) return undefined;
const attributeValue = attribute[index];
if(attributeValue == "Excavator") {
return "excavator";
} else if(attributeValue == "dumper") {
return "dumper";
}
return "modelId";
},
animationNameCallBack: function(indices, attribute) {
// 设备属性值转换为动画名称,理论值通过服务请求获取对应列表
const index = indices.indexOf("state");
if(index == -1) return undefined;
const attributeValue = attribute[index];
if(attributeValue == "RETURN") {
return "RETURN";
} else if(attributeValue == "GO") {
return "GO";
}
return "animationName";
},
Extends
Methods
-
addEventListener(type, listener [, thisArg])
-
在此事件派发器上添加事件监听.
Parameters:
Name Type Argument Description typestring 事件类型. listenerfunction 事件监听器. thisArgObject <optional>
事件监听器的this指针(可选). - Inherited From:
- Overrides:
Returns:
调用时将删除此事件侦听器的函数.- Type
- function
-
clearFeaturesModel()
-
清除实时路径模型与数据
-
conversionFramePathData(data)
-
转换的实时路径数据
Parameters:
Name Type Description dataJSON 实时路径数据 Returns:
转换后的实时路径数据- Type
- JSON
-
dispatchEvent(event)
-
在此事件派发器上派发事件.
Parameters:
Name Type Description eventObject 待派发的事件. - Inherited From:
- Overrides:
-
dispose()
-
释放资源
-
getFeaturesModel(featureID)
-
获取实时路径模型
Parameters:
Name Type Description featureIDstring 实时路径featureID -
hasEventListener(type [, listener])
-
检查此事件派发器上是否存在事件监听,如果不传递事件监听器,则判断是否存在指定事件类型的事件监听.
Parameters:
Name Type Argument Description typestring 事件类型 listenerfunction <optional>
事件监听器(可选). - Inherited From:
- Overrides:
Returns:
是否存在指定类型及指定事件监听器的事件监听.- Type
- boolean
-
on()
-
语法糖. on == addEventListener off == removeEventListeners|removeEventListener fire == dispatchEvent
- Inherited From:
- Overrides:
-
removeEventListener(type, listener)
-
从此事件派发器上删除指定事件监听.
Parameters:
Name Type Description typestring 事件类型. listenerfunction 事件监听器. - Inherited From:
- Overrides:
-
removeEventListeners(type)
-
从此事件派发器上删除事件监听,如果不提供事件类型,则删除全部事件监听.
Parameters:
Name Type Description typestring 事件类型. - Inherited From:
- Overrides:
-
showPathByPolylines(featureID, opt)
-
显示实时漫游线 (debugger用)
Parameters:
Name Type Description featureIDstring 实时路径featureID optObject 漫游线参数 Properties
Name Type Description lineTypenumber 漫游线类型,默认3;连线效果类型 0:实线|1:发光线|2:虚线|3:动态线 durationnumber 漫游线持续时间,默认5 lineWidthnumber 漫游线宽度,默认20 lineColorstring 漫游线颜色,默认#00C6FF imagestring 漫游线图片 maskLengthnumber 漫游线图片长度,默认25 -
updatePaths(options)
-
更新实时路径漫游数据
Parameters:
Name Type Description optionsObject 实时路径数据参数 Properties
Name Type Argument Default Description featuresPathObject feature实时路径数据 Properties
Name Type Description featureIDstring featureID {featureID}.modelIdstring modelId {featureID}.dataArray 轨迹数据 Properties
Name Type Description lonnumber 位置经度lon latnumber 位置纬度lat heightnumber 位置高度height timeStampnumber 时间戳,默认为0 animationNamestring 模型骨骼动画切换;非必要值; replacenumber <optional>
false 数据是否全替换,默认false fpsnumber <optional>
10 模拟速度,默认10 startRealTimenumber <optional>
0 模拟开始时间,默认0