@eeacms/volto-arcgis-block 0.1.108 → 0.1.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/package.json +3 -2
- package/src/components/MapViewer/AreaWidget.jsx +4 -5
- package/src/components/MapViewer/HotspotWidget.jsx +2 -4
- package/src/components/MapViewer/MenuWidget.jsx +117 -42
- package/src/components/MapViewer/TimesliderWidget.jsx +81 -51
- package/src/components/MapViewer/css/ArcgisMap.css +47 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [0.1.110](https://github.com/eea/volto-arcgis-block/compare/0.1.109...0.1.110) - 28 February 2023
|
|
8
|
+
|
|
9
|
+
#### :hammer_and_wrench: Others
|
|
10
|
+
|
|
11
|
+
- Update package.json [Amanda Rodriguez - [`5c523ea`](https://github.com/eea/volto-arcgis-block/commit/5c523eaa749576db2080f7d6dba08c46b32ace32)]
|
|
12
|
+
- ES Lint fix [Amanda Rodriguez - [`bacaca5`](https://github.com/eea/volto-arcgis-block/commit/bacaca5eee7e9d7e03ccb8c8b5f4aa40be0d122e)]
|
|
13
|
+
- CLMS-1758 [Amanda Rodriguez - [`0d43bc6`](https://github.com/eea/volto-arcgis-block/commit/0d43bc6e64ece410eeda3dbfb2ba4245ea4d2dc8)]
|
|
14
|
+
- CLMS-1827 [Amanda Rodriguez - [`1b589c7`](https://github.com/eea/volto-arcgis-block/commit/1b589c7661392692fa534f8c9061b9f11e7c4328)]
|
|
15
|
+
### [0.1.109](https://github.com/eea/volto-arcgis-block/compare/0.1.108...0.1.109) - 28 February 2023
|
|
16
|
+
|
|
17
|
+
#### :hammer_and_wrench: Others
|
|
18
|
+
|
|
19
|
+
- Merge pull request #306 from eea/develop [Unai Bolivar - [`0772fe3`](https://github.com/eea/volto-arcgis-block/commit/0772fe31cacc0c5e2cbeb369775c98535ec2b64b)]
|
|
20
|
+
- CLMS 1581 & CLMS 1771 pushing both tickets [ujbolivar - [`dd1a580`](https://github.com/eea/volto-arcgis-block/commit/dd1a580d32faff6754121dd49415030920543c72)]
|
|
21
|
+
- CLMS-1771 FIX: Area widget opened by default if user is logged in and downloadTag exists [ujbolivar - [`f629491`](https://github.com/eea/volto-arcgis-block/commit/f629491531dec0dd09234b41184413b3d2e54768)]
|
|
22
|
+
- CLMS-1581 FIX: Hotspot widget stays open after applying filters, and unchecking one hotspotlayer even though another hotspot layer is still checked [ujbolivar - [`e5b18d6`](https://github.com/eea/volto-arcgis-block/commit/e5b18d6477e6bc0dcc7f048835d7ce97483bc9d4)]
|
|
7
23
|
### [0.1.108](https://github.com/eea/volto-arcgis-block/compare/0.1.107...0.1.108) - 27 February 2023
|
|
8
24
|
|
|
9
25
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-arcgis-block",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.110",
|
|
4
4
|
"description": "volto-arcgis-block: Volto add-on",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "European Environment Agency: CodeSyntax",
|
|
@@ -42,7 +42,8 @@
|
|
|
42
42
|
"@fortawesome/react-fontawesome": "0.1.14",
|
|
43
43
|
"@eeacms/volto-clms-utils": "*",
|
|
44
44
|
"highcharts": "^9.3.2",
|
|
45
|
-
"highcharts-react-official": "^3.1.0"
|
|
45
|
+
"highcharts-react-official": "^3.1.0",
|
|
46
|
+
"react-datepicker": "4.10.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@cypress/code-coverage": "^3.9.5",
|
|
@@ -288,15 +288,14 @@ class AreaWidget extends React.Component {
|
|
|
288
288
|
? this.container !== null && this.props.view.ui.add(this.container)
|
|
289
289
|
: this.props.view.ui.add(this.container.current, 'top-right');
|
|
290
290
|
|
|
291
|
-
var
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
var popup = document.createElement('div');
|
|
292
|
+
popup.className = 'drawRectanglePopup-block';
|
|
293
|
+
popup.innerHTML =
|
|
294
294
|
'<div class="drawRectanglePopup-content">' +
|
|
295
295
|
'<span class="drawRectanglePopup-icon"><span class="esri-icon-cursor-marquee"></span></span>' +
|
|
296
296
|
'<div class="drawRectanglePopup-text">Select an area of interest to download a dataset</div>' +
|
|
297
297
|
'</div>';
|
|
298
|
-
|
|
299
|
-
this.props.download && this.props.view.ui.add(z, 'top-right');
|
|
298
|
+
this.props.download && this.props.view.ui.add(popup, 'top-right');
|
|
300
299
|
}
|
|
301
300
|
|
|
302
301
|
/**
|
|
@@ -167,6 +167,8 @@ class HotspotWidget extends React.Component {
|
|
|
167
167
|
this.props.map.add(this.esriLayer_lc);
|
|
168
168
|
this.props.selectedLayers['lc_filter'] = this.esriLayer_lc;
|
|
169
169
|
this.props.selectedLayers['lc_filter'].visible = true;
|
|
170
|
+
//set sessionStorage value to keep the widget open
|
|
171
|
+
sessionStorage.setItem('hotspotFilterApplied', 'true');
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
174
|
}
|
|
@@ -484,10 +486,6 @@ class HotspotWidget extends React.Component {
|
|
|
484
486
|
);
|
|
485
487
|
}
|
|
486
488
|
|
|
487
|
-
/**
|
|
488
|
-
* This method is executed before the render method is executed
|
|
489
|
-
*/
|
|
490
|
-
|
|
491
489
|
/**
|
|
492
490
|
* This method is executed after the rener method is executed
|
|
493
491
|
*/
|
|
@@ -124,6 +124,12 @@ export const AddCartItem = ({
|
|
|
124
124
|
dataset = cartData[0].Products[0].Datasets[0];
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
const setDownloadTag = (val) => {
|
|
128
|
+
if (!sessionStorage.key('downloadButtonClicked'))
|
|
129
|
+
sessionStorage.setItem('downloadButtonClicked', 'true');
|
|
130
|
+
else sessionStorage.setItem('downloadButtonClicked', val);
|
|
131
|
+
};
|
|
132
|
+
|
|
127
133
|
return (
|
|
128
134
|
<>
|
|
129
135
|
{download ? (
|
|
@@ -132,22 +138,26 @@ export const AddCartItem = ({
|
|
|
132
138
|
id="map_download_add"
|
|
133
139
|
className="ccl-button ccl-button-green"
|
|
134
140
|
onClick={(e) => {
|
|
135
|
-
if (
|
|
136
|
-
document.getElementById('
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
if (!document.querySelector('.map-menu-layer input:checked')) {
|
|
142
|
+
document.getElementById('products_label').click();
|
|
143
|
+
} else {
|
|
144
|
+
if (dataset.IsTimeSeries && !checkTimeData(dataset)) {
|
|
145
|
+
document.getElementById('active_label').click();
|
|
146
|
+
if (!document.querySelector('.timeslider-container')) {
|
|
147
|
+
let layerId = document.querySelector(
|
|
148
|
+
'[datasetid="' +
|
|
149
|
+
dataset.DatasetId +
|
|
150
|
+
'"] .map-menu-layer input:checked',
|
|
151
|
+
).id;
|
|
152
|
+
document
|
|
153
|
+
.querySelector(
|
|
154
|
+
"[layer-id='" + layerId + "'] .active-layer-time",
|
|
155
|
+
)
|
|
156
|
+
.click(e);
|
|
157
|
+
}
|
|
158
|
+
} else if (areaData) {
|
|
159
|
+
checkArea(e);
|
|
148
160
|
}
|
|
149
|
-
} else if (areaData) {
|
|
150
|
-
checkArea(e);
|
|
151
161
|
}
|
|
152
162
|
}}
|
|
153
163
|
>
|
|
@@ -245,6 +255,7 @@ export const AddCartItem = ({
|
|
|
245
255
|
<span
|
|
246
256
|
className={'map-menu-icon map-menu-icon-login'}
|
|
247
257
|
onClick={() => {
|
|
258
|
+
setDownloadTag(true);
|
|
248
259
|
document.querySelector('.header-login-link').click();
|
|
249
260
|
}}
|
|
250
261
|
onKeyDown={() => {
|
|
@@ -459,12 +470,13 @@ class MenuWidget extends React.Component {
|
|
|
459
470
|
}
|
|
460
471
|
|
|
461
472
|
let authToken = this.getAuthToken();
|
|
462
|
-
let timeSliderTag =
|
|
473
|
+
let timeSliderTag = sessionStorage.getItem('timeSliderTag');
|
|
474
|
+
let downloadTag = sessionStorage.getItem('downloadButtonClicked');
|
|
463
475
|
let checkedLayers = JSON.parse(sessionStorage.getItem('checkedLayers'));
|
|
464
476
|
|
|
465
477
|
// "Active on map" section and the time slider opened by default if user is logged in and timeSliderTag is true
|
|
466
|
-
|
|
467
|
-
|
|
478
|
+
if (checkedLayers && !this.props.download) {
|
|
479
|
+
// "Active on map" section and the time slider opened by default if user is logged in and timeSliderTag is true
|
|
468
480
|
if (authToken && timeSliderTag) {
|
|
469
481
|
for (let i = 0; i < checkedLayers.length; i++) {
|
|
470
482
|
let layerid = checkedLayers[i];
|
|
@@ -491,6 +503,30 @@ class MenuWidget extends React.Component {
|
|
|
491
503
|
}
|
|
492
504
|
}
|
|
493
505
|
}
|
|
506
|
+
// "Area widget" opened by default if user is logged in and downloadTag is true
|
|
507
|
+
else if (authToken && downloadTag) {
|
|
508
|
+
for (let i = 0; i < checkedLayers.length; i++) {
|
|
509
|
+
let layerid = checkedLayers[i];
|
|
510
|
+
if (
|
|
511
|
+
layerid &&
|
|
512
|
+
!this.layers[layerid].isTimeSeries &&
|
|
513
|
+
!this.container.current
|
|
514
|
+
.querySelector('.esri-widget')
|
|
515
|
+
.classList.contains('esri-icon-drag-horizontal')
|
|
516
|
+
) {
|
|
517
|
+
//open area widget
|
|
518
|
+
let event = new MouseEvent('click', {
|
|
519
|
+
view: window,
|
|
520
|
+
bubbles: true,
|
|
521
|
+
cancelable: false,
|
|
522
|
+
});
|
|
523
|
+
document
|
|
524
|
+
.querySelector('.map-menu-icon-login.logged')
|
|
525
|
+
.dispatchEvent(event);
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
494
530
|
}
|
|
495
531
|
// CLMS-1389
|
|
496
532
|
// "Active on map" section and the time slider opened by default if download and timeseries == true
|
|
@@ -571,14 +607,6 @@ class MenuWidget extends React.Component {
|
|
|
571
607
|
return tokenResult;
|
|
572
608
|
}
|
|
573
609
|
|
|
574
|
-
getTimeSliderTag() {
|
|
575
|
-
let tagResult = true;
|
|
576
|
-
if (!sessionStorage.key('timeSliderTag')) {
|
|
577
|
-
tagResult = false;
|
|
578
|
-
}
|
|
579
|
-
return tagResult;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
610
|
/**
|
|
583
611
|
* Close opacity panel if user clicks outside
|
|
584
612
|
*/
|
|
@@ -1114,6 +1142,23 @@ class MenuWidget extends React.Component {
|
|
|
1114
1142
|
)}
|
|
1115
1143
|
</label>
|
|
1116
1144
|
<div className="map-menu-icons">
|
|
1145
|
+
{!this.props.download && dataset.IsTimeSeries && (
|
|
1146
|
+
<Popup
|
|
1147
|
+
trigger={
|
|
1148
|
+
<span
|
|
1149
|
+
className="map-menu-icon"
|
|
1150
|
+
onClick={() => this.checkTimeLayer(dataset)}
|
|
1151
|
+
onKeyDown={() => this.checkTimeLayer(dataset)}
|
|
1152
|
+
tabIndex="0"
|
|
1153
|
+
role="button"
|
|
1154
|
+
>
|
|
1155
|
+
<FontAwesomeIcon icon={['far', 'clock']} />
|
|
1156
|
+
</span>
|
|
1157
|
+
}
|
|
1158
|
+
content={'Show time slider'}
|
|
1159
|
+
{...popupSettings}
|
|
1160
|
+
/>
|
|
1161
|
+
)}
|
|
1117
1162
|
{!this.props.download && (
|
|
1118
1163
|
<a
|
|
1119
1164
|
href={dataset.DatasetURL}
|
|
@@ -1456,6 +1501,8 @@ class MenuWidget extends React.Component {
|
|
|
1456
1501
|
this.map.reorder(nuts, this.map.layers.items.length + 1);
|
|
1457
1502
|
}
|
|
1458
1503
|
} else {
|
|
1504
|
+
sessionStorage.removeItem('downloadButtonClicked');
|
|
1505
|
+
sessionStorage.removeItem('timeSliderTag');
|
|
1459
1506
|
this.deleteCheckedLayer(elem.id);
|
|
1460
1507
|
this.deleteFilteredLayer();
|
|
1461
1508
|
this.layers[elem.id].opacity = 1;
|
|
@@ -1468,7 +1515,6 @@ class MenuWidget extends React.Component {
|
|
|
1468
1515
|
delete this.timeLayers[elem.id];
|
|
1469
1516
|
}
|
|
1470
1517
|
this.updateCheckDataset(parentId);
|
|
1471
|
-
//!this.props.download && this.toggleHotspotWidget();
|
|
1472
1518
|
this.toggleHotspotWidget();
|
|
1473
1519
|
this.layersReorder();
|
|
1474
1520
|
this.checkInfoWidget();
|
|
@@ -1495,17 +1541,24 @@ class MenuWidget extends React.Component {
|
|
|
1495
1541
|
if (this.props.download) {
|
|
1496
1542
|
checkedLayers = Object.keys(this.activeLayersJSON);
|
|
1497
1543
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1544
|
+
if (
|
|
1545
|
+
checkedLayers.length === 0 &&
|
|
1546
|
+
sessionStorage.getItem('hotspotFilterApplied')
|
|
1547
|
+
) {
|
|
1548
|
+
sessionStorage.removeItem('hotspotFilterApplied');
|
|
1549
|
+
}
|
|
1550
|
+
if (checkedLayers) {
|
|
1551
|
+
checkedLayers.forEach((key) => {
|
|
1552
|
+
if (
|
|
1553
|
+
key.includes('all_present_lc_a_pol') ||
|
|
1554
|
+
key.includes('all_lcc_a_pol')
|
|
1555
|
+
) {
|
|
1556
|
+
if (!this.props.mapViewer.activeWidget) {
|
|
1557
|
+
hotspotButton.click();
|
|
1558
|
+
}
|
|
1506
1559
|
}
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1509
1562
|
}
|
|
1510
1563
|
/**
|
|
1511
1564
|
* Hide or show a legend image in the legend widget for a WMTS or a TMS layer
|
|
@@ -2084,11 +2137,13 @@ class MenuWidget extends React.Component {
|
|
|
2084
2137
|
layers.push(layer);
|
|
2085
2138
|
}
|
|
2086
2139
|
});
|
|
2087
|
-
if (
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2140
|
+
if (!sessionStorage.getItem('hotspotFilterApplied')) {
|
|
2141
|
+
if (layers.length === 0 && document.querySelector('.info-container')) {
|
|
2142
|
+
this.props.mapViewer.closeActiveWidget();
|
|
2143
|
+
document.querySelector('.info-container').style.display = 'none';
|
|
2144
|
+
} else if (layers.length > 0) {
|
|
2145
|
+
document.querySelector('.info-container').style.display = 'flex';
|
|
2146
|
+
}
|
|
2092
2147
|
}
|
|
2093
2148
|
this.renderHotspot();
|
|
2094
2149
|
/**/
|
|
@@ -2533,12 +2588,32 @@ class MenuWidget extends React.Component {
|
|
|
2533
2588
|
time={time}
|
|
2534
2589
|
logged={isLoggedIn}
|
|
2535
2590
|
fromDownload={fromDownload}
|
|
2591
|
+
area={this.props.area}
|
|
2536
2592
|
/>,
|
|
2537
2593
|
document.querySelector('.esri-ui-bottom-right'),
|
|
2538
2594
|
);
|
|
2539
2595
|
}
|
|
2540
2596
|
}
|
|
2541
2597
|
|
|
2598
|
+
checkTimeLayer(dataset) {
|
|
2599
|
+
let id = dataset.DatasetId;
|
|
2600
|
+
let checkbox = document
|
|
2601
|
+
.querySelector('[datasetid="' + id + '"]')
|
|
2602
|
+
.querySelector('.map-dataset-checkbox input');
|
|
2603
|
+
if (!checkbox.checked) {
|
|
2604
|
+
checkbox.click();
|
|
2605
|
+
}
|
|
2606
|
+
document.getElementById('active_label').click();
|
|
2607
|
+
if (!document.querySelector('.timeslider-container')) {
|
|
2608
|
+
let layerId = document
|
|
2609
|
+
.querySelector('[datasetid="' + id + '"] input')
|
|
2610
|
+
.getAttribute('defcheck');
|
|
2611
|
+
setTimeout(() => {
|
|
2612
|
+
this.showTimeSlider(document.getElementById(layerId), false);
|
|
2613
|
+
}, 100);
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2542
2617
|
/**
|
|
2543
2618
|
* This method renders the component
|
|
2544
2619
|
* @returns jsx
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { createRef } from 'react';
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
3
|
import { loadModules } from 'esri-loader';
|
|
4
|
+
import DatePicker from 'react-datepicker';
|
|
5
|
+
import 'react-datepicker/dist/react-datepicker.css';
|
|
4
6
|
var TimeSlider;
|
|
5
7
|
var TimeExtent;
|
|
6
8
|
var esriRequest;
|
|
@@ -24,8 +26,7 @@ class TimesliderWidget extends React.Component {
|
|
|
24
26
|
timeSelectedValuesC: [], //To compare time slider stored values with new selected values
|
|
25
27
|
showDatePanel: false,
|
|
26
28
|
lockDatePanel: true,
|
|
27
|
-
showCalendar:
|
|
28
|
-
this.props.fromDownload || this.props.download ? true : false,
|
|
29
|
+
showCalendar: this.props.fromDownload ? true : false,
|
|
29
30
|
dateStart: this.props.time.start ? new Date(this.props.time.start) : null,
|
|
30
31
|
dateEnd: this.props.time.end ? new Date(this.props.time.end) : null,
|
|
31
32
|
periodicity: null,
|
|
@@ -200,7 +201,7 @@ class TimesliderWidget extends React.Component {
|
|
|
200
201
|
loop: false,
|
|
201
202
|
labelFormatFunction: (value, type, element, layout) => {
|
|
202
203
|
if (!this.TimesliderWidget.fullTimeExtent) {
|
|
203
|
-
element.innerText = '
|
|
204
|
+
element.innerText = 'Loading...';
|
|
204
205
|
return;
|
|
205
206
|
}
|
|
206
207
|
if (value) {
|
|
@@ -481,44 +482,60 @@ class TimesliderWidget extends React.Component {
|
|
|
481
482
|
showCalendar() {
|
|
482
483
|
if (this.state.showCalendar) {
|
|
483
484
|
this.setState({ showCalendar: false });
|
|
485
|
+
if (
|
|
486
|
+
document.querySelector('.drawRectanglePopup-block') &&
|
|
487
|
+
!this.props.area
|
|
488
|
+
) {
|
|
489
|
+
document.querySelector('.drawRectanglePopup-block').style.display =
|
|
490
|
+
'block';
|
|
491
|
+
}
|
|
484
492
|
} else {
|
|
485
493
|
this.setState({ showCalendar: true });
|
|
494
|
+
if (document.querySelector('.drawRectanglePopup-block')) {
|
|
495
|
+
document.querySelector('.drawRectanglePopup-block').style.display =
|
|
496
|
+
'none';
|
|
497
|
+
}
|
|
486
498
|
}
|
|
487
499
|
}
|
|
488
500
|
|
|
489
501
|
applyDate() {
|
|
490
|
-
let start =
|
|
491
|
-
start = start
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
let end = document.querySelector('#date_end').valueAsDate;
|
|
495
|
-
end = end ? new Date(end) : this.TimesliderWidget.fullTimeExtent.end;
|
|
502
|
+
let start = this.state.inputStart;
|
|
503
|
+
start = start ? start : this.TimesliderWidget.fullTimeExtent.start;
|
|
504
|
+
let end = this.state.inputEnd;
|
|
505
|
+
end = end ? end : this.TimesliderWidget.fullTimeExtent.end;
|
|
496
506
|
this.props.time.elem.setAttribute('time-start', new Date(start).getTime());
|
|
497
507
|
this.props.time.elem.setAttribute('time-end', new Date(end).getTime());
|
|
498
508
|
this.setState({
|
|
499
509
|
dateStart: start,
|
|
500
510
|
dateEnd: end,
|
|
501
|
-
showCalendar: false,
|
|
502
511
|
});
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
document.getElementById('
|
|
512
|
+
this.showCalendar();
|
|
513
|
+
if (this.props.download) {
|
|
514
|
+
if (this.props.fromDownload) {
|
|
515
|
+
this.props.time.elem.querySelector('.active-layer-time').click();
|
|
516
|
+
document.getElementById('download_label').click();
|
|
517
|
+
}
|
|
518
|
+
} else {
|
|
519
|
+
if (this.props.fromDownload) {
|
|
520
|
+
this.props.time.elem.querySelector('.active-layer-time').click();
|
|
521
|
+
document.getElementById('products_label').click();
|
|
522
|
+
if (
|
|
523
|
+
!this.props.mapViewer.activeWidget ||
|
|
524
|
+
!this.props.mapViewer.activeWidget.container.current.classList.contains(
|
|
525
|
+
'area-container',
|
|
526
|
+
)
|
|
527
|
+
) {
|
|
528
|
+
document.getElementById('map_area_button').click();
|
|
529
|
+
}
|
|
513
530
|
}
|
|
514
531
|
}
|
|
515
532
|
}
|
|
516
533
|
|
|
517
|
-
handleInputChange(e) {
|
|
518
|
-
if (
|
|
519
|
-
this.setState({ inputStart: e
|
|
520
|
-
} else if (
|
|
521
|
-
this.setState({ inputEnd: e
|
|
534
|
+
handleInputChange(e, input) {
|
|
535
|
+
if (input === 'date_start') {
|
|
536
|
+
this.setState({ inputStart: this.formatDate(e) });
|
|
537
|
+
} else if (input === 'date_end') {
|
|
538
|
+
this.setState({ inputEnd: this.formatDate(e) });
|
|
522
539
|
}
|
|
523
540
|
}
|
|
524
541
|
|
|
@@ -576,8 +593,11 @@ class TimesliderWidget extends React.Component {
|
|
|
576
593
|
<FontAwesomeIcon icon={['fas', 'calendar']} />
|
|
577
594
|
{this.state.dateStart && this.state.dateEnd ? (
|
|
578
595
|
<>
|
|
579
|
-
{this.state.dateStart.toLocaleDateString(
|
|
580
|
-
|
|
596
|
+
{new Date(this.state.dateStart).toLocaleDateString(
|
|
597
|
+
'en-gb',
|
|
598
|
+
)}{' '}
|
|
599
|
+
-{' '}
|
|
600
|
+
{new Date(this.state.dateEnd).toLocaleDateString('en-gb')}{' '}
|
|
581
601
|
</>
|
|
582
602
|
) : (
|
|
583
603
|
<>Select temporal interval to download</>
|
|
@@ -604,12 +624,8 @@ class TimesliderWidget extends React.Component {
|
|
|
604
624
|
id="timeslider_calendar_close"
|
|
605
625
|
role="button"
|
|
606
626
|
tabIndex="0"
|
|
607
|
-
onClick={() =>
|
|
608
|
-
|
|
609
|
-
}}
|
|
610
|
-
onKeyDown={() => {
|
|
611
|
-
this.setState({ showCalendar: false });
|
|
612
|
-
}}
|
|
627
|
+
onClick={() => this.showCalendar()}
|
|
628
|
+
onKeyDown={() => this.showCalendar()}
|
|
613
629
|
></div>
|
|
614
630
|
</div>
|
|
615
631
|
<div className="timeslider-calendar-panel">
|
|
@@ -620,32 +636,46 @@ class TimesliderWidget extends React.Component {
|
|
|
620
636
|
)}
|
|
621
637
|
<div className="timeslider-calendar-row">
|
|
622
638
|
<label htmlFor="start">From</label>
|
|
623
|
-
<
|
|
624
|
-
type="date"
|
|
639
|
+
<DatePicker
|
|
625
640
|
id="date_start"
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
641
|
+
minDate={new Date(timeStart)}
|
|
642
|
+
maxDate={
|
|
643
|
+
new Date(
|
|
644
|
+
Date.parse(inputEnd) < Date.parse(timeEnd)
|
|
645
|
+
? inputEnd
|
|
646
|
+
: timeEnd,
|
|
647
|
+
)
|
|
631
648
|
}
|
|
632
|
-
|
|
633
|
-
onChange={(e) => this.handleInputChange(e)}
|
|
649
|
+
selected={new Date(inputStart)}
|
|
650
|
+
onChange={(e) => this.handleInputChange(e, 'date_start')}
|
|
651
|
+
includeDates={this.TimesliderWidget.stops.dates}
|
|
652
|
+
dateFormat="dd/MM/yyyy"
|
|
653
|
+
calendarStartDay={1}
|
|
654
|
+
showMonthDropdown
|
|
655
|
+
showYearDropdown
|
|
656
|
+
dropdownMode="select"
|
|
634
657
|
/>
|
|
635
658
|
</div>
|
|
636
659
|
<div className="timeslider-calendar-row">
|
|
637
660
|
<label htmlFor="start">To</label>
|
|
638
|
-
<
|
|
639
|
-
type="date"
|
|
661
|
+
<DatePicker
|
|
640
662
|
id="date_end"
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
663
|
+
minDate={
|
|
664
|
+
new Date(
|
|
665
|
+
Date.parse(inputStart) > Date.parse(timeStart)
|
|
666
|
+
? inputStart
|
|
667
|
+
: timeStart,
|
|
668
|
+
)
|
|
645
669
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
onChange={(e) => this.handleInputChange(e)}
|
|
670
|
+
maxDate={new Date(timeEnd)}
|
|
671
|
+
selected={new Date(inputEnd)}
|
|
672
|
+
onChange={(e) => this.handleInputChange(e, 'date_end')}
|
|
673
|
+
includeDates={this.TimesliderWidget.stops.dates}
|
|
674
|
+
dateFormat="dd/MM/yyyy"
|
|
675
|
+
calendarStartDay={1}
|
|
676
|
+
showMonthDropdown
|
|
677
|
+
showYearDropdown
|
|
678
|
+
dropdownMode="select"
|
|
649
679
|
/>
|
|
650
680
|
</div>
|
|
651
681
|
<button
|
|
@@ -926,8 +926,12 @@
|
|
|
926
926
|
flex: 1;
|
|
927
927
|
}
|
|
928
928
|
|
|
929
|
-
.timeslider-calendar-row
|
|
929
|
+
.timeslider-calendar-row .react-datepicker-wrapper {
|
|
930
930
|
flex: 3;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
.timeslider-calendar-row .react-datepicker-wrapper input {
|
|
934
|
+
width: 100%;
|
|
931
935
|
padding: 0.5rem;
|
|
932
936
|
border: 1px solid #dadada;
|
|
933
937
|
}
|
|
@@ -938,6 +942,48 @@
|
|
|
938
942
|
font-size: 0.875rem;
|
|
939
943
|
}
|
|
940
944
|
|
|
945
|
+
.react-datepicker__header {
|
|
946
|
+
background-color: #a0b128 !important;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
.react-datepicker__header select {
|
|
950
|
+
border: none;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
.react-datepicker__navigation {
|
|
954
|
+
width: auto !important;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.react-datepicker__navigation--previous {
|
|
958
|
+
margin-left: 0.5rem;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.react-datepicker__navigation--next {
|
|
962
|
+
margin-right: 0.5rem;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.react-datepicker__navigation-icon::before {
|
|
966
|
+
border-color: white !important;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.react-datepicker__header__dropdown {
|
|
970
|
+
margin-top: 0.25rem;
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
.react-datepicker__day--selected {
|
|
974
|
+
background-color: #a0b128 !important;
|
|
975
|
+
color: white !important;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
.react-datepicker__day--keyboard-selected {
|
|
979
|
+
background-color: #a0b12833 !important;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.react-datepicker__current-month,
|
|
983
|
+
.react-datepicker__day-name {
|
|
984
|
+
color: white !important;
|
|
985
|
+
}
|
|
986
|
+
|
|
941
987
|
/* Scale */
|
|
942
988
|
.esri-scale-bar {
|
|
943
989
|
z-index: 0;
|