Skip to content

Commit 2c41c23

Browse files
committed
updates
1 parent dff85b2 commit 2c41c23

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

src/app/Services/API/Requests/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,18 @@ export class RequestApi extends Http {
125125
let labels = Object.fromEntries(labelsf.flat());
126126
labels['thirty_year'] = labels['30yr'];
127127
if (language === 'it') {
128-
labels['historical'][1] = 'Dati storici';
128+
if (!labels['historical']) {
129+
labels['historical'] = ['archive', 'Dati storici'];
130+
} else {
131+
labels['historical'][1] = 'Dati storici';
132+
}
133+
134+
if (!labels['forecast']) {
135+
labels['forecast'] = ['archive', 'Dati predittivi'];
136+
} else {
137+
labels['forecast'][1] = 'Dati predittivi';
138+
}
139+
129140
//labels['forecast'][1] = 'Predizioni';
130141
}
131142
const innerConf = {

src/app/components/DownloadDataDialog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const DownloadDataDialog = (props: DownloadDataDialogProps) => {
238238
<Grid xs={1}></Grid>
239239
<Grid xs={26}>
240240
<Typography variant={'h6'} sx={TitleDownloadStyle}>
241-
Estrazioni scaricabili
241+
{t('app.map.downloadDataDialog.downloadLinks')}
242242
</Typography>
243243
</Grid>
244244
<Grid xs={1} sx={CloseIconContStyle}>

src/app/components/Map/TWLSample.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const TWLSample = (props: any) => {
3232
const mode = props.mode;
3333
const data = props.data;
3434
const currentMap = props.currentMap;
35+
const [isSh, setIsSh] = useState(false);
3536

3637
const [tLayer, setTLayer] = useState<any>();
3738
const getMethods = obj =>
@@ -45,6 +46,7 @@ export const TWLSample = (props: any) => {
4546
url.searchParams.has('op') &&
4647
url.searchParams.get('op') === 'screenshot'
4748
) {
49+
setIsSh(true);
4850
if (url.searchParams.has('year')) {
4951
const y = url.searchParams.get('year');
5052
if (y) {
@@ -58,10 +60,13 @@ export const TWLSample = (props: any) => {
5860

5961
const setCurrYear = yr => {
6062
setCurrentYear(yr);
63+
//@ts-ignore
64+
context.map.timeDimension.setCurrentTime(yr);
6165
};
6266

6367
useEffect(() => {
6468
if (lyr && show) {
69+
const map = context.map;
6570
const url = new URL(window.location.href);
6671
if (
6772
url.searchParams.has('op') &&
@@ -77,13 +82,12 @@ export const TWLSample = (props: any) => {
7782
}
7883
}
7984

80-
const map = context.map;
8185
// @ts-ignore
8286
map.timeDimension.on('timeloading', data => {
8387
const url = new URL(window.location.href);
8488
if (
8589
url.searchParams.has('op') &&
86-
url.searchParams.get('op') !== 'screenshot'
90+
url.searchParams.get('op') === 'screenshot'
8791
) {
8892
} else {
8993
let dt = new Date(+data.time).getFullYear();
@@ -236,7 +240,7 @@ export const TWLSample = (props: any) => {
236240
cacheForward: 0,
237241
});
238242

239-
if (currentMap === 'annual') {
243+
if (currentMap === 'annual' && !isSh) {
240244
setLayer(tdWmsLayer2);
241245
setTimeout(() => {
242246
try {
@@ -297,6 +301,7 @@ export const TWLSample = (props: any) => {
297301
show,
298302
style,
299303
currentMap,
304+
isSh,
300305
]);
301306

302307
return null;

src/locales/en/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"app.index.header.disclaimer": "These are climate projections, not long-term forecasts. \nThe annual value is valid only in a \nthirty-year trend context.",
2525
"app.index.observations": "Observations",
2626
"app.map.downloadDataDialog.DLNetCDF": "Search NetCDF",
27+
"app.map.downloadDataDialog.downloadLinks": "Downloadable Extractions",
2728
"app.map.downloadDataDialog.map.east": "East",
2829
"app.map.downloadDataDialog.map.north": "North",
2930
"app.map.downloadDataDialog.map.south": "South",

src/locales/it/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"app.index.header.disclaimer": "Si tratta di proiezioni climatiche e non di previsioni \na lungo termine. Il valore annuale ha validità in un \ncontesto di trend trentennale.",
2525
"app.index.observations": "Osservazoni",
2626
"app.map.downloadDataDialog.DLNetCDF": "Cerca NetCDF",
27+
"app.map.downloadDataDialog.downloadLinks": "Estrazioni Scaricabili",
2728
"app.map.downloadDataDialog.map.east": "Est",
2829
"app.map.downloadDataDialog.map.north": "Nord",
2930
"app.map.downloadDataDialog.map.south": "Sud",

0 commit comments

Comments
 (0)