Merge pull request #812 from ahocevar/mousewheel
Better mousewheel/touchpad behavior for zooming. r=@elemoine
This commit is contained in:
@@ -77,7 +77,9 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* Property: mouseWheelOptions
|
||||
* {Object} Options passed to the MouseWheel control (only useful if
|
||||
* <zoomWheelEnabled> is set to true)
|
||||
* <zoomWheelEnabled> is set to true). Default is no options for maps
|
||||
* with fractionalZoom set to true, otherwise
|
||||
* {cumulative: false, interval: 50, maxDelta: 6}
|
||||
*/
|
||||
mouseWheelOptions: null,
|
||||
|
||||
@@ -208,10 +210,15 @@ OpenLayers.Control.Navigation = OpenLayers.Class(OpenLayers.Control, {
|
||||
{map: this.map, keyMask: this.zoomBoxKeyMask});
|
||||
this.dragPan.draw();
|
||||
this.zoomBox.draw();
|
||||
var wheelOptions = this.map.fractionalZoom ? {} : {
|
||||
cumulative: false,
|
||||
interval: 50,
|
||||
maxDelta: 6
|
||||
};
|
||||
this.handlers.wheel = new OpenLayers.Handler.MouseWheel(
|
||||
this, {"up" : this.wheelUp,
|
||||
"down": this.wheelDown},
|
||||
this.mouseWheelOptions );
|
||||
this, {up : this.wheelUp, down: this.wheelDown},
|
||||
OpenLayers.Util.extend(wheelOptions, this.mouseWheelOptions)
|
||||
);
|
||||
if (OpenLayers.Control.PinchZoom) {
|
||||
this.pinchZoom = new OpenLayers.Control.PinchZoom(
|
||||
OpenLayers.Util.extend(
|
||||
|
||||
Reference in New Issue
Block a user