mapbox / mapbox/mapbox-gl-js

safari raster color issue

Open
#13,207 2 comments 0 reactions 0 assignees View on GitHub
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.4.0

browser: safari

**Steps to trigger behavior**
1. Load attached grayscale image as image layer.
2. colorize the image using the attached json with raster color array

**Screenshots**
chrome
Chrome (as expected)

safari
Safari (bug)

![2024-06-24T17-00-00 000Z](https://github.com/mapbox/mapbox-gl-js/assets/16577564/4b39772b-e5e4-41cc-9c16-2fcd59a2dbf3)
original image

[rasterColor.json](https://github.com/user-attachments/files/15958910/rasterColor.json)

**Description**
I loaded the original image as image layer and user the attached raster color json file to generate raster color expression.

`let paint: mapboxgl.RasterPaint = {
"raster-opacity": 1,
"raster-resampling": "linear",
"raster-fade-duration": 0,
"raster-color": ["interpolate", ["linear"], ["raster-value"], ...colors],
"raster-emissive-strength": 1,
};
return [
{
id: this.id,
type: "raster",
source: this.id,
paint,
},
] as RasterLayer[];
}`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the raster color expression from the issue with the attached original image and rasterColor.json in Safari, then compare it with Chrome. Trace the RasterPaint settings, especially raster-color and raster-value; done means the Safari rendering matches the expected Chrome colorization.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.