Simpler type for ol.events.Key

Instead of having `ol.events.Key` be a listener object or an array of listener objects, it should be less error prone to have it just be a single listener object.

To avoid using too many functions with multiple return types, the `ol.events.*` functions for registering and unregistering listeners no longer accept an array of event types (and only a single key is returned when registering).

To make it convenient for users to register multiple listeners at once, the `observable.on()` method accepts an array of event types.  Internally in the library, we should use the less risky `ol.events.listen()`.
This commit is contained in:
Tim Schaub
2016-02-02 12:20:18 -07:00
committed by Andreas Hocevar
parent 78f44dcc8a
commit f10c90bdba
15 changed files with 173 additions and 108 deletions

View File

@@ -154,7 +154,7 @@ ol.MapBrowserEventHandler = function(map) {
this.dragListenerKeys_ = null;
/**
* @type {ol.events.Key}
* @type {?ol.events.Key}
* @private
*/
this.pointerdownListenerKey_ = null;