@opengeoweb/core 4.8.0 → 4.10.0
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/index.esm.js +488 -367
- package/index.umd.js +529 -393
- package/lib/components/LayerManager/LayerContainerRow/LayerRow/ActivateLayer/ActivateLayer.d.ts +3 -5
- package/lib/components/LayerManager/LayerContainerRow/LayerRow/DragHandle/DragHandle.d.ts +1 -0
- package/lib/components/LayerManager/LayerManagerHeaderOptions.d.ts +4 -0
- package/lib/components/LayerManager/index.d.ts +1 -0
- package/lib/components/TimeSlider/TimeSlider.d.ts +7 -0
- package/lib/components/TimeSlider/TimeSliderButtons/AnimationLengthButton/AnimationLengthButton.d.ts +1 -2
- package/lib/components/TimeSlider/TimeSliderButtons/TimeSliderMenu/TimeSliderMenu.d.ts +3 -2
- package/lib/components/TimeSlider/TimeSliderButtons/TimeStepButton/TimeStepButton.d.ts +2 -1
- package/lib/components/TimeSlider/TimeSliderConnect.d.ts +2 -27
- package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBox.d.ts +1 -0
- package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxConnect.d.ts +2 -0
- package/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxRenderFunctions.d.ts +1 -1
- package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegend.d.ts +0 -1
- package/lib/components/TimeSlider/TimeSliderLegend/TimeSliderLegendConnect.d.ts +2 -57
- package/lib/components/TimeSlider/TimeSliderLegend/{TimeSliderLegendUtils.d.ts → timeSliderLegendUtils.d.ts} +0 -0
- package/lib/components/TimeSlider/TimeSliderLegend/{TimeSliderLegenedUtils.spec.d.ts → timeSliderLegenedUtils.spec.d.ts} +0 -0
- package/lib/components/TimeSlider/index.d.ts +1 -1
- package/lib/components/TimeSlider/{TimeSliderUtils.d.ts → timeSliderUtils.d.ts} +7 -1
- package/lib/components/TimeSlider/{TimeSliderUtils.spec.d.ts → timeSliderUtils.spec.d.ts} +0 -0
- package/lib/index.d.ts +2 -2
- package/lib/store/mapStore/layers/selectors.d.ts +11 -11
- package/lib/store/mapStore/layers/types.d.ts +0 -2
- package/lib/store/mapStore/map/types.d.ts +1 -1
- package/lib/store/mapStore/map/utils.d.ts +1 -1
- package/lib/store/mapStore/service/selectors.d.ts +4 -4
- package/lib/store/mapStore/service/types.d.ts +2 -12
- package/lib/utils/__mocks__/getCapabilities.d.ts +1 -1
- package/lib/utils/defaultTestSettings.d.ts +21 -1
- package/lib/utils/getCapabilities.d.ts +1 -17
- package/package.json +7 -7
package/index.umd.js
CHANGED
|
@@ -836,46 +836,66 @@
|
|
|
836
836
|
TimeInMinutes[TimeInMinutes["MONTH"] = 43800] = "MONTH";
|
|
837
837
|
TimeInMinutes[TimeInMinutes["DAY"] = 1440] = "DAY";
|
|
838
838
|
TimeInMinutes[TimeInMinutes["HOUR"] = 60] = "HOUR";
|
|
839
|
+
TimeInMinutes[TimeInMinutes["MINUTE"] = 1] = "MINUTE";
|
|
839
840
|
})(TimeInMinutes || (TimeInMinutes = {}));
|
|
841
|
+
/**
|
|
842
|
+
*
|
|
843
|
+
* @param minutes
|
|
844
|
+
* @returns the two highest values in the format yr(s) mo(s) d h m
|
|
845
|
+
*/
|
|
840
846
|
|
|
841
|
-
var minutesToDescribedDuration = function minutesToDescribedDuration(minutes) {
|
|
842
|
-
var dateStr = '';
|
|
843
|
-
var time = minutes; // subtracting whole years/months/days from time duration and adding the amount to the string to be printed.
|
|
844
|
-
|
|
845
|
-
if (time >= TimeInMinutes.YEAR) {
|
|
846
|
-
var yearsInMintues = Math.floor(time / TimeInMinutes.YEAR);
|
|
847
|
-
dateStr += yearsInMintues + "y";
|
|
848
|
-
time -= yearsInMintues * TimeInMinutes.YEAR;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
if (time >= TimeInMinutes.MONTH) {
|
|
852
|
-
var monthsInMinutes = Math.floor(time / TimeInMinutes.MONTH);
|
|
853
|
-
dateStr += monthsInMinutes + "m";
|
|
854
|
-
time -= monthsInMinutes * TimeInMinutes.MONTH;
|
|
855
|
-
}
|
|
856
847
|
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
848
|
+
var minutesToDescribedDuration = function minutesToDescribedDuration(minutes) {
|
|
849
|
+
var units = [{
|
|
850
|
+
label: 'yr',
|
|
851
|
+
value: TimeInMinutes.YEAR,
|
|
852
|
+
plural: 's'
|
|
853
|
+
}, {
|
|
854
|
+
label: 'mo',
|
|
855
|
+
value: TimeInMinutes.MONTH,
|
|
856
|
+
plural: 's'
|
|
857
|
+
}, {
|
|
858
|
+
label: 'd',
|
|
859
|
+
value: TimeInMinutes.DAY
|
|
860
|
+
}, {
|
|
861
|
+
label: 'h',
|
|
862
|
+
value: TimeInMinutes.HOUR
|
|
863
|
+
}, {
|
|
864
|
+
label: 'm',
|
|
865
|
+
value: TimeInMinutes.MINUTE
|
|
866
|
+
}];
|
|
867
|
+
var durations = units.reduce(function (units, duration) {
|
|
868
|
+
var min = units.min,
|
|
869
|
+
time = units.time,
|
|
870
|
+
count = units.count;
|
|
871
|
+
var label = duration.label,
|
|
872
|
+
value = duration.value,
|
|
873
|
+
_a = duration.plural,
|
|
874
|
+
plural = _a === void 0 ? '' : _a;
|
|
875
|
+
var unit = Math.floor(min / value);
|
|
876
|
+
|
|
877
|
+
if (unit > 0 && count < 2) {
|
|
878
|
+
return {
|
|
879
|
+
time: "" + time + unit + label + (unit > 1 ? plural : '') + " ",
|
|
880
|
+
min: min - unit * value,
|
|
881
|
+
count: count + 1
|
|
882
|
+
};
|
|
883
|
+
}
|
|
874
884
|
|
|
875
|
-
|
|
885
|
+
return {
|
|
886
|
+
min: min,
|
|
887
|
+
time: time,
|
|
888
|
+
count: count
|
|
889
|
+
};
|
|
890
|
+
}, {
|
|
891
|
+
min: minutes,
|
|
892
|
+
time: '',
|
|
893
|
+
count: 0
|
|
894
|
+
});
|
|
895
|
+
return durations.time.trim();
|
|
876
896
|
};
|
|
877
897
|
|
|
878
|
-
var
|
|
898
|
+
var timeSliderUtils = /*#__PURE__*/Object.freeze({
|
|
879
899
|
__proto__: null,
|
|
880
900
|
millisecondsInSecond: millisecondsInSecond,
|
|
881
901
|
defaultAnimationDelayAtStart: defaultAnimationDelayAtStart,
|
|
@@ -1172,7 +1192,7 @@
|
|
|
1172
1192
|
}
|
|
1173
1193
|
};
|
|
1174
1194
|
var getActiveLayerTimeStep = function getActiveLayerTimeStep(timeDimension) {
|
|
1175
|
-
return (timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.timeInterval) ? getTimeStepFromDataInterval(timeDimension.timeInterval) :
|
|
1195
|
+
return (timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.timeInterval) ? getTimeStepFromDataInterval(timeDimension.timeInterval) : undefined;
|
|
1176
1196
|
};
|
|
1177
1197
|
|
|
1178
1198
|
var utils = /*#__PURE__*/Object.freeze({
|
|
@@ -2838,11 +2858,11 @@
|
|
|
2838
2858
|
|
|
2839
2859
|
|
|
2840
2860
|
var getLayerById = function getLayerById(store, layerId) {
|
|
2841
|
-
if (store && store.layers && store.layers.byId[layerId]) {
|
|
2861
|
+
if (layerId && store && store.layers && store.layers.byId[layerId]) {
|
|
2842
2862
|
return store.layers.byId[layerId];
|
|
2843
2863
|
}
|
|
2844
2864
|
|
|
2845
|
-
return
|
|
2865
|
+
return undefined;
|
|
2846
2866
|
};
|
|
2847
2867
|
/**
|
|
2848
2868
|
* Retrieves all layers indexed by layerId
|
|
@@ -3742,7 +3762,7 @@
|
|
|
3742
3762
|
return null;
|
|
3743
3763
|
};
|
|
3744
3764
|
|
|
3745
|
-
|
|
3765
|
+
toolkit.createSelector(getSyncSourceBySourceId, function (store) {
|
|
3746
3766
|
return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
|
|
3747
3767
|
});
|
|
3748
3768
|
|
|
@@ -4642,7 +4662,7 @@
|
|
|
4642
4662
|
allServicesEnabled: true,
|
|
4643
4663
|
activeLayerInfo: {
|
|
4644
4664
|
name: '',
|
|
4645
|
-
|
|
4665
|
+
title: '',
|
|
4646
4666
|
leaf: true,
|
|
4647
4667
|
path: [],
|
|
4648
4668
|
serviceName: ''
|
|
@@ -4868,7 +4888,7 @@
|
|
|
4868
4888
|
return filterId.toLowerCase().includes(searchLowercase);
|
|
4869
4889
|
});
|
|
4870
4890
|
var isSearchTextInLayerName = (_a = layer.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchLowercase);
|
|
4871
|
-
var isSearchTextInLayerText = (_b = layer.
|
|
4891
|
+
var isSearchTextInLayerText = (_b = layer.title) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchLowercase);
|
|
4872
4892
|
var isSearchTextInLayerAbstract = (_c = layer["abstract"]) === null || _c === void 0 ? void 0 : _c.toLowerCase().includes(searchLowercase);
|
|
4873
4893
|
var isSearchTextInServiceName = mapStoreService.name.toLowerCase().includes(searchLowercase);
|
|
4874
4894
|
var isSearchTextInLayer = isSearchTextInLayerName || isSearchTextInLayerText || isSearchTextInLayerAbstract || isSearchTextInLayerFilter || isSearchTextInServiceName;
|
|
@@ -6563,7 +6583,7 @@
|
|
|
6563
6583
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
6564
6584
|
* */
|
|
6565
6585
|
var animationIntervalDefault = 5;
|
|
6566
|
-
var connectRedux$
|
|
6586
|
+
var connectRedux$3 = reactRedux.connect(function (store, props) {
|
|
6567
6587
|
return {
|
|
6568
6588
|
animationStartTime: getAnimationStartTime(store, props.mapId),
|
|
6569
6589
|
animationEndTime: getAnimationEndTime$1(store, props.mapId),
|
|
@@ -6574,7 +6594,7 @@
|
|
|
6574
6594
|
mapStartAnimation: mapActions$1.mapStartAnimation,
|
|
6575
6595
|
mapStopAnimation: mapActions$1.mapStopAnimation
|
|
6576
6596
|
});
|
|
6577
|
-
var PlayButtonConnect = connectRedux$
|
|
6597
|
+
var PlayButtonConnect = connectRedux$3(function (_a) {
|
|
6578
6598
|
var mapId = _a.mapId,
|
|
6579
6599
|
animationStartTime = _a.animationStartTime,
|
|
6580
6600
|
animationEndTime = _a.animationEndTime,
|
|
@@ -8300,12 +8320,12 @@
|
|
|
8300
8320
|
});
|
|
8301
8321
|
}
|
|
8302
8322
|
function setLayerDimensionsSaga(_a) {
|
|
8303
|
-
var layerDimensions, dimensions, layerId, layer, newTimeDimension, mapId, activeLayerId, shouldAutoUpdate, prevTimeDimension, isAnimating$1, webmapInstance, isActiveLayer, timeStep, newTimeStep, error_1;
|
|
8323
|
+
var layerDimensions, dimensions, layerId, layer, newTimeDimension, mapId, activeLayerId, shouldAutoUpdate, prevTimeDimension, isAnimating$1, webmapInstance, isActiveLayer, timeStep, isTimestepAuto$1, newTimeStep, error_1;
|
|
8304
8324
|
var payload = _a.payload;
|
|
8305
8325
|
return __generator(this, function (_b) {
|
|
8306
8326
|
switch (_b.label) {
|
|
8307
8327
|
case 0:
|
|
8308
|
-
_b.trys.push([0,
|
|
8328
|
+
_b.trys.push([0, 16,, 17]);
|
|
8309
8329
|
|
|
8310
8330
|
layerDimensions = payload.layerDimensions;
|
|
8311
8331
|
if (!layerDimensions) return [2
|
|
@@ -8357,13 +8377,19 @@
|
|
|
8357
8377
|
|
|
8358
8378
|
case 6:
|
|
8359
8379
|
timeStep = _b.sent();
|
|
8360
|
-
|
|
8380
|
+
return [4
|
|
8381
|
+
/*yield*/
|
|
8382
|
+
, effects.select(isTimestepAuto, mapId)];
|
|
8383
|
+
|
|
8384
|
+
case 7:
|
|
8385
|
+
isTimestepAuto$1 = _b.sent();
|
|
8386
|
+
if (!(isTimestepAuto$1 && isActiveLayer && timeStep === undefined && newTimeDimension)) return [3
|
|
8361
8387
|
/*break*/
|
|
8362
|
-
,
|
|
8388
|
+
, 9];
|
|
8363
8389
|
newTimeStep = getActiveLayerTimeStep(newTimeDimension);
|
|
8364
8390
|
if (!newTimeStep) return [3
|
|
8365
8391
|
/*break*/
|
|
8366
|
-
,
|
|
8392
|
+
, 9];
|
|
8367
8393
|
return [4
|
|
8368
8394
|
/*yield*/
|
|
8369
8395
|
, effects.put(mapActions$1.setTimeStep({
|
|
@@ -8371,19 +8397,19 @@
|
|
|
8371
8397
|
timeStep: newTimeStep
|
|
8372
8398
|
}))];
|
|
8373
8399
|
|
|
8374
|
-
case
|
|
8400
|
+
case 8:
|
|
8375
8401
|
_b.sent();
|
|
8376
8402
|
|
|
8377
|
-
_b.label =
|
|
8403
|
+
_b.label = 9;
|
|
8378
8404
|
|
|
8379
|
-
case
|
|
8405
|
+
case 9:
|
|
8380
8406
|
if (!(isActiveLayer && // only update the active layer
|
|
8381
8407
|
shouldAutoUpdate && newTimeDimension && newTimeDimension.maxValue && prevTimeDimension && prevTimeDimension.currentValue && prevTimeDimension.currentValue !== newTimeDimension.maxValue)) return [3
|
|
8382
8408
|
/*break*/
|
|
8383
|
-
,
|
|
8409
|
+
, 13];
|
|
8384
8410
|
if (!!isAnimating$1) return [3
|
|
8385
8411
|
/*break*/
|
|
8386
|
-
,
|
|
8412
|
+
, 11];
|
|
8387
8413
|
return [4
|
|
8388
8414
|
/*yield*/
|
|
8389
8415
|
, effects.put(layerActions.layerChangeDimension({
|
|
@@ -8395,50 +8421,50 @@
|
|
|
8395
8421
|
}
|
|
8396
8422
|
}))];
|
|
8397
8423
|
|
|
8398
|
-
case
|
|
8424
|
+
case 10:
|
|
8399
8425
|
_b.sent();
|
|
8400
8426
|
|
|
8401
|
-
_b.label =
|
|
8427
|
+
_b.label = 11;
|
|
8402
8428
|
|
|
8403
|
-
case
|
|
8429
|
+
case 11:
|
|
8404
8430
|
return [4
|
|
8405
8431
|
/*yield*/
|
|
8406
8432
|
, effects.call(updateAnimation, mapId, newTimeDimension.maxValue)];
|
|
8407
8433
|
|
|
8408
|
-
case
|
|
8434
|
+
case 12:
|
|
8409
8435
|
_b.sent();
|
|
8410
8436
|
|
|
8411
8437
|
return [3
|
|
8412
8438
|
/*break*/
|
|
8413
|
-
,
|
|
8439
|
+
, 15];
|
|
8414
8440
|
|
|
8415
|
-
case
|
|
8441
|
+
case 13:
|
|
8416
8442
|
if (!(isAnimating$1 && !webmapInstance.isAnimating && newTimeDimension && newTimeDimension.maxValue)) return [3
|
|
8417
8443
|
/*break*/
|
|
8418
|
-
,
|
|
8444
|
+
, 15];
|
|
8419
8445
|
return [4
|
|
8420
8446
|
/*yield*/
|
|
8421
8447
|
, effects.call(updateAnimation, mapId, newTimeDimension.maxValue)];
|
|
8422
8448
|
|
|
8423
|
-
case
|
|
8449
|
+
case 14:
|
|
8424
8450
|
_b.sent();
|
|
8425
8451
|
|
|
8426
|
-
_b.label =
|
|
8452
|
+
_b.label = 15;
|
|
8427
8453
|
|
|
8428
|
-
case
|
|
8454
|
+
case 15:
|
|
8429
8455
|
return [3
|
|
8430
8456
|
/*break*/
|
|
8431
|
-
,
|
|
8457
|
+
, 17];
|
|
8432
8458
|
|
|
8433
|
-
case
|
|
8459
|
+
case 16:
|
|
8434
8460
|
error_1 = _b.sent(); // eslint-disable-next-line no-console
|
|
8435
8461
|
|
|
8436
8462
|
console.warn(error_1);
|
|
8437
8463
|
return [3
|
|
8438
8464
|
/*break*/
|
|
8439
|
-
,
|
|
8465
|
+
, 17];
|
|
8440
8466
|
|
|
8441
|
-
case
|
|
8467
|
+
case 17:
|
|
8442
8468
|
return [2
|
|
8443
8469
|
/*return*/
|
|
8444
8470
|
];
|
|
@@ -9308,8 +9334,8 @@
|
|
|
9308
9334
|
case 11:
|
|
9309
9335
|
dialogInfo = _c.sent();
|
|
9310
9336
|
if (!!filteredLayers.map(function (layer) {
|
|
9311
|
-
return layer.
|
|
9312
|
-
}).includes(dialogInfo.
|
|
9337
|
+
return layer.title;
|
|
9338
|
+
}).includes(dialogInfo.title)) return [3
|
|
9313
9339
|
/*break*/
|
|
9314
9340
|
, 13];
|
|
9315
9341
|
return [4
|
|
@@ -10238,7 +10264,7 @@
|
|
|
10238
10264
|
currentIndex: layers.length,
|
|
10239
10265
|
extendedLayers: __spreadArray(__spreadArray([], __read(layers)), [{
|
|
10240
10266
|
name: layerName,
|
|
10241
|
-
|
|
10267
|
+
title: layerName,
|
|
10242
10268
|
leaf: true,
|
|
10243
10269
|
path: []
|
|
10244
10270
|
}])
|
|
@@ -10301,7 +10327,7 @@
|
|
|
10301
10327
|
});
|
|
10302
10328
|
return /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
|
|
10303
10329
|
disableUnderline: true,
|
|
10304
|
-
tooltip: "Layer: " + ((_b = extendedLayers[currentIndex]) === null || _b === void 0 ? void 0 : _b.
|
|
10330
|
+
tooltip: "Layer: " + ((_b = extendedLayers[currentIndex]) === null || _b === void 0 ? void 0 : _b.title),
|
|
10305
10331
|
inputProps: {
|
|
10306
10332
|
SelectDisplayProps: {
|
|
10307
10333
|
'data-testid': 'selectLayer'
|
|
@@ -10319,7 +10345,7 @@
|
|
|
10319
10345
|
renderValue: function renderValue(value) {
|
|
10320
10346
|
return extendedLayers.find(function (layer) {
|
|
10321
10347
|
return layer.name === value;
|
|
10322
|
-
}).
|
|
10348
|
+
}).title;
|
|
10323
10349
|
}
|
|
10324
10350
|
}, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
|
|
10325
10351
|
disabled: true
|
|
@@ -10333,7 +10359,7 @@
|
|
|
10333
10359
|
marginLeft: '28px'
|
|
10334
10360
|
}
|
|
10335
10361
|
}
|
|
10336
|
-
}, layerFromServiceLayers.
|
|
10362
|
+
}, layerFromServiceLayers.title, currentIndex === layers.length && /*#__PURE__*/React__namespace.createElement(shared.AlertIcon, {
|
|
10337
10363
|
severity: "error"
|
|
10338
10364
|
}));
|
|
10339
10365
|
}));
|
|
@@ -10589,7 +10615,6 @@
|
|
|
10589
10615
|
return currentStyle === style.name;
|
|
10590
10616
|
});
|
|
10591
10617
|
return /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
|
|
10592
|
-
disableUnderline: true,
|
|
10593
10618
|
tooltip: "Style: " + ((_b = styles[currentIndex]) === null || _b === void 0 ? void 0 : _b.title),
|
|
10594
10619
|
inputProps: {
|
|
10595
10620
|
SelectDisplayProps: {
|
|
@@ -10632,51 +10657,108 @@
|
|
|
10632
10657
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10633
10658
|
* */
|
|
10634
10659
|
|
|
10635
|
-
var
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
return 'common.white';
|
|
10640
|
-
}
|
|
10660
|
+
var getIconColor = function getIconColor(isActive, isEnabled) {
|
|
10661
|
+
if (isActive) {
|
|
10662
|
+
return 'common.white';
|
|
10663
|
+
}
|
|
10641
10664
|
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10665
|
+
if (isEnabled) {
|
|
10666
|
+
return 'geowebColors.buttons.flat.default.color';
|
|
10667
|
+
}
|
|
10645
10668
|
|
|
10646
|
-
|
|
10647
|
-
}
|
|
10648
|
-
};
|
|
10669
|
+
return 'geowebColors.buttons.flat.disabled.color';
|
|
10649
10670
|
};
|
|
10650
10671
|
|
|
10651
10672
|
var ActivateLayer = function ActivateLayer(_a) {
|
|
10652
|
-
var
|
|
10653
|
-
|
|
10654
|
-
|
|
10655
|
-
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10673
|
+
var _onChange = _a.onChange,
|
|
10674
|
+
isActive = _a.isActive,
|
|
10675
|
+
isEnabled = _a.isEnabled;
|
|
10676
|
+
return /*#__PURE__*/React__namespace.createElement(shared.TooltipSelect, {
|
|
10677
|
+
variant: "standard",
|
|
10678
|
+
tooltip: "Auto update",
|
|
10679
|
+
// Don't show arrow https://stackoverflow.com/questions/69085735/how-to-remove-arrow-from-react-textfield-select
|
|
10680
|
+
inputProps: {
|
|
10681
|
+
IconComponent: function IconComponent() {
|
|
10682
|
+
return null;
|
|
10683
|
+
}
|
|
10684
|
+
},
|
|
10685
|
+
value: isActive ? 'Both' : 'None',
|
|
10686
|
+
sx: {
|
|
10687
|
+
'&& .MuiOutlinedInput-input': {
|
|
10688
|
+
padding: '0'
|
|
10689
|
+
},
|
|
10690
|
+
'&&& .MuiInput-input': {
|
|
10691
|
+
paddingRight: 0
|
|
10692
|
+
}
|
|
10693
|
+
},
|
|
10694
|
+
renderValue: function renderValue(optionSelected) {
|
|
10695
|
+
return /*#__PURE__*/React__namespace.createElement(AutoUpdateButton$1, {
|
|
10696
|
+
optionSelected: optionSelected,
|
|
10697
|
+
isActive: isActive,
|
|
10698
|
+
isEnabled: isEnabled
|
|
10699
|
+
});
|
|
10700
|
+
},
|
|
10701
|
+
onChange: function onChange(event) {
|
|
10702
|
+
event.stopPropagation();
|
|
10662
10703
|
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10704
|
+
_onChange(event.target.value === 'Both');
|
|
10705
|
+
},
|
|
10706
|
+
onClose: function onClose(event) {
|
|
10707
|
+
event.stopPropagation();
|
|
10708
|
+
}
|
|
10709
|
+
}, /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
|
|
10710
|
+
disabled: true
|
|
10711
|
+
}, "Auto-update"), /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
|
|
10712
|
+
value: "None"
|
|
10713
|
+
}, /*#__PURE__*/React__namespace.createElement(AutoOption, {
|
|
10714
|
+
icon: /*#__PURE__*/React__namespace.createElement(theme.None, null),
|
|
10715
|
+
text: "None"
|
|
10716
|
+
})), /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
|
|
10717
|
+
value: "Both"
|
|
10718
|
+
}, /*#__PURE__*/React__namespace.createElement(AutoOption, {
|
|
10719
|
+
icon: /*#__PURE__*/React__namespace.createElement(theme.Both, null),
|
|
10720
|
+
text: "Both"
|
|
10721
|
+
})));
|
|
10722
|
+
};
|
|
10667
10723
|
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10724
|
+
var AutoUpdateButton$1 = function AutoUpdateButton(_a) {
|
|
10725
|
+
var optionSelected = _a.optionSelected,
|
|
10726
|
+
isActive = _a.isActive,
|
|
10727
|
+
isEnabled = _a.isEnabled;
|
|
10728
|
+
var style = {
|
|
10729
|
+
backgroundColor: isActive ? 'geowebColors.buttons.primary.active.fill' : 'transparent!important',
|
|
10730
|
+
borderRadius: '5px',
|
|
10731
|
+
color: getIconColor(isActive, isEnabled)
|
|
10732
|
+
};
|
|
10733
|
+
var Icon = isActive ? /*#__PURE__*/React__namespace.createElement(theme.Both, {
|
|
10734
|
+
sx: style
|
|
10735
|
+
}) : /*#__PURE__*/React__namespace.createElement(theme.None, {
|
|
10736
|
+
sx: style
|
|
10679
10737
|
});
|
|
10738
|
+
return /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
|
|
10739
|
+
"data-testid": "activateLayer-btn",
|
|
10740
|
+
"aria-label": "Auto update " + optionSelected,
|
|
10741
|
+
sx: {
|
|
10742
|
+
'&.MuiButtonBase-root': {
|
|
10743
|
+
backgroundColor: 'transparent'
|
|
10744
|
+
}
|
|
10745
|
+
}
|
|
10746
|
+
}, Icon);
|
|
10747
|
+
};
|
|
10748
|
+
|
|
10749
|
+
var AutoOption = function AutoOption(_a) {
|
|
10750
|
+
var icon = _a.icon,
|
|
10751
|
+
text = _a.text;
|
|
10752
|
+
return /*#__PURE__*/React__namespace.createElement(material.Box, {
|
|
10753
|
+
sx: {
|
|
10754
|
+
display: 'flex',
|
|
10755
|
+
alignItems: 'center'
|
|
10756
|
+
}
|
|
10757
|
+
}, /*#__PURE__*/React__namespace.createElement(material.ListItemText, {
|
|
10758
|
+
sx: {
|
|
10759
|
+
width: '112px'
|
|
10760
|
+
}
|
|
10761
|
+
}, text), /*#__PURE__*/React__namespace.createElement(material.ListItemIcon, null, icon));
|
|
10680
10762
|
};
|
|
10681
10763
|
|
|
10682
10764
|
/* *
|
|
@@ -10742,8 +10824,8 @@
|
|
|
10742
10824
|
borderRadius: 1,
|
|
10743
10825
|
marginBottom: 0.5,
|
|
10744
10826
|
minHeight: '34px',
|
|
10745
|
-
'&.sortable-
|
|
10746
|
-
boxShadow:
|
|
10827
|
+
'&.sortable-chosen': {
|
|
10828
|
+
boxShadow: 1
|
|
10747
10829
|
},
|
|
10748
10830
|
'&.sortable-ghost': {
|
|
10749
10831
|
opacity: 0.5
|
|
@@ -10775,8 +10857,9 @@
|
|
|
10775
10857
|
},
|
|
10776
10858
|
id: "enableButton-medium"
|
|
10777
10859
|
}), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
|
|
10778
|
-
|
|
10779
|
-
|
|
10860
|
+
onChange: onClickRow,
|
|
10861
|
+
isActive: false,
|
|
10862
|
+
isEnabled: true
|
|
10780
10863
|
}), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
|
|
10781
10864
|
sx: {
|
|
10782
10865
|
fontWeight: '500',
|
|
@@ -10798,7 +10881,7 @@
|
|
|
10798
10881
|
}, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
10799
10882
|
item: true
|
|
10800
10883
|
}, "Style"), layerStylesLayout || /*#__PURE__*/React__default["default"].createElement(RenderStyles, {
|
|
10801
|
-
layerStyles:
|
|
10884
|
+
layerStyles: [],
|
|
10802
10885
|
currentLayerStyle: layer.style,
|
|
10803
10886
|
onChangeLayerStyle: function onChangeLayerStyle(style) {
|
|
10804
10887
|
onLayerChangeStyle({
|
|
@@ -10855,7 +10938,9 @@
|
|
|
10855
10938
|
});
|
|
10856
10939
|
}
|
|
10857
10940
|
}), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
|
|
10858
|
-
|
|
10941
|
+
onChange: onClickRow,
|
|
10942
|
+
isActive: false,
|
|
10943
|
+
isEnabled: true
|
|
10859
10944
|
})), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
10860
10945
|
item: true,
|
|
10861
10946
|
className: columnClasses.column2
|
|
@@ -10878,7 +10963,7 @@
|
|
|
10878
10963
|
item: true,
|
|
10879
10964
|
className: columnClasses.column3
|
|
10880
10965
|
}, layerStylesLayout || /*#__PURE__*/React__default["default"].createElement(RenderStyles, {
|
|
10881
|
-
layerStyles:
|
|
10966
|
+
layerStyles: [],
|
|
10882
10967
|
currentLayerStyle: layer.style,
|
|
10883
10968
|
onChangeLayerStyle: function onChangeLayerStyle(style) {
|
|
10884
10969
|
onLayerChangeStyle({
|
|
@@ -11212,7 +11297,7 @@
|
|
|
11212
11297
|
var newLayerTreeObj = {
|
|
11213
11298
|
leaf: nodesToRecur.leaf,
|
|
11214
11299
|
name: nodesToRecur.name,
|
|
11215
|
-
title: nodesToRecur.
|
|
11300
|
+
title: nodesToRecur.title,
|
|
11216
11301
|
path: nodesToRecur.path || [],
|
|
11217
11302
|
children: [],
|
|
11218
11303
|
keywords: nodesToRecur.keywords || [],
|
|
@@ -11478,11 +11563,10 @@
|
|
|
11478
11563
|
}, [dispatch]);
|
|
11479
11564
|
var isActive = activeLayerId === layerId;
|
|
11480
11565
|
return /*#__PURE__*/React__namespace.createElement(ActivateLayer, {
|
|
11481
|
-
|
|
11482
|
-
onClickActivate: function onClickActivate() {
|
|
11566
|
+
onChange: function onChange(isActive) {
|
|
11483
11567
|
setActiveLayerId({
|
|
11484
11568
|
mapId: mapId,
|
|
11485
|
-
layerId: layerId
|
|
11569
|
+
layerId: isActive ? layerId : undefined
|
|
11486
11570
|
});
|
|
11487
11571
|
|
|
11488
11572
|
if (isAutoUpdating$1) {
|
|
@@ -11530,7 +11614,7 @@
|
|
|
11530
11614
|
});
|
|
11531
11615
|
var fullLayerName = ((_b = reactRedux.useSelector(function (store) {
|
|
11532
11616
|
return getLayerFromService(store, layerService, layerName);
|
|
11533
|
-
})) === null || _b === void 0 ? void 0 : _b.
|
|
11617
|
+
})) === null || _b === void 0 ? void 0 : _b.title) || '';
|
|
11534
11618
|
var layers = reactRedux.useSelector(function (store) {
|
|
11535
11619
|
return getLayersFromService$1(store, layerService);
|
|
11536
11620
|
});
|
|
@@ -11606,7 +11690,9 @@
|
|
|
11606
11690
|
_c = _a.index,
|
|
11607
11691
|
index = _c === void 0 ? undefined : _c,
|
|
11608
11692
|
_d = _a.hideTooltip,
|
|
11609
|
-
hideTooltip = _d === void 0 ? false : _d
|
|
11693
|
+
hideTooltip = _d === void 0 ? false : _d,
|
|
11694
|
+
_e = _a.isSorting,
|
|
11695
|
+
isSorting = _e === void 0 ? false : _e;
|
|
11610
11696
|
var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
|
|
11611
11697
|
return /*#__PURE__*/React__default["default"].createElement(shared.ManagerButton, {
|
|
11612
11698
|
tooltipTitle: tooltipTitle,
|
|
@@ -11620,7 +11706,7 @@
|
|
|
11620
11706
|
disabled: isDisabled,
|
|
11621
11707
|
isAccessible: true,
|
|
11622
11708
|
sx: {
|
|
11623
|
-
cursor: 'grab',
|
|
11709
|
+
cursor: isSorting ? 'grabbing' : 'grab',
|
|
11624
11710
|
'&:hover': {
|
|
11625
11711
|
backgroundColor: 'inherit!important'
|
|
11626
11712
|
},
|
|
@@ -11682,7 +11768,7 @@
|
|
|
11682
11768
|
var onStart = React__namespace.useCallback(function (_a) {
|
|
11683
11769
|
var oldIndex = _a.oldIndex;
|
|
11684
11770
|
setActiveDragIndex(oldIndex);
|
|
11685
|
-
Sortable__default["default"].ghost.style.opacity = '1';
|
|
11771
|
+
if (Sortable__default["default"].ghost) Sortable__default["default"].ghost.style.opacity = '1';
|
|
11686
11772
|
}, []);
|
|
11687
11773
|
var onEnd = React__namespace.useCallback(function () {
|
|
11688
11774
|
if (activeDragIndex !== null) {
|
|
@@ -11762,12 +11848,11 @@
|
|
|
11762
11848
|
handle: ".handle",
|
|
11763
11849
|
direction: "vertical",
|
|
11764
11850
|
// hover props
|
|
11765
|
-
forceFallback:
|
|
11851
|
+
forceFallback: false,
|
|
11766
11852
|
onStart: onStart,
|
|
11767
11853
|
onEnd: onEnd,
|
|
11768
11854
|
style: {
|
|
11769
|
-
width: '100%'
|
|
11770
|
-
cursor: isSorting ? 'grabbing' : 'inherit'
|
|
11855
|
+
width: '100%'
|
|
11771
11856
|
}
|
|
11772
11857
|
}, layerIds.map(function (layerId, index) {
|
|
11773
11858
|
return /*#__PURE__*/React__namespace.createElement(LayerRowConnect, {
|
|
@@ -11778,7 +11863,8 @@
|
|
|
11778
11863
|
dragHandle: /*#__PURE__*/React__namespace.createElement(DragHandle, {
|
|
11779
11864
|
isDisabled: isDragDisabled,
|
|
11780
11865
|
index: index,
|
|
11781
|
-
hideTooltip: isSorting || isDragDisabled
|
|
11866
|
+
hideTooltip: isSorting || isDragDisabled,
|
|
11867
|
+
isSorting: isSorting
|
|
11782
11868
|
})
|
|
11783
11869
|
});
|
|
11784
11870
|
})));
|
|
@@ -12244,7 +12330,7 @@
|
|
|
12244
12330
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
12245
12331
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
12246
12332
|
* */
|
|
12247
|
-
var connectRedux$
|
|
12333
|
+
var connectRedux$2 = reactRedux.connect(function (store, props) {
|
|
12248
12334
|
return {
|
|
12249
12335
|
loadedLayers: getMapLayers(store, props.mapId)
|
|
12250
12336
|
};
|
|
@@ -12308,7 +12394,7 @@
|
|
|
12308
12394
|
});
|
|
12309
12395
|
};
|
|
12310
12396
|
|
|
12311
|
-
var WMSLayerTreeConnect = connectRedux$
|
|
12397
|
+
var WMSLayerTreeConnect = connectRedux$2(ConnectedTree);
|
|
12312
12398
|
|
|
12313
12399
|
var preset = {
|
|
12314
12400
|
presetType: "mapPreset",
|
|
@@ -13951,7 +14037,7 @@
|
|
|
13951
14037
|
}
|
|
13952
14038
|
}, /*#__PURE__*/React__default["default"].createElement(LayerInfoText, {
|
|
13953
14039
|
label: "Title",
|
|
13954
|
-
value: layer.
|
|
14040
|
+
value: layer.title
|
|
13955
14041
|
}), /*#__PURE__*/React__default["default"].createElement(LayerInfoText, {
|
|
13956
14042
|
label: "Name",
|
|
13957
14043
|
value: layer.name
|
|
@@ -13977,7 +14063,7 @@
|
|
|
13977
14063
|
label: "Keywords",
|
|
13978
14064
|
value: ((_b = layer.keywords) === null || _b === void 0 ? void 0 : _b.join(', ')) || '-'
|
|
13979
14065
|
}), /*#__PURE__*/React__default["default"].createElement(LayerInfoLegend, {
|
|
13980
|
-
title: layer.
|
|
14066
|
+
title: layer.title,
|
|
13981
14067
|
name: layer.name,
|
|
13982
14068
|
dimensions: layer.dimensions,
|
|
13983
14069
|
legendURL: ((_c = layer.styles) === null || _c === void 0 ? void 0 : _c.length) ? layer.styles[0].legendURL : undefined
|
|
@@ -14263,7 +14349,7 @@
|
|
|
14263
14349
|
overflow: 'hidden'
|
|
14264
14350
|
}
|
|
14265
14351
|
}, /*#__PURE__*/React__default["default"].createElement(SearchHighlight, {
|
|
14266
|
-
text: layer.
|
|
14352
|
+
text: layer.title,
|
|
14267
14353
|
search: searchFilter
|
|
14268
14354
|
}))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
14269
14355
|
item: true,
|
|
@@ -17231,7 +17317,8 @@
|
|
|
17231
17317
|
icon = _a.icon,
|
|
17232
17318
|
_b = _a.onChangeMouseWheel,
|
|
17233
17319
|
onChangeMouseWheel = _b === void 0 ? function () {} : _b,
|
|
17234
|
-
|
|
17320
|
+
displayVariableDuration = _a.displayVariableDuration,
|
|
17321
|
+
layerHasTimeStep = _a.layerHasTimeStep;
|
|
17235
17322
|
var currentMarkIndex = marks.findIndex(function (mark) {
|
|
17236
17323
|
return mark.value === value;
|
|
17237
17324
|
});
|
|
@@ -17271,11 +17358,12 @@
|
|
|
17271
17358
|
},
|
|
17272
17359
|
ref: setAnchorRef,
|
|
17273
17360
|
active: true,
|
|
17274
|
-
width: "
|
|
17361
|
+
width: "100%",
|
|
17275
17362
|
onWheel: onWheel
|
|
17276
|
-
}, icon, /*#__PURE__*/React__namespace.createElement(
|
|
17277
|
-
|
|
17278
|
-
|
|
17363
|
+
}, icon, /*#__PURE__*/React__namespace.createElement(material.Typography, {
|
|
17364
|
+
fontSize: 12,
|
|
17365
|
+
fontWeight: 400
|
|
17366
|
+
}, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
|
|
17279
17367
|
anchorEl: anchorRef,
|
|
17280
17368
|
open: open,
|
|
17281
17369
|
onClose: function onClose() {
|
|
@@ -17311,7 +17399,7 @@
|
|
|
17311
17399
|
setOpen(false);
|
|
17312
17400
|
},
|
|
17313
17401
|
key: mark.value,
|
|
17314
|
-
selected: (currentMark === null || currentMark === void 0 ? void 0 : currentMark.value) === mark.value,
|
|
17402
|
+
selected: (currentMark === null || currentMark === void 0 ? void 0 : currentMark.value) === mark.value && !isAutoSelected,
|
|
17315
17403
|
disabled: isDisabled
|
|
17316
17404
|
}, mark.label || mark.text);
|
|
17317
17405
|
}), handleAutoClick && /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
|
|
@@ -17320,8 +17408,8 @@
|
|
|
17320
17408
|
setOpen(false);
|
|
17321
17409
|
},
|
|
17322
17410
|
selected: isAutoSelected,
|
|
17323
|
-
disabled: isDisabled
|
|
17324
|
-
}, "Auto"),
|
|
17411
|
+
disabled: isDisabled || !layerHasTimeStep
|
|
17412
|
+
}, "Auto"), displayVariableDuration && /*#__PURE__*/React__namespace.createElement(material.MenuItem, {
|
|
17325
17413
|
disabled: true,
|
|
17326
17414
|
sx: {
|
|
17327
17415
|
fontSize: '12px',
|
|
@@ -17331,12 +17419,12 @@
|
|
|
17331
17419
|
minHeight: '30px!important'
|
|
17332
17420
|
}
|
|
17333
17421
|
}
|
|
17334
|
-
}, "length"),
|
|
17422
|
+
}, "length"), displayVariableDuration && /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
|
|
17335
17423
|
"data-testid": "menu-animation-length-button",
|
|
17336
17424
|
active: false,
|
|
17337
17425
|
disableRipple: true,
|
|
17338
17426
|
width: "100%"
|
|
17339
|
-
}, minutesToDescribedDuration(
|
|
17427
|
+
}, minutesToDescribedDuration(value))));
|
|
17340
17428
|
};
|
|
17341
17429
|
|
|
17342
17430
|
/* *
|
|
@@ -17468,16 +17556,16 @@
|
|
|
17468
17556
|
text: '2w'
|
|
17469
17557
|
}, {
|
|
17470
17558
|
label: '1 month',
|
|
17471
|
-
value:
|
|
17472
|
-
text: '
|
|
17559
|
+
value: 43800,
|
|
17560
|
+
text: '1mo'
|
|
17473
17561
|
}, {
|
|
17474
17562
|
label: '2 months',
|
|
17475
|
-
value:
|
|
17476
|
-
text: '
|
|
17563
|
+
value: 87600,
|
|
17564
|
+
text: '2mos'
|
|
17477
17565
|
}, {
|
|
17478
17566
|
label: '6 months',
|
|
17479
|
-
value:
|
|
17480
|
-
text: '
|
|
17567
|
+
value: 262800,
|
|
17568
|
+
text: '6mos'
|
|
17481
17569
|
}, {
|
|
17482
17570
|
label: '1 year',
|
|
17483
17571
|
value: 525600,
|
|
@@ -17492,15 +17580,17 @@
|
|
|
17492
17580
|
var timeStepTitle = 'Time step';
|
|
17493
17581
|
|
|
17494
17582
|
var TimeStepButton = function TimeStepButton(_a) {
|
|
17495
|
-
var
|
|
17496
|
-
|
|
17497
|
-
|
|
17583
|
+
var _b = _a.timeStep,
|
|
17584
|
+
timeStep = _b === void 0 ? marks$2[0].value : _b,
|
|
17585
|
+
_c = _a.disabled,
|
|
17586
|
+
disabled = _c === void 0 ? false : _c,
|
|
17498
17587
|
isTimestepAuto = _a.isTimestepAuto,
|
|
17499
17588
|
onChangeTimeStep = _a.onChangeTimeStep,
|
|
17500
|
-
|
|
17501
|
-
onToggleTimestepAuto =
|
|
17502
|
-
|
|
17503
|
-
isOpenByDefault =
|
|
17589
|
+
_d = _a.onToggleTimestepAuto,
|
|
17590
|
+
onToggleTimestepAuto = _d === void 0 ? function () {} : _d,
|
|
17591
|
+
_e = _a.isOpenByDefault,
|
|
17592
|
+
isOpenByDefault = _e === void 0 ? false : _e,
|
|
17593
|
+
timeStepFromLayer = _a.timeStepFromLayer;
|
|
17504
17594
|
|
|
17505
17595
|
var handleMenuItemClick = function handleMenuItemClick(mark) {
|
|
17506
17596
|
if (isTimestepAuto) {
|
|
@@ -17510,6 +17600,12 @@
|
|
|
17510
17600
|
onChangeTimeStep(mark.value, MapActionOrigin.map);
|
|
17511
17601
|
};
|
|
17512
17602
|
|
|
17603
|
+
var handleToggleTimeStep = function handleToggleTimeStep() {
|
|
17604
|
+
if (isTimestepAuto) return;
|
|
17605
|
+
onToggleTimestepAuto();
|
|
17606
|
+
timeStepFromLayer && onChangeTimeStep(timeStepFromLayer, MapActionOrigin.map);
|
|
17607
|
+
};
|
|
17608
|
+
|
|
17513
17609
|
return /*#__PURE__*/React__namespace.createElement(TimeSliderMenu, {
|
|
17514
17610
|
title: timeStepTitle,
|
|
17515
17611
|
isOpenByDefault: isOpenByDefault,
|
|
@@ -17518,9 +17614,11 @@
|
|
|
17518
17614
|
handleMenuItemClick: handleMenuItemClick,
|
|
17519
17615
|
isDisabled: disabled,
|
|
17520
17616
|
isAutoSelected: isTimestepAuto,
|
|
17521
|
-
handleAutoClick:
|
|
17617
|
+
handleAutoClick: handleToggleTimeStep,
|
|
17522
17618
|
icon: /*#__PURE__*/React__namespace.createElement(theme.FastForward, null),
|
|
17523
|
-
onChangeMouseWheel: handleMenuItemClick
|
|
17619
|
+
onChangeMouseWheel: handleMenuItemClick,
|
|
17620
|
+
displayVariableDuration: true,
|
|
17621
|
+
layerHasTimeStep: Boolean(timeStepFromLayer)
|
|
17524
17622
|
});
|
|
17525
17623
|
};
|
|
17526
17624
|
|
|
@@ -17704,7 +17802,6 @@
|
|
|
17704
17802
|
disabled = _b === void 0 ? false : _b,
|
|
17705
17803
|
_c = _a.animationLength,
|
|
17706
17804
|
animationLength = _c === void 0 ? AnimationLength.Hours1 : _c,
|
|
17707
|
-
animationLengthInMinutes = _a.animationLengthInMinutes,
|
|
17708
17805
|
onChangeAnimationLength = _a.onChangeAnimationLength;
|
|
17709
17806
|
|
|
17710
17807
|
var onChangeSliderValue = function onChangeSliderValue(mark) {
|
|
@@ -17724,7 +17821,7 @@
|
|
|
17724
17821
|
isDisabled: disabled,
|
|
17725
17822
|
value: animationLength,
|
|
17726
17823
|
onChangeMouseWheel: onChangeSliderValue,
|
|
17727
|
-
|
|
17824
|
+
displayVariableDuration: true
|
|
17728
17825
|
});
|
|
17729
17826
|
};
|
|
17730
17827
|
|
|
@@ -17772,7 +17869,6 @@
|
|
|
17772
17869
|
item: true,
|
|
17773
17870
|
xs: "auto"
|
|
17774
17871
|
}, timeStepBtn || /*#__PURE__*/React__default["default"].createElement(TimeStepButton, {
|
|
17775
|
-
timeStep: 0,
|
|
17776
17872
|
onChangeTimeStep: function onChangeTimeStep() {},
|
|
17777
17873
|
isTimestepAuto: false
|
|
17778
17874
|
})), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
|
|
@@ -19004,34 +19100,6 @@
|
|
|
19004
19100
|
};
|
|
19005
19101
|
}
|
|
19006
19102
|
|
|
19007
|
-
function useHandleKeyDown(mapIsActive, timeStep, dataStartTime, dataEndTime, currentTime, onSetNewDate, onSetCenterTime, selectedTime) {
|
|
19008
|
-
var curTime = selectedTime !== undefined ? moment__default["default"].unix(selectedTime).toISOString() : moment__default["default"].utc().toISOString();
|
|
19009
|
-
React__namespace.useEffect(function () {
|
|
19010
|
-
var handleKeyDown = function handleKeyDown(event) {
|
|
19011
|
-
if (event.key === 'Home' && mapIsActive) {
|
|
19012
|
-
handleSetNowEvent(timeStep, dataStartTime, dataEndTime, currentTime, onSetNewDate, onSetCenterTime);
|
|
19013
|
-
}
|
|
19014
|
-
|
|
19015
|
-
if (event.ctrlKey && dataStartTime && dataEndTime && mapIsActive) {
|
|
19016
|
-
switch (event.code) {
|
|
19017
|
-
case 'ArrowLeft':
|
|
19018
|
-
setPreviousTimeStep(timeStep, curTime, dataStartTime, onSetNewDate);
|
|
19019
|
-
break;
|
|
19020
|
-
|
|
19021
|
-
case 'ArrowRight':
|
|
19022
|
-
setNextTimeStep(timeStep, curTime, dataEndTime, onSetNewDate);
|
|
19023
|
-
break;
|
|
19024
|
-
}
|
|
19025
|
-
}
|
|
19026
|
-
};
|
|
19027
|
-
|
|
19028
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
19029
|
-
return function () {
|
|
19030
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
19031
|
-
};
|
|
19032
|
-
}, [curTime, currentTime, dataEndTime, dataStartTime, mapIsActive, onSetCenterTime, onSetNewDate, timeStep]);
|
|
19033
|
-
}
|
|
19034
|
-
|
|
19035
19103
|
function convertStringTimeToUnix(time) {
|
|
19036
19104
|
return time ? moment__default["default"].utc(time).unix() : undefined;
|
|
19037
19105
|
} // Explanation of props can be found here:
|
|
@@ -19053,54 +19121,51 @@
|
|
|
19053
19121
|
animationStartTime = _a.animationStartTime,
|
|
19054
19122
|
animationEndTime = _a.animationEndTime,
|
|
19055
19123
|
timeStep = _a.timeStep,
|
|
19056
|
-
_d = _a.mapIsActive,
|
|
19057
|
-
mapIsActive = _d === void 0 ? true : _d,
|
|
19058
19124
|
unfilteredSelectedTime = _a.unfilteredSelectedTime,
|
|
19059
19125
|
setUnfilteredSelectedTime = _a.setUnfilteredSelectedTime,
|
|
19060
|
-
|
|
19061
|
-
onSetNewDate =
|
|
19062
|
-
|
|
19063
|
-
onSetCenterTime =
|
|
19064
|
-
|
|
19065
|
-
onSetAnimationStartTime =
|
|
19066
|
-
|
|
19067
|
-
onSetAnimationEndTime =
|
|
19068
|
-
|
|
19069
|
-
|
|
19070
|
-
|
|
19071
|
-
|
|
19072
|
-
|
|
19073
|
-
|
|
19074
|
-
|
|
19075
|
-
|
|
19126
|
+
_d = _a.onSetNewDate,
|
|
19127
|
+
onSetNewDate = _d === void 0 ? function () {} : _d,
|
|
19128
|
+
_e = _a.onSetCenterTime,
|
|
19129
|
+
onSetCenterTime = _e === void 0 ? function () {} : _e,
|
|
19130
|
+
_f = _a.onSetAnimationStartTime,
|
|
19131
|
+
onSetAnimationStartTime = _f === void 0 ? function () {} : _f,
|
|
19132
|
+
_g = _a.onSetAnimationEndTime,
|
|
19133
|
+
onSetAnimationEndTime = _g === void 0 ? function () {} : _g;
|
|
19134
|
+
|
|
19135
|
+
var _h = __read(useCanvasTarget('mousedown'), 2),
|
|
19136
|
+
node = _h[1];
|
|
19137
|
+
|
|
19138
|
+
var _j = __read(React__namespace.useState(0), 2),
|
|
19139
|
+
canvasWidth = _j[0],
|
|
19140
|
+
setCanvasWidth = _j[1];
|
|
19141
|
+
|
|
19142
|
+
var _k = __read(React__namespace.useState(false), 2),
|
|
19143
|
+
selectedTimeDragging = _k[0],
|
|
19144
|
+
setSelectedTimeDragging = _k[1];
|
|
19076
19145
|
|
|
19077
19146
|
var _l = __read(React__namespace.useState(false), 2),
|
|
19078
|
-
|
|
19079
|
-
|
|
19147
|
+
leftMarkerDragging = _l[0],
|
|
19148
|
+
setLeftMarkerDragging = _l[1];
|
|
19080
19149
|
|
|
19081
19150
|
var _m = __read(React__namespace.useState(false), 2),
|
|
19082
|
-
|
|
19083
|
-
|
|
19151
|
+
rightMarkerDragging = _m[0],
|
|
19152
|
+
setRightMarkerDragging = _m[1];
|
|
19084
19153
|
|
|
19085
19154
|
var _o = __read(React__namespace.useState(false), 2),
|
|
19086
|
-
|
|
19087
|
-
|
|
19155
|
+
dragTooltipOpen = _o[0],
|
|
19156
|
+
setDragTooltipOpen = _o[1];
|
|
19088
19157
|
|
|
19089
19158
|
var _p = __read(React__namespace.useState(false), 2),
|
|
19090
|
-
|
|
19091
|
-
|
|
19159
|
+
mouseDownInLegend = _p[0],
|
|
19160
|
+
setMouseDownInLegend = _p[1];
|
|
19092
19161
|
|
|
19093
19162
|
var _q = __read(React__namespace.useState(false), 2),
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
var _r = __read(React__namespace.useState(false), 2),
|
|
19098
|
-
animationAreaDragging = _r[0],
|
|
19099
|
-
setAnimationAreaDragging = _r[1];
|
|
19163
|
+
animationAreaDragging = _q[0],
|
|
19164
|
+
setAnimationAreaDragging = _q[1];
|
|
19100
19165
|
|
|
19101
|
-
var
|
|
19102
|
-
cursorStyle =
|
|
19103
|
-
setCursorStyle =
|
|
19166
|
+
var _r = __read(React__namespace.useState('auto'), 2),
|
|
19167
|
+
cursorStyle = _r[0],
|
|
19168
|
+
setCursorStyle = _r[1];
|
|
19104
19169
|
/**
|
|
19105
19170
|
* remove active drag. can happen outside canvas.
|
|
19106
19171
|
*/
|
|
@@ -19129,14 +19194,14 @@
|
|
|
19129
19194
|
var timeSliderLegendElement = document.querySelector("." + timeSliderLegendId);
|
|
19130
19195
|
var pixelsToLeft = timeSliderLegendElement === null || timeSliderLegendElement === void 0 ? void 0 : timeSliderLegendElement.getBoundingClientRect()['left'];
|
|
19131
19196
|
|
|
19132
|
-
var
|
|
19133
|
-
tooltipTime =
|
|
19134
|
-
setTooltipTime =
|
|
19197
|
+
var _s = __read(React__namespace.useState(moment__default["default"].utc(0)), 2),
|
|
19198
|
+
tooltipTime = _s[0],
|
|
19199
|
+
setTooltipTime = _s[1];
|
|
19135
19200
|
|
|
19136
|
-
var
|
|
19137
|
-
handleAnimationDragging =
|
|
19138
|
-
localAnimationEndTime =
|
|
19139
|
-
localAnimationStartTime =
|
|
19201
|
+
var _t = useAnimationTime(animationStartTime, animationEndTime, onSetAnimationStartTime, onSetAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, dragTooltipPosition, pixelsToLeft, setTooltipTime, startDraggingPosition),
|
|
19202
|
+
handleAnimationDragging = _t.handleAnimationDragging,
|
|
19203
|
+
localAnimationEndTime = _t.localAnimationEndTime,
|
|
19204
|
+
localAnimationStartTime = _t.localAnimationStartTime;
|
|
19140
19205
|
|
|
19141
19206
|
var setSelectedTime = React.useCallback(function (x) {
|
|
19142
19207
|
var unfliteredSelectedTimePx = timestampToPixel(unfilteredSelectedTime, centerTime, canvasWidth, secondsPerPx) + x;
|
|
@@ -19410,6 +19475,26 @@
|
|
|
19410
19475
|
ctx.restore();
|
|
19411
19476
|
};
|
|
19412
19477
|
|
|
19478
|
+
var drawAutoUpdateIcon = function drawAutoUpdateIcon(ctx, x, y, theme, isAutoUpdating) {
|
|
19479
|
+
ctx.save();
|
|
19480
|
+
ctx.translate(x, y);
|
|
19481
|
+
var playerTimeText = theme.palette.geowebColors.timeSlider.playerTimeText;
|
|
19482
|
+
ctx.fillStyle = isAutoUpdating ? '#7BACFF' : '#B4B4B4';
|
|
19483
|
+
var path = new Path2D('M12.385 3.295l5 3-5 3V7.723l-.085.014c-3.08.548-5.418 3.24-5.418 6.479 0 3.634 2.945 6.58 6.577 6.58 2.914 0 5.385-1.896 6.248-4.523l2.815-1.626c-.225 4.814-4.197 8.648-9.063 8.648-5.012 0-9.074-4.065-9.074-9.08 0-4.65 3.495-8.484 8-9.015V3.295z');
|
|
19484
|
+
ctx.translate(7, -8);
|
|
19485
|
+
ctx.rotate(13.295);
|
|
19486
|
+
ctx.fill(path);
|
|
19487
|
+
ctx.restore();
|
|
19488
|
+
var text = 'Auto';
|
|
19489
|
+
ctx.save();
|
|
19490
|
+
ctx.translate(x, y);
|
|
19491
|
+
ctx.fillStyle = isAutoUpdating ? '#7BACFF' : '#B4B4B4'; // ON
|
|
19492
|
+
|
|
19493
|
+
ctx.font = "7px " + playerTimeText.fontFamily;
|
|
19494
|
+
ctx.fillText(text, 5, 14);
|
|
19495
|
+
ctx.restore();
|
|
19496
|
+
};
|
|
19497
|
+
|
|
19413
19498
|
var drawTextAnnotation = function drawTextAnnotation(ctx, x, y, text, theme) {
|
|
19414
19499
|
var playerTimeText = theme.palette.geowebColors.timeSlider.playerTimeText;
|
|
19415
19500
|
ctx.save();
|
|
@@ -19423,20 +19508,22 @@
|
|
|
19423
19508
|
ctx.restore();
|
|
19424
19509
|
};
|
|
19425
19510
|
|
|
19426
|
-
var drawNewCurrentTimeBox = function drawNewCurrentTimeBox(ctx, selectedTime, selectedPx, scale, theme) {
|
|
19511
|
+
var drawNewCurrentTimeBox = function drawNewCurrentTimeBox(ctx, selectedTime, selectedPx, scale, theme, isAutoUpdating) {
|
|
19512
|
+
var iconWidth = 25;
|
|
19427
19513
|
var smallWidth = needleGeom.smallWidth,
|
|
19428
19514
|
largeWidth = needleGeom.largeWidth,
|
|
19429
19515
|
height = needleGeom.height;
|
|
19430
|
-
var
|
|
19431
|
-
var needleX = selectedPx -
|
|
19516
|
+
var boxWidth = scale === Scale.Year ? largeWidth : smallWidth;
|
|
19517
|
+
var needleX = selectedPx - boxWidth / 2;
|
|
19432
19518
|
var needleY = needleGeom.lineWidth;
|
|
19433
|
-
drawRoundedRectangle(ctx, needleX, needleY,
|
|
19519
|
+
drawRoundedRectangle(ctx, needleX - iconWidth, needleY, boxWidth + iconWidth, height, needleGeom.cornerRadius, theme);
|
|
19434
19520
|
var timeFormat = scale === Scale.Year ? 'Y ddd DD MMM HH:mm' : 'ddd DD MMM HH:mm';
|
|
19435
19521
|
var timeText = moment__default["default"].utc(selectedTime * 1000).format(timeFormat).toString();
|
|
19436
|
-
drawTextAnnotation(ctx, needleX +
|
|
19522
|
+
drawTextAnnotation(ctx, needleX + boxWidth / 2 - iconWidth, needleY + height / 2, timeText, theme);
|
|
19523
|
+
drawAutoUpdateIcon(ctx, needleX + boxWidth - iconWidth, needleY, theme, isAutoUpdating);
|
|
19437
19524
|
};
|
|
19438
19525
|
|
|
19439
|
-
var renderTimeSliderCurrentTimeBox = function renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selected, secondsPerPx, scale) {
|
|
19526
|
+
var renderTimeSliderCurrentTimeBox = function renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selected, secondsPerPx, scale, isAutoUpdating) {
|
|
19440
19527
|
// map unix timestamps to pixel values
|
|
19441
19528
|
var _a = __read([selected].map(function (t) {
|
|
19442
19529
|
return timestampToPixel(t, centerTime, width, secondsPerPx);
|
|
@@ -19444,7 +19531,7 @@
|
|
|
19444
19531
|
selectedPx = _a[0];
|
|
19445
19532
|
|
|
19446
19533
|
ctx.clearRect(0, 0, width, height);
|
|
19447
|
-
drawNewCurrentTimeBox(ctx, selected, selectedPx, scale, theme);
|
|
19534
|
+
drawNewCurrentTimeBox(ctx, selected, selectedPx, scale, theme, isAutoUpdating);
|
|
19448
19535
|
};
|
|
19449
19536
|
|
|
19450
19537
|
/* *
|
|
@@ -19476,6 +19563,7 @@
|
|
|
19476
19563
|
dataStartTime = _a.dataStartTime,
|
|
19477
19564
|
dataEndTime = _a.dataEndTime,
|
|
19478
19565
|
unfilteredSelectedTime = _a.unfilteredSelectedTime,
|
|
19566
|
+
isAutoUpdating = _a.isAutoUpdating,
|
|
19479
19567
|
onSetNewDate = _a.onSetNewDate,
|
|
19480
19568
|
setUnfilteredSelectedTime = _a.setUnfilteredSelectedTime;
|
|
19481
19569
|
var TIME_BOX_WIDTH = 140;
|
|
@@ -19556,7 +19644,7 @@
|
|
|
19556
19644
|
},
|
|
19557
19645
|
onRenderCanvas: function onRenderCanvas(ctx, width, height) {
|
|
19558
19646
|
setCanvasWidth(width);
|
|
19559
|
-
renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime, secondsPerPx, scale);
|
|
19647
|
+
renderTimeSliderCurrentTimeBox(ctx, theme, width, height, centerTime, selectedTime, secondsPerPx, scale, isAutoUpdating);
|
|
19560
19648
|
}
|
|
19561
19649
|
}));
|
|
19562
19650
|
};
|
|
@@ -19578,7 +19666,7 @@
|
|
|
19578
19666
|
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
19579
19667
|
* */
|
|
19580
19668
|
|
|
19581
|
-
var
|
|
19669
|
+
var useToggleTimesliderVisibility = function useToggleTimesliderVisibility(mapIsActive, isVisible, onToggleTimeSlider) {
|
|
19582
19670
|
React__namespace.useEffect(function () {
|
|
19583
19671
|
var handleKeyDown = function handleKeyDown(event) {
|
|
19584
19672
|
var target = event.target;
|
|
@@ -19595,6 +19683,34 @@
|
|
|
19595
19683
|
}, [mapIsActive, isVisible, onToggleTimeSlider]);
|
|
19596
19684
|
};
|
|
19597
19685
|
|
|
19686
|
+
var useMoveTimeWithKeyboard = function useMoveTimeWithKeyboard(mapIsActive, timeStep, dataStartTime, dataEndTime, onSetNewDate, onSetCenterTime, selectedTime, currentTime) {
|
|
19687
|
+
var curTime = selectedTime !== undefined ? moment__default["default"].unix(selectedTime).toISOString() : moment__default["default"].utc().toISOString();
|
|
19688
|
+
React__namespace.useEffect(function () {
|
|
19689
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
19690
|
+
if (event.key === 'Home' && mapIsActive) {
|
|
19691
|
+
handleSetNowEvent(timeStep, dataStartTime, dataEndTime, currentTime, onSetNewDate, onSetCenterTime);
|
|
19692
|
+
}
|
|
19693
|
+
|
|
19694
|
+
if (event.ctrlKey && dataStartTime && dataEndTime && mapIsActive) {
|
|
19695
|
+
switch (event.code) {
|
|
19696
|
+
case 'ArrowLeft':
|
|
19697
|
+
setPreviousTimeStep(timeStep, curTime, dataStartTime, onSetNewDate);
|
|
19698
|
+
break;
|
|
19699
|
+
|
|
19700
|
+
case 'ArrowRight':
|
|
19701
|
+
setNextTimeStep(timeStep, curTime, dataEndTime, onSetNewDate);
|
|
19702
|
+
break;
|
|
19703
|
+
}
|
|
19704
|
+
}
|
|
19705
|
+
};
|
|
19706
|
+
|
|
19707
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
19708
|
+
return function () {
|
|
19709
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
19710
|
+
};
|
|
19711
|
+
}, [curTime, currentTime, dataEndTime, dataStartTime, mapIsActive, onSetCenterTime, onSetNewDate, timeStep]);
|
|
19712
|
+
};
|
|
19713
|
+
|
|
19598
19714
|
var defaultProps = {
|
|
19599
19715
|
centerTime: moment__default["default"].utc().startOf('day').hours(12).unix(),
|
|
19600
19716
|
secondsPerPx: 5,
|
|
@@ -19611,9 +19727,17 @@
|
|
|
19611
19727
|
mapIsActive = _b === void 0 ? true : _b,
|
|
19612
19728
|
_c = _a.isVisible,
|
|
19613
19729
|
isVisible = _c === void 0 ? true : _c,
|
|
19730
|
+
timeStep = _a.timeStep,
|
|
19731
|
+
dataStartTime = _a.dataStartTime,
|
|
19732
|
+
dataEndTime = _a.dataEndTime,
|
|
19733
|
+
selectedTime = _a.selectedTime,
|
|
19734
|
+
currentTime = _a.currentTime,
|
|
19735
|
+
onSetNewDate = _a.onSetNewDate,
|
|
19736
|
+
onSetCenterTime = _a.onSetCenterTime,
|
|
19614
19737
|
_d = _a.onToggleTimeSlider,
|
|
19615
19738
|
onToggleTimeSlider = _d === void 0 ? function () {} : _d;
|
|
19616
|
-
|
|
19739
|
+
useToggleTimesliderVisibility(mapIsActive, isVisible, onToggleTimeSlider);
|
|
19740
|
+
useMoveTimeWithKeyboard(mapIsActive, timeStep, dataStartTime, dataEndTime, onSetNewDate, onSetCenterTime, selectedTime, currentTime);
|
|
19617
19741
|
|
|
19618
19742
|
var _e = __read(React__namespace.useState(defaultProps.selectedTime), 2),
|
|
19619
19743
|
unfilteredSelectedTime = _e[0],
|
|
@@ -19627,7 +19751,7 @@
|
|
|
19627
19751
|
container: true,
|
|
19628
19752
|
sx: {
|
|
19629
19753
|
display: 'grid',
|
|
19630
|
-
gridTemplateColumns: '
|
|
19754
|
+
gridTemplateColumns: '120px 1fr 40px',
|
|
19631
19755
|
gridTemplateRows: TIME_SLIDER_LEGEND_HEIGHT,
|
|
19632
19756
|
paddingBottom: 1,
|
|
19633
19757
|
alignItems: 'center',
|
|
@@ -19653,7 +19777,6 @@
|
|
|
19653
19777
|
item: true
|
|
19654
19778
|
}, legend || /*#__PURE__*/React__namespace.createElement(TimeSliderLegend, __assign({}, defaultProps, {
|
|
19655
19779
|
mapId: mapId,
|
|
19656
|
-
mapIsActive: mapIsActive,
|
|
19657
19780
|
unfilteredSelectedTime: unfilteredSelectedTime,
|
|
19658
19781
|
setUnfilteredSelectedTime: setUnfilteredSelectedTime
|
|
19659
19782
|
})), ' '), /*#__PURE__*/React__namespace.createElement(material.Grid, {
|
|
@@ -19694,14 +19817,14 @@
|
|
|
19694
19817
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19695
19818
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
19696
19819
|
* */
|
|
19697
|
-
var connectRedux$
|
|
19820
|
+
var connectRedux$1 = reactRedux.connect(function (store, props) {
|
|
19698
19821
|
return {
|
|
19699
19822
|
isAutoUpdating: isAutoUpdating(store, props.mapId)
|
|
19700
19823
|
};
|
|
19701
19824
|
}, {
|
|
19702
19825
|
toggleAutoUpdate: mapActions$1.toggleAutoUpdate
|
|
19703
19826
|
});
|
|
19704
|
-
var AutoUpdateButtonConnectComponent = connectRedux$
|
|
19827
|
+
var AutoUpdateButtonConnectComponent = connectRedux$1(function (_a) {
|
|
19705
19828
|
var mapId = _a.mapId,
|
|
19706
19829
|
isAutoUpdating = _a.isAutoUpdating,
|
|
19707
19830
|
toggleAutoUpdate = _a.toggleAutoUpdate;
|
|
@@ -19720,7 +19843,7 @@
|
|
|
19720
19843
|
disabled: false
|
|
19721
19844
|
});
|
|
19722
19845
|
});
|
|
19723
|
-
var AutoUpdateButtonConnect = connectRedux$
|
|
19846
|
+
var AutoUpdateButtonConnect = connectRedux$1(AutoUpdateButtonConnectComponent);
|
|
19724
19847
|
|
|
19725
19848
|
/* *
|
|
19726
19849
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -19795,26 +19918,15 @@
|
|
|
19795
19918
|
var activeLayerTimeDimension = reactRedux.useSelector(function (store) {
|
|
19796
19919
|
return getLayerTimeDimension(store, activeLayerId);
|
|
19797
19920
|
});
|
|
19798
|
-
|
|
19799
|
-
var onToggleTimestepAuto = function
|
|
19800
|
-
var newTimestepAuto = !isTimestepAuto$1;
|
|
19801
|
-
|
|
19802
|
-
if (newTimestepAuto) {
|
|
19803
|
-
var timeStepFromLayer = getActiveLayerTimeStep(activeLayerTimeDimension);
|
|
19804
|
-
|
|
19805
|
-
if (timeStepFromLayer) {
|
|
19806
|
-
dispatch(mapActions$1.setTimeStep({
|
|
19807
|
-
mapId: mapId,
|
|
19808
|
-
timeStep: timeStepFromLayer
|
|
19809
|
-
}));
|
|
19810
|
-
}
|
|
19811
|
-
}
|
|
19812
|
-
|
|
19921
|
+
var timeStepFromLayer = getActiveLayerTimeStep(activeLayerTimeDimension);
|
|
19922
|
+
var onToggleTimestepAuto = React__namespace.useCallback(function () {
|
|
19813
19923
|
dispatch(mapActions$1.toggleTimestepAuto({
|
|
19814
19924
|
mapId: mapId,
|
|
19815
|
-
timestepAuto:
|
|
19925
|
+
timestepAuto: !isTimestepAuto$1,
|
|
19926
|
+
origin: MapActionOrigin.map
|
|
19816
19927
|
}));
|
|
19817
|
-
};
|
|
19928
|
+
}, [dispatch, isTimestepAuto$1, mapId]);
|
|
19929
|
+
var activeTimeStep = isTimestepAuto$1 && timeStepFromLayer ? timeStepFromLayer : timeStep;
|
|
19818
19930
|
|
|
19819
19931
|
var onSetTimeStep = function onSetTimeStep(timeStep) {
|
|
19820
19932
|
dispatch(mapActions$1.setTimeStep({
|
|
@@ -19824,11 +19936,12 @@
|
|
|
19824
19936
|
};
|
|
19825
19937
|
|
|
19826
19938
|
return /*#__PURE__*/React__namespace.createElement(TimeStepButton, {
|
|
19827
|
-
timeStep:
|
|
19939
|
+
timeStep: activeTimeStep,
|
|
19828
19940
|
onChangeTimeStep: onSetTimeStep,
|
|
19829
19941
|
disabled: isAnimating$1,
|
|
19830
19942
|
onToggleTimestepAuto: onToggleTimestepAuto,
|
|
19831
|
-
isTimestepAuto: Boolean(isTimestepAuto$1)
|
|
19943
|
+
isTimestepAuto: Boolean(isTimestepAuto$1) && Boolean(timeStepFromLayer),
|
|
19944
|
+
timeStepFromLayer: timeStepFromLayer
|
|
19832
19945
|
});
|
|
19833
19946
|
};
|
|
19834
19947
|
|
|
@@ -19992,11 +20105,6 @@
|
|
|
19992
20105
|
return getAnimationEndTime$1(store, mapId);
|
|
19993
20106
|
});
|
|
19994
20107
|
var currentDiffInMinutes = moment__default["default"](animationEndTime).diff(moment__default["default"](animationStartTime), 'minutes');
|
|
19995
|
-
var currentLength = Object.values(AnimationLength).map(function (val) {
|
|
19996
|
-
return Number(val);
|
|
19997
|
-
}).find(function (val) {
|
|
19998
|
-
return val >= currentDiffInMinutes;
|
|
19999
|
-
});
|
|
20000
20108
|
|
|
20001
20109
|
var handlechangeAnimationLength = function handlechangeAnimationLength(length) {
|
|
20002
20110
|
var animationEndTime = moment__default["default"](animationStartTime).add(length, 'minutes').toISOString();
|
|
@@ -20008,9 +20116,8 @@
|
|
|
20008
20116
|
|
|
20009
20117
|
return /*#__PURE__*/React__namespace.createElement(AnimationLengthButton, {
|
|
20010
20118
|
disabled: isAnimating$1,
|
|
20011
|
-
animationLength:
|
|
20012
|
-
onChangeAnimationLength: handlechangeAnimationLength
|
|
20013
|
-
animationLengthInMinutes: currentDiffInMinutes
|
|
20119
|
+
animationLength: currentDiffInMinutes || Number(AnimationLength.Hours24),
|
|
20120
|
+
onChangeAnimationLength: handlechangeAnimationLength
|
|
20014
20121
|
});
|
|
20015
20122
|
};
|
|
20016
20123
|
|
|
@@ -20201,56 +20308,46 @@
|
|
|
20201
20308
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
20202
20309
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
20203
20310
|
* */
|
|
20204
|
-
var connectRedux$2 = reactRedux.connect(function (store, props) {
|
|
20205
|
-
return {
|
|
20206
|
-
layers: getMapLayers(store, props.mapId),
|
|
20207
|
-
dimensions: getMapDimensions(store, props.mapId),
|
|
20208
|
-
scale: getMapTimeSliderScale(store, props.mapId),
|
|
20209
|
-
centerTime: getMapTimeSliderCenterTime(store, props.mapId),
|
|
20210
|
-
secondsPerPx: getMapTimeSliderSecondsPerPx(store, props.mapId),
|
|
20211
|
-
dataScaleToSecondsPerPx: getMapTimeSliderDataScaleToSecondsPerPx(store, props.mapId),
|
|
20212
|
-
isAnimating: isAnimating(store, props.mapId),
|
|
20213
|
-
timeStep: getMapTimeStep(store, props.mapId),
|
|
20214
|
-
isTimeSliderHoverOn: isTimeSliderHoverOn(store, props.mapId),
|
|
20215
|
-
timeValue: getTime(getSynchronizationGroupStore(store), props.sourceId),
|
|
20216
|
-
animationStartTime: getAnimationStartTime(store, props.mapId),
|
|
20217
|
-
animationEndTime: getAnimationEndTime$1(store, props.mapId),
|
|
20218
|
-
activeWindowId: getActiveWindowId(store),
|
|
20219
|
-
unfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime(store, props.mapId)
|
|
20220
|
-
};
|
|
20221
|
-
}, {
|
|
20222
|
-
setTimeSliderUnfilteredSelectedTime: mapActions$1.setTimeSliderUnfilteredSelectedTime,
|
|
20223
|
-
stopMapAnimation: mapActions$1.mapStopAnimation,
|
|
20224
|
-
setTime: genericActions.setTime,
|
|
20225
|
-
mapSetTimeSliderCenterTime: mapActions$1.setTimeSliderCenterTime,
|
|
20226
|
-
mapSetTimeSliderSecondsPerPx: mapActions$1.setTimeSliderSecondsPerPx,
|
|
20227
|
-
setAnimationStartTime: mapActions$1.setAnimationStartTime,
|
|
20228
|
-
setAnimationEndTime: mapActions$1.setAnimationEndTime
|
|
20229
|
-
});
|
|
20230
20311
|
|
|
20231
20312
|
var TimeSliderLegendConnect = function TimeSliderLegendConnect(_a) {
|
|
20232
20313
|
var sourceId = _a.sourceId,
|
|
20233
|
-
mapId = _a.mapId
|
|
20234
|
-
|
|
20235
|
-
|
|
20236
|
-
|
|
20237
|
-
|
|
20238
|
-
|
|
20239
|
-
|
|
20240
|
-
|
|
20241
|
-
|
|
20242
|
-
|
|
20243
|
-
|
|
20244
|
-
|
|
20245
|
-
|
|
20246
|
-
|
|
20247
|
-
|
|
20248
|
-
|
|
20249
|
-
|
|
20250
|
-
|
|
20251
|
-
|
|
20252
|
-
|
|
20253
|
-
|
|
20314
|
+
mapId = _a.mapId;
|
|
20315
|
+
var layers = reactRedux.useSelector(function (store) {
|
|
20316
|
+
return getMapLayers(store, mapId);
|
|
20317
|
+
});
|
|
20318
|
+
var dimensions = reactRedux.useSelector(function (store) {
|
|
20319
|
+
return getMapDimensions(store, mapId);
|
|
20320
|
+
});
|
|
20321
|
+
var scale = reactRedux.useSelector(function (store) {
|
|
20322
|
+
return getMapTimeSliderScale(store, mapId);
|
|
20323
|
+
});
|
|
20324
|
+
var centerTime = reactRedux.useSelector(function (store) {
|
|
20325
|
+
return getMapTimeSliderCenterTime(store, mapId);
|
|
20326
|
+
});
|
|
20327
|
+
var secondsPerPx = reactRedux.useSelector(function (store) {
|
|
20328
|
+
return getMapTimeSliderSecondsPerPx(store, mapId);
|
|
20329
|
+
});
|
|
20330
|
+
var dataScaleToSecondsPerPx = reactRedux.useSelector(function (store) {
|
|
20331
|
+
return getMapTimeSliderDataScaleToSecondsPerPx(store, mapId);
|
|
20332
|
+
});
|
|
20333
|
+
var isAnimating$1 = reactRedux.useSelector(function (store) {
|
|
20334
|
+
return isAnimating(store, mapId);
|
|
20335
|
+
});
|
|
20336
|
+
var timeStep = reactRedux.useSelector(function (store) {
|
|
20337
|
+
return getMapTimeStep(store, mapId);
|
|
20338
|
+
});
|
|
20339
|
+
var isTimeSliderHoverOn$1 = reactRedux.useSelector(function (store) {
|
|
20340
|
+
return isTimeSliderHoverOn(store, mapId);
|
|
20341
|
+
});
|
|
20342
|
+
var animationStartTime = reactRedux.useSelector(function (store) {
|
|
20343
|
+
return getAnimationStartTime(store, mapId);
|
|
20344
|
+
});
|
|
20345
|
+
var animationEndTime = reactRedux.useSelector(function (store) {
|
|
20346
|
+
return getAnimationEndTime$1(store, mapId);
|
|
20347
|
+
});
|
|
20348
|
+
var unfilteredSelectedTime = reactRedux.useSelector(function (store) {
|
|
20349
|
+
return getTimeSliderUnfilteredSelectedTime(store, mapId);
|
|
20350
|
+
});
|
|
20254
20351
|
var selectedTime = getTimeBounds(dimensions).selectedTime;
|
|
20255
20352
|
var currentTime = moment__default["default"].utc().unix();
|
|
20256
20353
|
|
|
@@ -20258,7 +20355,7 @@
|
|
|
20258
20355
|
dataStartTime = _b[0],
|
|
20259
20356
|
dataEndTime = _b[1];
|
|
20260
20357
|
|
|
20261
|
-
var
|
|
20358
|
+
var dispatch = reactRedux.useDispatch();
|
|
20262
20359
|
return /*#__PURE__*/React__namespace.createElement(TimeSliderLegend, {
|
|
20263
20360
|
mapId: mapId,
|
|
20264
20361
|
centerTime: centerTime,
|
|
@@ -20267,74 +20364,62 @@
|
|
|
20267
20364
|
selectedTime: selectedTime,
|
|
20268
20365
|
scale: scale,
|
|
20269
20366
|
currentTime: currentTime,
|
|
20270
|
-
isTimeSliderHoverOn: isTimeSliderHoverOn,
|
|
20367
|
+
isTimeSliderHoverOn: isTimeSliderHoverOn$1,
|
|
20271
20368
|
dataStartTime: dataStartTime,
|
|
20272
20369
|
dataEndTime: dataEndTime,
|
|
20273
20370
|
animationStartTime: animationStartTime,
|
|
20274
20371
|
animationEndTime: animationEndTime,
|
|
20275
20372
|
timeStep: timeStep,
|
|
20276
|
-
mapIsActive: mapIsActive,
|
|
20277
20373
|
unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
|
|
20278
20374
|
setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
|
|
20279
|
-
|
|
20375
|
+
dispatch(mapActions$1.setTimeSliderUnfilteredSelectedTime({
|
|
20280
20376
|
timeSliderUnfilteredSelectedTime: timeSliderUnfilteredSelectedTime,
|
|
20281
20377
|
mapId: mapId
|
|
20282
|
-
});
|
|
20378
|
+
}));
|
|
20283
20379
|
},
|
|
20284
20380
|
onSetNewDate: function onSetNewDate(newDate) {
|
|
20285
|
-
if (isAnimating) {
|
|
20286
|
-
|
|
20381
|
+
if (isAnimating$1) {
|
|
20382
|
+
dispatch(mapActions$1.mapStopAnimation({
|
|
20287
20383
|
mapId: mapId
|
|
20288
|
-
});
|
|
20384
|
+
}));
|
|
20289
20385
|
}
|
|
20290
20386
|
|
|
20291
|
-
setTime({
|
|
20387
|
+
dispatch(genericActions.setTime({
|
|
20292
20388
|
sourceId: sourceId,
|
|
20293
20389
|
origin: 'TimeSliderConnect, 139',
|
|
20294
20390
|
value: handleMomentISOString(newDate)
|
|
20295
|
-
});
|
|
20391
|
+
}));
|
|
20296
20392
|
},
|
|
20297
20393
|
onSetCenterTime: function onSetCenterTime(newTime) {
|
|
20298
|
-
|
|
20394
|
+
dispatch(mapActions$1.setTimeSliderCenterTime({
|
|
20299
20395
|
mapId: mapId,
|
|
20300
20396
|
timeSliderCenterTime: newTime
|
|
20301
|
-
});
|
|
20397
|
+
}));
|
|
20302
20398
|
},
|
|
20303
20399
|
onZoom: function onZoom(newSecondsPerPx, newCenterTime) {
|
|
20304
|
-
|
|
20400
|
+
dispatch(mapActions$1.setTimeSliderSecondsPerPx({
|
|
20305
20401
|
mapId: mapId,
|
|
20306
20402
|
timeSliderSecondsPerPx: newSecondsPerPx
|
|
20307
|
-
});
|
|
20308
|
-
|
|
20403
|
+
}));
|
|
20404
|
+
dispatch(mapActions$1.setTimeSliderCenterTime({
|
|
20309
20405
|
mapId: mapId,
|
|
20310
20406
|
timeSliderCenterTime: newCenterTime
|
|
20311
|
-
});
|
|
20407
|
+
}));
|
|
20312
20408
|
},
|
|
20313
20409
|
onSetAnimationStartTime: function onSetAnimationStartTime(animationStartTime) {
|
|
20314
|
-
setAnimationStartTime({
|
|
20410
|
+
dispatch(mapActions$1.setAnimationStartTime({
|
|
20315
20411
|
mapId: mapId,
|
|
20316
20412
|
animationStartTime: animationStartTime
|
|
20317
|
-
});
|
|
20413
|
+
}));
|
|
20318
20414
|
},
|
|
20319
20415
|
onSetAnimationEndTime: function onSetAnimationEndTime(animationEndTime) {
|
|
20320
|
-
setAnimationEndTime({
|
|
20416
|
+
dispatch(mapActions$1.setAnimationEndTime({
|
|
20321
20417
|
mapId: mapId,
|
|
20322
20418
|
animationEndTime: animationEndTime
|
|
20323
|
-
});
|
|
20419
|
+
}));
|
|
20324
20420
|
}
|
|
20325
20421
|
});
|
|
20326
20422
|
};
|
|
20327
|
-
/**
|
|
20328
|
-
* TimeSliderLegend component connected to the store displaying a legend of the time slider
|
|
20329
|
-
*
|
|
20330
|
-
* Expects the following props:
|
|
20331
|
-
* @param {string} mapId mapId: string - Id of the map
|
|
20332
|
-
* @example
|
|
20333
|
-
* ``` <TimeSliderLegendConnect mapId={mapId} />```
|
|
20334
|
-
*/
|
|
20335
|
-
|
|
20336
|
-
|
|
20337
|
-
var TimeSliderLegendConnect$1 = connectRedux$2(TimeSliderLegendConnect);
|
|
20338
20423
|
|
|
20339
20424
|
/* *
|
|
20340
20425
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -20352,7 +20437,7 @@
|
|
|
20352
20437
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
20353
20438
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
20354
20439
|
* */
|
|
20355
|
-
var connectRedux
|
|
20440
|
+
var connectRedux = reactRedux.connect(function (store, props) {
|
|
20356
20441
|
return {
|
|
20357
20442
|
layers: getMapLayers(store, props.mapId),
|
|
20358
20443
|
dimensions: getMapDimensions(store, props.mapId),
|
|
@@ -20361,6 +20446,7 @@
|
|
|
20361
20446
|
scale: getMapTimeSliderScale(store, props.mapId),
|
|
20362
20447
|
timeStep: getMapTimeStep(store, props.mapId),
|
|
20363
20448
|
isAnimating: isAnimating(store, props.mapId),
|
|
20449
|
+
isAutoUpdating: isAutoUpdating(store, props.mapId),
|
|
20364
20450
|
unfilteredSelectedTime: getTimeSliderUnfilteredSelectedTime(store, props.mapId)
|
|
20365
20451
|
};
|
|
20366
20452
|
}, {
|
|
@@ -20379,6 +20465,7 @@
|
|
|
20379
20465
|
layers = _a.layers,
|
|
20380
20466
|
timeStep = _a.timeStep,
|
|
20381
20467
|
isAnimating = _a.isAnimating,
|
|
20468
|
+
isAutoUpdating = _a.isAutoUpdating,
|
|
20382
20469
|
stopMapAnimation = _a.stopMapAnimation,
|
|
20383
20470
|
unfilteredSelectedTime = _a.unfilteredSelectedTime,
|
|
20384
20471
|
setTimeSliderUnfilteredSelectedTime = _a.setTimeSliderUnfilteredSelectedTime,
|
|
@@ -20397,6 +20484,7 @@
|
|
|
20397
20484
|
dataStartTime: dataStartTime,
|
|
20398
20485
|
dataEndTime: dataEndTime,
|
|
20399
20486
|
timeStep: timeStep,
|
|
20487
|
+
isAutoUpdating: isAutoUpdating,
|
|
20400
20488
|
unfilteredSelectedTime: unfilteredSelectedTime || selectedTime,
|
|
20401
20489
|
setUnfilteredSelectedTime: function setUnfilteredSelectedTime(timeSliderUnfilteredSelectedTime) {
|
|
20402
20490
|
if (setTimeSliderUnfilteredSelectedTime) setTimeSliderUnfilteredSelectedTime({
|
|
@@ -20420,7 +20508,7 @@
|
|
|
20420
20508
|
});
|
|
20421
20509
|
};
|
|
20422
20510
|
|
|
20423
|
-
var TimeSliderCurrentTimeBoxConnect = connectRedux
|
|
20511
|
+
var TimeSliderCurrentTimeBoxConnect = connectRedux(TimeSliderCurrentTimeBoxConnectComponent);
|
|
20424
20512
|
|
|
20425
20513
|
/* *
|
|
20426
20514
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -20438,38 +20526,54 @@
|
|
|
20438
20526
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
20439
20527
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
20440
20528
|
* */
|
|
20441
|
-
var
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
|
|
20448
|
-
|
|
20449
|
-
|
|
20450
|
-
|
|
20529
|
+
var useUpdateTimestep = function useUpdateTimestep(mapId) {
|
|
20530
|
+
var activeLayerId = reactRedux.useSelector(function (store) {
|
|
20531
|
+
return getActiveLayerId(store, mapId);
|
|
20532
|
+
});
|
|
20533
|
+
var isTimeStepAuto = reactRedux.useSelector(function (store) {
|
|
20534
|
+
return isTimestepAuto(store, mapId);
|
|
20535
|
+
});
|
|
20536
|
+
var timeDimension = reactRedux.useSelector(function (store) {
|
|
20537
|
+
return getLayerTimeDimension(store, activeLayerId);
|
|
20538
|
+
});
|
|
20539
|
+
var dispatch = reactRedux.useDispatch();
|
|
20540
|
+
React__namespace.useEffect(function () {
|
|
20541
|
+
if (isTimeStepAuto) {
|
|
20542
|
+
var timeStep = getActiveLayerTimeStep(timeDimension);
|
|
20543
|
+
dispatch(mapActions$1.setTimeStep({
|
|
20544
|
+
mapId: mapId,
|
|
20545
|
+
timeStep: timeStep
|
|
20546
|
+
}));
|
|
20547
|
+
}
|
|
20548
|
+
}, [activeLayerId, dispatch, isTimeStepAuto, mapId, timeDimension]);
|
|
20549
|
+
};
|
|
20451
20550
|
|
|
20452
|
-
var
|
|
20551
|
+
var TimeSliderConnect = function TimeSliderConnect(_a) {
|
|
20453
20552
|
var sourceId = _a.sourceId,
|
|
20454
20553
|
mapId = _a.mapId,
|
|
20455
|
-
isTimeSliderHoverOn = _a.isTimeSliderHoverOn,
|
|
20456
|
-
toggleTimeSliderHover = _a.toggleTimeSliderHover,
|
|
20457
|
-
activeWindowId = _a.activeWindowId,
|
|
20458
|
-
isTimeSliderVisible = _a.isTimeSliderVisible,
|
|
20459
|
-
toggleTimeSliderIsVisible = _a.toggleTimeSliderIsVisible,
|
|
20460
20554
|
_b = _a.isAlwaysVisible,
|
|
20461
|
-
isAlwaysVisible = _b === void 0 ? false : _b;
|
|
20555
|
+
isAlwaysVisible = _b === void 0 ? false : _b;
|
|
20556
|
+
var isTimeSliderHoverOn$1 = reactRedux.useSelector(function (store) {
|
|
20557
|
+
return isTimeSliderHoverOn(store, mapId);
|
|
20558
|
+
});
|
|
20559
|
+
var activeWindowId = reactRedux.useSelector(function (store) {
|
|
20560
|
+
return getActiveWindowId(store);
|
|
20561
|
+
});
|
|
20562
|
+
var isTimeSliderVisible$1 = reactRedux.useSelector(function (store) {
|
|
20563
|
+
return isTimeSliderVisible(store, mapId);
|
|
20564
|
+
}); // don't use redux state if isAlwaysVisible
|
|
20462
20565
|
|
|
20463
|
-
var isVisible = isAlwaysVisible || isTimeSliderVisible;
|
|
20464
|
-
var mapIsActive = mapId === activeWindowId;
|
|
20566
|
+
var isVisible = isAlwaysVisible || isTimeSliderVisible$1;
|
|
20567
|
+
var mapIsActive = mapId === activeWindowId;
|
|
20568
|
+
var dispatch = reactRedux.useDispatch(); // TODO: move keyboard logic to TimeSlider.tsx
|
|
20465
20569
|
|
|
20466
20570
|
React__namespace.useEffect(function () {
|
|
20467
20571
|
var handleKeyDown = function handleKeyDown(event) {
|
|
20468
20572
|
if (event.ctrlKey && event.altKey && event.key === 'h') {
|
|
20469
|
-
toggleTimeSliderHover({
|
|
20573
|
+
dispatch(mapActions$1.toggleTimeSliderHover({
|
|
20470
20574
|
mapId: mapId,
|
|
20471
|
-
isTimeSliderHoverOn: !isTimeSliderHoverOn
|
|
20472
|
-
});
|
|
20575
|
+
isTimeSliderHoverOn: !isTimeSliderHoverOn$1
|
|
20576
|
+
}));
|
|
20473
20577
|
}
|
|
20474
20578
|
};
|
|
20475
20579
|
|
|
@@ -20477,17 +20581,60 @@
|
|
|
20477
20581
|
return function () {
|
|
20478
20582
|
document.removeEventListener('keydown', handleKeyDown);
|
|
20479
20583
|
};
|
|
20480
|
-
}, [mapId, isTimeSliderHoverOn,
|
|
20584
|
+
}, [mapId, isTimeSliderHoverOn$1, dispatch]);
|
|
20481
20585
|
|
|
20482
20586
|
var onToggleTimeSliderVisibility = function onToggleTimeSliderVisibility(isTimeSliderVisible) {
|
|
20483
|
-
toggleTimeSliderIsVisible({
|
|
20587
|
+
dispatch(mapActions$1.toggleTimeSliderIsVisible({
|
|
20484
20588
|
mapId: mapId,
|
|
20485
20589
|
isTimeSliderVisible: isTimeSliderVisible,
|
|
20486
20590
|
origin: MapActionOrigin.map
|
|
20487
|
-
});
|
|
20591
|
+
}));
|
|
20488
20592
|
};
|
|
20489
20593
|
|
|
20594
|
+
var timeStep = reactRedux.useSelector(function (store) {
|
|
20595
|
+
return getMapTimeStep(store, mapId);
|
|
20596
|
+
});
|
|
20597
|
+
var layers = reactRedux.useSelector(function (store) {
|
|
20598
|
+
return getMapLayers(store, mapId);
|
|
20599
|
+
});
|
|
20600
|
+
|
|
20601
|
+
var _c = __read(getDataLimitsFromLayers(layers), 2),
|
|
20602
|
+
dataStartTime = _c[0],
|
|
20603
|
+
dataEndTime = _c[1];
|
|
20604
|
+
|
|
20605
|
+
var isAnimating$1 = reactRedux.useSelector(function (store) {
|
|
20606
|
+
return isAnimating(store, mapId);
|
|
20607
|
+
});
|
|
20608
|
+
var dimensions = reactRedux.useSelector(function (store) {
|
|
20609
|
+
return getMapDimensions(store, mapId);
|
|
20610
|
+
});
|
|
20611
|
+
var selectedTime = getTimeBounds(dimensions).selectedTime;
|
|
20612
|
+
useUpdateTimestep(mapId);
|
|
20490
20613
|
return /*#__PURE__*/React__namespace.createElement(TimeSlider, {
|
|
20614
|
+
currentTime: moment__default["default"].utc().unix(),
|
|
20615
|
+
timeStep: timeStep,
|
|
20616
|
+
dataStartTime: dataStartTime,
|
|
20617
|
+
dataEndTime: dataEndTime,
|
|
20618
|
+
onSetNewDate: function onSetNewDate(newDate) {
|
|
20619
|
+
if (isAnimating$1) {
|
|
20620
|
+
dispatch(mapActions$1.mapStopAnimation({
|
|
20621
|
+
mapId: mapId
|
|
20622
|
+
}));
|
|
20623
|
+
}
|
|
20624
|
+
|
|
20625
|
+
dispatch(genericActions.setTime({
|
|
20626
|
+
sourceId: sourceId,
|
|
20627
|
+
value: handleMomentISOString(newDate),
|
|
20628
|
+
origin: ''
|
|
20629
|
+
}));
|
|
20630
|
+
},
|
|
20631
|
+
onSetCenterTime: function onSetCenterTime(newTime) {
|
|
20632
|
+
dispatch(mapActions$1.setTimeSliderCenterTime({
|
|
20633
|
+
mapId: mapId,
|
|
20634
|
+
timeSliderCenterTime: newTime
|
|
20635
|
+
}));
|
|
20636
|
+
},
|
|
20637
|
+
selectedTime: selectedTime,
|
|
20491
20638
|
mapId: mapId,
|
|
20492
20639
|
buttons: /*#__PURE__*/React__namespace.createElement(TimeSliderButtonsConnect, {
|
|
20493
20640
|
mapId: mapId,
|
|
@@ -20497,7 +20644,7 @@
|
|
|
20497
20644
|
mapId: mapId,
|
|
20498
20645
|
sourceId: sourceId
|
|
20499
20646
|
}),
|
|
20500
|
-
legend: /*#__PURE__*/React__namespace.createElement(TimeSliderLegendConnect
|
|
20647
|
+
legend: /*#__PURE__*/React__namespace.createElement(TimeSliderLegendConnect, {
|
|
20501
20648
|
mapId: mapId,
|
|
20502
20649
|
sourceId: sourceId
|
|
20503
20650
|
}),
|
|
@@ -20506,18 +20653,6 @@
|
|
|
20506
20653
|
isVisible: isVisible
|
|
20507
20654
|
});
|
|
20508
20655
|
};
|
|
20509
|
-
/**
|
|
20510
|
-
* TimeSlider component with components connected to the store displaying the time slider
|
|
20511
|
-
*
|
|
20512
|
-
* Expects the following props:
|
|
20513
|
-
* @param {string} mapId mapId: string - Id of the map
|
|
20514
|
-
* @param {string} sourceId sourceId: string - Source Id of the timeslider
|
|
20515
|
-
* @example
|
|
20516
|
-
* ``` <TimeSliderConnect sourceId="timeslider-1" mapId={mapId} />```
|
|
20517
|
-
*/
|
|
20518
|
-
|
|
20519
|
-
|
|
20520
|
-
var TimeSliderConnect = connectRedux(ConnectedTimeSlider);
|
|
20521
20656
|
|
|
20522
20657
|
/* *
|
|
20523
20658
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -27275,6 +27410,7 @@
|
|
|
27275
27410
|
exports.CoreThemeStoreProvider = CoreThemeStoreProvider;
|
|
27276
27411
|
exports.DockedLayerManagerConnect = DockedLayerManagerConnect;
|
|
27277
27412
|
exports.HarmonieTempAndPrecipPreset = HarmonieTempAndPrecipPreset;
|
|
27413
|
+
exports.LayerManager = LayerManager;
|
|
27278
27414
|
exports.LayerManagerConnect = LayerManagerConnect;
|
|
27279
27415
|
exports.LayerManagerMapButtonConnect = LayerManagerMapButtonConnect;
|
|
27280
27416
|
exports.LayerSelectConnect = LayerSelectConnect;
|
|
@@ -27342,7 +27478,7 @@
|
|
|
27342
27478
|
exports.synchronizationGroupModuleConfig = synchronizationGroupConfig;
|
|
27343
27479
|
exports.synchronizationGroupsConfig = synchronizationGroupConfig;
|
|
27344
27480
|
exports.testLayers = testLayers;
|
|
27345
|
-
exports.timeSliderUtils =
|
|
27481
|
+
exports.timeSliderUtils = timeSliderUtils;
|
|
27346
27482
|
exports.uiActions = uiActions;
|
|
27347
27483
|
exports.uiModuleConfig = uiModuleConfig;
|
|
27348
27484
|
exports.uiSelectors = selectors$1;
|