Skip to content

Commit 640d009

Browse files
committed
Website updates
1 parent 8b372cc commit 640d009

9 files changed

+31
-35
lines changed

dist/en/main/apidoc/module-ol_interaction_MouseWheelZoom-MouseWheelZoom.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h4 class="name">
157157

158158
<div class="tag-source">
159159
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/MouseWheelZoom.js">interaction/MouseWheelZoom.js</a>,
160-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/MouseWheelZoom.js#L37">line 37</a>
160+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/MouseWheelZoom.js#L49">line 49</a>
161161
</div>
162162

163163
</div>
@@ -2028,7 +2028,7 @@ <h4 class="name">
20282028

20292029
<div class="tag-source">
20302030
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/MouseWheelZoom.js">interaction/MouseWheelZoom.js</a>,
2031-
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/MouseWheelZoom.js#L295">line 295</a>
2031+
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/interaction/MouseWheelZoom.js#L312">line 312</a>
20322032
</div>
20332033

20342034
</div>

dist/en/main/examples/common.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/examples/common.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/dist/ol.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/en/main/ol/interaction/MouseWheelZoom.d.ts

-21
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,6 @@ export type Options = {
3838
*/
3939
constrainResolution?: boolean | undefined;
4040
};
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-
*/
6241
/**
6342
* @classdesc
6443
* Allows the user to zoom the map by scrolling the mouse wheel.

dist/en/main/ol/interaction/MouseWheelZoom.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/en/main/ol/interaction/MouseWheelZoom.js

+23-6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ import Interaction, {zoomByDelta} from './Interaction.js';
2929
* false means intermediary zoom levels are allowed.
3030
*/
3131

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+
3244
/**
3345
* @classdesc
3446
* Allows the user to zoom the map by scrolling the mouse wheel.
@@ -192,12 +204,17 @@ class MouseWheelZoom extends Interaction {
192204

193205
// Delta normalisation inspired by
194206
// 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
201218
}
202219

203220
if (delta === 0) {

dist/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)