mapbox / mapbox/mapbox-gl-js

Refactor to clearly differentiate between "interaction handler" events and "camera mutation" events

Open
#3,357 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Some interaction handlers fire events that are named as if they originate the `Camera` rather than the interaction handler. The separation between these two types of events should be explicit.
- [ ] make `DragPanInteraction` fire `dragpanstart` and `dragpanend` instead of `movestart` and `moveend`
- [ ] make `DragRotateInteraction` fire `dragrotatestart` and `dragrotateend` instead of `rotate`, `move`, `rotatestart`, `movestart`, `rotateend`, `moveend`
- [ ] ensure camera fires {`pitch`, `rotate`, `move`} x {`*`, `*start`, `*end`} events itself whenever appropriate
- [ ] prevent interaction handlers with inertia from firing multiple `moveend` events within an individual interaction

Related to #3068 #2792

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 tracing DragPanInteraction, DragRotateInteraction, and the camera event paths that emit movement and rotation events. Compare the current interaction and camera event sequences, including inertia, against the requested distinctions. Done means interactions emit their own start/end events, the camera emits its appropriate pitch, rotate, and move events, and one interaction does not produce multiple moveend events.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.