mapbox / mapbox/mapbox-gl-js

incorrect interpolation for transitions on hillshade-illumination-direction

Open
#5,934 2 comments 0 reactions 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**: 0.43.0

### Steps to Trigger Behavior

1. Create a hilshade layer with `hillshade-illumination-direction` of 359
2. Call `map.setPaintProperty(layername, 'hillshade-illumination-direction', 0)`

### Expected Behavior
Almost no visible effect.

### Actual Behavior
Entire map repaints with large visible flicker.

Easily seen here: https://bl.ocks.org/stevage/raw/a4569595d8592181ab09a5a13166be8d

(The current direction is shown in the URL)

Code: https://gist.github.com/stevage/a4569595d8592181ab09a5a13166be8d

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 with the hillshade layer's `hillshade-illumination-direction` paint property and the `map.setPaintProperty` transition from 359 to 0, using the linked reproduction to observe the flicker. Done means interpolating across the wraparound produces almost no visible effect instead of repainting the entire map.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.