From 8801542744aa69938be2688425eec0cf6c3de16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Thu, 12 Jul 2012 08:14:21 +0200 Subject: [PATCH] add code comments to click and mousewheel handlers --- src/ol/handler/Click.js | 1 + src/ol/handler/MouseWheel.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ol/handler/Click.js b/src/ol/handler/Click.js index 89ab32fe58..e19df4bb2d 100644 --- a/src/ol/handler/Click.js +++ b/src/ol/handler/Click.js @@ -57,6 +57,7 @@ ol.handler.Click.prototype.disposeInternal = function() { * @param {goog.events.BrowserEvent} e */ ol.handler.Click.prototype.handleClick = function(e) { + // do not emit a map click event after a drag if (!this.states_.dragged) { goog.events.dispatchEvent(this.map_, e); } diff --git a/src/ol/handler/MouseWheel.js b/src/ol/handler/MouseWheel.js index 8d9e1ea7e1..e6af0bccf5 100644 --- a/src/ol/handler/MouseWheel.js +++ b/src/ol/handler/MouseWheel.js @@ -76,5 +76,6 @@ ol.handler.MouseWheel.prototype.defaultBehavior = function(e) { map.setZoom(map.getZoom() - step, e.position); // We don't want the page to scroll. + // (MouseWheelEvent is a BrowserEvent) e.preventDefault(); };