mapbox / mapbox/mapbox-gl-js

Clarify documentation for map.loaded(), map.isStyleLoaded()

Open
#6,708 5 comments 8 reactions 1 assignee View on GitHub

@domlet is already working on this.

Since Jul 9, 2021.

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

Description

mapbox-gl-js version: 0.45.0

Refs https://github.com/mapbox/mapbox-gl-js/issues/6707

The documentation for map.loaded() and map.isStyleLoaded() do not make it clear what the difference is between them.

    /**
     * Returns a Boolean indicating whether the map is fully loaded.
     *
     * Returns `false` if the style is not yet fully loaded,
     * or if there has been a change to the sources or style that
     * has not yet fully loaded.
     *
     * @returns {boolean} A Boolean indicating whether the map is fully loaded.
     */
    loaded()
    /**
     * Returns a Boolean indicating whether the map's style is fully loaded.
     *
     * @returns {boolean} A Boolean indicating whether the style is fully loaded.
     */
    isStyleLoaded()

It should be clear from reading the docs:

  • What "fully loaded" means / what might cause it to be not true.
  • Under what conditions map.loaded() !== map.isStyleLoaded()

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.