new Cesium.EventHelper()

简化附加事件听众常见模式的便利对象 ,然后立即删除所有的听众,例如: 一个破坏方法.
Example:
const 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 可选对象范围用作 NT 0 this NT 1 指针,听器的功能将在其中执行.
Returns:
引用时会删除此事件倾听器的函数 .
See:

removeAll()

未注册所有先前添加的听众 .
See:

Type Definitions

Cesium.EventHelper.RemoveCallback()

一个删除听众的函数.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.