mapbox / mapbox/mapbox-gl-js

SVG icon-image with filter behaves different than without (Worked with 3.9.2)

Open
#13,546 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

v3.14.0

### Browser and version

Version 139.0.7258.138 (Official Build) (64-bit)

### Expected behavior

Icons are rendered everytime just like without the filter. It works with mapbox 3.9.2

### Actual behavior

Icons are disappearing and appearing depending on zoom level

### Link to the demonstration

https://codepen.io/pomm0/pen/JoYwWPQ

### Steps to trigger the unexpected behavior

* add a valid mapbox accesstoken
* zoom in and out
* do the same without the filter on line 98 (`filter: ['==', 'number', number]`)

https://github.com/user-attachments/assets/aa24f527-c0f9-425c-ae86-69c0172b105d

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 CodePen and reproduce the zoom-dependent disappearance in Mapbox GL JS 3.14.0, comparing the SVG icon-image with and without the filter on line 98. Use the working 3.9.2 behavior as a reference; done means filtered icons remain rendered consistently while zooming in and out.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.