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
+7 -26
View File
@@ -32,7 +32,6 @@ goog.provide('ol.pointer.TouchSource');
goog.require('goog.array');
goog.require('goog.math.Coordinate');
goog.require('goog.object');
goog.require('ol.pointer.EventSource');
@@ -44,7 +43,13 @@ goog.require('ol.pointer.EventSource');
* @extends {ol.pointer.EventSource}
*/
ol.pointer.TouchSource = function(dispatcher, mouseSource) {
goog.base(this, dispatcher);
var mapping = {
'touchstart': this.touchstart,
'touchmove': this.touchmove,
'touchend': this.touchend,
'touchcancel': this.touchcancel
};
goog.base(this, dispatcher, mapping);
/**
* @const
@@ -89,18 +94,6 @@ ol.pointer.TouchSource = function(dispatcher, mouseSource) {
* @type {?number}
*/
this.resetId_ = null;
/**
* @private
* @const
* @type {Object.<string, function(goog.events.BrowserEvent)>}
*/
this.mapping_ = {
'touchstart': this.touchstart,
'touchmove': this.touchmove,
'touchend': this.touchend,
'touchcancel': this.touchcancel
};
};
goog.inherits(ol.pointer.TouchSource, ol.pointer.EventSource);
@@ -112,18 +105,6 @@ goog.inherits(ol.pointer.TouchSource, ol.pointer.EventSource);
ol.pointer.TouchSource.POINTER_TYPE = 'touch';
/** @inheritDoc */
ol.pointer.TouchSource.prototype.getEvents = function() {
return goog.object.getKeys(this.mapping_);
};
/** @inheritDoc */
ol.pointer.TouchSource.prototype.getMapping = function() {
return this.mapping_;
};
/**
* @private
* @param {Touch} inTouch