mapbox / mapbox/mapbox-gl-js

Provide access mouse/touch events in continuously-updating interaction handlers

Open
#6,047 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api :memo:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

As a consequence of integrating camera easing into the main render loop (#5743), we've changed (#6005 #6029) the way continuously-updating interaction handlers manage the camera so that, during dragging/scrolling action, we accumulate movement from multiple mouse events between one render frame and the next, and then in each frame, we synchronously update the camera and fire move (and rotate, etc.) events.

Right now, when DragPanHandler, DragRotateHandler, and ScrollZoomHandler fire 'move', etc., they attach the last mouse event as originalEvent, even though multiple mouse events may be responsible for this particular 'move'. Instead, we should either (a) omit originalEvent in these cases, or (b) include an originalEvents array with all of the contributing events.

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 reading the DragPanHandler, DragRotateHandler, and ScrollZoomHandler implementations and the event-dispatch paths for their continuously-updating actions. Trace how contributing mouse events are accumulated and assigned to originalEvent; done means the emitted move, rotate, and related events no longer misrepresent multiple contributing events, using one of the two behaviors described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.