Patch from euzuro for #448 . Make mouseWheel work on MouseToolbar.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2102 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -33,6 +33,15 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
this.map.events.register( "mousemove", this, this.defaultMouseMove );
|
this.map.events.register( "mousemove", this, this.defaultMouseMove );
|
||||||
this.map.events.register( "mouseout", this, this.defaultMouseOut );
|
this.map.events.register( "mouseout", this, this.defaultMouseOut );
|
||||||
|
|
||||||
|
this.registerWheelEvents();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
registerWheelEvents: function() {
|
||||||
|
|
||||||
//register mousewheel events specifically on the window and document
|
//register mousewheel events specifically on the window and document
|
||||||
OpenLayers.Event.observe(window, "DOMMouseScroll",
|
OpenLayers.Event.observe(window, "DOMMouseScroll",
|
||||||
this.onWheelEvent.bindAsEventListener(this));
|
this.onWheelEvent.bindAsEventListener(this));
|
||||||
|
|||||||
@@ -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.");
|
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));
|
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
|
||||||
this.switchModeTo("pan");
|
this.switchModeTo("pan");
|
||||||
|
|
||||||
|
this.registerWheelEvents();
|
||||||
|
|
||||||
return this.div;
|
return this.div;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_addButton:function(id, img, activeImg, xy, sz, title) {
|
_addButton:function(id, img, activeImg, xy, sz, title) {
|
||||||
|
|||||||
Reference in New Issue
Block a user