mapbox / mapbox/mapbox-gl-js

Cannot use feature-state with icon-image-cross-fade paint property

Open
#13,097 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.1.2

**browser**: chrome

### Steps to Trigger Behavior

1. Create a symbol layer with two icon-image variants which uses icon-image-cross-fade to control the image shown
2. Set the feature-state of an element so that the second image variant should be used
3. See that the image shown is still the default (1st).

### Link to Demonstration

https://codesandbox.io/p/sandbox/icon-image-cross-fade-w2rjl7

### Expected Behavior

One can use feature-state to control the icon-image-cross-fade paint property

### Actual Behavior

Feature-state does not allow to manipulate icon-image-cross-fade on an element by element basis. Other properties, such as zoom, do work as expected.

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 linked CodeSandbox reproduction and the reported mapbox-gl-js version, focusing on the symbol layer's icon-image-cross-fade paint property and feature-state interaction. Confirm whether changing feature-state can select the second icon variant on an individual element; done means the reproduction shows the expected variant while other supported controls continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.