mapbox / mapbox/mapbox-gl-js

Add “movecancelled” event to Map

Open
#10,797 4 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

It’s really difficult to figure out at the application level when a map move initiated with fitBounds(), flyTo(), etc. has been cancelled by a click on the map. Currently the click event is fired after the moveend event, which complicates things even further because it can’t be guessed if the map is moving (isMoving() returns false inside the click event). So to filter out that click from, let’s say, selecting a symbol, a lot of logic needs to be implemented.

It would be good to have an event fired when a click that cancels an animated map move is performed.

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 the map movement paths named in the issue, including fitBounds() and flyTo(), alongside click, moveend, and isMoving() handling. Determine where an animated move is cancelled by a map click and identify the existing event tests or event entry points. Done means the new movecancelled event reliably identifies that cancellation without changing unrelated click or moveend behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.