ol 10.5.1-dev.1744207447184 → 10.5.1-dev.1744368031882

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,27 +38,6 @@ export type Options = {
38
38
  */
39
39
  constrainResolution?: boolean | undefined;
40
40
  };
41
- /**
42
- * @typedef {'trackpad' | 'wheel'} Mode
43
- */
44
- /**
45
- * @typedef {Object} Options
46
- * @property {import("../events/condition.js").Condition} [condition] A function that
47
- * takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
48
- * boolean to indicate whether that event should be handled. Default is
49
- * {@link module:ol/events/condition.always}.
50
- * @property {boolean} [onFocusOnly=false] When the map's target has a `tabindex` attribute set,
51
- * the interaction will only handle events when the map has the focus.
52
- * @property {number} [maxDelta=1] Maximum mouse wheel delta.
53
- * @property {number} [duration=250] Animation duration in milliseconds.
54
- * @property {number} [timeout=80] Mouse wheel timeout duration in milliseconds.
55
- * @property {boolean} [useAnchor=true] Enable zooming using the mouse's
56
- * location as the anchor. When set to `false`, zooming in and out will zoom to
57
- * the center of the screen instead of zooming on the mouse's location.
58
- * @property {boolean} [constrainResolution=false] If true, the mouse wheel zoom
59
- * event will always animate to the closest zoom level after an interaction;
60
- * false means intermediary zoom levels are allowed.
61
- */
62
41
  /**
63
42
  * @classdesc
64
43
  * Allows the user to zoom the map by scrolling the mouse wheel.
@@ -1 +1 @@
1
- {"version":3,"file":"MouseWheelZoom.d.ts","sourceRoot":"","sources":["MouseWheelZoom.js"],"names":[],"mappings":";mBASa,UAAU,GAAG,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AADjC;;GAEG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,sBAFW,OAAO,EA6GjB;IApGC;;;OAGG;IACH,oBAAoB;IAEpB;;;OAGG;IACH,mBAAmB;IAEnB;;;OAGG;IACH,kBAAsE;IAEtE;;;OAGG;IACH,kBAAwE;IAExE;;;OAGG;IACH,iBAAoE;IAEpE;;;OAGG;IACH,mBAC4D;IAE5D;;;OAGG;IACH,6BAGW;IAIX;;;OAGG;IACH,mBAEa;IAEb;;;OAGG;IACH,oBAAuB;IAEvB;;;OAGG;IACH,mBAA2B;IAE3B;;;OAGG;IACH,mBAAe;IAEf;;;OAGG;IACH,cAAsB;IAEtB;;;;;OAKG;IACH,0BAA4B;IAE5B;;;OAGG;IACH,2BAAuB;IAEvB;;;;OAIG;IACH,sBAAwB;IAG1B;;OAEG;IACH,wBAYC;IA2FD;;;OAGG;IACH,yBA2BC;IAED;;;;;OAKG;IACH,0BAJW,OAAO,QASjB;CACF;wBAtSsC,kBAAkB"}
1
+ {"version":3,"file":"MouseWheelZoom.d.ts","sourceRoot":"","sources":["MouseWheelZoom.js"],"names":[],"mappings":";mBASa,UAAU,GAAG,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCjC;;;;GAIG;AACH;IACE;;OAEG;IACH,sBAFW,OAAO,EA6GjB;IApGC;;;OAGG;IACH,oBAAoB;IAEpB;;;OAGG;IACH,mBAAmB;IAEnB;;;OAGG;IACH,kBAAsE;IAEtE;;;OAGG;IACH,kBAAwE;IAExE;;;OAGG;IACH,iBAAoE;IAEpE;;;OAGG;IACH,mBAC4D;IAE5D;;;OAGG;IACH,6BAGW;IAIX;;;OAGG;IACH,mBAEa;IAEb;;;OAGG;IACH,oBAAuB;IAEvB;;;OAGG;IACH,mBAA2B;IAE3B;;;OAGG;IACH,mBAAe;IAEf;;;OAGG;IACH,cAAsB;IAEtB;;;;;OAKG;IACH,0BAA4B;IAE5B;;;OAGG;IACH,2BAAuB;IAEvB;;;;OAIG;IACH,sBAAwB;IAG1B;;OAEG;IACH,wBAYC;IAgGD;;;OAGG;IACH,yBA2BC;IAED;;;;;OAKG;IACH,0BAJW,OAAO,QASjB;CACF;wBAvTsC,kBAAkB"}
@@ -29,6 +29,18 @@ import Interaction, {zoomByDelta} from './Interaction.js';
29
29
  * false means intermediary zoom levels are allowed.
30
30
  */
31
31
 
32
+ /**
33
+ * Mutliplier for the DOM_DELTA_LINE delta value.
34
+ * @type {number}
35
+ */
36
+ const DELTA_LINE_MULTIPLIER = 40;
37
+
38
+ /**
39
+ * Mutliplier for the DOM_DELTA_PAGE delta value.
40
+ * @type {number}
41
+ */
42
+ const DELTA_PAGE_MULTIPLIER = 300;
43
+
32
44
  /**
33
45
  * @classdesc
34
46
  * Allows the user to zoom the map by scrolling the mouse wheel.
@@ -192,12 +204,17 @@ class MouseWheelZoom extends Interaction {
192
204
 
193
205
  // Delta normalisation inspired by
194
206
  // https://github.com/mapbox/mapbox-gl-js/blob/001c7b9/js/ui/handler/scroll_zoom.js
195
- let delta;
196
- if (mapBrowserEvent.type == EventType.WHEEL) {
197
- delta = wheelEvent.deltaY;
198
- if (wheelEvent.deltaMode === WheelEvent.DOM_DELTA_LINE) {
199
- delta *= 40;
200
- }
207
+ let delta = wheelEvent.deltaY;
208
+
209
+ switch (wheelEvent.deltaMode) {
210
+ case WheelEvent.DOM_DELTA_LINE:
211
+ delta *= DELTA_LINE_MULTIPLIER;
212
+ break;
213
+ case WheelEvent.DOM_DELTA_PAGE:
214
+ delta *= DELTA_PAGE_MULTIPLIER;
215
+ break;
216
+ default:
217
+ // pass
201
218
  }
202
219
 
203
220
  if (delta === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "10.5.1-dev.1744207447184",
3
+ "version": "10.5.1-dev.1744368031882",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
package/util.js CHANGED
@@ -33,4 +33,4 @@ export function getUid(obj) {
33
33
  * OpenLayers version.
34
34
  * @type {string}
35
35
  */
36
- export const VERSION = '10.5.1-dev.1744207447184';
36
+ export const VERSION = '10.5.1-dev.1744368031882';