TrafficLayer

TrafficLayer

new TrafficLayer(params)

Description:
  • 车辆轨迹孪生,包括车辆、行人、障碍物等 通过SocketIO3接口获取感知数据,然后渲染这些物体的运动轨迹等 支持onConnected,onDIsconnected,onFail,follow,unfollow等事件回调
Source:
  • objects/other/TrafficLayer.js, line40
Author:
  • wema
Parameters:
Name Type Description
params object 参数
Properties
Name Type Description
url string websocket的链接地址
eventName string 绑定的后端处理事件名称,必传,默认geo_window_state
interval number 间隔时间,可选,默认100ms,后端参数
labelVisible boolean 交通参与者标签可见性,默认false
labelGroup string 交通参与者标签组,可选 'highSpeed', 'realism', 默认'highSpeed'
labelScale number 交通参与者标签渲染缩放,默认1,0.5代表0.5倍缩放,2代表2倍缩放
labelRenderType number 交通参与者标签渲染空间类型,可选0(屏幕空间),1(世界空间),默认0
uiRenderDistance number UI渲染距离,可选,默认50000,单位cm, 0为完全熏染
rayDetectionDistance number 射线检测距离,可选,默认0,单位cm,0为不开启
carRenderDistance number 模型最大渲染距离,可选,默认300000,单位cm, 超出视野距离外的车辆暂时隐藏,提升性能
namespace string message的namespace,可选,默认'/'
handShakePath string socketio连接的的handShakePath,可选,默认'socket.io'
isSubsection boolean 监听onCurrentCarList是否分段推送,格式(index: 1, total: 3, data:'[{uuid: a'),可选,默认false

Extends

  • Object3D

Methods

followTraffic(options)

Description:
  • 追踪车辆
Source:
  • objects/other/TrafficLayer.js, line118
Parameters:
Name Type Description
options object 追踪参数
Properties
Name Type Description
carId string 追踪车辆id,优先判断
plateNumber string 追踪车辆车牌号,没有id的时候会读取
isFollow boolean 追踪状态
color object 追踪光圈颜色,默认{r:0,g:1,b:0.8}
followRotations object 追踪时是否跟随车辆旋转,默认{Roll: false, Pitch:false,Yaw:false}