Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
sirmmo committed Nov 27, 2024
1 parent 8ae92b0 commit c23ce9a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/app/components/Map/VectorWrapperLayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ export const VectorWrapperLayer = (props: any) => {
}, []);

useEffect(() => {
if (currentTimeSerie?.values?.length === 0) {
if (
currentTimeSerie === undefined ||
currentTimeSerie?.values === undefined ||
currentTimeSerie?.values?.length === 0
) {
try {
popupRef.current.closePopup();
} catch (ex) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/MapSearch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export const MapPopup: React.FunctionComponent<MapPopupProps> = props => {
<IconButton
onClick={() => openCharts(value)}
aria-label={'Mostra serie temporale'}
disabled={timeserie?.length === 1}
disabled={timeserie?.length <= 1}
>
<LineAxisIcon />
</IconButton>
Expand Down
9 changes: 7 additions & 2 deletions src/app/pages/MapPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ export function MapPage(props: MapPageProps) {
: ''
}
- ${labelFor(currentMap.year_period)}
${currentYear ? ` - Anno ${currentYear}` : ''} © ARPAV - Arpa FVG`; // string or function, added caption to bottom of screen
${currentMap.aggregation_period != '30yr' && currentYear
? ` - Anno ${currentYear - 1}`
: ''
} © ARPAV - Arpa FVG`; // string or function, added caption to bottom of screen

let filename = `Screenshot ${labelFor(
currentMap.climatological_variable,
Expand All @@ -403,7 +406,9 @@ export function MapPage(props: MapPageProps) {
])} ${currentMap.time_window && currentMap.aggregation_period === '30yr'
? ' - ' + labelFor(currentMap.time_window)
: ''
} - ${labelFor(currentMap.year_period)} ${currentYear ? ` - Anno ${currentYear}` : ''
} - ${labelFor(currentMap.year_period)} ${currentMap.aggregation_period != '30yr' && currentYear
? ` - Anno ${currentYear - 1}`
: ''
}.${
//@ts-ignore
navigator?.userAgentData?.platform.toLowerCase().indexOf('linux') >= 0
Expand Down

0 comments on commit c23ce9a

Please sign in to comment.