Pass the mapping object to the ol.pointer.EventSource constructor

Conflicts:
	src/ol/pointer/mssource.js
This commit is contained in:
Frederic Junod
2014-03-10 12:25:25 +01:00
committed by tsauerwein
parent 4468d96a13
commit 028a183d11
5 changed files with 49 additions and 110 deletions
+9 -26
View File
@@ -41,20 +41,7 @@ goog.require('ol.pointer.EventSource');
* @extends {ol.pointer.EventSource}
*/
ol.pointer.NativeSource = function(dispatcher) {
goog.base(this, dispatcher);
/**
* @const
* @type {goog.structs.Map}
*/
this.pointerMap = dispatcher.pointerMap;
/**
* @private
* @const
* @type {Object.<string, function(goog.events.BrowserEvent)>}
*/
this.mapping_ = {
var mapping = {
'pointerdown': this.pointerDown,
'pointermove': this.pointerMove,
'pointerup': this.pointerUp,
@@ -64,22 +51,18 @@ ol.pointer.NativeSource = function(dispatcher) {
'gotpointercapture': this.gotPointerCapture,
'lostpointercapture': this.lostPointerCapture
};
goog.base(this, dispatcher, mapping);
/**
* @const
* @type {goog.structs.Map}
*/
this.pointerMap = dispatcher.pointerMap;
};
goog.inherits(ol.pointer.NativeSource, ol.pointer.EventSource);
/** @inheritDoc */
ol.pointer.NativeSource.prototype.getEvents = function() {
return goog.object.getKeys(this.mapping_);
};
/** @inheritDoc */
ol.pointer.NativeSource.prototype.getMapping = function() {
return this.mapping_;
};
/**
* Handler for `pointerdown`.
*