diff --git a/lib/OpenLayers/Handler/MouseWheel.js b/lib/OpenLayers/Handler/MouseWheel.js index 4cab3fdc25..0ec01725e5 100644 --- a/lib/OpenLayers/Handler/MouseWheel.js +++ b/lib/OpenLayers/Handler/MouseWheel.js @@ -21,14 +21,6 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, { */ wheelListener: null, - /** - * Property: mousePosition - * {} mousePosition is necessary because - * evt.clientX/Y is buggy in Moz on wheel events, so we cache and use the - * value from the last mousemove. - */ - mousePosition: null, - /** * Property: interval * {Integer} In order to increase server performance, an interval (in @@ -214,23 +206,7 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, { this.delta = 0; if (delta) { - // add the mouse position to the event because mozilla has - // a bug with clientX and clientY (see - // https://bugzilla.mozilla.org/show_bug.cgi?id=352179) - // getLonLatFromViewPortPx(e) returns wrong values - if (this.mousePosition) { - e.xy = this.mousePosition; - } - if (!e.xy) { - // If the mouse hasn't moved over the map yet, then - // we don't have a mouse position (in FF), so we just - // act as if the mouse was at the center of the map. - // Note that we can tell we are in the map -- and - // this.map is ensured to be true above. - e.xy = this.map.getPixelFromLonLat( - this.map.getCenter() - ); - } + e.xy = this.map.events.getMousePosition(e); if (delta < 0) { this.callback("down", [e, this.cumulative ? delta : -1]); } else { @@ -239,20 +215,6 @@ OpenLayers.Handler.MouseWheel = OpenLayers.Class(OpenLayers.Handler, { } }, - /** - * Method: mousemove - * Update the stored mousePosition on every move. - * - * Parameters: - * evt - {Event} The browser event - * - * Returns: - * {Boolean} Allow event propagation - */ - mousemove: function (evt) { - this.mousePosition = evt.xy; - }, - /** * Method: activate */