@opengeoweb/core 2.1.0 → 2.1.1
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/core.esm.js +712 -317
- package/core.umd.js +655 -257
- package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +47 -0
- package/lib/components/ComponentsLookUp/componentsLookUp.stories.d.ts +7 -0
- package/lib/components/ComponentsLookUp/componentsLookup.spec.d.ts +1 -0
- package/lib/components/ComponentsLookUp/index.d.ts +1 -0
- package/lib/components/{SyncGroups → ConfigurableConnectedMap}/ConfigurableConnectedMap.d.ts +18 -2
- package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.spec.d.ts +1 -0
- package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.stories.d.ts +6 -0
- package/lib/components/ConfigurableConnectedMap/index.d.ts +1 -0
- package/lib/components/ConfigurableMapWithSlider/ConfigurableMapWithSliderConnect.d.ts +3 -0
- package/lib/components/LayerManager/DescriptionRow/DescriptionRow.d.ts +1 -0
- package/lib/components/LayerManager/LayerManager.d.ts +2 -0
- package/lib/components/LayerManager/LayerManager.stories.d.ts +7 -9
- package/lib/components/LayerManager/LayerManagerConnect.d.ts +1 -0
- package/lib/components/LayerManager/LayerManagerConnect.stories.d.ts +5 -0
- package/lib/components/LayerManager/LayerManagerStories.stories.d.ts +6 -0
- package/lib/components/LayerManager/LayerSelect/LayerSelectConnect.d.ts +2 -0
- package/lib/components/MapView/MapView.Error.stories.d.ts +4 -0
- package/lib/components/MultiMapDimensionSelect/DimensionSelectDialogConnect.stories.d.ts +25 -0
- package/lib/components/MultiMapDimensionSelect/MultiDimensionSelect.stories.d.ts +1 -0
- package/lib/components/TimeSlider/TimeSliderButtons/PlayButton/PlayButtonConnect.d.ts +1 -0
- package/lib/components/TimeSlider/TimeSliderButtons/SpeedButton/SpeedButton.d.ts +0 -2
- package/lib/components/TimeSlider/TimeSliderUtils.d.ts +7 -0
- package/lib/index.d.ts +2 -1
- package/lib/store/mapStore/map/actions.d.ts +2 -2
- package/lib/store/mapStore/map/reducer.d.ts +7 -0
- package/lib/utils/__mocks__/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +2 -0
- package/lib/utils/getCapabilities.d.ts +6 -0
- package/package.json +7 -7
package/core.umd.js
CHANGED
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
/**
|
|
160
160
|
* Starts the animation for a map.
|
|
161
161
|
*
|
|
162
|
-
* Example: mapStartAnimation({mapId:'mapId1', start: 'someISOTime', end: 'someISOTime', interval:
|
|
163
|
-
* @param {object} payload Object with mapId: string, start: Moment, end: Moment and interval: number (in
|
|
162
|
+
* Example: mapStartAnimation({mapId:'mapId1', start: 'someISOTime', end: 'someISOTime', interval: 15})
|
|
163
|
+
* @param {object} payload Object with mapId: string, start: Moment, end: Moment and interval: number (in minutes), timeList?: TimeListType[]
|
|
164
164
|
*/
|
|
165
165
|
|
|
166
166
|
var mapStartAnimation = function mapStartAnimation(payload) {
|
|
@@ -1375,6 +1375,17 @@
|
|
|
1375
1375
|
});
|
|
1376
1376
|
|
|
1377
1377
|
var defaultAnimationDelayAtStart = 250;
|
|
1378
|
+
var defaultDelay = 1000; // [ms]
|
|
1379
|
+
|
|
1380
|
+
var speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
|
|
1384
|
+
*/
|
|
1385
|
+
|
|
1386
|
+
var getSpeedDelay = function getSpeedDelay(speedFactor) {
|
|
1387
|
+
return defaultDelay / speedFactor;
|
|
1388
|
+
};
|
|
1378
1389
|
/**
|
|
1379
1390
|
* Returns time bounds from the given dimension. If no time dimension given, current time is returned as default
|
|
1380
1391
|
*/
|
|
@@ -4112,10 +4123,18 @@
|
|
|
4112
4123
|
|
|
4113
4124
|
var getAddLayerActionsTargets = function getAddLayerActionsTargets(state, payload, actionType) {
|
|
4114
4125
|
var foundTargets = findTargets(state, payload, actionType, payload.mapId);
|
|
4115
|
-
return foundTargets.map(function (
|
|
4116
|
-
|
|
4126
|
+
return foundTargets.map(function (_a) {
|
|
4127
|
+
var payload = _a.payload,
|
|
4128
|
+
targetId = _a.targetId;
|
|
4129
|
+
var layer = payload.layer;
|
|
4130
|
+
|
|
4131
|
+
layer.id;
|
|
4132
|
+
var layerWithoutId = __rest(layer, ["id"]);
|
|
4133
|
+
|
|
4134
|
+
return __assign(__assign({}, payload), {
|
|
4135
|
+
layer: layerWithoutId,
|
|
4117
4136
|
layerId: generateLayerId(),
|
|
4118
|
-
mapId:
|
|
4137
|
+
mapId: targetId,
|
|
4119
4138
|
origin: ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_ADDACTION
|
|
4120
4139
|
});
|
|
4121
4140
|
});
|
|
@@ -4944,7 +4963,7 @@
|
|
|
4944
4963
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
4945
4964
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
4946
4965
|
* */
|
|
4947
|
-
var useStyles$
|
|
4966
|
+
var useStyles$A = core.makeStyles(function (theme) {
|
|
4948
4967
|
return {
|
|
4949
4968
|
select: {
|
|
4950
4969
|
'& ul': {
|
|
@@ -4997,7 +5016,7 @@
|
|
|
4997
5016
|
tooltipOpen = _f[0],
|
|
4998
5017
|
setTooltipOpen = _f[1];
|
|
4999
5018
|
|
|
5000
|
-
var classes = useStyles$
|
|
5019
|
+
var classes = useStyles$A();
|
|
5001
5020
|
var onWheel = React__namespace.useCallback(function (event) {
|
|
5002
5021
|
if (selectOpen) return;
|
|
5003
5022
|
var direction = event.deltaY < 0 ? 1 : -1;
|
|
@@ -5524,12 +5543,32 @@
|
|
|
5524
5543
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5525
5544
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
5526
5545
|
* */
|
|
5546
|
+
/**
|
|
5547
|
+
* Checks if the layer id is already taken in one of the maps.
|
|
5548
|
+
* @param state The WebMapState
|
|
5549
|
+
* @param layerIdToCheck The layerId to check
|
|
5550
|
+
* @returns true if the layerId is already taken somewhere else.
|
|
5551
|
+
*/
|
|
5552
|
+
|
|
5553
|
+
var checkIfMapLayerIdIsAlreadyTaken = function checkIfMapLayerIdIsAlreadyTaken(state, layerId) {
|
|
5554
|
+
return state.allIds.some(function (mapId) {
|
|
5555
|
+
var map = state.byId[mapId];
|
|
5556
|
+
|
|
5557
|
+
var doesLayeridExist = function doesLayeridExist(layers) {
|
|
5558
|
+
return layers && layers.some(function (id) {
|
|
5559
|
+
return id === layerId;
|
|
5560
|
+
});
|
|
5561
|
+
};
|
|
5562
|
+
|
|
5563
|
+
return doesLayeridExist(map.mapLayers) || doesLayeridExist(map.overLayers) || doesLayeridExist(map.baseLayers) || doesLayeridExist(map.featureLayers);
|
|
5564
|
+
});
|
|
5565
|
+
};
|
|
5527
5566
|
/**
|
|
5528
5567
|
* Addes id's to the layer object. All layers need to have an id for referring.
|
|
5529
5568
|
* @param layers
|
|
5530
5569
|
*/
|
|
5531
5570
|
|
|
5532
|
-
var createLayersWithIds = function createLayersWithIds(layers) {
|
|
5571
|
+
var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
5533
5572
|
if (!layers) return layers;
|
|
5534
5573
|
return produce.produce(layers, function (draft) {
|
|
5535
5574
|
for (var j = 0; j < draft.length; j += 1) {
|
|
@@ -5537,6 +5576,9 @@
|
|
|
5537
5576
|
|
|
5538
5577
|
if (!layer.id) {
|
|
5539
5578
|
layer.id = generateLayerId();
|
|
5579
|
+
} else if (checkIfMapLayerIdIsAlreadyTaken(state, layer.id)) {
|
|
5580
|
+
console.warn("Warning: Layer id " + layer.id + " was already taken: Generating new one.");
|
|
5581
|
+
layer.id = generateLayerId();
|
|
5540
5582
|
}
|
|
5541
5583
|
}
|
|
5542
5584
|
});
|
|
@@ -5589,21 +5631,17 @@
|
|
|
5589
5631
|
return state;
|
|
5590
5632
|
}
|
|
5591
5633
|
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
if (layerIndex_1 >= 0) {
|
|
5595
|
-
// Do nothing if layerId is already used
|
|
5634
|
+
if (checkIfMapLayerIdIsAlreadyTaken(state, layerId_1)) {
|
|
5635
|
+
console.warn("Warning: Layer id " + layerId_1 + " was already taken");
|
|
5596
5636
|
return state;
|
|
5597
5637
|
}
|
|
5598
5638
|
|
|
5599
5639
|
return produce.produce(state, function (draft) {
|
|
5600
|
-
if (
|
|
5601
|
-
|
|
5602
|
-
draft.byId[mapId_3].activeLayerId = layerId_1;
|
|
5603
|
-
}
|
|
5604
|
-
|
|
5605
|
-
draft.byId[mapId_3].mapLayers.unshift(layerId_1);
|
|
5640
|
+
if (!state.byId[mapId_3].mapLayers.length) {
|
|
5641
|
+
draft.byId[mapId_3].activeLayerId = layerId_1;
|
|
5606
5642
|
}
|
|
5643
|
+
|
|
5644
|
+
draft.byId[mapId_3].mapLayers.unshift(layerId_1);
|
|
5607
5645
|
});
|
|
5608
5646
|
}
|
|
5609
5647
|
|
|
@@ -5662,6 +5700,19 @@
|
|
|
5662
5700
|
|
|
5663
5701
|
return produce.produce(state, function (draft) {
|
|
5664
5702
|
draft.byId[mapId_7].isAnimating = true;
|
|
5703
|
+
|
|
5704
|
+
if (action.payload.start) {
|
|
5705
|
+
draft.byId[mapId_7].animationStartTime = action.payload.start.toISOString();
|
|
5706
|
+
}
|
|
5707
|
+
|
|
5708
|
+
if (action.payload.end) {
|
|
5709
|
+
draft.byId[mapId_7].animationEndTime = action.payload.end.toISOString();
|
|
5710
|
+
}
|
|
5711
|
+
|
|
5712
|
+
if (action.payload.interval && action.payload.interval !== draft.byId[mapId_7].timeStep) {
|
|
5713
|
+
draft.byId[mapId_7].timeStep = action.payload.interval;
|
|
5714
|
+
draft.byId[mapId_7].isTimestepAuto = false;
|
|
5715
|
+
}
|
|
5665
5716
|
});
|
|
5666
5717
|
}
|
|
5667
5718
|
|
|
@@ -5689,33 +5740,20 @@
|
|
|
5689
5740
|
return state;
|
|
5690
5741
|
}
|
|
5691
5742
|
|
|
5692
|
-
if (
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
// Do nothing if layerId is already used
|
|
5697
|
-
return state;
|
|
5698
|
-
}
|
|
5743
|
+
if (checkIfMapLayerIdIsAlreadyTaken(state, layerId_2)) {
|
|
5744
|
+
console.warn("Warning: Layer id " + layerId_2 + " was already taken");
|
|
5745
|
+
return state;
|
|
5746
|
+
}
|
|
5699
5747
|
|
|
5748
|
+
if (layer.layerType === LayerType.baseLayer) {
|
|
5700
5749
|
return produce.produce(state, function (draft) {
|
|
5701
|
-
|
|
5702
|
-
draft.byId[mapId_9].baseLayers.unshift(layerId_2);
|
|
5703
|
-
}
|
|
5750
|
+
draft.byId[mapId_9].baseLayers.unshift(layerId_2);
|
|
5704
5751
|
});
|
|
5705
5752
|
}
|
|
5706
5753
|
|
|
5707
5754
|
if (layer.layerType === LayerType.overLayer) {
|
|
5708
|
-
var layerIndex_3 = state.byId[mapId_9].overLayers.indexOf(layerId_2);
|
|
5709
|
-
|
|
5710
|
-
if (layerIndex_3 >= 0) {
|
|
5711
|
-
// Do nothing if layerId is already used
|
|
5712
|
-
return state;
|
|
5713
|
-
}
|
|
5714
|
-
|
|
5715
5755
|
return produce.produce(state, function (draft) {
|
|
5716
|
-
|
|
5717
|
-
draft.byId[mapId_9].overLayers.unshift(layerId_2);
|
|
5718
|
-
}
|
|
5756
|
+
draft.byId[mapId_9].overLayers.unshift(layerId_2);
|
|
5719
5757
|
});
|
|
5720
5758
|
}
|
|
5721
5759
|
|
|
@@ -5788,7 +5826,7 @@
|
|
|
5788
5826
|
case WEBMAP_SET_LAYERS:
|
|
5789
5827
|
{
|
|
5790
5828
|
var mapId_14 = action.payload.mapId;
|
|
5791
|
-
var layersWithIds = createLayersWithIds(action.payload.layers);
|
|
5829
|
+
var layersWithIds = createLayersWithIds(state, action.payload.layers);
|
|
5792
5830
|
var layerIds_1 = layersWithIds.map(function (_a) {
|
|
5793
5831
|
var id = _a.id;
|
|
5794
5832
|
return id;
|
|
@@ -5835,8 +5873,8 @@
|
|
|
5835
5873
|
baseLayers_1.push(layer);
|
|
5836
5874
|
}
|
|
5837
5875
|
});
|
|
5838
|
-
var baseLayersWithIds = createLayersWithIds(baseLayers_1);
|
|
5839
|
-
var overLayersWithIds = createLayersWithIds(overLayers_1);
|
|
5876
|
+
var baseLayersWithIds = createLayersWithIds(state, baseLayers_1);
|
|
5877
|
+
var overLayersWithIds = createLayersWithIds(state, overLayers_1);
|
|
5840
5878
|
var baseLayerIds_1 = baseLayersWithIds.map(function (_a) {
|
|
5841
5879
|
var id = _a.id;
|
|
5842
5880
|
return id;
|
|
@@ -6204,12 +6242,14 @@
|
|
|
6204
6242
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6205
6243
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
6206
6244
|
* */
|
|
6245
|
+
|
|
6207
6246
|
var generateTimeList = function generateTimeList(start, end, interval) {
|
|
6208
6247
|
var timeList = [];
|
|
6209
6248
|
var unixStart = moment__default["default"](start).utc().unix();
|
|
6210
6249
|
var unixEnd = moment__default["default"](end).utc().unix();
|
|
6250
|
+
var intervalSeconds = interval * 60;
|
|
6211
6251
|
|
|
6212
|
-
for (var j = unixStart; j <= unixEnd; j +=
|
|
6252
|
+
for (var j = unixStart; j <= unixEnd; j += intervalSeconds) {
|
|
6213
6253
|
timeList.push({
|
|
6214
6254
|
name: 'time',
|
|
6215
6255
|
value: moment__default["default"].unix(j).toISOString()
|
|
@@ -6235,8 +6275,8 @@
|
|
|
6235
6275
|
switch (_b.label) {
|
|
6236
6276
|
case 0:
|
|
6237
6277
|
mapId = payload.mapId, start = payload.start, end = payload.end, interval = payload.interval, timeList = payload.timeList;
|
|
6238
|
-
roundedStart = roundWithTimeStep(start && start.unix(), interval
|
|
6239
|
-
roundedEnd = roundWithTimeStep(end && end.unix(), interval
|
|
6278
|
+
roundedStart = roundWithTimeStep(start && start.unix(), interval, 'ceil');
|
|
6279
|
+
roundedEnd = roundWithTimeStep(end && end.unix(), interval, 'floor');
|
|
6240
6280
|
return [4
|
|
6241
6281
|
/*yield*/
|
|
6242
6282
|
, timeList || generateTimeList(moment__default["default"].utc(roundedStart * 1000), moment__default["default"].utc(roundedEnd * 1000), interval)];
|
|
@@ -6372,7 +6412,7 @@
|
|
|
6372
6412
|
mapId: mapId,
|
|
6373
6413
|
start: start,
|
|
6374
6414
|
end: end,
|
|
6375
|
-
interval: timeStep
|
|
6415
|
+
interval: timeStep
|
|
6376
6416
|
}))];
|
|
6377
6417
|
|
|
6378
6418
|
case 7:
|
|
@@ -6388,12 +6428,12 @@
|
|
|
6388
6428
|
});
|
|
6389
6429
|
}
|
|
6390
6430
|
function setLayerDimensionsSaga(_a) {
|
|
6391
|
-
var dimensions, layerId, layer, newTimeDimension, mapId, activeLayerId, shouldAutoUpdate, prevTimeDimension, error_1;
|
|
6431
|
+
var dimensions, layerId, layer, newTimeDimension, mapId, activeLayerId, shouldAutoUpdate, prevTimeDimension, isAnimating$1, webmapInstance, error_1;
|
|
6392
6432
|
var payload = _a.payload;
|
|
6393
6433
|
return __generator(this, function (_b) {
|
|
6394
6434
|
switch (_b.label) {
|
|
6395
6435
|
case 0:
|
|
6396
|
-
_b.trys.push([0,
|
|
6436
|
+
_b.trys.push([0, 11,, 12]);
|
|
6397
6437
|
|
|
6398
6438
|
dimensions = payload.dimensions, layerId = payload.layerId;
|
|
6399
6439
|
return [4
|
|
@@ -6427,10 +6467,17 @@
|
|
|
6427
6467
|
|
|
6428
6468
|
case 4:
|
|
6429
6469
|
prevTimeDimension = _b.sent();
|
|
6470
|
+
return [4
|
|
6471
|
+
/*yield*/
|
|
6472
|
+
, effects.select(isAnimating, mapId)];
|
|
6473
|
+
|
|
6474
|
+
case 5:
|
|
6475
|
+
isAnimating$1 = _b.sent();
|
|
6476
|
+
webmapInstance = getWMJSMapById(mapId);
|
|
6430
6477
|
if (!(layerId === activeLayerId && // only update the active layer
|
|
6431
6478
|
shouldAutoUpdate && newTimeDimension && newTimeDimension.maxValue && prevTimeDimension && prevTimeDimension.currentValue && prevTimeDimension.currentValue !== newTimeDimension.maxValue)) return [3
|
|
6432
6479
|
/*break*/
|
|
6433
|
-
,
|
|
6480
|
+
, 8];
|
|
6434
6481
|
return [4
|
|
6435
6482
|
/*yield*/
|
|
6436
6483
|
, effects.put(layerChangeDimension({
|
|
@@ -6442,32 +6489,47 @@
|
|
|
6442
6489
|
}
|
|
6443
6490
|
}))];
|
|
6444
6491
|
|
|
6445
|
-
case
|
|
6492
|
+
case 6:
|
|
6446
6493
|
_b.sent();
|
|
6447
6494
|
|
|
6448
6495
|
return [4
|
|
6449
6496
|
/*yield*/
|
|
6450
6497
|
, effects.call(updateAnimation, mapId, newTimeDimension.maxValue)];
|
|
6451
6498
|
|
|
6452
|
-
case
|
|
6499
|
+
case 7:
|
|
6453
6500
|
_b.sent();
|
|
6454
6501
|
|
|
6455
|
-
_b.label = 7;
|
|
6456
|
-
|
|
6457
|
-
case 7:
|
|
6458
6502
|
return [3
|
|
6459
6503
|
/*break*/
|
|
6460
|
-
,
|
|
6504
|
+
, 10];
|
|
6461
6505
|
|
|
6462
6506
|
case 8:
|
|
6507
|
+
if (!(isAnimating$1 && !webmapInstance.isAnimating && newTimeDimension && newTimeDimension.maxValue)) return [3
|
|
6508
|
+
/*break*/
|
|
6509
|
+
, 10];
|
|
6510
|
+
return [4
|
|
6511
|
+
/*yield*/
|
|
6512
|
+
, effects.call(updateAnimation, mapId, newTimeDimension.maxValue)];
|
|
6513
|
+
|
|
6514
|
+
case 9:
|
|
6515
|
+
_b.sent();
|
|
6516
|
+
|
|
6517
|
+
_b.label = 10;
|
|
6518
|
+
|
|
6519
|
+
case 10:
|
|
6520
|
+
return [3
|
|
6521
|
+
/*break*/
|
|
6522
|
+
, 12];
|
|
6523
|
+
|
|
6524
|
+
case 11:
|
|
6463
6525
|
error_1 = _b.sent(); // eslint-disable-next-line no-console
|
|
6464
6526
|
|
|
6465
6527
|
console.warn(error_1);
|
|
6466
6528
|
return [3
|
|
6467
6529
|
/*break*/
|
|
6468
|
-
,
|
|
6530
|
+
, 12];
|
|
6469
6531
|
|
|
6470
|
-
case
|
|
6532
|
+
case 12:
|
|
6471
6533
|
return [2
|
|
6472
6534
|
/*return*/
|
|
6473
6535
|
];
|
|
@@ -6695,6 +6757,26 @@
|
|
|
6695
6757
|
}, forceReload);
|
|
6696
6758
|
});
|
|
6697
6759
|
};
|
|
6760
|
+
/**
|
|
6761
|
+
* Returns a promise with a webmapjs node structure layers from the WMS GetCapabilities document.
|
|
6762
|
+
* @param serviceUrl The URL of the WMS service
|
|
6763
|
+
* @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
|
|
6764
|
+
*/
|
|
6765
|
+
|
|
6766
|
+
var getLayerNodesFromService = function getLayerNodesFromService(serviceUrl, forceReload) {
|
|
6767
|
+
if (forceReload === void 0) {
|
|
6768
|
+
forceReload = false;
|
|
6769
|
+
}
|
|
6770
|
+
|
|
6771
|
+
return new Promise(function (resolve, reject) {
|
|
6772
|
+
var serviceObject = webmap.WMGetServiceFromStore(serviceUrl);
|
|
6773
|
+
serviceObject.getNodes(function (nodes) {
|
|
6774
|
+
resolve(nodes.children);
|
|
6775
|
+
}, function (error) {
|
|
6776
|
+
reject(new Error(error));
|
|
6777
|
+
}, forceReload);
|
|
6778
|
+
});
|
|
6779
|
+
};
|
|
6698
6780
|
|
|
6699
6781
|
/* *
|
|
6700
6782
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -7628,7 +7710,7 @@
|
|
|
7628
7710
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7629
7711
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
7630
7712
|
* */
|
|
7631
|
-
var useStyles$
|
|
7713
|
+
var useStyles$z = core.makeStyles({
|
|
7632
7714
|
buttonDiv: {
|
|
7633
7715
|
position: 'relative'
|
|
7634
7716
|
},
|
|
@@ -7664,7 +7746,7 @@
|
|
|
7664
7746
|
handleClose = _a.handleClose,
|
|
7665
7747
|
_e = _a.layerType,
|
|
7666
7748
|
layerType = _e === void 0 ? LayerType.mapLayer : _e;
|
|
7667
|
-
var classes = useStyles$
|
|
7749
|
+
var classes = useStyles$z();
|
|
7668
7750
|
|
|
7669
7751
|
var _f = __read(React__namespace.useState(''), 2),
|
|
7670
7752
|
serviceURL = _f[0],
|
|
@@ -7827,7 +7909,7 @@
|
|
|
7827
7909
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7828
7910
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
7829
7911
|
* */
|
|
7830
|
-
var useStyles$
|
|
7912
|
+
var useStyles$y = core.makeStyles(function (theme) {
|
|
7831
7913
|
return {
|
|
7832
7914
|
buttonDiv: {
|
|
7833
7915
|
position: 'relative'
|
|
@@ -7862,7 +7944,7 @@
|
|
|
7862
7944
|
_f = _a.shouldFocus,
|
|
7863
7945
|
shouldFocus = _f === void 0 ? false : _f;
|
|
7864
7946
|
var ref = React__namespace.useRef(null);
|
|
7865
|
-
var classes = useStyles$
|
|
7947
|
+
var classes = useStyles$y();
|
|
7866
7948
|
|
|
7867
7949
|
var _g = __read(React__namespace.useState(false), 2),
|
|
7868
7950
|
open = _g[0],
|
|
@@ -7970,6 +8052,65 @@
|
|
|
7970
8052
|
return LayerManagerWidth.lg;
|
|
7971
8053
|
};
|
|
7972
8054
|
|
|
8055
|
+
/* *
|
|
8056
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8057
|
+
* you may not use this file except in compliance with the License.
|
|
8058
|
+
* You may obtain a copy of the License at
|
|
8059
|
+
*
|
|
8060
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8061
|
+
*
|
|
8062
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8063
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8064
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8065
|
+
* See the License for the specific language governing permissions and
|
|
8066
|
+
* limitations under the License.
|
|
8067
|
+
*
|
|
8068
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8069
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8070
|
+
* */
|
|
8071
|
+
var useStyles$x = core.makeStyles(function (theme) {
|
|
8072
|
+
return {
|
|
8073
|
+
button: {
|
|
8074
|
+
width: '24px',
|
|
8075
|
+
height: '24px',
|
|
8076
|
+
margin: '6px 0px 0px 10px',
|
|
8077
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
|
|
8078
|
+
borderRadius: '15%'
|
|
8079
|
+
}
|
|
8080
|
+
};
|
|
8081
|
+
});
|
|
8082
|
+
|
|
8083
|
+
var LayerSelectButtonConnect = function LayerSelectButtonConnect(_a) {
|
|
8084
|
+
var mapId = _a.mapId,
|
|
8085
|
+
_b = _a.source,
|
|
8086
|
+
source = _b === void 0 ? 'app' : _b;
|
|
8087
|
+
var dispatch = reactRedux.useDispatch();
|
|
8088
|
+
var classes = useStyles$x();
|
|
8089
|
+
var currentActiveMapId = reactRedux.useSelector(function (store) {
|
|
8090
|
+
return getDialogMapId(store, 'layerSelect');
|
|
8091
|
+
});
|
|
8092
|
+
var isOpenInStore = reactRedux.useSelector(function (store) {
|
|
8093
|
+
return getisDialogOpen(store, 'layerSelect');
|
|
8094
|
+
});
|
|
8095
|
+
var openLayerSelectDialog = React__namespace.useCallback(function () {
|
|
8096
|
+
dispatch(setActiveMapIdForDialog({
|
|
8097
|
+
type: 'layerSelect',
|
|
8098
|
+
activeMapId: mapId,
|
|
8099
|
+
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
|
|
8100
|
+
source: source
|
|
8101
|
+
}));
|
|
8102
|
+
}, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
|
|
8103
|
+
return /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
|
|
8104
|
+
title: "Layer Select"
|
|
8105
|
+
}, /*#__PURE__*/React__namespace.createElement(core.IconButton, {
|
|
8106
|
+
onClick: openLayerSelectDialog,
|
|
8107
|
+
className: classes.button,
|
|
8108
|
+
id: "layerSelectButton",
|
|
8109
|
+
"data-testid": "layerSelectButton",
|
|
8110
|
+
disableRipple: true
|
|
8111
|
+
}, /*#__PURE__*/React__namespace.createElement(icons.Add, null)));
|
|
8112
|
+
};
|
|
8113
|
+
|
|
7973
8114
|
/* *
|
|
7974
8115
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7975
8116
|
* you may not use this file except in compliance with the License.
|
|
@@ -8007,7 +8148,9 @@
|
|
|
8007
8148
|
preloadedServices = _c === void 0 ? preloadedDefaultMapServices : _c,
|
|
8008
8149
|
_d = _a.tooltip,
|
|
8009
8150
|
tooltip = _d === void 0 ? '' : _d,
|
|
8010
|
-
layerManagerWidth = _a.layerManagerWidth
|
|
8151
|
+
layerManagerWidth = _a.layerManagerWidth,
|
|
8152
|
+
_e = _a.layerSelect,
|
|
8153
|
+
layerSelect = _e === void 0 ? false : _e;
|
|
8011
8154
|
var classes = useStyles$w();
|
|
8012
8155
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
8013
8156
|
return /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
@@ -8029,6 +8172,8 @@
|
|
|
8029
8172
|
});
|
|
8030
8173
|
},
|
|
8031
8174
|
shouldFocus: true
|
|
8175
|
+
}), layerSelect && /*#__PURE__*/React__namespace.createElement(LayerSelectButtonConnect, {
|
|
8176
|
+
mapId: mapId
|
|
8032
8177
|
})), /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
8033
8178
|
className: columnSizes.column2
|
|
8034
8179
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -8694,7 +8839,7 @@
|
|
|
8694
8839
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
8695
8840
|
className: sliderClasses.sliderHeader
|
|
8696
8841
|
}, "Opacity"), /*#__PURE__*/React__namespace.createElement(shared.CustomSlider, {
|
|
8697
|
-
|
|
8842
|
+
"data-testid": "opacitySlider",
|
|
8698
8843
|
orientation: "vertical",
|
|
8699
8844
|
value: currentOpacity,
|
|
8700
8845
|
step: 0.01,
|
|
@@ -10124,12 +10269,16 @@
|
|
|
10124
10269
|
_c = _a.order,
|
|
10125
10270
|
order = _c === void 0 ? 0 : _c,
|
|
10126
10271
|
_d = _a.source,
|
|
10127
|
-
source = _d === void 0 ? 'app' : _d
|
|
10272
|
+
source = _d === void 0 ? 'app' : _d,
|
|
10273
|
+
_e = _a.layerSelect,
|
|
10274
|
+
layerSelect = _e === void 0 ? false : _e,
|
|
10275
|
+
_f = _a.showAddLayersTooltip,
|
|
10276
|
+
showAddLayersTooltip = _f === void 0 ? true : _f;
|
|
10128
10277
|
var classes = useStyles$j();
|
|
10129
10278
|
|
|
10130
|
-
var
|
|
10131
|
-
layerManagerWidth =
|
|
10132
|
-
setLayerManagerWidth =
|
|
10279
|
+
var _g = __read(React__namespace.useState(LayerManagerWidth.lg), 2),
|
|
10280
|
+
layerManagerWidth = _g[0],
|
|
10281
|
+
setLayerManagerWidth = _g[1];
|
|
10133
10282
|
|
|
10134
10283
|
var onChangeSize = function onChangeSize(_a) {
|
|
10135
10284
|
var width = _a.width;
|
|
@@ -10165,9 +10314,10 @@
|
|
|
10165
10314
|
className: classes.layerRowContainer
|
|
10166
10315
|
}, /*#__PURE__*/React__namespace.createElement(DescriptionRow, {
|
|
10167
10316
|
mapId: mapId,
|
|
10168
|
-
tooltip:
|
|
10317
|
+
tooltip: showAddLayersTooltip ? 'Add Layers' : '',
|
|
10169
10318
|
layerManagerWidth: layerManagerWidth,
|
|
10170
|
-
preloadedServices: preloadedMapServices
|
|
10319
|
+
preloadedServices: preloadedMapServices,
|
|
10320
|
+
layerSelect: layerSelect
|
|
10171
10321
|
}), /*#__PURE__*/React__namespace.createElement(LayerContainerRow, {
|
|
10172
10322
|
mapId: mapId,
|
|
10173
10323
|
layerManagerWidth: layerManagerWidth
|
|
@@ -10180,6 +10330,179 @@
|
|
|
10180
10330
|
}))));
|
|
10181
10331
|
};
|
|
10182
10332
|
|
|
10333
|
+
/* *
|
|
10334
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10335
|
+
* you may not use this file except in compliance with the License.
|
|
10336
|
+
* You may obtain a copy of the License at
|
|
10337
|
+
*
|
|
10338
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10339
|
+
*
|
|
10340
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10341
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10342
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10343
|
+
* See the License for the specific language governing permissions and
|
|
10344
|
+
* limitations under the License.
|
|
10345
|
+
*
|
|
10346
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10347
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10348
|
+
* */
|
|
10349
|
+
|
|
10350
|
+
var LayerSelect = function LayerSelect(_a) {
|
|
10351
|
+
var mapId = _a.mapId,
|
|
10352
|
+
bounds = _a.bounds,
|
|
10353
|
+
_b = _a.onClose,
|
|
10354
|
+
onClose = _b === void 0 ? function () {} : _b,
|
|
10355
|
+
showTitle = _a.showTitle,
|
|
10356
|
+
isOpen = _a.isOpen,
|
|
10357
|
+
_c = _a.onMouseDown,
|
|
10358
|
+
onMouseDown = _c === void 0 ? function () {} : _c,
|
|
10359
|
+
_d = _a.order,
|
|
10360
|
+
order = _d === void 0 ? 0 : _d,
|
|
10361
|
+
_e = _a.source,
|
|
10362
|
+
source = _e === void 0 ? 'module' : _e;
|
|
10363
|
+
return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
|
|
10364
|
+
title: showTitle ? "Layer Select " + mapId : 'Layer Select',
|
|
10365
|
+
startSize: {
|
|
10366
|
+
width: 500,
|
|
10367
|
+
height: 500
|
|
10368
|
+
},
|
|
10369
|
+
minWidth: 300,
|
|
10370
|
+
minHeight: 126,
|
|
10371
|
+
startPosition: {
|
|
10372
|
+
top: 100,
|
|
10373
|
+
left: 100
|
|
10374
|
+
},
|
|
10375
|
+
isOpen: isOpen,
|
|
10376
|
+
onChangeSize: function onChangeSize() {},
|
|
10377
|
+
onClose: onClose,
|
|
10378
|
+
headerSize: "small",
|
|
10379
|
+
bounds: bounds,
|
|
10380
|
+
"data-testid": "layerSelectWindow",
|
|
10381
|
+
onMouseDown: onMouseDown,
|
|
10382
|
+
order: order,
|
|
10383
|
+
source: source
|
|
10384
|
+
}, /*#__PURE__*/React__namespace.createElement("div", null));
|
|
10385
|
+
};
|
|
10386
|
+
|
|
10387
|
+
/* *
|
|
10388
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10389
|
+
* you may not use this file except in compliance with the License.
|
|
10390
|
+
* You may obtain a copy of the License at
|
|
10391
|
+
*
|
|
10392
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10393
|
+
*
|
|
10394
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10395
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10396
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10397
|
+
* See the License for the specific language governing permissions and
|
|
10398
|
+
* limitations under the License.
|
|
10399
|
+
*
|
|
10400
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10401
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10402
|
+
* */
|
|
10403
|
+
/**
|
|
10404
|
+
* LayerSelectConnect is a component that is opened from LayerManager
|
|
10405
|
+
* It's used to add Services and Layers to the application
|
|
10406
|
+
* It doesn't expect any props, its subcomponents only read and write to redux store
|
|
10407
|
+
*
|
|
10408
|
+
* ``` <LayerSelectConnect />```
|
|
10409
|
+
*/
|
|
10410
|
+
|
|
10411
|
+
var LayerSelectConnect = function LayerSelectConnect(_a) {
|
|
10412
|
+
var bounds = _a.bounds,
|
|
10413
|
+
_b = _a.showTitle,
|
|
10414
|
+
showTitle = _b === void 0 ? false : _b,
|
|
10415
|
+
_c = _a.preloadedServices,
|
|
10416
|
+
preloadedServices = _c === void 0 ? preloadedDefaultMapServices : _c;
|
|
10417
|
+
var dispatch = reactRedux.useDispatch();
|
|
10418
|
+
var isMounted = shared.useIsMounted().isMounted;
|
|
10419
|
+
var mapId = reactRedux.useSelector(function (store) {
|
|
10420
|
+
return getDialogMapId(store, 'layerSelect');
|
|
10421
|
+
});
|
|
10422
|
+
var isOpenInStore = reactRedux.useSelector(function (store) {
|
|
10423
|
+
return getisDialogOpen(store, 'layerSelect');
|
|
10424
|
+
});
|
|
10425
|
+
var onClose = React__namespace.useCallback(function () {
|
|
10426
|
+
return dispatch(setToggleOpenDialog({
|
|
10427
|
+
type: 'layerSelect',
|
|
10428
|
+
setOpen: false
|
|
10429
|
+
}));
|
|
10430
|
+
}, [dispatch]);
|
|
10431
|
+
var isMapPresent = reactRedux.useSelector(function (store) {
|
|
10432
|
+
return getIsMapPresent(store, mapId);
|
|
10433
|
+
});
|
|
10434
|
+
var uiOrder = reactRedux.useSelector(function (store) {
|
|
10435
|
+
return getDialogOrder(store, 'layerSelect');
|
|
10436
|
+
});
|
|
10437
|
+
var uiSource = reactRedux.useSelector(function (store) {
|
|
10438
|
+
return getDialogSource(store, 'layerSelect');
|
|
10439
|
+
});
|
|
10440
|
+
var uiIsOrderedOnTop = reactRedux.useSelector(function (store) {
|
|
10441
|
+
return getDialogIsOrderedOnTop(store, 'layerSelect');
|
|
10442
|
+
}); // Check to ensure the currently active map is still present on screen - if not, close the dialog
|
|
10443
|
+
|
|
10444
|
+
React__namespace.useEffect(function () {
|
|
10445
|
+
if (mapId !== '' && !isMapPresent) {
|
|
10446
|
+
onClose();
|
|
10447
|
+
}
|
|
10448
|
+
}, [mapId, isMapPresent, onClose]);
|
|
10449
|
+
var registerDialog$1 = React__namespace.useCallback(function () {
|
|
10450
|
+
return dispatch(registerDialog({
|
|
10451
|
+
type: 'layerSelect',
|
|
10452
|
+
setOpen: false
|
|
10453
|
+
}));
|
|
10454
|
+
}, [dispatch]);
|
|
10455
|
+
var unregisterDialog$1 = React__namespace.useCallback(function () {
|
|
10456
|
+
return dispatch(unregisterDialog({
|
|
10457
|
+
type: 'layerSelect'
|
|
10458
|
+
}));
|
|
10459
|
+
}, [dispatch]);
|
|
10460
|
+
var onOrderDialog = React__namespace.useCallback(function () {
|
|
10461
|
+
if (!uiIsOrderedOnTop) {
|
|
10462
|
+
dispatch(orderDialog({
|
|
10463
|
+
type: 'layerSelect'
|
|
10464
|
+
}));
|
|
10465
|
+
}
|
|
10466
|
+
}, [dispatch, uiIsOrderedOnTop]); // Register this dialog in the store
|
|
10467
|
+
|
|
10468
|
+
React__namespace.useEffect(function () {
|
|
10469
|
+
registerDialog$1();
|
|
10470
|
+
return function () {
|
|
10471
|
+
unregisterDialog$1();
|
|
10472
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10473
|
+
}, []);
|
|
10474
|
+
var serviceSetLayers$1 = React__namespace.useCallback(function (payload) {
|
|
10475
|
+
return dispatch(serviceSetLayers(payload));
|
|
10476
|
+
}, [dispatch]);
|
|
10477
|
+
React__namespace.useEffect(function () {
|
|
10478
|
+
if (isOpenInStore && preloadedServices && preloadedServices.length > 0) {
|
|
10479
|
+
preloadedServices.forEach(function (service) {
|
|
10480
|
+
getLayerNodesFromService(service.url).then(function (layers) {
|
|
10481
|
+
if (isMounted.current) {
|
|
10482
|
+
serviceSetLayers$1({
|
|
10483
|
+
service: service.url,
|
|
10484
|
+
layers: layers
|
|
10485
|
+
});
|
|
10486
|
+
}
|
|
10487
|
+
})["catch"](function () {
|
|
10488
|
+
return null;
|
|
10489
|
+
});
|
|
10490
|
+
});
|
|
10491
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10492
|
+
|
|
10493
|
+
}, [isOpenInStore, preloadedServices, serviceSetLayers$1]);
|
|
10494
|
+
return /*#__PURE__*/React__namespace.createElement(LayerSelect, {
|
|
10495
|
+
mapId: mapId,
|
|
10496
|
+
bounds: bounds,
|
|
10497
|
+
isOpen: isOpenInStore,
|
|
10498
|
+
onClose: onClose,
|
|
10499
|
+
showTitle: showTitle,
|
|
10500
|
+
onMouseDown: onOrderDialog,
|
|
10501
|
+
order: uiOrder,
|
|
10502
|
+
source: uiSource
|
|
10503
|
+
});
|
|
10504
|
+
};
|
|
10505
|
+
|
|
10183
10506
|
/* *
|
|
10184
10507
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10185
10508
|
* you may not use this file except in compliance with the License.
|
|
@@ -10214,7 +10537,9 @@
|
|
|
10214
10537
|
preloadedBaseServices = _a.preloadedBaseServices,
|
|
10215
10538
|
bounds = _a.bounds,
|
|
10216
10539
|
_b = _a.showTitle,
|
|
10217
|
-
showTitle = _b === void 0 ? false : _b
|
|
10540
|
+
showTitle = _b === void 0 ? false : _b,
|
|
10541
|
+
_c = _a.layerSelect,
|
|
10542
|
+
layerSelect = _c === void 0 ? false : _c;
|
|
10218
10543
|
var dispatch = reactRedux.useDispatch();
|
|
10219
10544
|
var isOpenInStore = reactRedux.useSelector(function (store) {
|
|
10220
10545
|
return getisDialogOpen(store, 'layerManager');
|
|
@@ -10271,7 +10596,7 @@
|
|
|
10271
10596
|
unregisterDialog$1();
|
|
10272
10597
|
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10273
10598
|
}, []);
|
|
10274
|
-
return /*#__PURE__*/React__namespace.createElement(LayerManager, {
|
|
10599
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(LayerManager, {
|
|
10275
10600
|
mapId: mapId,
|
|
10276
10601
|
preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
|
|
10277
10602
|
preloadedMapServices: preloadedMapServices,
|
|
@@ -10281,9 +10606,10 @@
|
|
|
10281
10606
|
onClose: onClose,
|
|
10282
10607
|
showTitle: showTitle,
|
|
10283
10608
|
onMouseDown: onOrderDialog,
|
|
10284
|
-
order: uiOrder,
|
|
10285
|
-
source: uiSource
|
|
10286
|
-
|
|
10609
|
+
order: uiOrder,
|
|
10610
|
+
source: uiSource,
|
|
10611
|
+
layerSelect: layerSelect
|
|
10612
|
+
}), layerSelect && /*#__PURE__*/React__namespace.createElement(LayerSelectConnect, null));
|
|
10287
10613
|
};
|
|
10288
10614
|
|
|
10289
10615
|
/* *
|
|
@@ -11401,9 +11727,6 @@
|
|
|
11401
11727
|
}
|
|
11402
11728
|
};
|
|
11403
11729
|
});
|
|
11404
|
-
var defaultDelay = 1000; // [ms]
|
|
11405
|
-
|
|
11406
|
-
var speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
|
|
11407
11730
|
|
|
11408
11731
|
var SpeedButton = function SpeedButton(_a) {
|
|
11409
11732
|
var animationDelay = _a.animationDelay,
|
|
@@ -11417,7 +11740,7 @@
|
|
|
11417
11740
|
|
|
11418
11741
|
var marks = speedFactors.map(function (speedFactor, i) {
|
|
11419
11742
|
return {
|
|
11420
|
-
delay:
|
|
11743
|
+
delay: getSpeedDelay(speedFactor),
|
|
11421
11744
|
markPos: i,
|
|
11422
11745
|
text: speedFactor + "x"
|
|
11423
11746
|
};
|
|
@@ -11469,7 +11792,7 @@
|
|
|
11469
11792
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11470
11793
|
className: sliderClasses.sliderHeader
|
|
11471
11794
|
}, "Speed"), /*#__PURE__*/React__namespace.createElement(shared.CustomSlider, {
|
|
11472
|
-
|
|
11795
|
+
"data-testid": "speedSlider",
|
|
11473
11796
|
orientation: "vertical",
|
|
11474
11797
|
value: currentValue,
|
|
11475
11798
|
step: null,
|
|
@@ -11643,21 +11966,6 @@
|
|
|
11643
11966
|
disabled: {}
|
|
11644
11967
|
};
|
|
11645
11968
|
});
|
|
11646
|
-
|
|
11647
|
-
var ThumbComponent = function ThumbComponent(props) {
|
|
11648
|
-
var ref = React__namespace.useRef(null);
|
|
11649
|
-
React__namespace.useEffect(function () {
|
|
11650
|
-
if (ref.current) {
|
|
11651
|
-
ref.current.focus();
|
|
11652
|
-
}
|
|
11653
|
-
}, []);
|
|
11654
|
-
return /*#__PURE__*/React__namespace.createElement("span", __assign({}, props, {
|
|
11655
|
-
ref: ref,
|
|
11656
|
-
"data-testid": "timeStepButtonSliderThumb",
|
|
11657
|
-
id: "thumbTimeStep"
|
|
11658
|
-
}));
|
|
11659
|
-
};
|
|
11660
|
-
|
|
11661
11969
|
var TimeStepSwitch = core.withStyles(function (theme) {
|
|
11662
11970
|
return {
|
|
11663
11971
|
root: {
|
|
@@ -11761,7 +12069,7 @@
|
|
|
11761
12069
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11762
12070
|
className: sliderClasses.sliderHeader
|
|
11763
12071
|
}, "Time step"), /*#__PURE__*/React__namespace.createElement(shared.CustomSlider, {
|
|
11764
|
-
|
|
12072
|
+
"data-testid": "timeStepButtonSlider",
|
|
11765
12073
|
orientation: "vertical",
|
|
11766
12074
|
value: currentMark && currentMark.value ? currentMark.value : 0,
|
|
11767
12075
|
step: null,
|
|
@@ -11769,9 +12077,9 @@
|
|
|
11769
12077
|
max: timeStepMarks[timeStepMarks.length - 1].value,
|
|
11770
12078
|
marks: timeStepMarks,
|
|
11771
12079
|
disabled: disabledSlider,
|
|
11772
|
-
ThumbComponent: ThumbComponent,
|
|
11773
12080
|
onChange: onChangeSlider,
|
|
11774
|
-
onKeyDown: onKeyDown
|
|
12081
|
+
onKeyDown: onKeyDown,
|
|
12082
|
+
shouldAutoFocus: true
|
|
11775
12083
|
}), /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
|
|
11776
12084
|
title: timestepAutoSwitch.title
|
|
11777
12085
|
}, /*#__PURE__*/React__namespace.createElement("span", {
|
|
@@ -14329,6 +14637,7 @@
|
|
|
14329
14637
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
14330
14638
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
14331
14639
|
* */
|
|
14640
|
+
var animationIntervalDefault = 5;
|
|
14332
14641
|
var connectRedux$3 = reactRedux.connect(function (store, props) {
|
|
14333
14642
|
return {
|
|
14334
14643
|
isAnimating: isAnimating(store, props.mapId),
|
|
@@ -14349,8 +14658,7 @@
|
|
|
14349
14658
|
timeStep = _a.timeStep,
|
|
14350
14659
|
mapStartAnimation = _a.mapStartAnimation,
|
|
14351
14660
|
mapStopAnimation = _a.mapStopAnimation;
|
|
14352
|
-
var
|
|
14353
|
-
var animationInterval = timeStep ? timeStep * 60 : animationIntervalDefault;
|
|
14661
|
+
var animationInterval = timeStep || animationIntervalDefault;
|
|
14354
14662
|
|
|
14355
14663
|
var onTogglePlay = function onTogglePlay() {
|
|
14356
14664
|
if (isAnimating) {
|
|
@@ -14880,128 +15188,6 @@
|
|
|
14880
15188
|
|
|
14881
15189
|
var TimeSliderConnect = connectRedux(ConnectedTimeSlider);
|
|
14882
15190
|
|
|
14883
|
-
/* *
|
|
14884
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14885
|
-
* you may not use this file except in compliance with the License.
|
|
14886
|
-
* You may obtain a copy of the License at
|
|
14887
|
-
*
|
|
14888
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14889
|
-
*
|
|
14890
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14891
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14892
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14893
|
-
* See the License for the specific language governing permissions and
|
|
14894
|
-
* limitations under the License.
|
|
14895
|
-
*
|
|
14896
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
14897
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
14898
|
-
* */
|
|
14899
|
-
var generateUniqueLayerIds = function generateUniqueLayerIds(layers, activeLayerId) {
|
|
14900
|
-
// if there is an activeLayerId given, generate a unique id for it
|
|
14901
|
-
var activeLayerNewId = activeLayerId ? generateLayerId() : activeLayerId; // first match is set as activeLayer because there can only be one
|
|
14902
|
-
|
|
14903
|
-
var activeLayerIndex = layers.findIndex(function (layer) {
|
|
14904
|
-
return layer.id === activeLayerId;
|
|
14905
|
-
});
|
|
14906
|
-
var layersNewIds = layers.map(function (layer, index) {
|
|
14907
|
-
if (layer.id && index === activeLayerIndex) {
|
|
14908
|
-
return __assign(__assign({}, layer), {
|
|
14909
|
-
id: activeLayerNewId
|
|
14910
|
-
});
|
|
14911
|
-
}
|
|
14912
|
-
|
|
14913
|
-
return __assign(__assign({}, layer), {
|
|
14914
|
-
id: generateLayerId()
|
|
14915
|
-
});
|
|
14916
|
-
});
|
|
14917
|
-
return {
|
|
14918
|
-
layersNewIds: layersNewIds,
|
|
14919
|
-
activeLayerNewId: activeLayerNewId
|
|
14920
|
-
};
|
|
14921
|
-
};
|
|
14922
|
-
|
|
14923
|
-
/* *
|
|
14924
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14925
|
-
* you may not use this file except in compliance with the License.
|
|
14926
|
-
* You may obtain a copy of the License at
|
|
14927
|
-
*
|
|
14928
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14929
|
-
*
|
|
14930
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14931
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14932
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14933
|
-
* See the License for the specific language governing permissions and
|
|
14934
|
-
* limitations under the License.
|
|
14935
|
-
*
|
|
14936
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
14937
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
14938
|
-
* */
|
|
14939
|
-
var initialBbox = {
|
|
14940
|
-
srs: 'EPSG:3857',
|
|
14941
|
-
bbox: {
|
|
14942
|
-
left: -450651.2255879827,
|
|
14943
|
-
bottom: 6490531.093143953,
|
|
14944
|
-
right: 1428345.8183648037,
|
|
14945
|
-
top: 7438773.776232235
|
|
14946
|
-
}
|
|
14947
|
-
};
|
|
14948
|
-
var useDefaultMapSettings = function useDefaultMapSettings(props) {
|
|
14949
|
-
if (props === void 0) {
|
|
14950
|
-
props = {};
|
|
14951
|
-
}
|
|
14952
|
-
|
|
14953
|
-
var dispatch = reactRedux.useDispatch();
|
|
14954
|
-
var _a = props.mapId,
|
|
14955
|
-
mapId = _a === void 0 ? 'test-map-1' : _a;
|
|
14956
|
-
var _b = props.layers,
|
|
14957
|
-
layers = _b === void 0 ? [] : _b,
|
|
14958
|
-
_c = props.activeLayerId,
|
|
14959
|
-
activeLayerId = _c === void 0 ? undefined : _c,
|
|
14960
|
-
_d = props.baseLayers,
|
|
14961
|
-
baseLayers = _d === void 0 ? [__assign(__assign({}, baseLayerGrey$1), {
|
|
14962
|
-
id: "layer-grey-" + mapId
|
|
14963
|
-
}), overLayer$1] : _d,
|
|
14964
|
-
_e = props.bbox,
|
|
14965
|
-
bbox = _e === void 0 ? initialBbox.bbox : _e,
|
|
14966
|
-
_f = props.srs,
|
|
14967
|
-
srs = _f === void 0 ? initialBbox.srs : _f,
|
|
14968
|
-
_g = props.shouldAutoUpdate,
|
|
14969
|
-
shouldAutoUpdate = _g === void 0 ? false : _g; // make sure all layers have a unique id before going forward
|
|
14970
|
-
|
|
14971
|
-
var _h = generateUniqueLayerIds(layers, activeLayerId),
|
|
14972
|
-
layersNewIds = _h.layersNewIds,
|
|
14973
|
-
activeLayerNewId = _h.activeLayerNewId;
|
|
14974
|
-
|
|
14975
|
-
React__namespace.useEffect(function () {
|
|
14976
|
-
// set layers
|
|
14977
|
-
dispatch(setLayers({
|
|
14978
|
-
mapId: mapId,
|
|
14979
|
-
layers: layersNewIds
|
|
14980
|
-
})); // set active layer if given otherwise to first layer
|
|
14981
|
-
|
|
14982
|
-
dispatch(setActiveLayerId({
|
|
14983
|
-
mapId: mapId,
|
|
14984
|
-
layerId: activeLayerNewId || layersNewIds.length && layersNewIds[0].id
|
|
14985
|
-
})); // baseLayers
|
|
14986
|
-
|
|
14987
|
-
dispatch(setBaseLayers({
|
|
14988
|
-
mapId: mapId,
|
|
14989
|
-
layers: baseLayers
|
|
14990
|
-
})); // bbox
|
|
14991
|
-
|
|
14992
|
-
dispatch(setBbox$1({
|
|
14993
|
-
bbox: bbox,
|
|
14994
|
-
srs: srs,
|
|
14995
|
-
mapId: mapId
|
|
14996
|
-
})); // auto update
|
|
14997
|
-
|
|
14998
|
-
dispatch(toggleAutoUpdate({
|
|
14999
|
-
mapId: mapId,
|
|
15000
|
-
shouldAutoUpdate: shouldAutoUpdate
|
|
15001
|
-
})); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15002
|
-
}, []);
|
|
15003
|
-
};
|
|
15004
|
-
|
|
15005
15191
|
/* *
|
|
15006
15192
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15007
15193
|
* you may not use this file except in compliance with the License.
|
|
@@ -17918,18 +18104,27 @@
|
|
|
17918
18104
|
var children = props.children;
|
|
17919
18105
|
|
|
17920
18106
|
if (children !== this.currentMapProps.children) {
|
|
17921
|
-
var wmjsLayers_1 = this.adaguc.webMapJS.getLayers();
|
|
17922
18107
|
var myChildren_1 = [];
|
|
18108
|
+
var takenIds_1 = new Set();
|
|
17923
18109
|
React__namespace.Children.forEach(children, function (child) {
|
|
17924
|
-
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
18110
|
+
if (child) {
|
|
18111
|
+
var childProps = child.props;
|
|
18112
|
+
|
|
18113
|
+
if (childProps && childProps.id) {
|
|
18114
|
+
if (!takenIds_1.has(childProps.id)) {
|
|
18115
|
+
myChildren_1.push(child);
|
|
18116
|
+
takenIds_1.add(childProps.id);
|
|
18117
|
+
} else {
|
|
18118
|
+
childProps.onLayerError(childProps, new Error("Duplicate layer id \"" + childProps.id + "\" encountered within this WebMap"), _this.adaguc.webMapJS);
|
|
18119
|
+
console.warn('ReactWMJSLayer has a duplicate id', child);
|
|
18120
|
+
}
|
|
18121
|
+
} else {
|
|
18122
|
+
webmap.debug(webmap.DebugType.Warning, 'ReactElement child ignored: has no props or id', child);
|
|
18123
|
+
}
|
|
17930
18124
|
}
|
|
17931
18125
|
});
|
|
17932
18126
|
myChildren_1.reverse();
|
|
18127
|
+
var wmjsLayers_1 = this.adaguc.webMapJS.getLayers();
|
|
17933
18128
|
|
|
17934
18129
|
var _loop_1 = function _loop_1(l) {
|
|
17935
18130
|
if (myChildren_1.filter(function (c) {
|
|
@@ -19181,14 +19376,51 @@
|
|
|
19181
19376
|
* See the License for the specific language governing permissions and
|
|
19182
19377
|
* limitations under the License.
|
|
19183
19378
|
*
|
|
19184
|
-
* Copyright
|
|
19185
|
-
* Copyright
|
|
19379
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19380
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
19381
|
+
* */
|
|
19382
|
+
var generateUniqueLayerIds = function generateUniqueLayerIds(layers, activeLayerId) {
|
|
19383
|
+
// if there is an activeLayerId given, generate a unique id for it
|
|
19384
|
+
var activeLayerNewId = activeLayerId ? generateLayerId() : activeLayerId; // first match is set as activeLayer because there can only be one
|
|
19385
|
+
|
|
19386
|
+
var activeLayerIndex = layers.findIndex(function (layer) {
|
|
19387
|
+
return layer.id === activeLayerId;
|
|
19388
|
+
});
|
|
19389
|
+
var layersNewIds = layers.map(function (layer, index) {
|
|
19390
|
+
if (layer.id && index === activeLayerIndex) {
|
|
19391
|
+
return __assign(__assign({}, layer), {
|
|
19392
|
+
id: activeLayerNewId
|
|
19393
|
+
});
|
|
19394
|
+
}
|
|
19395
|
+
|
|
19396
|
+
return __assign(__assign({}, layer), {
|
|
19397
|
+
id: generateLayerId()
|
|
19398
|
+
});
|
|
19399
|
+
});
|
|
19400
|
+
return {
|
|
19401
|
+
layersNewIds: layersNewIds,
|
|
19402
|
+
activeLayerNewId: activeLayerNewId
|
|
19403
|
+
};
|
|
19404
|
+
};
|
|
19405
|
+
|
|
19406
|
+
/* *
|
|
19407
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19408
|
+
* you may not use this file except in compliance with the License.
|
|
19409
|
+
* You may obtain a copy of the License at
|
|
19410
|
+
*
|
|
19411
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19412
|
+
*
|
|
19413
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19414
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19415
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19416
|
+
* See the License for the specific language governing permissions and
|
|
19417
|
+
* limitations under the License.
|
|
19418
|
+
*
|
|
19419
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19420
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
19186
19421
|
* */
|
|
19187
19422
|
var useStyles$4 = core.makeStyles(function (theme) {
|
|
19188
19423
|
return {
|
|
19189
|
-
draggableThing: {
|
|
19190
|
-
boxShadow: '4px 4px 15px 1px rgba(0,0,0,0.75)'
|
|
19191
|
-
},
|
|
19192
19424
|
mapTitle: {
|
|
19193
19425
|
position: 'absolute',
|
|
19194
19426
|
padding: '5px',
|
|
@@ -19204,6 +19436,15 @@
|
|
|
19204
19436
|
}
|
|
19205
19437
|
};
|
|
19206
19438
|
});
|
|
19439
|
+
var defaultBbox = {
|
|
19440
|
+
srs: 'EPSG:3857',
|
|
19441
|
+
bbox: {
|
|
19442
|
+
left: -450651.2255879827,
|
|
19443
|
+
bottom: 6490531.093143953,
|
|
19444
|
+
right: 1428345.8183648037,
|
|
19445
|
+
top: 7438773.776232235
|
|
19446
|
+
}
|
|
19447
|
+
};
|
|
19207
19448
|
var ConfigurableConnectedMap = function ConfigurableConnectedMap(_a) {
|
|
19208
19449
|
var id = _a.id,
|
|
19209
19450
|
title = _a.title,
|
|
@@ -19222,45 +19463,96 @@
|
|
|
19222
19463
|
displayDimensionSelectButtonInMap = _e === void 0 ? true : _e,
|
|
19223
19464
|
_f = _a.shouldAutoUpdate,
|
|
19224
19465
|
shouldAutoUpdate = _f === void 0 ? false : _f,
|
|
19225
|
-
_g = _a.
|
|
19226
|
-
|
|
19227
|
-
|
|
19466
|
+
_g = _a.shouldAnimate,
|
|
19467
|
+
shouldAnimate = _g === void 0 ? false : _g,
|
|
19468
|
+
_h = _a.animationPayload,
|
|
19469
|
+
animationPayload = _h === void 0 ? undefined : _h,
|
|
19470
|
+
_j = _a.shouldShowZoomControls,
|
|
19471
|
+
shouldShowZoomControls = _j === void 0 ? false : _j;
|
|
19472
|
+
var classes = useStyles$4();
|
|
19473
|
+
var dispatch = reactRedux.useDispatch();
|
|
19474
|
+
var mapId = React__default["default"].useRef(id || generateMapId()).current;
|
|
19228
19475
|
|
|
19229
19476
|
var baseLayerWithUniqueId = __assign(__assign({}, baseLayer), {
|
|
19230
|
-
id: "baseLayer-" +
|
|
19231
|
-
});
|
|
19477
|
+
id: "baseLayer-" + mapId
|
|
19478
|
+
}); // make sure all layers have a unique id before going forward
|
|
19232
19479
|
|
|
19233
|
-
|
|
19234
|
-
|
|
19235
|
-
|
|
19236
|
-
|
|
19237
|
-
|
|
19238
|
-
|
|
19239
|
-
|
|
19240
|
-
|
|
19241
|
-
|
|
19242
|
-
|
|
19243
|
-
|
|
19244
|
-
|
|
19480
|
+
|
|
19481
|
+
var _k = generateUniqueLayerIds(layers, activeLayerId),
|
|
19482
|
+
layersNewIds = _k.layersNewIds,
|
|
19483
|
+
activeLayerNewId = _k.activeLayerNewId;
|
|
19484
|
+
|
|
19485
|
+
React__default["default"].useEffect(function () {
|
|
19486
|
+
// set layers
|
|
19487
|
+
dispatch(setLayers({
|
|
19488
|
+
mapId: mapId,
|
|
19489
|
+
layers: layersNewIds
|
|
19490
|
+
})); // set active layer if given otherwise to first layer
|
|
19491
|
+
|
|
19492
|
+
dispatch(setActiveLayerId({
|
|
19493
|
+
mapId: mapId,
|
|
19494
|
+
layerId: activeLayerNewId || layersNewIds.length && layersNewIds[0].id
|
|
19495
|
+
})); // baseLayers
|
|
19496
|
+
|
|
19497
|
+
dispatch(setBaseLayers({
|
|
19498
|
+
mapId: mapId,
|
|
19499
|
+
layers: [baseLayerWithUniqueId, __assign(__assign({}, overLayer$1), {
|
|
19500
|
+
id: generateLayerId()
|
|
19501
|
+
})]
|
|
19502
|
+
})); // bbox
|
|
19503
|
+
|
|
19504
|
+
dispatch(setBbox$1({
|
|
19505
|
+
bbox: bbox || defaultBbox.bbox,
|
|
19506
|
+
srs: srs || defaultBbox.srs,
|
|
19507
|
+
mapId: mapId
|
|
19508
|
+
})); // auto update
|
|
19509
|
+
|
|
19510
|
+
dispatch(toggleAutoUpdate({
|
|
19511
|
+
mapId: mapId,
|
|
19512
|
+
shouldAutoUpdate: shouldAutoUpdate
|
|
19513
|
+
})); // turn animation on
|
|
19514
|
+
|
|
19515
|
+
if (shouldAnimate === true) {
|
|
19516
|
+
var duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
|
|
19517
|
+
|
|
19518
|
+
dispatch(mapStartAnimation({
|
|
19519
|
+
mapId: mapId,
|
|
19520
|
+
start: moment__default["default"].utc().subtract(duration, 'minutes'),
|
|
19521
|
+
end: moment__default["default"].utc(),
|
|
19522
|
+
interval: animationPayload && animationPayload.interval ? animationPayload.interval : animationIntervalDefault
|
|
19523
|
+
}));
|
|
19524
|
+
|
|
19525
|
+
if (animationPayload && animationPayload.speed) {
|
|
19526
|
+
dispatch(setAnimationDelay({
|
|
19527
|
+
mapId: mapId,
|
|
19528
|
+
animationDelay: getSpeedDelay(animationPayload.speed)
|
|
19529
|
+
}));
|
|
19530
|
+
}
|
|
19531
|
+
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19532
|
+
|
|
19533
|
+
}, []);
|
|
19245
19534
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
19246
|
-
className: className || classes.mapContainer
|
|
19535
|
+
className: className || classes.mapContainer,
|
|
19536
|
+
"data-testid": "configurableConnectedMap"
|
|
19247
19537
|
}, /*#__PURE__*/React__default["default"].createElement(core.Typography, {
|
|
19538
|
+
"data-testid": "mapTitle",
|
|
19248
19539
|
className: classes.mapTitle
|
|
19249
|
-
}, title ||
|
|
19540
|
+
}, title || mapId), /*#__PURE__*/React__default["default"].createElement(MapControls, {
|
|
19541
|
+
"data-testid": "mapControls",
|
|
19250
19542
|
style: {
|
|
19251
19543
|
top: shouldShowZoomControls ? 120 : 24
|
|
19252
19544
|
}
|
|
19253
19545
|
}, displayLayerManagerButtonInMap && /*#__PURE__*/React__default["default"].createElement(LayerManagerMapButtonConnect, {
|
|
19254
|
-
mapId:
|
|
19546
|
+
mapId: mapId
|
|
19255
19547
|
}), /*#__PURE__*/React__default["default"].createElement(LegendMapButtonConnect, {
|
|
19256
|
-
mapId:
|
|
19548
|
+
mapId: mapId
|
|
19257
19549
|
}), displayDimensionSelectButtonInMap && /*#__PURE__*/React__default["default"].createElement(MultiDimensionSelectMapButtonsConnect, {
|
|
19258
|
-
mapId:
|
|
19550
|
+
mapId: mapId
|
|
19259
19551
|
})), /*#__PURE__*/React__default["default"].createElement(MapViewConnect, {
|
|
19260
19552
|
controls: {},
|
|
19261
19553
|
displayTimeInMap: displayTimeInMap,
|
|
19262
19554
|
showScaleBar: false,
|
|
19263
|
-
mapId:
|
|
19555
|
+
mapId: mapId
|
|
19264
19556
|
}));
|
|
19265
19557
|
};
|
|
19266
19558
|
|
|
@@ -19651,10 +19943,14 @@
|
|
|
19651
19943
|
activeLayerId = _c === void 0 ? undefined : _c,
|
|
19652
19944
|
_d = _a.shouldAutoUpdate,
|
|
19653
19945
|
shouldAutoUpdate = _d === void 0 ? false : _d,
|
|
19946
|
+
_e = _a.shouldAnimate,
|
|
19947
|
+
shouldAnimate = _e === void 0 ? false : _e,
|
|
19654
19948
|
bbox = _a.bbox,
|
|
19655
19949
|
srs = _a.srs,
|
|
19656
|
-
|
|
19657
|
-
shouldShowZoomControls =
|
|
19950
|
+
_f = _a.shouldShowZoomControls,
|
|
19951
|
+
shouldShowZoomControls = _f === void 0 ? true : _f,
|
|
19952
|
+
_g = _a.animationPayload,
|
|
19953
|
+
animationPayload = _g === void 0 ? undefined : _g;
|
|
19658
19954
|
var classes = useStyles$2();
|
|
19659
19955
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
19660
19956
|
className: classes.mapSliderConnect,
|
|
@@ -19677,10 +19973,111 @@
|
|
|
19677
19973
|
bbox: bbox,
|
|
19678
19974
|
srs: srs,
|
|
19679
19975
|
shouldAutoUpdate: shouldAutoUpdate,
|
|
19976
|
+
shouldAnimate: shouldAnimate,
|
|
19977
|
+
animationPayload: animationPayload,
|
|
19680
19978
|
shouldShowZoomControls: shouldShowZoomControls
|
|
19681
19979
|
}));
|
|
19682
19980
|
};
|
|
19683
19981
|
|
|
19982
|
+
/* *
|
|
19983
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19984
|
+
* you may not use this file except in compliance with the License.
|
|
19985
|
+
* You may obtain a copy of the License at
|
|
19986
|
+
*
|
|
19987
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19988
|
+
*
|
|
19989
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19990
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19991
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19992
|
+
* See the License for the specific language governing permissions and
|
|
19993
|
+
* limitations under the License.
|
|
19994
|
+
*
|
|
19995
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19996
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
19997
|
+
* */
|
|
19998
|
+
var componentsLookUp = function componentsLookUp(_a) {
|
|
19999
|
+
var componentType = _a.componentType,
|
|
20000
|
+
initialProps = _a.initialProps,
|
|
20001
|
+
id = _a.id;
|
|
20002
|
+
|
|
20003
|
+
switch (componentType) {
|
|
20004
|
+
case 'ConfigurableMap':
|
|
20005
|
+
case 'ConfigurableMapWithSlider':
|
|
20006
|
+
{
|
|
20007
|
+
var _b = initialProps,
|
|
20008
|
+
mapPreset = _b.mapPreset,
|
|
20009
|
+
shouldShowZoomControls = _b.shouldShowZoomControls;
|
|
20010
|
+
return /*#__PURE__*/React__default["default"].createElement(ConfigurableMapWithSliderConnect, __assign({}, mapPreset, {
|
|
20011
|
+
id: id,
|
|
20012
|
+
bbox: mapPreset && mapPreset.proj && mapPreset.proj.bbox,
|
|
20013
|
+
srs: mapPreset && mapPreset.proj && mapPreset.proj.srs,
|
|
20014
|
+
shouldAutoUpdate: mapPreset && mapPreset.shouldAutoUpdate || false,
|
|
20015
|
+
shouldShowZoomControls: shouldShowZoomControls !== undefined ? shouldShowZoomControls : true,
|
|
20016
|
+
shouldAnimate: mapPreset && mapPreset.shouldAnimate || false,
|
|
20017
|
+
animationPayload: mapPreset && mapPreset.animationPayload ? mapPreset.animationPayload : undefined,
|
|
20018
|
+
"data-testid": "coreConfigurableMapWithSlider"
|
|
20019
|
+
}));
|
|
20020
|
+
}
|
|
20021
|
+
|
|
20022
|
+
case 'HarmonieTempAndPrecipPreset':
|
|
20023
|
+
{
|
|
20024
|
+
var layers = initialProps.layers;
|
|
20025
|
+
return /*#__PURE__*/React__default["default"].createElement(HarmonieTempAndPrecipPreset, {
|
|
20026
|
+
layers: layers || null,
|
|
20027
|
+
"data-testid": "coreHarmonieTempAndPrecipPreset"
|
|
20028
|
+
});
|
|
20029
|
+
}
|
|
20030
|
+
|
|
20031
|
+
case 'HarmRefTimePreset':
|
|
20032
|
+
{
|
|
20033
|
+
var _c = initialProps,
|
|
20034
|
+
layers = _c.layers,
|
|
20035
|
+
layerSyncGroupId = _c.layerSyncGroupId;
|
|
20036
|
+
return /*#__PURE__*/React__default["default"].createElement(HarmRefTimePreset, {
|
|
20037
|
+
layers: layers || [],
|
|
20038
|
+
layerSyncGroupId: layerSyncGroupId,
|
|
20039
|
+
"data-testid": "coreHarmonieRefTimePreset"
|
|
20040
|
+
});
|
|
20041
|
+
}
|
|
20042
|
+
|
|
20043
|
+
case 'ConfigurableMultiMapWithSlider':
|
|
20044
|
+
{
|
|
20045
|
+
var _d = initialProps,
|
|
20046
|
+
mapPreset_1 = _d.mapPreset,
|
|
20047
|
+
shouldShowZoomControls = _d.shouldShowZoomControls;
|
|
20048
|
+
if (!mapPreset_1 || mapPreset_1.length === 0) return null;
|
|
20049
|
+
return /*#__PURE__*/React__default["default"].createElement(MultiMapViewConnect, {
|
|
20050
|
+
rows: 2,
|
|
20051
|
+
cols: 2,
|
|
20052
|
+
showZoomControls: shouldShowZoomControls !== undefined ? shouldShowZoomControls : true,
|
|
20053
|
+
maps: mapPreset_1.map(function (p, i) {
|
|
20054
|
+
return {
|
|
20055
|
+
id: id + "_" + i,
|
|
20056
|
+
layers: p.layers || [],
|
|
20057
|
+
activeLayerId: p.activeLayerId || undefined,
|
|
20058
|
+
baseLayer: p.baseLayer || undefined,
|
|
20059
|
+
bbox: mapPreset_1[0] && mapPreset_1[0].proj && mapPreset_1[0].proj.bbox || null,
|
|
20060
|
+
srs: mapPreset_1[0] && mapPreset_1[0].proj && mapPreset_1[0].proj.srs || null
|
|
20061
|
+
};
|
|
20062
|
+
}),
|
|
20063
|
+
"data-testid": "coreConfigurableMultiMapWithSlider"
|
|
20064
|
+
});
|
|
20065
|
+
}
|
|
20066
|
+
|
|
20067
|
+
case 'TimeSlider':
|
|
20068
|
+
{
|
|
20069
|
+
var sliderPreset = initialProps.sliderPreset;
|
|
20070
|
+
return /*#__PURE__*/React__default["default"].createElement(TimeSliderConnect, __assign({}, sliderPreset, {
|
|
20071
|
+
sourceId: id,
|
|
20072
|
+
"data-testid": "coreTimeSliderConnect"
|
|
20073
|
+
}));
|
|
20074
|
+
}
|
|
20075
|
+
|
|
20076
|
+
default:
|
|
20077
|
+
return null;
|
|
20078
|
+
}
|
|
20079
|
+
};
|
|
20080
|
+
|
|
19684
20081
|
/* *
|
|
19685
20082
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19686
20083
|
* you may not use this file except in compliance with the License.
|
|
@@ -20360,6 +20757,7 @@
|
|
|
20360
20757
|
exports.TooltipSelect = TooltipSelect;
|
|
20361
20758
|
exports.ZoomControlConnect = ZoomControlConnect;
|
|
20362
20759
|
exports.ZoomControls = ZoomControls;
|
|
20760
|
+
exports.componentsLookUp = componentsLookUp;
|
|
20363
20761
|
exports.coreModuleConfig = coreModuleConfig;
|
|
20364
20762
|
exports.defaultConfigurations = defaultConfigurations;
|
|
20365
20763
|
exports.filterNonTimeDimensions = filterNonTimeDimensions;
|