Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Color on Zoom for Non-Opaque Fill Polygons with Dusk/Night Lighting #13411

Open
dhwa-kyle opened this issue Feb 19, 2025 · 0 comments

Comments

@dhwa-kyle
Copy link

mapbox-gl-js version: v3.10.0, others untested

browser: Chrome and Firefox, others untested

Steps to Trigger Behavior

  1. Set the lightPreset to night or dusk
  2. Add a polygon source and layer to the map with a color, an opacity within (0.0, 1.0) and an emissive strength of 1.
  3. Zoom in and out between roughly a zoom level of 13 and 14

Reproducible Example

        const map = new mapboxgl.Map({
            container: 'map',
            style: 'mapbox://styles/mapbox/standard',
            zoom: 15,
            center: [-74.02803044931156, 40.69935650338837]
        });

        map.on('style.load', () => {
            map.setConfigProperty('basemap', 'lightPreset', 'night');
            map.addSource('polygon-source', {
                type: 'geojson',
                data: {
                    type: 'Feature',
                    geometry: {
                        type: 'Polygon',
                        coordinates: [[
                            [-74.03523913092677, 40.703543421598965],
                            [-74.03523913092677, 40.69468447346813],
                            [-74.02018228787509, 40.69468447346813],
                            [-74.02018228787509, 40.703543421598965],
                            [-74.03523913092677, 40.703543421598965]
                        ]]
                    }
                }
            });
            map.addLayer({
                id: 'polygon-layer',
                type: 'fill',
                source: 'polygon-source',
                paint: {
                    'fill-color': 'red',
                    'fill-emissive-strength': 1,
                    'fill-opacity': 0.5
                }
            });
        });

Expected Behavior

The polygon should remain the same shade of its configured fill color regardless of the current zoom level.

Actual Behavior

The polygon's fill color abruptly becomes much lighter as soon as the zoom level falls below roughly 14.

Further Details/Explanation

This does not seem to happen with dawn or day lighting, nor any of the non-standard map styles. I feel that this is erroneous behavior for polygon coloring, at least with the presence of the emissive-strength property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant