diff --git a/lib/OpenLayers/Control/MouseDefaults.js b/lib/OpenLayers/Control/MouseDefaults.js index 3ae2ce8661..11ed47253b 100644 --- a/lib/OpenLayers/Control/MouseDefaults.js +++ b/lib/OpenLayers/Control/MouseDefaults.js @@ -33,6 +33,15 @@ OpenLayers.Control.MouseDefaults.prototype = this.map.events.register( "mousemove", this, this.defaultMouseMove ); this.map.events.register( "mouseout", this, this.defaultMouseOut ); + this.registerWheelEvents(); + + }, + + /** + * + */ + registerWheelEvents: function() { + //register mousewheel events specifically on the window and document OpenLayers.Event.observe(window, "DOMMouseScroll", this.onWheelEvent.bindAsEventListener(this)); diff --git a/lib/OpenLayers/Control/MouseToolbar.js b/lib/OpenLayers/Control/MouseToolbar.js index 9973a367f4..8392deea19 100644 --- a/lib/OpenLayers/Control/MouseToolbar.js +++ b/lib/OpenLayers/Control/MouseToolbar.js @@ -48,8 +48,10 @@ OpenLayers.Control.MouseToolbar.prototype = this._addButton("pan", "panning-hand-off.png", "panning-hand-on.png", centered, sz, "Drag the map to pan."); centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0)); this.switchModeTo("pan"); + + this.registerWheelEvents(); + return this.div; - }, _addButton:function(id, img, activeImg, xy, sz, title) {