Open bman654 opened 1 year ago
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')
after (setting "line-emissive-strength": 1)
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,
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
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
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
lightPreset dusk
lightPreset night
lightPreset dawn
using dark-v11 style
Raw Raster Tile