openlayers / openlayers/openlayers

Scroll support for WheelEvent.DOM_DELTA_PAGE

Open
#16,788 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request pull request accepted
Dominant language
JavaScript
Stars
12.6k
Forks
3.2k
Avg merge
2d 17h
Merged PRs (30d)
21

Description

Is your feature request related to a problem? Please describe.

When the scroll is set to "One screen at a time" on Windows .
From personal observations (zooming in):

  • On Chrome/Edge { deltaMode: 2, deltaY: -0.8 }
  • On Firefox { deltaMode: 2, deltaY: -1 }

so currently, you zoom miniscule amount.

There are other findings, though some a bit outdated:

Normalization examples:

Describe the solution you'd like

It is not very clear how much a page scroll should be in zooming context. Suggestions:

  • scaling delta like WheelEvent.DOM_DELTA_LINE with a presumptive const PAGE_SIZE = 8 * LINE_SIZE
  • delta = Math.sign(delta) * this.deltaPerZoom_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the map zoom handling for WheelEvent.DOM_DELTA_LINE and compare it with the reported Chrome, Edge, and Firefox DOM_DELTA_PAGE values. Review the linked normalization examples and determine a consistent page-size or zoom-step policy; done means page-mode wheel events produce an appropriate, tested zoom amount.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.