File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -68,16 +68,20 @@ function preventUnintendedZoomOnScroll(map) {
68
68
} ) ;
69
69
$ ( document ) . on ( "mousemove" , "*" , function ( e ) {
70
70
// Did the mouse really move?
71
- if ( lastScreen . x !== null && e . screenX !== lastScreen . x || e . screenY !== lastScreen . y ) {
72
- // It really moved. Enable zooming.
73
- map . scrollWheelZoom . enable ( ) ;
74
- lastScreen = { x : null , y : null } ;
71
+ if ( map . options . scrollWheelZoom ) {
72
+ if ( lastScreen . x !== null && e . screenX !== lastScreen . x || e . screenY !== lastScreen . y ) {
73
+ // It really moved. Enable zooming.
74
+ map . scrollWheelZoom . enable ( ) ;
75
+ lastScreen = { x : null , y : null } ;
76
+ }
75
77
}
76
78
} ) ;
77
79
$ ( document ) . on ( "mousedown" , ".leaflet" , function ( e ) {
78
80
// Clicking always enables zooming.
79
- map . scrollWheelZoom . enable ( ) ;
80
- lastScreen = { x : null , y : null } ;
81
+ if ( map . options . scrollWheelZoom ) {
82
+ map . scrollWheelZoom . enable ( ) ;
83
+ lastScreen = { x : null , y : null } ;
84
+ }
81
85
} ) ;
82
86
}
83
87
You can’t perform that action at this time.
0 commit comments