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

How to disable lighting effects for wms raster layer? #12869

Open
bman654 opened this issue Aug 28, 2023 · 4 comments
Open

How to disable lighting effects for wms raster layer? #12869

bman654 opened this issue Aug 28, 2023 · 4 comments

Comments

@bman654
Copy link

bman654 commented Aug 28, 2023

Hello,

I'm experimenting with the new standard layer beta and I really like it. Except I've added a raster layer to my map and it is being affected by the lighting effect.

In all of these images, my raster layer is generating YELLOW dots (FFFF00), however using the new standard style they show up on the map in colors ranging from ALMOST WHITE to ALMOST BLACK.

How can I make them show up the unaltered YELLOW from the raw raster image no matter the lighting conditions?

My use case: I want to use the lighting conditions to control the theme of the basemap (e.g. easily switch from light/dark), but I want to control the colors of the data I add to the map. Does not seem possible with the dusk or night presets. Is there something I can override for my raster layer?

lightPreset day

image

lightPreset dusk

image

lightPreset night

image

lightPreset dawn

image

using dark-v11 style

image

Raw Raster Tile

image

@mejiafabiandj
Copy link

I also ran into this issue. It seems that all features added to the map are affected by the lighting conditions, with little room for customization. However, I discovered the line-emissive-strength property (I'm working with vector data). Setting this property to 1 prevents my features from being affected by lighting conditions.

I realize you're working with raster data, but I hope my experience can provide a clue to solving your problem.

map.addLayer({
        id: routeLayerId,
        type: 'line',
        source: {
            type: 'geojson',
            data: routeGeoJSON
        },
        paint: {
            'line-color': lineColor,
            'line-width': 8,
            "line-emissive-strength": 1
        }
    });

before (on lightPreset = 'night')

image

after (setting "line-emissive-strength": 1)

image

@bman654
Copy link
Author

bman654 commented Aug 29, 2023

Unfortunately it does not look like an emmissive property was added for raster layers. I messed with these paint properties but did not have any success:

          'raster-brightness-min': 0.9,
          "raster-saturation": 1,
          "raster-contrast": 1,
@alexwohlbruck
Copy link

From the migration guide, there were a number of new style properties mentioned. Without documentation, it's hard to tell what they all do with the new lighting API, but setting these paint properties with a value of 1 seems to fix the darkened layers when using the night or dusk light modes:

  • background:
    • background-emissive-strength
  • circle:
    • circle-emissive-strength
  • fill:
    • fill-emissive-strength
  • icon:
    • icon-emissive-strength
  • line:
    • line-emissive-strength
  • text:
    • text-emissive-strength
@justin-noggle-torch
Copy link

If anyone is still struggling with this, there has been added a raster-emissive-strength property that can solve this. See https://docs.mapbox.com/style-spec/reference/layers/#paint-raster-raster-emissive-strength

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment