mapbox / mapbox/mapbox-gl-js

Map resize fires "movestart", "move", and "moveend" events.

Open
#6,512 11 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Mapboxgl, current version.

https://github.com/mapbox/mapbox-gl-js/blob/6997943681e50b6563f98f20887cf83c6e0ddfbf/src/ui/map.js#L428-L442

The resize function fires movestart, move, and moveend. This is nonsensical, during a resize the map has not moved. This is causing those event handlers to fire unnecessarily, and I don't see any way to distinguish the "source" of the event.

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 with src/ui/map.js at the linked resize function, lines 428-442, and trace how it dispatches movestart, move, and moveend. Confirm the expected resize behavior and identify the relevant event handling or test coverage; done means resize no longer causes movement events to fire unnecessarily.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.