mapbox / mapbox/mapbox-gl-js

isStyleLoaded return false inside style.load listener

Open
#13,438 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**mapbox-gl-js version**: 3.10.0

**browser**: Microsoft Edge 134.0.3124.85

### Steps to Trigger Behavior

1. Add a listener to style.load event that prints the return value from isStyleLoaded()
2. Call a function that trigger the style.load event

### Link to Demonstration
https://jsfiddle.net/6L2fvs7t/1/

### Expected Behavior
isStyleLoaded returns true

### Actual Behavior
isStyleLoaded returns false

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

Reproduce the behavior using the linked JSFiddle with mapbox-gl-js 3.10.0, an isStyleLoaded() call, and a style.load listener. Trace the style.load event and isStyleLoaded entry points to determine why the listener observes false; done means the reported scenario returns true as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.