pointer events generated by mouse events

This commit is contained in:
tsauerwein
2014-02-03 14:37:59 +01:00
parent 1a40b1793c
commit 7140f608f8
6 changed files with 1065 additions and 208 deletions

View File

@@ -0,0 +1,40 @@
goog.provide('ol.pointer.EventSource');
/**
* @param {ol.pointer.PointerEventHandler} dispatcher
* @constructor
*/
ol.pointer.EventSource = function(dispatcher) {
/**
* @type {ol.pointer.PointerEventHandler}
*/
this.dispatcher = dispatcher;
};
/**
* List of events supported by this source.
* @return {Array.<string>} Event names
*/
ol.pointer.EventSource.prototype.getEvents = goog.abstractMethod;
/**
* Returns a mapping between the supported event types and
* the handlers that should handle an event.
* @return {Object.<string, function(Event)>} Event/Handler mapping
*/
ol.pointer.EventSource.prototype.getMapping = goog.abstractMethod;
/**
* Returns the handler that should handle a given event type.
* @param {string} eventType
* @return {function(Event)} Handler
*/
ol.pointer.EventSource.prototype.getHandlerForEvent = function(eventType) {
return this.getMapping()[eventType];
};