new Cesium.CameraEventAggregator(canvas)

汇总输入事件。 例如,假设框架之间收到下列输入: 鼠标左键下移,鼠标移动,鼠标左键上移. 这些活动将归纳为: 一个带有鼠标始末位置的事件.
Name Type Default Description
canvas HTMLCanvasElement 文档 optional 用于处理事件的元素 .
See:

Members

anyButtonDown : boolean

获取鼠标按钮是否降下, 是否开始触摸, 或是否移动了方向盘 .

currentMousePosition : Cartesian2

获取当前鼠标位置.

Methods

destroy()

删除该对象所持有的鼠标听众.

Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.
Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
handler = handler && handler.destroy();
See:

getButtonPressTime(type, modifier)Date

获得按下按钮或启动触摸的时间 .
Name Type Description
type CameraEventType 相机事件类型.
modifier KeyboardEventModifier optional 键盘修饰器.
Returns:
按下按钮或开始触摸的时间 .

getButtonReleaseTime(type, modifier)Date

获取按钮释放或触摸结束的时间 .
Name Type Description
type CameraEventType 相机事件类型.
modifier KeyboardEventModifier optional 键盘修饰器.
Returns:
按钮释放或触摸结束的时间.

getLastMovement(type, modifier)object|undefined

获取上次移动事件的开始和结束位置(不是集合事件).
Name Type Description
type CameraEventType 相机事件类型.
modifier KeyboardEventModifier optional 键盘修饰器.
Returns:
An object with two Cartesian2 properties: startPosition and endPosition or undefined.

getMovement(type, modifier)object

获取当前事件的起始和结束位置.
Name Type Description
type CameraEventType 相机事件类型.
modifier KeyboardEventModifier optional 键盘修饰器.
Returns:
An object with two Cartesian2 properties: startPosition and endPosition.

getStartMousePosition(type, modifier)Cartesian2

获取启动聚合的鼠标位置 .
Name Type Description
type CameraEventType 相机事件类型.
modifier KeyboardEventModifier optional 键盘修饰器.
Returns:
鼠标位置.

isButtonDown(type, modifier)boolean

获取鼠标按钮是否在下方或触摸开始 .
Name Type Description
type CameraEventType 相机事件类型.
modifier KeyboardEventModifier optional 键盘修饰器.
Returns:
鼠标按钮是否在下方或触摸已启动 .

isDestroyed()boolean

如果此对象被销毁, 返回真实; 否则, 错误 .

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.
Returns:
true if this object was destroyed; otherwise, false.
See:

isMoving(type, modifier)boolean

如果鼠标按钮下移或触摸已启动并已移动, 则获取 .
Name Type Description
type CameraEventType 相机事件类型.
modifier KeyboardEventModifier optional 键盘修饰器.
Returns:
Returns true if a mouse button down or touch has started and has been moved; otherwise, false

reset()

所有事件都已处理完毕的信号,聚合器应当重置,以处理新的事件.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.