Skip to content

Commit

Permalink
wip: legend fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sampov2 committed Dec 18, 2024
1 parent e882206 commit 2d212a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/components/TemperatureComponent/TemperatureComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ export const TemperatureComponent: React.FC<TemperatureProps> = ({ data, height,
)

const legendsContent = (
<Flex boxSizing="border-box" w="100%" mt="4" flexWrap="wrap" gap="4">
<Flex boxSizing="border-box" w="100%" mt="4" flexWrap="wrap" columnGap="4" rowGap="1">
{data.legend.map(({ color, minValue, maxValue }, index) => {
return (
<Flex
key={index}
minW="30%"
maxW="30%"
minW="20%"
maxW="20%"
boxSizing="border-box"
alignItems="center"
textAlign="center"
Expand Down
9 changes: 1 addition & 8 deletions src/config/layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ export const availableLayers: Array<LayerConfiguration> = [
layer: 'seaheat-customer:seaheat-producer:seaheat-monthly-monthly-timmean-bottomtemperature',
isDatalayer: true,
type: 'WMS',
dimensions: ['time'],
legend: {
width: 345,
height: 250,
// eslint-disable-next-line max-len
url: "https://ext-seaheat-smartmet-server.out.ock.fmi.fi/wms?service=WMS&request=GetLegendGraphic&version=1.3.0&sld_version=1.1.0&style=default&format=image%2Fpng&layer=seaheat-customer%3Aseaheat-producer%3Aseaheat-monthly-monthly-timmean-bottomtemperature&width=548&height=250",
scale: 0.8
}
dimensions: ['time']
},
{
id: 'a530150a-0e40-4fdc-8087-d50b62404d8a',
Expand Down
4 changes: 2 additions & 2 deletions src/types/temperature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export interface Value {
}

interface Legend {
minValue: number
maxValue: number
minValue: number | null
maxValue: number | null
color: string
}

Expand Down

0 comments on commit 2d212a8

Please sign in to comment.