Skip to content

Commit

Permalink
color fema raster layer
Browse files Browse the repository at this point in the history
  • Loading branch information
indraneel committed Mar 14, 2024
1 parent 70e10ce commit c5e7a94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/components/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ function Filter({
<div className="bg-white mt-5 h-1/6 drop-shadow text-xs">
<div>FEMA Flood Hazard</div>
<div className="flex flex-row justify-start">
<span className="inline-block w-[15px] h-[15px] bg-[#808080] border-[1px] border-black"></span>
<span className={`inline-block w-[15px] h-[15px] bg-[#52dfff] border-[1px] border-black`}></span>
1% chance of exceeding 100-year flood
</div>
<div className="flex flex-row justify-start">
<span className="inline-block w-[15px] h-[15px] bg-white border-[1px] border-black"></span>
<span className={`inline-block w-[15px] h-[15px] bg-[#d4f7ff] border-[1px] border-black`}></span>
0.2% chance of exceeding 500-year flood
</div>
</div>
Expand Down
12 changes: 11 additions & 1 deletion app/src/utils/sourceLayerConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export enum COLORS {
'darkgreen' = 'rgba(100,165,189,1)',
'mediumgreen' = 'rgba(150,195,196,1)',
'lightgreen' = 'rgba(210,237,242,1)',
'darkblue' = 'rgba(0,150,184,1)',
'mediumblue' = 'rgba(82, 223, 255,1)',
'lightblue' = 'rgba(212, 247, 255,1)',
}

export type SLConfigType = {
Expand Down Expand Up @@ -168,7 +171,14 @@ export function useSourceLayerConfigs(
maxzoom: 20,
layoutProperties: [],
paintProperties: [
// { name: 'fill-color', value: 'rgba(104, 207, 255, .95)' },
{ name: 'raster-color', value: [
'case',
['==', ['raster-value'], 0],
`${COLORS.mediumblue}`,
['==', ['raster-value'], 1],
`${COLORS.lightblue}`,
`${COLORS.mediumblue}`,
]},
],
markers: [],
},
Expand Down

0 comments on commit c5e7a94

Please sign in to comment.