Skip to content

Commit

Permalink
React to opacity changes
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Jul 3, 2024
1 parent 3b26793 commit f6b0157
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/base/src/mainview/mainview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ export class MainView extends React.Component<IProps, IStates> {
layout: {
visibility: layer.visible ? 'visible' : 'none'
},
paint: {
'raster-opacity': layer.parameters?.opacity !== undefined ? layer.parameters.opacity : 1
},
source: sourceId,
minzoom: source.parameters?.minZoom || 0,
maxzoom: source.parameters?.maxZoom || 24
Expand Down Expand Up @@ -346,6 +349,11 @@ export class MainView extends React.Component<IProps, IStates> {
'visibility',
layer.visible ? 'visible' : 'none'
);
this._Map.setPaintProperty(
id,
'raster-opacity',
layer.parameters?.opacity !== undefined ? layer.parameters.opacity : 1
)
}
};

Expand Down

0 comments on commit f6b0157

Please sign in to comment.