Skip to content

Commit

Permalink
sets individual opacity for conservation areas
Browse files Browse the repository at this point in the history
  • Loading branch information
andresgnlez committed Oct 30, 2023
1 parent 7ee9ccc commit 2b70e1d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/hooks/map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,23 +252,23 @@ export function useWDPAPreviewLayer({
},
render: {
layers: [
{
...visibleCategories.map((id) => ({
type: 'fill',
'source-layer': 'layer0',
layout: {
visibility: 'visible',
},
// wdpaIucnCategories are filtered in two steps as they are custom and WDPA.
// We have not way to separate them into two arrays but it would be ideal
filter: [
'any',
['all', ['in', ['get', 'iucn_cat'], ['literal', visibleCategories]]],
['all', ['in', ['get', 'id'], ['literal', visibleCategories]]],
['all', ['in', ['get', 'iucn_cat'], ['literal', id]]],
['all', ['in', ['get', 'id'], ['literal', id]]],
],
paint: {
'fill-color': COLORS['wdpa-preview'],
'fill-opacity': layerSettings[id]?.opacity || 1,
},
},
})),
{
type: 'line',
'source-layer': 'layer0',
Expand Down

0 comments on commit 2b70e1d

Please sign in to comment.