Private enum for mousewheel mode

This commit is contained in:
Tim Schaub
2016-12-27 13:32:24 -07:00
parent 455be84cbd
commit 69d345171e
2 changed files with 8 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ ol.interaction.MouseWheelZoom = function(opt_options) {
/**
* @private
* @type {ol.interaction.MouseWheelZoom.Mode|undefined}
* @type {ol.interaction.MouseWheelZoom.Mode_|undefined}
*/
this.mode_ = undefined;
@@ -158,11 +158,11 @@ ol.interaction.MouseWheelZoom.handleEvent = function(mapBrowserEvent) {
if (!this.mode_ || now - this.startTime_ > this.trackpadEventGap_) {
this.mode_ = Math.abs(delta) < 4 ?
ol.interaction.MouseWheelZoom.Mode.TRACKPAD :
ol.interaction.MouseWheelZoom.Mode.WHEEL;
ol.interaction.MouseWheelZoom.Mode_.TRACKPAD :
ol.interaction.MouseWheelZoom.Mode_.WHEEL;
}
if (this.mode_ === ol.interaction.MouseWheelZoom.Mode.TRACKPAD) {
if (this.mode_ === ol.interaction.MouseWheelZoom.Mode_.TRACKPAD) {
var view = map.getView();
if (this.trackpadTimeoutId_) {
clearTimeout(this.trackpadTimeoutId_);
@@ -263,8 +263,9 @@ ol.interaction.MouseWheelZoom.prototype.setMouseAnchor = function(useAnchor) {
/**
* @enum {string}
* @private
*/
ol.interaction.MouseWheelZoom.Mode = {
ol.interaction.MouseWheelZoom.Mode_ = {
TRACKPAD: 'trackpad',
WHEEL: 'wheel'
};