English中文

ScreenSpaceEventHandler

new Cesium.ScreenSpaceEventHandler(element)

处理用户输入事件。可以添加自定义函数以在用户输入时执行。 Handles user input events. Custom functions can be added to be executed on when the user enters input.
名称 Name 类型 Type 默认值 Default 说明 Description
element HTMLCanvasElement document 可选 optional 要添加事件的元素。 The element to add events to.

成员 Members

static Cesium.ScreenSpaceEventHandler.mouseEmulationIgnoreMilliseconds : number

接收到任何触摸事件后将禁用鼠标事件的时间量(以毫秒为单位),以便忽略任何模拟的鼠标事件。 The amount of time, in milliseconds, that mouse events will be disabled after receiving any touch events, such that any emulated mouse events will be ignored.
默认值: Default Value: 800

static Cesium.ScreenSpaceEventHandler.touchHoldDelayMilliseconds : number

在屏幕上的触摸变成触摸并按住之前的时间量(以毫秒为单位)。 The amount of time, in milliseconds, before a touch on the screen becomes a touch and hold.
默认值: Default Value: 1500

方法 Methods

删除该对象持有的侦听器。 Removes listeners held by this object.

一旦对象被销毁,就不应再使用;调用除 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:
返回要在输入事件上执行的函数。 Returns the function to be executed on an input event.
名称 Name 类型 Type 说明 Description
type ScreenSpaceEventType 输入事件的ScreenSpaceEventType。 The ScreenSpaceEventType of input event.
modifier KeyboardEventModifier 可选 optional 一个 KeyboardEventModifier 键,当 A KeyboardEventModifier key that is held when a type 事件发生。 event occurs.
返回: Returns:
在输入事件上执行的函数。 The function to be executed on an input event.
另见: See:
如果该对象被销毁则返回 true;否则为假。 Returns true if this object was destroyed; otherwise, false.

如果该对象被破坏,则不应使用它;调用除 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)

删除要在输入事件上执行的函数。 Removes the function to be executed on an input event.
名称 Name 类型 Type 说明 Description
type ScreenSpaceEventType 输入事件的ScreenSpaceEventType。 The ScreenSpaceEventType of input event.
modifier KeyboardEventModifier 可选 optional 一个 KeyboardEventModifier 键,当 A KeyboardEventModifier key that is held when a type 事件发生。 event occurs.
另见: See:

setInputAction(action, type, modifier)

设置要在输入事件上执行的函数。 Set a function to be executed on an input event.
名称 Name 类型 Type 说明 Description
action ScreenSpaceEventHandler.PositionedEventCallback | ScreenSpaceEventHandler.MotionEventCallback | ScreenSpaceEventHandler.WheelEventCallback | ScreenSpaceEventHandler.TwoPointEventCallback | ScreenSpaceEventHandler.TwoPointMotionEventCallback 当输入事件发生时执行的函数。 Function to be executed when the input event occurs.
type ScreenSpaceEventType 输入事件的ScreenSpaceEventType。 The ScreenSpaceEventType of input event.
modifier KeyboardEventModifier 可选 optional 一个 KeyboardEventModifier 键,当 A KeyboardEventModifier key that is held when a type 事件发生。 event occurs.
另见: See:

类型定义 Type Definitions

Cesium.ScreenSpaceEventHandler.MotionEvent

从一个位置开始并在另一个位置结束的事件。 An Event that starts at one position and ends at another.
属性: Properties:
名称 Name 类型 Type 说明 Description
startPosition Cartesian2
endPosition Cartesian2

Cesium.ScreenSpaceEventHandler.MotionEventCallback(event)

名称 Name 类型 Type 说明 Description
event ScreenSpaceEventHandler.MotionEvent 触发监听器的事件 The event which triggered the listener

Cesium.ScreenSpaceEventHandler.PositionedEvent

在屏幕上的单个位置发生的事件。 An Event that occurs at a single position on screen.
属性: Properties:
名称 Name 类型 Type 说明 Description
position Cartesian2

Cesium.ScreenSpaceEventHandler.PositionedEventCallback(event)

名称 Name 类型 Type 说明 Description
event ScreenSpaceEventHandler.PositionedEvent 触发监听器的事件 The event which triggered the listener

Cesium.ScreenSpaceEventHandler.TwoPointEvent

在屏幕上的两个位置发生的事件。 An Event that occurs at a two positions on screen.
属性: Properties:
名称 Name 类型 Type 说明 Description
position1 Cartesian2
position2 Cartesian2

Cesium.ScreenSpaceEventHandler.TwoPointEventCallback(event)

名称 Name 类型 Type 说明 Description
event ScreenSpaceEventHandler.TwoPointEvent 触发监听器的事件 The event which triggered the listener

Cesium.ScreenSpaceEventHandler.TwoPointMotionEvent

从屏幕上的两个位置开始并移动到另外两个位置的事件。 An Event that starts at a two positions on screen and moves to two other positions.
属性: Properties:
名称 Name 类型 Type 说明 Description
position1 Cartesian2
position2 Cartesian2
previousPosition1 Cartesian2
previousPosition2 Cartesian2

Cesium.ScreenSpaceEventHandler.TwoPointMotionEventCallback(event)

名称 Name 类型 Type 说明 Description
event ScreenSpaceEventHandler.TwoPointMotionEvent 触发监听器的事件 The event which triggered the listener

Cesium.ScreenSpaceEventHandler.WheelEventCallback(delta)

名称 Name 类型 Type 说明 Description
delta number 鼠标滚轮移动的量 The amount that the mouse wheel moved
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.