简化附加事件侦听器的通用模式的便利对象
对于多个事件,然后在以后一次删除所有这些侦听器,例如
破坏方法。
Example:
var helper = new Cesium.EventHelper();
helper.add(someObject.event, listener1, this);
helper.add(otherObject.event, listener2, this);
// later...
helper.removeAll();
See:
Methods
add(event, listener, scope) → EventHelper.RemoveCallback
向事件添加侦听器,并记录要在以后清理的注册。
Name | Type | Description |
---|---|---|
event |
Event | 要附加到的事件。 |
listener |
function | 引发事件时要执行的函数。 |
scope |
Object | optional
作为this 的可选对象范围
侦听器函数将在其中执行的指针。 |
Returns:
调用时将删除此事件侦听器的函数。
注销以前添加的所有侦听器。
Type Definitions
删除侦听器的函数。