mapbox / mapbox/mapbox-gl-js

Ambiguities in event documentation

Open
#4,177 1 comment 0 reactions 1 assignee View on GitHub

@ansis is already working on this.

Since Jul 9, 2021.

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

Description

There are a few events that use the ambiguous wording "when X occurs", rather than a more precise "before X occurs" or "immediately after X occurs".

For instance, does StyleData fire after a style JSON has been fetched (but before it is applied), or later than that? (I was trying to find out whether this was a good hook to manipulate a style after it's been fetched but before it is rendered).

Also, I don't know if I'm looking in the wrong place, but I can't see anywhere where the on() function is documented. In particular, I was trying to find out whether event handlers like moveEnd are removed after they fire once - and if not, how one removes them?

Lastly, the ordering of the events in the documentation is a bit weird. moveend, mouseup, mousemove, touchstart, move, movestart...

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.