mapbox / mapbox/mapbox-gl-js

style's zoom level overrides map's zoom when zoom is 0

Open
#7,666 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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: master

browser: all

Steps to Trigger Behavior
  1. set the zoom level to 0 when initializing the map
  2. load a style with a default zoom level
Link to Demonstration

https://jsbin.com/yijetahijo/edit?html,output

Expected Behavior

Map zoom does not change (stays at zoom 0).

Actual Behavior

Map zoom changes to style's default zoom.


The same happens with center: [0, 0] as well.

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 issue with the linked JSBin by initializing the map at zoom 0 and loading a style with a default zoom, then inspect the map initialization and style-loading path. Verify that the map remains at zoom 0; also check the reported equivalent behavior for center [0, 0].

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.