new Cesium.ScreenSpaceEventHandler(element)

处理用户输入事件. 自定义函数可以添加到 当用户输入输入时.
Name Type Default Description
element HTMLCanvasElement 文档 optional 添加事件的内容 .

Members

static Cesium.ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds : number

鼠标事件将在之后禁用时间, 以毫秒计 接收任何触摸事件,从而忽略任何模拟鼠标事件.
Default Value: 800

static Cesium.ScreenSpaceEventHandler.touchHoldDelayMilliseconds : number

The amount of time, in milliseconds, before a touch on the screen becomes a 抚摸和抱住.
Default Value: 1500

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:
返回输入事件时要执行的函数.
Name Type Description
type ScreenSpaceEventType 输入事件的 ScreenSpaceEventType .
modifier KeyboardEventModifier optional A KeyboardEventModifier key that is held when a type event occurs.
Returns:
在输入事件上要执行的函数 .
See:

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:

removeInputAction(type, modifier)

删除输入事件上要执行的函数.
Name Type Description
type ScreenSpaceEventType 输入事件的 ScreenSpaceEventType .
modifier KeyboardEventModifier optional A KeyboardEventModifier key that is held when a type event occurs.
See:

setInputAction(action, type, modifier)

设置要执行的函数 .
Name Type Description
action ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback 当输入事件发生时要执行的函数 .
type ScreenSpaceEventType 输入事件的 ScreenSpaceEventType .
modifier KeyboardEventModifier optional A KeyboardEventModifier key that is held when a type event occurs.
See:

Type Definitions

Cesium.ScreenSpaceEventHandler.MotionEvent

一个事件从一个位置开始,从另一个位置结束.
Properties:
Name Type Description
startPosition Cartesian2
endPosition Cartesian2

Cesium.ScreenSpaceEventHandler.MotionEventCallback(event)

Name Type Description
event ScreenSpaceEventHandler.MotionEvent 引发听众的事件

Cesium.ScreenSpaceEventHandler.PositionedEvent

发生在屏幕上一个位置的事件.
Properties:
Name Type Description
position Cartesian2

Cesium.ScreenSpaceEventHandler.PositionedEventCallback(event)

Name Type Description
event ScreenSpaceEventHandler.PositionedEvent 引发听众的事件

Cesium.ScreenSpaceEventHandler.TwoPointEvent

发生在屏幕上两个位置的事件.
Properties:
Name Type Description
position1 Cartesian2
position2 Cartesian2

Cesium.ScreenSpaceEventHandler.TwoPointEventCallback(event)

Name Type Description
event ScreenSpaceEventHandler.TwoPointEvent 引发听众的事件

Cesium.ScreenSpaceEventHandler.TwoPointMotionEvent

活动从屏幕上的两个位置开始,转移到另外两个位置.
Properties:
Name Type Description
position1 Cartesian2
position2 Cartesian2
previousPosition1 Cartesian2
previousPosition2 Cartesian2

Cesium.ScreenSpaceEventHandler.TwoPointMotionEventCallback(event)

Name Type Description
event ScreenSpaceEventHandler.TwoPointMotionEvent 引发听众的事件

Cesium.ScreenSpaceEventHandler.WheelEventCallback(delta)

Name Type Description
delta number 鼠标轮子移动的量
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.