Skip to content

Commit

Permalink
Patch from euzuro for openlayers#448 . Make mouseWheel work on MouseT…
Browse files Browse the repository at this point in the history
…oolbar.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2102 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
  • Loading branch information
crschmidt committed Dec 27, 2006
1 parent 6c9cb57 commit 4cac0a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/OpenLayers/Control/MouseDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 3 additions & 1 deletion lib/OpenLayers/Control/MouseToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4cac0a2

Please sign in to comment.