@opengeoweb/core 2.1.2 → 2.1.3
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 +1469 -452
- package/core.umd.js +1674 -542
- package/lib/components/ConfigurableConnectedMap/ConfigurableConnectedMap.d.ts +1 -0
- package/lib/components/ConfigurableMapWithSlider/ConfigurableMapWithSliderConnect.d.ts +1 -0
- package/lib/components/CustomSwitch/CustomSwitch.d.ts +1 -1
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButtonConnect.d.ts +8 -0
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/{KeywordFilterButton.spec.d.ts → KeywordFilterButtonConnect.spec.d.ts} +0 -0
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.d.ts +10 -5
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResults.stories.d.ts +13 -0
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsConnect.d.ts +5 -1
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsListItem.d.ts +1 -1
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.d.ts +9 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerList.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerListConnect.d.ts +6 -0
- package/lib/components/LayerManager/LayerSelect/LayerList/LayerListConnect.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchField.d.ts +5 -1
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldButtonContainer.d.ts +8 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldButtonContainer.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldConnect.d.ts +3 -0
- package/lib/components/LayerManager/LayerSelect/SearchField/SearchFieldConnect.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.d.ts +6 -0
- package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.spec.d.ts +1 -0
- package/lib/components/LayerManager/LayerSelect/ServiceOptionsDialog/ServiceOptionsDialog.stories.d.ts +13 -0
- package/lib/components/LayerManager/LayerSelect/ServicePopup/ServicePopup.d.ts +3 -0
- package/lib/components/Legend/LegendConnect.d.ts +3 -0
- package/lib/components/Legend/LegendDialog.d.ts +2 -0
- package/lib/components/Legend/LegendMapButtonConnect.d.ts +2 -0
- package/lib/components/MultiMapDimensionSelect/DimensionSelectButtonConnect.d.ts +2 -0
- package/lib/components/MultiMapDimensionSelect/DimensionSelectDialogConnect.d.ts +2 -0
- package/lib/components/MultiMapDimensionSelect/MultiDimensionSelectMapButtonsConnect.d.ts +2 -0
- package/lib/components/MultiMapView/MultiMapView.stories.d.ts +2 -0
- package/lib/components/MultiMapView/MultiMapView10x10.stories.d.ts +2 -0
- package/lib/components/ReactMapView/ReactMapView.d.ts +0 -1
- package/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +1 -1
- package/lib/components/ReactMapView/types.d.ts +0 -1
- package/lib/components/TimeSlider/TimeSliderUtils.d.ts +1 -1
- package/lib/store/coreModuleConfig.d.ts +1 -1
- package/lib/store/layerSelect/actions.d.ts +8 -1
- package/lib/store/layerSelect/config.d.ts +2 -2
- package/lib/store/layerSelect/constants.d.ts +1 -0
- package/lib/store/layerSelect/sagas.d.ts +5 -0
- package/lib/store/layerSelect/sagas.spec.d.ts +1 -0
- package/lib/store/layerSelect/selectors.d.ts +3 -1
- package/lib/store/layerSelect/types.d.ts +18 -2
- package/lib/store/mapStore/map/selectors.d.ts +1 -1
- package/lib/store/mapStore/service/selectors.d.ts +0 -8
- package/lib/store/mapStore/service/types.d.ts +1 -0
- package/lib/store/ui/actions.d.ts +2 -2
- package/lib/store/ui/types.d.ts +2 -1
- package/lib/storybookUtils/HelperComponents.d.ts +1 -1
- package/lib/utils/defaultTestSettings.d.ts +11 -2
- package/lib/utils/testUtils.d.ts +2 -2
- package/package.json +5 -5
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButton.d.ts +0 -3
- package/lib/components/LayerManager/LayerSelect/KeywordFilterButton/KeywordFilterButton.stories.d.ts +0 -7
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/KeywordFilterResultsConnect.stories.d.ts +0 -7
- package/lib/components/LayerManager/LayerSelect/KeywordFilterResults/mockServices.d.ts +0 -42
package/core.umd.js
CHANGED
|
@@ -1548,13 +1548,33 @@
|
|
|
1548
1548
|
var newValue = value - 1;
|
|
1549
1549
|
return newValue < min ? min : newValue;
|
|
1550
1550
|
};
|
|
1551
|
-
var getValueFromKeyboardEvent = function getValueFromKeyboardEvent(event, value, min, max) {
|
|
1552
|
-
if (
|
|
1551
|
+
var getValueFromKeyboardEvent = function getValueFromKeyboardEvent(event, value, min, max, supportFourDirectionNavigation) {
|
|
1552
|
+
if (supportFourDirectionNavigation === void 0) {
|
|
1553
|
+
supportFourDirectionNavigation = false;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
if (!supportFourDirectionNavigation) {
|
|
1557
|
+
if (event.ctrlKey || event.metaKey) {
|
|
1558
|
+
switch (event.key) {
|
|
1559
|
+
case 'ArrowDown':
|
|
1560
|
+
return getPreviousTimeStepvalue(value, min);
|
|
1561
|
+
|
|
1562
|
+
case 'ArrowUp':
|
|
1563
|
+
return getNextTimeStepvalue(value, max);
|
|
1564
|
+
|
|
1565
|
+
default:
|
|
1566
|
+
return null;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
} else {
|
|
1570
|
+
// currently supportFourDirectionNavigation (left/right/up/down) is only used in horizontal slider TimeSliderScaleSlider
|
|
1553
1571
|
switch (event.key) {
|
|
1554
1572
|
case 'ArrowDown':
|
|
1573
|
+
case 'ArrowLeft':
|
|
1555
1574
|
return getPreviousTimeStepvalue(value, min);
|
|
1556
1575
|
|
|
1557
1576
|
case 'ArrowUp':
|
|
1577
|
+
case 'ArrowRight':
|
|
1558
1578
|
return getNextTimeStepvalue(value, max);
|
|
1559
1579
|
|
|
1560
1580
|
default:
|
|
@@ -2458,7 +2478,7 @@
|
|
|
2458
2478
|
*/
|
|
2459
2479
|
|
|
2460
2480
|
var getPinLocation = reselect.createSelector(getMapById, function (store) {
|
|
2461
|
-
return store ? store.mapPinLocation :
|
|
2481
|
+
return store ? store.mapPinLocation : undefined;
|
|
2462
2482
|
});
|
|
2463
2483
|
|
|
2464
2484
|
/* *
|
|
@@ -2519,25 +2539,6 @@
|
|
|
2519
2539
|
|
|
2520
2540
|
return null;
|
|
2521
2541
|
};
|
|
2522
|
-
/**
|
|
2523
|
-
* Gets all keywords from services
|
|
2524
|
-
*
|
|
2525
|
-
* const keywords = useSelector((store) => mapSelectors.getKeywords(store));
|
|
2526
|
-
* @param {object} store store: object - Store object
|
|
2527
|
-
* @returns {array} returnType: Keyword[]
|
|
2528
|
-
*/
|
|
2529
|
-
|
|
2530
|
-
var getKeywords = reselect.createSelector(servicesStore, function (store) {
|
|
2531
|
-
var keywords = store ? store.allIds.flatMap(function (id) {
|
|
2532
|
-
return store.byId[id].layers.flatMap(function (layer) {
|
|
2533
|
-
return layer.keywords;
|
|
2534
|
-
});
|
|
2535
|
-
}) : null;
|
|
2536
|
-
|
|
2537
|
-
var uniqueKeywords = __spreadArray([], __read(new Set(keywords)));
|
|
2538
|
-
|
|
2539
|
-
return uniqueKeywords;
|
|
2540
|
-
});
|
|
2541
2542
|
|
|
2542
2543
|
/* *
|
|
2543
2544
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -2615,8 +2616,7 @@
|
|
|
2615
2616
|
getAvailableBaseLayersForMap: getAvailableBaseLayersForMap,
|
|
2616
2617
|
getServiceIds: getServiceIds,
|
|
2617
2618
|
getServices: getServices,
|
|
2618
|
-
getServiceLayersByName: getServiceLayersByName
|
|
2619
|
-
getKeywords: getKeywords
|
|
2619
|
+
getServiceLayersByName: getServiceLayersByName
|
|
2620
2620
|
});
|
|
2621
2621
|
|
|
2622
2622
|
/* *
|
|
@@ -2720,8 +2720,8 @@
|
|
|
2720
2720
|
/**
|
|
2721
2721
|
* Registers the dialog in the store and creates the dialog state
|
|
2722
2722
|
*
|
|
2723
|
-
* Example: registerDialog({'dialogId1', type: 'legend}) you can optionally specify the activeMapId
|
|
2724
|
-
* @param {string} payload {type: 'legend' | 'layerManager' | 'dimensionSelect-elevation', activeMapId?: string, setOpen?: boolean}
|
|
2723
|
+
* Example: registerDialog({'dialogId1', type: 'legend}) you can optionally specify the activeMapId, whether the dialog is open and the souce ('app' or 'module', default is 'app')
|
|
2724
|
+
* @param {string} payload {type: 'legend' | 'layerManager' | 'dimensionSelect-elevation', activeMapId?: string, setOpen?: boolean, source?: Source}
|
|
2725
2725
|
*/
|
|
2726
2726
|
|
|
2727
2727
|
var registerDialog = function registerDialog(payload) {
|
|
@@ -4340,9 +4340,9 @@
|
|
|
4340
4340
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
4341
4341
|
* */
|
|
4342
4342
|
var ORIGIN_REACTMAPVIEWPARSELAYER = 'ReactMapViewParseLayer';
|
|
4343
|
-
var setServiceMetadata = function setServiceMetadata(wmLayer, mapId,
|
|
4343
|
+
var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, webMapJSInstance, mapProperties, onMapUpdateAllDimensions, onLayerChangeStyle, onServiceSetLayers, onLayerSetStyles, onLayerSetDimensions) {
|
|
4344
4344
|
var origin = ORIGIN_REACTMAPVIEWPARSELAYER;
|
|
4345
|
-
var service = webmap.WMGetServiceFromStore(wmLayer.service
|
|
4345
|
+
var service = webmap.WMGetServiceFromStore(wmLayer.service);
|
|
4346
4346
|
/* Update list of layers for service */
|
|
4347
4347
|
|
|
4348
4348
|
var done = function done(layers) {
|
|
@@ -4419,7 +4419,7 @@
|
|
|
4419
4419
|
};
|
|
4420
4420
|
|
|
4421
4421
|
service.getLayerObjectsFlat(done, function () {// do nothing
|
|
4422
|
-
}, false,
|
|
4422
|
+
}, false, {
|
|
4423
4423
|
headers: wmLayer.headers
|
|
4424
4424
|
});
|
|
4425
4425
|
};
|
|
@@ -4728,7 +4728,7 @@
|
|
|
4728
4728
|
}
|
|
4729
4729
|
});
|
|
4730
4730
|
}
|
|
4731
|
-
function rootSaga$
|
|
4731
|
+
function rootSaga$4() {
|
|
4732
4732
|
return __generator(this, function (_a) {
|
|
4733
4733
|
switch (_a.label) {
|
|
4734
4734
|
case 0:
|
|
@@ -4973,7 +4973,7 @@
|
|
|
4973
4973
|
});
|
|
4974
4974
|
}
|
|
4975
4975
|
|
|
4976
|
-
function rootSaga$
|
|
4976
|
+
function rootSaga$3() {
|
|
4977
4977
|
return __generator(this, function (_a) {
|
|
4978
4978
|
switch (_a.label) {
|
|
4979
4979
|
case 0:
|
|
@@ -5019,7 +5019,7 @@
|
|
|
5019
5019
|
reducerMap: {
|
|
5020
5020
|
syncronizationGroupStore: reducer$4
|
|
5021
5021
|
},
|
|
5022
|
-
sagas: [rootSaga$
|
|
5022
|
+
sagas: [rootSaga$4, rootSaga$3]
|
|
5023
5023
|
};
|
|
5024
5024
|
|
|
5025
5025
|
/* *
|
|
@@ -5038,7 +5038,7 @@
|
|
|
5038
5038
|
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5039
5039
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
5040
5040
|
* */
|
|
5041
|
-
var useStyles$
|
|
5041
|
+
var useStyles$J = core.makeStyles(function (theme) {
|
|
5042
5042
|
return {
|
|
5043
5043
|
select: {
|
|
5044
5044
|
'& ul': {
|
|
@@ -5091,7 +5091,7 @@
|
|
|
5091
5091
|
tooltipOpen = _f[0],
|
|
5092
5092
|
setTooltipOpen = _f[1];
|
|
5093
5093
|
|
|
5094
|
-
var classes = useStyles$
|
|
5094
|
+
var classes = useStyles$J();
|
|
5095
5095
|
|
|
5096
5096
|
var preventDefault = function preventDefault(event) {
|
|
5097
5097
|
event.preventDefault();
|
|
@@ -5254,12 +5254,14 @@
|
|
|
5254
5254
|
var type_1 = action.payload.type;
|
|
5255
5255
|
var activeMapId_1 = action.payload.activeMapId ? action.payload.activeMapId : '';
|
|
5256
5256
|
var setOpen_1 = action.payload.setOpen ? action.payload.setOpen : false;
|
|
5257
|
+
var source_1 = action.payload.source ? action.payload.source : 'app';
|
|
5257
5258
|
return produce.produce(state, function (draft) {
|
|
5258
5259
|
if (!Object.keys(draft.dialogs).includes(type_1)) {
|
|
5259
5260
|
draft.dialogs[type_1] = createUIDialogElement({
|
|
5260
5261
|
activeMapId: activeMapId_1,
|
|
5261
5262
|
type: type_1,
|
|
5262
|
-
setOpen: setOpen_1
|
|
5263
|
+
setOpen: setOpen_1,
|
|
5264
|
+
source: source_1
|
|
5263
5265
|
});
|
|
5264
5266
|
} // // register dialog to order
|
|
5265
5267
|
|
|
@@ -5288,7 +5290,7 @@
|
|
|
5288
5290
|
var _a = action.payload,
|
|
5289
5291
|
type_3 = _a.type,
|
|
5290
5292
|
activeMapId_2 = _a.activeMapId,
|
|
5291
|
-
|
|
5293
|
+
source_2 = _a.source;
|
|
5292
5294
|
|
|
5293
5295
|
if (!state.dialogs[type_3]) {
|
|
5294
5296
|
return state;
|
|
@@ -5298,7 +5300,7 @@
|
|
|
5298
5300
|
var isOpen = action.payload.setOpen !== undefined ? action.payload.setOpen : draft.dialogs[type_3].isOpen;
|
|
5299
5301
|
draft.dialogs[type_3].activeMapId = activeMapId_2;
|
|
5300
5302
|
draft.dialogs[type_3].isOpen = isOpen;
|
|
5301
|
-
draft.dialogs[type_3].source =
|
|
5303
|
+
draft.dialogs[type_3].source = source_2;
|
|
5302
5304
|
|
|
5303
5305
|
if (isOpen) {
|
|
5304
5306
|
draft.order = moveToTop(state.order, type_3);
|
|
@@ -5445,7 +5447,7 @@
|
|
|
5445
5447
|
return isOrderedOnTop;
|
|
5446
5448
|
});
|
|
5447
5449
|
var getDialogSource = reselect.createSelector(getDialogDetailsByType, function (details) {
|
|
5448
|
-
if (details) {
|
|
5450
|
+
if (details && details.source) {
|
|
5449
5451
|
return details.source;
|
|
5450
5452
|
}
|
|
5451
5453
|
|
|
@@ -5469,7 +5471,7 @@
|
|
|
5469
5471
|
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
5470
5472
|
* */
|
|
5471
5473
|
function registerMapUISaga() {
|
|
5472
|
-
var fields;
|
|
5474
|
+
var fields, source;
|
|
5473
5475
|
return __generator(this, function (_a) {
|
|
5474
5476
|
switch (_a.label) {
|
|
5475
5477
|
case 0:
|
|
@@ -5481,23 +5483,28 @@
|
|
|
5481
5483
|
fields = _a.sent();
|
|
5482
5484
|
if (!(fields.length === 1)) return [3
|
|
5483
5485
|
/*break*/
|
|
5484
|
-
,
|
|
5486
|
+
, 4];
|
|
5487
|
+
return [4
|
|
5488
|
+
/*yield*/
|
|
5489
|
+
, effects.select(getDialogSource, 'legend')];
|
|
5485
5490
|
|
|
5491
|
+
case 2:
|
|
5492
|
+
source = _a.sent();
|
|
5486
5493
|
return [4
|
|
5487
5494
|
/*yield*/
|
|
5488
5495
|
, effects.put(setActiveMapIdForDialog({
|
|
5489
5496
|
type: 'legend',
|
|
5490
5497
|
activeMapId: fields[0],
|
|
5491
|
-
setOpen: true
|
|
5498
|
+
setOpen: true,
|
|
5499
|
+
source: source
|
|
5492
5500
|
}))];
|
|
5493
5501
|
|
|
5494
|
-
case
|
|
5495
|
-
// if first map is in store, we open the legend for it
|
|
5502
|
+
case 3:
|
|
5496
5503
|
_a.sent();
|
|
5497
5504
|
|
|
5498
|
-
_a.label =
|
|
5505
|
+
_a.label = 4;
|
|
5499
5506
|
|
|
5500
|
-
case
|
|
5507
|
+
case 4:
|
|
5501
5508
|
return [2
|
|
5502
5509
|
/*return*/
|
|
5503
5510
|
];
|
|
@@ -5566,7 +5573,7 @@
|
|
|
5566
5573
|
}
|
|
5567
5574
|
});
|
|
5568
5575
|
}
|
|
5569
|
-
function rootSaga$
|
|
5576
|
+
function rootSaga$2() {
|
|
5570
5577
|
return __generator(this, function (_a) {
|
|
5571
5578
|
switch (_a.label) {
|
|
5572
5579
|
case 0:
|
|
@@ -5612,7 +5619,7 @@
|
|
|
5612
5619
|
reducerMap: {
|
|
5613
5620
|
ui: reducer$3
|
|
5614
5621
|
},
|
|
5615
|
-
sagas: [rootSaga$
|
|
5622
|
+
sagas: [rootSaga$2]
|
|
5616
5623
|
};
|
|
5617
5624
|
|
|
5618
5625
|
/* *
|
|
@@ -6712,7 +6719,7 @@
|
|
|
6712
6719
|
}
|
|
6713
6720
|
});
|
|
6714
6721
|
}
|
|
6715
|
-
function rootSaga() {
|
|
6722
|
+
function rootSaga$1() {
|
|
6716
6723
|
return __generator(this, function (_a) {
|
|
6717
6724
|
switch (_a.label) {
|
|
6718
6725
|
case 0:
|
|
@@ -6781,7 +6788,7 @@
|
|
|
6781
6788
|
services: reducer$1,
|
|
6782
6789
|
layers: reducer$5
|
|
6783
6790
|
},
|
|
6784
|
-
sagas: [rootSaga]
|
|
6791
|
+
sagas: [rootSaga$1]
|
|
6785
6792
|
};
|
|
6786
6793
|
|
|
6787
6794
|
/* *
|
|
@@ -6802,7 +6809,9 @@
|
|
|
6802
6809
|
* */
|
|
6803
6810
|
var initialState = {
|
|
6804
6811
|
filters: {
|
|
6805
|
-
searchFilter: ''
|
|
6812
|
+
searchFilter: '',
|
|
6813
|
+
keywords: [],
|
|
6814
|
+
addedServices: []
|
|
6806
6815
|
}
|
|
6807
6816
|
};
|
|
6808
6817
|
var reducer = function reducer(state, action) {
|
|
@@ -6819,11 +6828,195 @@
|
|
|
6819
6828
|
});
|
|
6820
6829
|
}
|
|
6821
6830
|
|
|
6831
|
+
case 'LAYER_SELECT_ADD_NEW_KEYWORDS':
|
|
6832
|
+
{
|
|
6833
|
+
return produce__default["default"](state, function (draft) {
|
|
6834
|
+
var e_1, _a;
|
|
6835
|
+
|
|
6836
|
+
var _b = action.payload,
|
|
6837
|
+
serviceName = _b.serviceName,
|
|
6838
|
+
keywords = _b.keywords; // If store does not contain keywords from a service, add keywords and service Name
|
|
6839
|
+
|
|
6840
|
+
if (!draft.filters.addedServices.includes(serviceName)) {
|
|
6841
|
+
draft.filters.addedServices.push(serviceName);
|
|
6842
|
+
|
|
6843
|
+
var _loop_1 = function _loop_1(keyword) {
|
|
6844
|
+
var foundObject = draft.filters.keywords.find(function (object) {
|
|
6845
|
+
return object.id === keyword;
|
|
6846
|
+
});
|
|
6847
|
+
|
|
6848
|
+
if (foundObject) {
|
|
6849
|
+
foundObject.amount += 1;
|
|
6850
|
+
foundObject.amountVisible += 1;
|
|
6851
|
+
} else {
|
|
6852
|
+
var newKeywordObject = {
|
|
6853
|
+
id: keyword,
|
|
6854
|
+
amount: 1,
|
|
6855
|
+
amountVisible: 1,
|
|
6856
|
+
checked: true
|
|
6857
|
+
};
|
|
6858
|
+
draft.filters.keywords.push(newKeywordObject);
|
|
6859
|
+
}
|
|
6860
|
+
};
|
|
6861
|
+
|
|
6862
|
+
try {
|
|
6863
|
+
for (var keywords_1 = __values(keywords), keywords_1_1 = keywords_1.next(); !keywords_1_1.done; keywords_1_1 = keywords_1.next()) {
|
|
6864
|
+
var keyword = keywords_1_1.value;
|
|
6865
|
+
|
|
6866
|
+
_loop_1(keyword);
|
|
6867
|
+
}
|
|
6868
|
+
} catch (e_1_1) {
|
|
6869
|
+
e_1 = {
|
|
6870
|
+
error: e_1_1
|
|
6871
|
+
};
|
|
6872
|
+
} finally {
|
|
6873
|
+
try {
|
|
6874
|
+
if (keywords_1_1 && !keywords_1_1.done && (_a = keywords_1["return"])) _a.call(keywords_1);
|
|
6875
|
+
} finally {
|
|
6876
|
+
if (e_1) throw e_1.error;
|
|
6877
|
+
}
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
});
|
|
6881
|
+
}
|
|
6882
|
+
|
|
6822
6883
|
default:
|
|
6823
6884
|
return state;
|
|
6824
6885
|
}
|
|
6825
6886
|
};
|
|
6826
6887
|
|
|
6888
|
+
/* *
|
|
6889
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6890
|
+
* you may not use this file except in compliance with the License.
|
|
6891
|
+
* You may obtain a copy of the License at
|
|
6892
|
+
*
|
|
6893
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6894
|
+
*
|
|
6895
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6896
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6897
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6898
|
+
* See the License for the specific language governing permissions and
|
|
6899
|
+
* limitations under the License.
|
|
6900
|
+
*
|
|
6901
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6902
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6903
|
+
* */
|
|
6904
|
+
var LAYER_SELECT_SET_SEARCH_FILTER = 'LAYER_SELECT_SET_SEARCH_FILTER';
|
|
6905
|
+
var LAYER_SELECT_ADD_NEW_KEYWORDS = 'LAYER_SELECT_ADD_NEW_KEYWORDS';
|
|
6906
|
+
|
|
6907
|
+
/* *
|
|
6908
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6909
|
+
* you may not use this file except in compliance with the License.
|
|
6910
|
+
* You may obtain a copy of the License at
|
|
6911
|
+
*
|
|
6912
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6913
|
+
*
|
|
6914
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6915
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6916
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6917
|
+
* See the License for the specific language governing permissions and
|
|
6918
|
+
* limitations under the License.
|
|
6919
|
+
*
|
|
6920
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6921
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
6922
|
+
* */
|
|
6923
|
+
/**
|
|
6924
|
+
* Sets the given text to the searchFilter
|
|
6925
|
+
*
|
|
6926
|
+
* Example: setSearchFilter({ filterText: 'hello world' })
|
|
6927
|
+
* @param {string} payload { filterText: string }
|
|
6928
|
+
*/
|
|
6929
|
+
|
|
6930
|
+
var setSearchFilter = function setSearchFilter(payload) {
|
|
6931
|
+
return {
|
|
6932
|
+
type: LAYER_SELECT_SET_SEARCH_FILTER,
|
|
6933
|
+
payload: payload
|
|
6934
|
+
};
|
|
6935
|
+
};
|
|
6936
|
+
/**
|
|
6937
|
+
* Sets the given keywords to Layer Select store
|
|
6938
|
+
*
|
|
6939
|
+
* Example: addNewKeywords({ keywords: ['keyword1', 'keyword2'] })
|
|
6940
|
+
* @param {string[]} payload { keywords: string[] }
|
|
6941
|
+
*/
|
|
6942
|
+
|
|
6943
|
+
var addNewKeywords = function addNewKeywords(payload) {
|
|
6944
|
+
return {
|
|
6945
|
+
type: LAYER_SELECT_ADD_NEW_KEYWORDS,
|
|
6946
|
+
payload: payload
|
|
6947
|
+
};
|
|
6948
|
+
};
|
|
6949
|
+
|
|
6950
|
+
/* *
|
|
6951
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6952
|
+
* you may not use this file except in compliance with the License.
|
|
6953
|
+
* You may obtain a copy of the License at
|
|
6954
|
+
*
|
|
6955
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6956
|
+
*
|
|
6957
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6958
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6959
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6960
|
+
* See the License for the specific language governing permissions and
|
|
6961
|
+
* limitations under the License.
|
|
6962
|
+
*
|
|
6963
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6964
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
6965
|
+
* */
|
|
6966
|
+
function newServiceAddedSaga(capturedAction) {
|
|
6967
|
+
var addedService, serviceName, keywords;
|
|
6968
|
+
return __generator(this, function (_a) {
|
|
6969
|
+
switch (_a.label) {
|
|
6970
|
+
case 0:
|
|
6971
|
+
addedService = capturedAction.payload;
|
|
6972
|
+
serviceName = addedService.name;
|
|
6973
|
+
keywords = addedService.layers.reduce(function (keywordAccumulator, layer) {
|
|
6974
|
+
if (!layer.keywords) {
|
|
6975
|
+
return keywordAccumulator;
|
|
6976
|
+
}
|
|
6977
|
+
|
|
6978
|
+
return keywordAccumulator.concat(layer.keywords);
|
|
6979
|
+
}, []);
|
|
6980
|
+
if (!(keywords.length > 0)) return [3
|
|
6981
|
+
/*break*/
|
|
6982
|
+
, 2];
|
|
6983
|
+
return [4
|
|
6984
|
+
/*yield*/
|
|
6985
|
+
, effects.put(addNewKeywords({
|
|
6986
|
+
serviceName: serviceName,
|
|
6987
|
+
keywords: keywords
|
|
6988
|
+
}))];
|
|
6989
|
+
|
|
6990
|
+
case 1:
|
|
6991
|
+
_a.sent();
|
|
6992
|
+
|
|
6993
|
+
_a.label = 2;
|
|
6994
|
+
|
|
6995
|
+
case 2:
|
|
6996
|
+
return [2
|
|
6997
|
+
/*return*/
|
|
6998
|
+
];
|
|
6999
|
+
}
|
|
7000
|
+
});
|
|
7001
|
+
}
|
|
7002
|
+
function rootSaga() {
|
|
7003
|
+
return __generator(this, function (_a) {
|
|
7004
|
+
switch (_a.label) {
|
|
7005
|
+
case 0:
|
|
7006
|
+
return [4
|
|
7007
|
+
/*yield*/
|
|
7008
|
+
, effects.takeEvery(MAP_SERVICES_SET_LAYERS, newServiceAddedSaga)];
|
|
7009
|
+
|
|
7010
|
+
case 1:
|
|
7011
|
+
_a.sent();
|
|
7012
|
+
|
|
7013
|
+
return [2
|
|
7014
|
+
/*return*/
|
|
7015
|
+
];
|
|
7016
|
+
}
|
|
7017
|
+
});
|
|
7018
|
+
}
|
|
7019
|
+
|
|
6827
7020
|
/* *
|
|
6828
7021
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6829
7022
|
* you may not use this file except in compliance with the License.
|
|
@@ -6844,7 +7037,8 @@
|
|
|
6844
7037
|
id: 'layerSelect-module',
|
|
6845
7038
|
reducerMap: {
|
|
6846
7039
|
layerSelect: reducer
|
|
6847
|
-
}
|
|
7040
|
+
},
|
|
7041
|
+
sagas: [rootSaga]
|
|
6848
7042
|
};
|
|
6849
7043
|
|
|
6850
7044
|
/* *
|
|
@@ -7879,7 +8073,7 @@
|
|
|
7879
8073
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7880
8074
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
7881
8075
|
* */
|
|
7882
|
-
var useStyles$
|
|
8076
|
+
var useStyles$I = core.makeStyles({
|
|
7883
8077
|
buttonDiv: {
|
|
7884
8078
|
position: 'relative'
|
|
7885
8079
|
},
|
|
@@ -7915,7 +8109,7 @@
|
|
|
7915
8109
|
handleClose = _a.handleClose,
|
|
7916
8110
|
_e = _a.layerType,
|
|
7917
8111
|
layerType = _e === void 0 ? LayerType.mapLayer : _e;
|
|
7918
|
-
var classes = useStyles$
|
|
8112
|
+
var classes = useStyles$I();
|
|
7919
8113
|
|
|
7920
8114
|
var _f = __read(React__namespace.useState(''), 2),
|
|
7921
8115
|
serviceURL = _f[0],
|
|
@@ -8078,7 +8272,7 @@
|
|
|
8078
8272
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8079
8273
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8080
8274
|
* */
|
|
8081
|
-
var useStyles$
|
|
8275
|
+
var useStyles$H = core.makeStyles(function (theme) {
|
|
8082
8276
|
return {
|
|
8083
8277
|
buttonDiv: {
|
|
8084
8278
|
position: 'relative'
|
|
@@ -8113,7 +8307,7 @@
|
|
|
8113
8307
|
_f = _a.shouldFocus,
|
|
8114
8308
|
shouldFocus = _f === void 0 ? false : _f;
|
|
8115
8309
|
var ref = React__namespace.useRef(null);
|
|
8116
|
-
var classes = useStyles$
|
|
8310
|
+
var classes = useStyles$H();
|
|
8117
8311
|
|
|
8118
8312
|
var _g = __read(React__namespace.useState(false), 2),
|
|
8119
8313
|
open = _g[0],
|
|
@@ -8237,7 +8431,7 @@
|
|
|
8237
8431
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8238
8432
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8239
8433
|
* */
|
|
8240
|
-
var useStyles$
|
|
8434
|
+
var useStyles$G = core.makeStyles(function (theme) {
|
|
8241
8435
|
return {
|
|
8242
8436
|
button: {
|
|
8243
8437
|
width: '24px',
|
|
@@ -8254,7 +8448,7 @@
|
|
|
8254
8448
|
_b = _a.source,
|
|
8255
8449
|
source = _b === void 0 ? 'app' : _b;
|
|
8256
8450
|
var dispatch = reactRedux.useDispatch();
|
|
8257
|
-
var classes = useStyles$
|
|
8451
|
+
var classes = useStyles$G();
|
|
8258
8452
|
var currentActiveMapId = reactRedux.useSelector(function (store) {
|
|
8259
8453
|
return getDialogMapId(store, 'layerSelect');
|
|
8260
8454
|
});
|
|
@@ -8296,7 +8490,7 @@
|
|
|
8296
8490
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8297
8491
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8298
8492
|
* */
|
|
8299
|
-
var useStyles$
|
|
8493
|
+
var useStyles$F = core.makeStyles({
|
|
8300
8494
|
row: {
|
|
8301
8495
|
height: '32px'
|
|
8302
8496
|
},
|
|
@@ -8320,7 +8514,7 @@
|
|
|
8320
8514
|
layerManagerWidth = _a.layerManagerWidth,
|
|
8321
8515
|
_e = _a.layerSelect,
|
|
8322
8516
|
layerSelect = _e === void 0 ? false : _e;
|
|
8323
|
-
var classes = useStyles$
|
|
8517
|
+
var classes = useStyles$F();
|
|
8324
8518
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
8325
8519
|
return /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
8326
8520
|
container: true,
|
|
@@ -8588,7 +8782,7 @@
|
|
|
8588
8782
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8589
8783
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8590
8784
|
* */
|
|
8591
|
-
var useStyles$
|
|
8785
|
+
var useStyles$E = core.makeStyles(function (theme) {
|
|
8592
8786
|
return core.createStyles({
|
|
8593
8787
|
button: {
|
|
8594
8788
|
height: 28,
|
|
@@ -8647,7 +8841,7 @@
|
|
|
8647
8841
|
testId = _a.testId,
|
|
8648
8842
|
props = __rest(_a, ["tooltipTitle", "onClick", "isActive", "isEnabled", "icon", "testId"]);
|
|
8649
8843
|
|
|
8650
|
-
var classes = useStyles$
|
|
8844
|
+
var classes = useStyles$E({
|
|
8651
8845
|
isActive: isActive,
|
|
8652
8846
|
isEnabled: isEnabled
|
|
8653
8847
|
});
|
|
@@ -8684,7 +8878,7 @@
|
|
|
8684
8878
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8685
8879
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8686
8880
|
* */
|
|
8687
|
-
var useStyles$
|
|
8881
|
+
var useStyles$D = core.makeStyles(function (theme) {
|
|
8688
8882
|
return core.createStyles({
|
|
8689
8883
|
checkbox: {
|
|
8690
8884
|
color: 'inherit',
|
|
@@ -8707,7 +8901,7 @@
|
|
|
8707
8901
|
var isEnabled = _a.isEnabled,
|
|
8708
8902
|
title = _a.title,
|
|
8709
8903
|
onChangeEnableLayer = _a.onChangeEnableLayer;
|
|
8710
|
-
var classes = useStyles$
|
|
8904
|
+
var classes = useStyles$D(isEnabled);
|
|
8711
8905
|
|
|
8712
8906
|
var onClick = function onClick() {
|
|
8713
8907
|
onChangeEnableLayer(!isEnabled);
|
|
@@ -8763,7 +8957,7 @@
|
|
|
8763
8957
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8764
8958
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8765
8959
|
* */
|
|
8766
|
-
var useStyles$
|
|
8960
|
+
var useStyles$C = core.makeStyles(function (theme) {
|
|
8767
8961
|
return core.createStyles({
|
|
8768
8962
|
dropdownEmpty: {
|
|
8769
8963
|
paddingLeft: 8,
|
|
@@ -8786,7 +8980,7 @@
|
|
|
8786
8980
|
layers = _b === void 0 ? [] : _b,
|
|
8787
8981
|
_c = _a.isEnabled,
|
|
8788
8982
|
isEnabled = _c === void 0 ? true : _c;
|
|
8789
|
-
var classes = useStyles$
|
|
8983
|
+
var classes = useStyles$C();
|
|
8790
8984
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
8791
8985
|
|
|
8792
8986
|
if (!layers || !layers.length) {
|
|
@@ -8859,7 +9053,7 @@
|
|
|
8859
9053
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8860
9054
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
8861
9055
|
* */
|
|
8862
|
-
var useStyles$
|
|
9056
|
+
var useStyles$B = core.makeStyles(function (theme) {
|
|
8863
9057
|
return {
|
|
8864
9058
|
opacityDiv: {
|
|
8865
9059
|
height: 'calc(100% - 5px)',
|
|
@@ -8920,7 +9114,7 @@
|
|
|
8920
9114
|
onLayerChangeOpacity = _a.onLayerChangeOpacity,
|
|
8921
9115
|
_b = _a.isEnabled,
|
|
8922
9116
|
isEnabled = _b === void 0 ? true : _b;
|
|
8923
|
-
var classes = useStyles$
|
|
9117
|
+
var classes = useStyles$B();
|
|
8924
9118
|
var sliderClasses = shared.sliderStyles();
|
|
8925
9119
|
var containerClass = useTooltipContainerStyles(isEnabled);
|
|
8926
9120
|
|
|
@@ -9030,7 +9224,7 @@
|
|
|
9030
9224
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9031
9225
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9032
9226
|
* */
|
|
9033
|
-
var useStyles$
|
|
9227
|
+
var useStyles$A = core.makeStyles(function (theme) {
|
|
9034
9228
|
return core.createStyles({
|
|
9035
9229
|
icon: {
|
|
9036
9230
|
minWidth: 32,
|
|
@@ -9047,7 +9241,7 @@
|
|
|
9047
9241
|
var title = _a.title,
|
|
9048
9242
|
tooltipTitle = _a.tooltipTitle,
|
|
9049
9243
|
icon = _a.icon;
|
|
9050
|
-
var classes = useStyles$
|
|
9244
|
+
var classes = useStyles$A();
|
|
9051
9245
|
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(core.ListItemIcon, {
|
|
9052
9246
|
className: classes.icon + " icon"
|
|
9053
9247
|
}, icon), /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
|
|
@@ -9075,7 +9269,7 @@
|
|
|
9075
9269
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9076
9270
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9077
9271
|
* */
|
|
9078
|
-
var useStyles$
|
|
9272
|
+
var useStyles$z = core.makeStyles(function (theme) {
|
|
9079
9273
|
return {
|
|
9080
9274
|
menu: {
|
|
9081
9275
|
backgroundColor: theme.palette.geowebColors.background.surface,
|
|
@@ -9093,7 +9287,7 @@
|
|
|
9093
9287
|
onLayerDuplicate = _a.onLayerDuplicate,
|
|
9094
9288
|
_b = _a.isEnabled,
|
|
9095
9289
|
isEnabled = _b === void 0 ? true : _b;
|
|
9096
|
-
var classes = useStyles$
|
|
9290
|
+
var classes = useStyles$z();
|
|
9097
9291
|
|
|
9098
9292
|
var _c = __read(React__namespace.useState(null), 2),
|
|
9099
9293
|
anchorEl = _c[0],
|
|
@@ -9217,7 +9411,7 @@
|
|
|
9217
9411
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9218
9412
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9219
9413
|
* */
|
|
9220
|
-
var useStyles$
|
|
9414
|
+
var useStyles$y = core.makeStyles(function () {
|
|
9221
9415
|
return core.createStyles({
|
|
9222
9416
|
icon: {
|
|
9223
9417
|
width: 20,
|
|
@@ -9231,7 +9425,7 @@
|
|
|
9231
9425
|
onClickDelete = _a.onClickDelete,
|
|
9232
9426
|
_b = _a.isEnabled,
|
|
9233
9427
|
isEnabled = _b === void 0 ? true : _b;
|
|
9234
|
-
var classes = useStyles$
|
|
9428
|
+
var classes = useStyles$y();
|
|
9235
9429
|
return /*#__PURE__*/React__namespace.createElement(LayerManagerButton, {
|
|
9236
9430
|
tooltipTitle: tooltipTitle,
|
|
9237
9431
|
onClick: onClickDelete,
|
|
@@ -9259,7 +9453,7 @@
|
|
|
9259
9453
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9260
9454
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9261
9455
|
* */
|
|
9262
|
-
var useStyles$
|
|
9456
|
+
var useStyles$x = core.makeStyles(function (theme) {
|
|
9263
9457
|
return core.createStyles({
|
|
9264
9458
|
icon: {
|
|
9265
9459
|
width: 18,
|
|
@@ -9296,7 +9490,7 @@
|
|
|
9296
9490
|
isActive = _c === void 0 ? false : _c,
|
|
9297
9491
|
_d = _a.isEnabled,
|
|
9298
9492
|
isEnabled = _d === void 0 ? true : _d;
|
|
9299
|
-
var classes = useStyles$
|
|
9493
|
+
var classes = useStyles$x({
|
|
9300
9494
|
isActive: isActive,
|
|
9301
9495
|
isEnabled: isEnabled
|
|
9302
9496
|
});
|
|
@@ -9345,7 +9539,7 @@
|
|
|
9345
9539
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9346
9540
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9347
9541
|
* */
|
|
9348
|
-
var useStyles$
|
|
9542
|
+
var useStyles$w = core.makeStyles(function (theme) {
|
|
9349
9543
|
return core.createStyles({
|
|
9350
9544
|
row: {
|
|
9351
9545
|
background: function background(isEnabled) {
|
|
@@ -9397,7 +9591,7 @@
|
|
|
9397
9591
|
layerActiveLayout = _a.layerActiveLayout,
|
|
9398
9592
|
layerManagerWidth = _a.layerManagerWidth,
|
|
9399
9593
|
dragHandle = _a.dragHandle;
|
|
9400
|
-
var classes = useStyles$
|
|
9594
|
+
var classes = useStyles$w(isEnabled);
|
|
9401
9595
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
9402
9596
|
|
|
9403
9597
|
var onClickRow = function onClickRow() {
|
|
@@ -9976,7 +10170,7 @@
|
|
|
9976
10170
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
9977
10171
|
* */
|
|
9978
10172
|
var TOOLTIP_TITLE = 'Drag a layer up or down';
|
|
9979
|
-
var useStyles$
|
|
10173
|
+
var useStyles$v = core.makeStyles(function (theme) {
|
|
9980
10174
|
return {
|
|
9981
10175
|
dragHandle: {
|
|
9982
10176
|
cursor: 'grab',
|
|
@@ -9999,7 +10193,7 @@
|
|
|
9999
10193
|
index = _c === void 0 ? undefined : _c,
|
|
10000
10194
|
_d = _a.hideTooltip,
|
|
10001
10195
|
hideTooltip = _d === void 0 ? false : _d;
|
|
10002
|
-
var classes = useStyles$
|
|
10196
|
+
var classes = useStyles$v({
|
|
10003
10197
|
isDisabled: isDisabled
|
|
10004
10198
|
});
|
|
10005
10199
|
var tooltipTitle = hideTooltip ? '' : TOOLTIP_TITLE;
|
|
@@ -10032,7 +10226,7 @@
|
|
|
10032
10226
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10033
10227
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10034
10228
|
* */
|
|
10035
|
-
var useStyles$
|
|
10229
|
+
var useStyles$u = core.makeStyles(function () {
|
|
10036
10230
|
return {
|
|
10037
10231
|
layerRows: {
|
|
10038
10232
|
width: '100%',
|
|
@@ -10098,7 +10292,7 @@
|
|
|
10098
10292
|
|
|
10099
10293
|
var isSorting = activeDragIndex !== null;
|
|
10100
10294
|
var isDragDisabled = layerIds.length === 1;
|
|
10101
|
-
var classes = useStyles$
|
|
10295
|
+
var classes = useStyles$u(isSorting);
|
|
10102
10296
|
return /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
10103
10297
|
container: true,
|
|
10104
10298
|
item: true,
|
|
@@ -10308,7 +10502,7 @@
|
|
|
10308
10502
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10309
10503
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10310
10504
|
* */
|
|
10311
|
-
var useStyles$
|
|
10505
|
+
var useStyles$t = core.makeStyles({
|
|
10312
10506
|
layerRow: {
|
|
10313
10507
|
width: '100%',
|
|
10314
10508
|
height: '36px'
|
|
@@ -10331,7 +10525,7 @@
|
|
|
10331
10525
|
layerManagerWidth = _a.layerManagerWidth,
|
|
10332
10526
|
_d = _a.tooltip,
|
|
10333
10527
|
tooltip = _d === void 0 ? '' : _d;
|
|
10334
|
-
var classes = useStyles$
|
|
10528
|
+
var classes = useStyles$t();
|
|
10335
10529
|
var columnSizes = layerManagerWidth === LayerManagerWidth.sm ? LayerManagerColumnsSmall() : LayerManagerColumnsLarge();
|
|
10336
10530
|
return /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
10337
10531
|
container: true,
|
|
@@ -10376,7 +10570,7 @@
|
|
|
10376
10570
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10377
10571
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10378
10572
|
* */
|
|
10379
|
-
var useStyles$
|
|
10573
|
+
var useStyles$s = core.makeStyles({
|
|
10380
10574
|
layerRowContainer: {
|
|
10381
10575
|
position: 'relative',
|
|
10382
10576
|
width: '100%',
|
|
@@ -10411,7 +10605,7 @@
|
|
|
10411
10605
|
layerSelect = _e === void 0 ? false : _e,
|
|
10412
10606
|
_f = _a.showAddLayersTooltip,
|
|
10413
10607
|
showAddLayersTooltip = _f === void 0 ? true : _f;
|
|
10414
|
-
var classes = useStyles$
|
|
10608
|
+
var classes = useStyles$s();
|
|
10415
10609
|
|
|
10416
10610
|
var _g = __read(React__namespace.useState(LayerManagerWidth.lg), 2),
|
|
10417
10611
|
layerManagerWidth = _g[0],
|
|
@@ -10483,72 +10677,962 @@
|
|
|
10483
10677
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10484
10678
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10485
10679
|
* */
|
|
10486
|
-
var
|
|
10487
|
-
return {
|
|
10488
|
-
|
|
10489
|
-
|
|
10680
|
+
var useButtonStyles = core.makeStyles(function (theme) {
|
|
10681
|
+
return core.createStyles({
|
|
10682
|
+
button: {
|
|
10683
|
+
height: '24px',
|
|
10684
|
+
width: function width(_a) {
|
|
10685
|
+
var width = _a.width;
|
|
10686
|
+
return width ? width + "px" : '24px';
|
|
10687
|
+
},
|
|
10688
|
+
border: 0,
|
|
10689
|
+
backgroundColor: theme.palette.geowebColors.buttons.surfaceIconDefault.fill,
|
|
10690
|
+
borderRadius: '4.5px',
|
|
10691
|
+
textTransform: 'none',
|
|
10692
|
+
'& svg path, svg text': {
|
|
10693
|
+
fill: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10694
|
+
},
|
|
10695
|
+
'&:hover': {
|
|
10696
|
+
backgroundColor: theme.palette.geowebColors.buttons.flatMouseover.fill
|
|
10697
|
+
},
|
|
10698
|
+
'&:disabled': {
|
|
10699
|
+
backgroundColor: theme.palette.geowebColors.buttons.disabled.fill,
|
|
10700
|
+
'& svg path, svg text': {
|
|
10701
|
+
fill: theme.palette.geowebColors.typographyAndIcons.iconLinkDisabled
|
|
10702
|
+
}
|
|
10703
|
+
},
|
|
10704
|
+
'&.Mui-selected': {
|
|
10705
|
+
backgroundColor: theme.palette.geowebColors.buttons.primaryActive.fill,
|
|
10706
|
+
'&:hover': {
|
|
10707
|
+
backgroundColor: theme.palette.geowebColors.buttons.primaryMouseover.fill
|
|
10708
|
+
},
|
|
10709
|
+
'& svg': {
|
|
10710
|
+
backgroundColor: 'transparent'
|
|
10711
|
+
},
|
|
10712
|
+
'& svg path, svg text': {
|
|
10713
|
+
fill: theme.palette.geowebColors.typographyAndIcons.buttonIcon
|
|
10714
|
+
}
|
|
10715
|
+
}
|
|
10490
10716
|
}
|
|
10491
|
-
};
|
|
10717
|
+
});
|
|
10492
10718
|
});
|
|
10493
|
-
var clearIconPath = 'M12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M15.44426,7.26697571 L12.0002861,10.7110482 L8.55573996,7.26697571 C8.19978253,6.9110081 7.62292549,6.9110081 7.26696807,7.26697571 C6.91101064,7.62294331 6.91101064,8.19981687 7.26696807,8.55578447 L10.7115142,11.9998569 L7.26696807,15.4445017 C6.91101064,15.8004693 6.91101064,16.3767705 7.26696807,16.7333104 C7.44494678,16.910722 7.67843653,17 7.91192629,17 C8.14484377,17 8.37776125,16.910722 8.55573996,16.7333104 L12.0002861,13.289238 L15.44426,16.7333104 C15.6222388,16.910722 15.8551562,17 16.088646,17 C16.3221357,17 16.5550532,16.910722 16.7330319,16.7333104 C17.0889894,16.3767705 17.0889894,15.8004693 16.7330319,15.4445017 L13.289058,11.9998569 L16.7330319,8.55578447 C17.0889894,8.19981687 17.0889894,7.62294331 16.7330319,7.26697571 C16.3770745,6.9110081 15.8002175,6.9110081 15.44426,7.26697571 Z';
|
|
10494
|
-
var clearIcon = /*#__PURE__*/React__namespace.createElement(core.SvgIcon, {
|
|
10495
|
-
style: {
|
|
10496
|
-
width: '24px',
|
|
10497
|
-
height: '24px'
|
|
10498
|
-
},
|
|
10499
|
-
viewBox: "0 0 24 24",
|
|
10500
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
10501
|
-
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
10502
|
-
d: clearIconPath
|
|
10503
|
-
}));
|
|
10504
|
-
var searchIconPath = 'M7.81701445,12.5845372 L7.81701445,12.5845372 C7.17924024,11.946763 6.82932049,11.100321 6.82932049,10.1993044 C6.82932049,9.29828785 7.17924024,8.45077582 7.81701445,7.8140717 C8.47405029,7.15703585 9.3376137,6.82851792 10.2022472,6.82851792 C11.0658106,6.82851792 11.929374,7.15703585 12.5874799,7.8140717 C13.9026217,9.12921348 13.9026217,11.2693954 12.5874799,12.5845372 C11.9497057,13.2212413 11.1021937,13.5722311 10.2022472,13.5722311 C9.3012306,13.5722311 8.45371857,13.2212413 7.81701445,12.5845372 M19.5858748,17.581862 L15.4681648,13.465222 C16.9513109,11.0735688 16.6613162,7.88683788 14.5874799,5.81300161 C12.1690744,3.39566613 8.23434992,3.39566613 5.81594436,5.81300161 C4.64419476,6.9847512 4,8.54280364 4,10.1993044 C4,11.8558052 4.64419476,13.4138577 5.81594436,14.5845372 C6.98769395,15.7562868 8.5446763,16.4015516 10.2022472,16.4015516 C11.376137,16.4015516 12.4965222,16.0719636 13.4681648,15.4662921 L17.5837346,19.582932 C17.8608882,19.8590155 18.2225789,19.9970572 18.5853398,19.9970572 C18.9470305,19.9970572 19.3087212,19.8590155 19.5858748,19.582932 C20.1380417,19.029695 20.1380417,18.135099 19.5858748,17.581862';
|
|
10505
|
-
var searchIcon = /*#__PURE__*/React__namespace.createElement(core.SvgIcon, {
|
|
10506
|
-
style: {
|
|
10507
|
-
width: '24px',
|
|
10508
|
-
height: '24px'
|
|
10509
|
-
},
|
|
10510
|
-
viewBox: "0 0 24 24",
|
|
10511
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
10512
|
-
}, /*#__PURE__*/React__namespace.createElement("path", {
|
|
10513
|
-
d: searchIconPath
|
|
10514
|
-
}));
|
|
10515
10719
|
|
|
10516
|
-
var
|
|
10517
|
-
var
|
|
10518
|
-
|
|
10519
|
-
|
|
10720
|
+
var ToggleIconButton = function ToggleIconButton(_a) {
|
|
10721
|
+
var active = _a.active,
|
|
10722
|
+
width = _a.width,
|
|
10723
|
+
children = _a.children,
|
|
10724
|
+
props = __rest(_a, ["active", "width", "children"]);
|
|
10520
10725
|
|
|
10521
|
-
var classes =
|
|
10522
|
-
|
|
10726
|
+
var classes = useButtonStyles({
|
|
10727
|
+
width: width
|
|
10728
|
+
});
|
|
10729
|
+
return /*#__PURE__*/React__namespace.createElement(lab.ToggleButton, __assign({
|
|
10730
|
+
className: classes.button,
|
|
10731
|
+
disableRipple: true,
|
|
10732
|
+
selected: active,
|
|
10733
|
+
value: 0
|
|
10734
|
+
}, props), children);
|
|
10735
|
+
};
|
|
10736
|
+
|
|
10737
|
+
/* *
|
|
10738
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10739
|
+
* you may not use this file except in compliance with the License.
|
|
10740
|
+
* You may obtain a copy of the License at
|
|
10741
|
+
*
|
|
10742
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10743
|
+
*
|
|
10744
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10745
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10746
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10747
|
+
* See the License for the specific language governing permissions and
|
|
10748
|
+
* limitations under the License.
|
|
10749
|
+
*
|
|
10750
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10751
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10752
|
+
* */
|
|
10753
|
+
|
|
10754
|
+
var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_a) {
|
|
10755
|
+
var mapId = _a.mapId,
|
|
10756
|
+
_b = _a.source,
|
|
10757
|
+
source = _b === void 0 ? 'app' : _b;
|
|
10758
|
+
var dispatch = reactRedux.useDispatch();
|
|
10759
|
+
var currentActiveMapId = reactRedux.useSelector(function (store) {
|
|
10760
|
+
return getDialogMapId(store, 'keywordFilter');
|
|
10761
|
+
});
|
|
10762
|
+
var isOpenInStore = reactRedux.useSelector(function (store) {
|
|
10763
|
+
return getisDialogOpen(store, 'keywordFilter');
|
|
10764
|
+
});
|
|
10765
|
+
var openFilterResultsDialog = React__namespace.useCallback(function () {
|
|
10766
|
+
dispatch(setActiveMapIdForDialog({
|
|
10767
|
+
type: 'keywordFilter',
|
|
10768
|
+
activeMapId: mapId,
|
|
10769
|
+
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
|
|
10770
|
+
source: source
|
|
10771
|
+
}));
|
|
10772
|
+
}, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
|
|
10773
|
+
return /*#__PURE__*/React__namespace.createElement(ToggleIconButton, {
|
|
10774
|
+
onClick: openFilterResultsDialog,
|
|
10775
|
+
active: isOpenInStore,
|
|
10776
|
+
id: "keywordFilterButton",
|
|
10777
|
+
"data-testid": "keywordFilterButton",
|
|
10778
|
+
disableRipple: true
|
|
10779
|
+
}, /*#__PURE__*/React__namespace.createElement(core.SvgIcon, {
|
|
10780
|
+
viewBox: "0 0 24 24",
|
|
10781
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10782
|
+
}, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
10783
|
+
d: "M14.155 12.567c1.362 0 2.523.848 2.992 2.043h1.895a1.173 1.173 0 0 1 0 2.346h-1.895A3.213 3.213 0 0 1 14.155 19a3.213 3.213 0 0 1-2.992-2.044h-5.99a1.172 1.172 0 1 1 0-2.346h5.99a3.214 3.214 0 0 1 2.992-2.043zm0 1.755a1.461 1.461 0 1 0 0 2.922 1.461 1.461 0 0 0 0-2.922zM10.06 5c1.362 0 2.524.848 2.992 2.044h5.99a1.173 1.173 0 1 1 0 2.344h-5.99a3.214 3.214 0 0 1-2.992 2.044 3.216 3.216 0 0 1-2.992-2.044H5.173a1.172 1.172 0 1 1 0-2.344h1.895A3.216 3.216 0 0 1 10.06 5zm0 1.754a1.461 1.461 0 1 0 0 2.922 1.461 1.461 0 0 0 0-2.922z",
|
|
10784
|
+
fill: "#FFF",
|
|
10785
|
+
fillRule: "evenodd"
|
|
10786
|
+
}))));
|
|
10787
|
+
};
|
|
10788
|
+
|
|
10789
|
+
/* *
|
|
10790
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10791
|
+
* you may not use this file except in compliance with the License.
|
|
10792
|
+
* You may obtain a copy of the License at
|
|
10793
|
+
*
|
|
10794
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10795
|
+
*
|
|
10796
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10797
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10798
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10799
|
+
* See the License for the specific language governing permissions and
|
|
10800
|
+
* limitations under the License.
|
|
10801
|
+
*
|
|
10802
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10803
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10804
|
+
* */
|
|
10805
|
+
|
|
10806
|
+
var layerSelectStore = function layerSelectStore(store) {
|
|
10807
|
+
return store && store.layerSelect ? store.layerSelect : null;
|
|
10808
|
+
};
|
|
10809
|
+
|
|
10810
|
+
var getSearchFilter = reselect.createSelector(layerSelectStore, function (store) {
|
|
10811
|
+
return store ? store.filters.searchFilter : '';
|
|
10812
|
+
});
|
|
10813
|
+
var getKeywords = reselect.createSelector(layerSelectStore, function (store) {
|
|
10814
|
+
return store ? store.filters.keywords : [];
|
|
10815
|
+
});
|
|
10816
|
+
|
|
10817
|
+
/* *
|
|
10818
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10819
|
+
* you may not use this file except in compliance with the License.
|
|
10820
|
+
* You may obtain a copy of the License at
|
|
10821
|
+
*
|
|
10822
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10823
|
+
*
|
|
10824
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10825
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10826
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10827
|
+
* See the License for the specific language governing permissions and
|
|
10828
|
+
* limitations under the License.
|
|
10829
|
+
*
|
|
10830
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10831
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10832
|
+
* */
|
|
10833
|
+
var useStyles$r = core.makeStyles(function (theme) {
|
|
10834
|
+
return core.createStyles({
|
|
10835
|
+
dialogTitle: {
|
|
10836
|
+
display: 'flex',
|
|
10837
|
+
justifyContent: 'space-between'
|
|
10838
|
+
},
|
|
10839
|
+
textField: {
|
|
10840
|
+
width: '100%'
|
|
10841
|
+
},
|
|
10842
|
+
button: {
|
|
10843
|
+
'&.MuiButton-containedPrimary': {
|
|
10844
|
+
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
10845
|
+
},
|
|
10846
|
+
'&.MuiButton-outlined': {
|
|
10847
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10848
|
+
}
|
|
10849
|
+
},
|
|
10850
|
+
container: {
|
|
10851
|
+
'& .MuiDialog-paper': {
|
|
10852
|
+
backgroundColor: theme.palette.geowebColors.cards.cardContainer
|
|
10853
|
+
}
|
|
10854
|
+
}
|
|
10855
|
+
});
|
|
10856
|
+
});
|
|
10857
|
+
var ADD_HEADING = 'Add a new service';
|
|
10858
|
+
var EDIT_HEADING = 'Edit service';
|
|
10859
|
+
var SAVE_HEADING = 'Save service';
|
|
10860
|
+
|
|
10861
|
+
var getTitleForVariant = function getTitleForVariant(variant) {
|
|
10862
|
+
switch (variant) {
|
|
10863
|
+
case 'add':
|
|
10864
|
+
return ADD_HEADING;
|
|
10865
|
+
|
|
10866
|
+
case 'edit':
|
|
10867
|
+
return EDIT_HEADING;
|
|
10868
|
+
|
|
10869
|
+
default:
|
|
10870
|
+
return SAVE_HEADING;
|
|
10871
|
+
}
|
|
10872
|
+
};
|
|
10873
|
+
|
|
10874
|
+
var ServicePopup = function ServicePopup(_a) {
|
|
10875
|
+
var servicePopupVariant = _a.servicePopupVariant,
|
|
10876
|
+
_b = _a.hideBackdrop,
|
|
10877
|
+
hideBackdrop = _b === void 0 ? false : _b,
|
|
10878
|
+
isOpen = _a.isOpen,
|
|
10879
|
+
closePopup = _a.closePopup,
|
|
10880
|
+
_c = _a.url,
|
|
10881
|
+
url = _c === void 0 ? '' : _c;
|
|
10882
|
+
var classes = useStyles$r();
|
|
10883
|
+
return /*#__PURE__*/React__namespace.createElement(core.Dialog, {
|
|
10884
|
+
open: isOpen,
|
|
10885
|
+
disableBackdropClick: true,
|
|
10886
|
+
hideBackdrop: hideBackdrop,
|
|
10887
|
+
fullWidth: true,
|
|
10888
|
+
maxWidth: "xs",
|
|
10889
|
+
className: classes.container
|
|
10890
|
+
}, /*#__PURE__*/React__namespace.createElement(core.DialogTitle, {
|
|
10891
|
+
className: classes.dialogTitle,
|
|
10892
|
+
disableTypography: true
|
|
10893
|
+
}, /*#__PURE__*/React__namespace.createElement(core.Typography, {
|
|
10894
|
+
variant: "h5"
|
|
10895
|
+
}, getTitleForVariant(servicePopupVariant)), /*#__PURE__*/React__namespace.createElement(core.IconButton, {
|
|
10896
|
+
size: "small",
|
|
10897
|
+
onClick: closePopup,
|
|
10898
|
+
"data-testid": "ClosePopupButtonCross"
|
|
10899
|
+
}, /*#__PURE__*/React__namespace.createElement(icons.Close, null))), /*#__PURE__*/React__namespace.createElement(core.DialogContent, null, /*#__PURE__*/React__namespace.createElement(core.TextField, {
|
|
10900
|
+
className: classes.textField,
|
|
10901
|
+
variant: "filled",
|
|
10902
|
+
label: "Service name"
|
|
10903
|
+
})), /*#__PURE__*/React__namespace.createElement(core.DialogContent, null, /*#__PURE__*/React__namespace.createElement(core.TextField, {
|
|
10904
|
+
className: classes.textField,
|
|
10905
|
+
variant: "filled",
|
|
10906
|
+
label: "Service URL",
|
|
10907
|
+
defaultValue: url,
|
|
10908
|
+
id: "service-url"
|
|
10909
|
+
})), /*#__PURE__*/React__namespace.createElement(core.DialogContent, null, /*#__PURE__*/React__namespace.createElement(core.TextField, {
|
|
10910
|
+
className: classes.textField,
|
|
10911
|
+
variant: "filled",
|
|
10912
|
+
multiline: true,
|
|
10913
|
+
rows: 4,
|
|
10914
|
+
label: "Abstracts",
|
|
10915
|
+
helperText: "Short description of what this service does"
|
|
10916
|
+
})), /*#__PURE__*/React__namespace.createElement(core.DialogActions, null, /*#__PURE__*/React__namespace.createElement(core.Button, {
|
|
10917
|
+
variant: "outlined",
|
|
10918
|
+
className: classes.button,
|
|
10919
|
+
onClick: closePopup,
|
|
10920
|
+
"data-testid": "ClosePopupButtonCancel"
|
|
10921
|
+
}, "cancel"), /*#__PURE__*/React__namespace.createElement(core.Button, {
|
|
10922
|
+
variant: "contained",
|
|
10923
|
+
color: "primary",
|
|
10924
|
+
className: classes.button
|
|
10925
|
+
}, "save")));
|
|
10926
|
+
};
|
|
10927
|
+
|
|
10928
|
+
/* *
|
|
10929
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10930
|
+
* you may not use this file except in compliance with the License.
|
|
10931
|
+
* You may obtain a copy of the License at
|
|
10932
|
+
*
|
|
10933
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10934
|
+
*
|
|
10935
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10936
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10937
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10938
|
+
* See the License for the specific language governing permissions and
|
|
10939
|
+
* limitations under the License.
|
|
10940
|
+
*
|
|
10941
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10942
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10943
|
+
* */
|
|
10944
|
+
var isURL = function isURL(string) {
|
|
10945
|
+
return /^https?:\/\//.test(string);
|
|
10946
|
+
};
|
|
10947
|
+
var useStyles$q = core.makeStyles(function (theme) {
|
|
10948
|
+
return {
|
|
10949
|
+
iconButton: {
|
|
10950
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10951
|
+
},
|
|
10952
|
+
saveButton: {
|
|
10953
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
|
|
10954
|
+
textTransform: 'none',
|
|
10955
|
+
border: "1px solid " + theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
10956
|
+
}
|
|
10957
|
+
};
|
|
10958
|
+
});
|
|
10959
|
+
var clearIconPath = 'M12,2 C17.5228475,2 22,6.4771525 22,12 C22,17.5228475 17.5228475,22 12,22 C6.4771525,22 2,17.5228475 2,12 C2,6.4771525 6.4771525,2 12,2 Z M15.44426,7.26697571 L12.0002861,10.7110482 L8.55573996,7.26697571 C8.19978253,6.9110081 7.62292549,6.9110081 7.26696807,7.26697571 C6.91101064,7.62294331 6.91101064,8.19981687 7.26696807,8.55578447 L10.7115142,11.9998569 L7.26696807,15.4445017 C6.91101064,15.8004693 6.91101064,16.3767705 7.26696807,16.7333104 C7.44494678,16.910722 7.67843653,17 7.91192629,17 C8.14484377,17 8.37776125,16.910722 8.55573996,16.7333104 L12.0002861,13.289238 L15.44426,16.7333104 C15.6222388,16.910722 15.8551562,17 16.088646,17 C16.3221357,17 16.5550532,16.910722 16.7330319,16.7333104 C17.0889894,16.3767705 17.0889894,15.8004693 16.7330319,15.4445017 L13.289058,11.9998569 L16.7330319,8.55578447 C17.0889894,8.19981687 17.0889894,7.62294331 16.7330319,7.26697571 C16.3770745,6.9110081 15.8002175,6.9110081 15.44426,7.26697571 Z';
|
|
10960
|
+
var clearIcon = /*#__PURE__*/React__default["default"].createElement(core.SvgIcon, {
|
|
10961
|
+
style: {
|
|
10962
|
+
width: '24px',
|
|
10963
|
+
height: '24px'
|
|
10964
|
+
},
|
|
10965
|
+
viewBox: "0 0 24 24",
|
|
10966
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10967
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
10968
|
+
d: clearIconPath
|
|
10969
|
+
}));
|
|
10970
|
+
var searchIconPath = 'M7.81701445,12.5845372 L7.81701445,12.5845372 C7.17924024,11.946763 6.82932049,11.100321 6.82932049,10.1993044 C6.82932049,9.29828785 7.17924024,8.45077582 7.81701445,7.8140717 C8.47405029,7.15703585 9.3376137,6.82851792 10.2022472,6.82851792 C11.0658106,6.82851792 11.929374,7.15703585 12.5874799,7.8140717 C13.9026217,9.12921348 13.9026217,11.2693954 12.5874799,12.5845372 C11.9497057,13.2212413 11.1021937,13.5722311 10.2022472,13.5722311 C9.3012306,13.5722311 8.45371857,13.2212413 7.81701445,12.5845372 M19.5858748,17.581862 L15.4681648,13.465222 C16.9513109,11.0735688 16.6613162,7.88683788 14.5874799,5.81300161 C12.1690744,3.39566613 8.23434992,3.39566613 5.81594436,5.81300161 C4.64419476,6.9847512 4,8.54280364 4,10.1993044 C4,11.8558052 4.64419476,13.4138577 5.81594436,14.5845372 C6.98769395,15.7562868 8.5446763,16.4015516 10.2022472,16.4015516 C11.376137,16.4015516 12.4965222,16.0719636 13.4681648,15.4662921 L17.5837346,19.582932 C17.8608882,19.8590155 18.2225789,19.9970572 18.5853398,19.9970572 C18.9470305,19.9970572 19.3087212,19.8590155 19.5858748,19.582932 C20.1380417,19.029695 20.1380417,18.135099 19.5858748,17.581862';
|
|
10971
|
+
var searchIcon = /*#__PURE__*/React__default["default"].createElement(core.SvgIcon, {
|
|
10972
|
+
style: {
|
|
10973
|
+
width: '24px',
|
|
10974
|
+
height: '24px'
|
|
10975
|
+
},
|
|
10976
|
+
viewBox: "0 0 24 24",
|
|
10977
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
10978
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
10979
|
+
d: searchIconPath
|
|
10980
|
+
}));
|
|
10981
|
+
|
|
10982
|
+
var SearchFieldButtonContainer = function SearchFieldButtonContainer(_a) {
|
|
10983
|
+
var localSearchString = _a.localSearchString,
|
|
10984
|
+
onClickClear = _a.onClickClear;
|
|
10985
|
+
|
|
10986
|
+
var _b = __read(React__default["default"].useState(false), 2),
|
|
10987
|
+
isPopupOpen = _b[0],
|
|
10988
|
+
setPopupOpen = _b[1];
|
|
10989
|
+
|
|
10990
|
+
var classes = useStyles$q();
|
|
10991
|
+
var ClearButton = /*#__PURE__*/React__default["default"].createElement(core.Tooltip, {
|
|
10992
|
+
title: "Clear",
|
|
10993
|
+
placement: "top"
|
|
10994
|
+
}, /*#__PURE__*/React__default["default"].createElement(core.IconButton, {
|
|
10995
|
+
className: classes.iconButton,
|
|
10996
|
+
edge: "end",
|
|
10997
|
+
onClick: function onClick() {
|
|
10998
|
+
onClickClear();
|
|
10999
|
+
}
|
|
11000
|
+
}, clearIcon));
|
|
11001
|
+
if (isURL(localSearchString)) return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
11002
|
+
style: {
|
|
11003
|
+
marginRight: '15px'
|
|
11004
|
+
}
|
|
11005
|
+
}, ClearButton), /*#__PURE__*/React__default["default"].createElement(core.Button, {
|
|
11006
|
+
variant: "outlined",
|
|
11007
|
+
onClick: function onClick() {
|
|
11008
|
+
return setPopupOpen(true);
|
|
11009
|
+
},
|
|
11010
|
+
className: classes.saveButton
|
|
11011
|
+
}, "Save"), /*#__PURE__*/React__default["default"].createElement(ServicePopup, {
|
|
11012
|
+
servicePopupVariant: "save",
|
|
11013
|
+
isOpen: isPopupOpen,
|
|
11014
|
+
closePopup: function closePopup() {
|
|
11015
|
+
return setPopupOpen(false);
|
|
11016
|
+
},
|
|
11017
|
+
url: localSearchString
|
|
11018
|
+
}));
|
|
11019
|
+
if (localSearchString) return ClearButton;
|
|
11020
|
+
return /*#__PURE__*/React__default["default"].createElement(core.Tooltip, {
|
|
11021
|
+
title: "Search",
|
|
11022
|
+
placement: "top"
|
|
11023
|
+
}, /*#__PURE__*/React__default["default"].createElement(core.IconButton, {
|
|
11024
|
+
className: classes.iconButton,
|
|
11025
|
+
edge: "end"
|
|
11026
|
+
}, searchIcon));
|
|
11027
|
+
};
|
|
11028
|
+
|
|
11029
|
+
/* *
|
|
11030
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11031
|
+
* you may not use this file except in compliance with the License.
|
|
11032
|
+
* You may obtain a copy of the License at
|
|
11033
|
+
*
|
|
11034
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11035
|
+
*
|
|
11036
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11037
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11038
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11039
|
+
* See the License for the specific language governing permissions and
|
|
11040
|
+
* limitations under the License.
|
|
11041
|
+
*
|
|
11042
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11043
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11044
|
+
* */
|
|
11045
|
+
|
|
11046
|
+
var SearchField = function SearchField(_a) {
|
|
11047
|
+
var searchFilter = _a.searchFilter,
|
|
11048
|
+
setSearchFilter = _a.setSearchFilter;
|
|
11049
|
+
|
|
11050
|
+
var _b = __read(React__namespace.useState(''), 2),
|
|
11051
|
+
localSearchString = _b[0],
|
|
11052
|
+
setLocalSearchString = _b[1]; // mirror store unless typing a URL
|
|
11053
|
+
|
|
11054
|
+
|
|
11055
|
+
React__namespace.useEffect(function () {
|
|
11056
|
+
if (isURL(localSearchString)) return;
|
|
11057
|
+
setLocalSearchString(searchFilter); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11058
|
+
}, [searchFilter]); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
11059
|
+
|
|
11060
|
+
var setSearchFilterDebounced = React__namespace.useCallback(_.debounce(setSearchFilter, 300), []);
|
|
11061
|
+
|
|
11062
|
+
var handleChange = function handleChange(text) {
|
|
11063
|
+
setLocalSearchString(text);
|
|
11064
|
+
if (!isURL(text)) setSearchFilterDebounced(text);else if (searchFilter) setSearchFilterDebounced('');
|
|
11065
|
+
};
|
|
11066
|
+
|
|
11067
|
+
return /*#__PURE__*/React__namespace.createElement(core.TextField, {
|
|
10523
11068
|
variant: "filled",
|
|
10524
11069
|
label: "Search through services or enter a service URL",
|
|
10525
|
-
value:
|
|
11070
|
+
value: localSearchString,
|
|
10526
11071
|
onChange: function onChange(e) {
|
|
10527
|
-
|
|
11072
|
+
handleChange(e.target.value);
|
|
11073
|
+
},
|
|
11074
|
+
autoFocus: true,
|
|
11075
|
+
fullWidth: true,
|
|
11076
|
+
InputProps: {
|
|
11077
|
+
endAdornment: /*#__PURE__*/React__namespace.createElement(core.InputAdornment, {
|
|
11078
|
+
position: "end"
|
|
11079
|
+
}, /*#__PURE__*/React__namespace.createElement(SearchFieldButtonContainer, {
|
|
11080
|
+
localSearchString: localSearchString,
|
|
11081
|
+
onClickClear: function onClickClear() {
|
|
11082
|
+
setLocalSearchString('');
|
|
11083
|
+
setSearchFilterDebounced('');
|
|
11084
|
+
}
|
|
11085
|
+
}))
|
|
11086
|
+
}
|
|
11087
|
+
});
|
|
11088
|
+
};
|
|
11089
|
+
|
|
11090
|
+
/* *
|
|
11091
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11092
|
+
* you may not use this file except in compliance with the License.
|
|
11093
|
+
* You may obtain a copy of the License at
|
|
11094
|
+
*
|
|
11095
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11096
|
+
*
|
|
11097
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11098
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11099
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11100
|
+
* See the License for the specific language governing permissions and
|
|
11101
|
+
* limitations under the License.
|
|
11102
|
+
*
|
|
11103
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11104
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11105
|
+
* */
|
|
11106
|
+
|
|
11107
|
+
var SearchFieldConnect = function SearchFieldConnect() {
|
|
11108
|
+
var dispatch = reactRedux.useDispatch();
|
|
11109
|
+
var searchFilter = reactRedux.useSelector(function (store) {
|
|
11110
|
+
return getSearchFilter(store);
|
|
11111
|
+
});
|
|
11112
|
+
return /*#__PURE__*/React__namespace.createElement(SearchField, {
|
|
11113
|
+
setSearchFilter: function setSearchFilter$1(filterText) {
|
|
11114
|
+
return dispatch(setSearchFilter({
|
|
11115
|
+
filterText: filterText
|
|
11116
|
+
}));
|
|
11117
|
+
},
|
|
11118
|
+
searchFilter: searchFilter
|
|
11119
|
+
});
|
|
11120
|
+
};
|
|
11121
|
+
|
|
11122
|
+
/* *
|
|
11123
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11124
|
+
* you may not use this file except in compliance with the License.
|
|
11125
|
+
* You may obtain a copy of the License at
|
|
11126
|
+
*
|
|
11127
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11128
|
+
*
|
|
11129
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11130
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11131
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11132
|
+
* See the License for the specific language governing permissions and
|
|
11133
|
+
* limitations under the License.
|
|
11134
|
+
*
|
|
11135
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11136
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11137
|
+
* */
|
|
11138
|
+
var useStyles$p = core.makeStyles(function (theme) {
|
|
11139
|
+
return {
|
|
11140
|
+
layerRow: {
|
|
11141
|
+
background: theme.palette.geowebColors.background.surface,
|
|
11142
|
+
padding: '8px 0px 8px 12px',
|
|
11143
|
+
marginBottom: '4px',
|
|
11144
|
+
height: '64px',
|
|
11145
|
+
border: "solid 1px " + theme.palette.geowebColors.cards.cardContainerBorder
|
|
11146
|
+
},
|
|
11147
|
+
layerText: {
|
|
11148
|
+
fontSize: '12px',
|
|
11149
|
+
fontWeight: 500,
|
|
11150
|
+
overflow: 'clip',
|
|
11151
|
+
height: '20px',
|
|
11152
|
+
textOverflow: 'ellipsis',
|
|
11153
|
+
whiteSpace: 'nowrap'
|
|
11154
|
+
},
|
|
11155
|
+
layerName: {
|
|
11156
|
+
fontSize: '12px',
|
|
11157
|
+
height: '24px',
|
|
11158
|
+
maxWidth: '100%',
|
|
11159
|
+
overflow: 'clip',
|
|
11160
|
+
"float": 'left',
|
|
11161
|
+
paddingTop: '6px',
|
|
11162
|
+
textOverflow: 'ellipsis',
|
|
11163
|
+
whiteSpace: 'nowrap'
|
|
11164
|
+
},
|
|
11165
|
+
layerNameMaxWidth: {
|
|
11166
|
+
maxWidth: '196px'
|
|
11167
|
+
},
|
|
11168
|
+
layerAbstract: {
|
|
11169
|
+
fontSize: '10px',
|
|
11170
|
+
paddingLeft: '200px',
|
|
11171
|
+
overflow: 'clip',
|
|
11172
|
+
height: '30px'
|
|
11173
|
+
},
|
|
11174
|
+
resultCount: {
|
|
11175
|
+
marginBottom: '4px',
|
|
11176
|
+
fontSize: '12px'
|
|
11177
|
+
}
|
|
11178
|
+
};
|
|
11179
|
+
});
|
|
11180
|
+
|
|
11181
|
+
var LayerList = function LayerList(_a) {
|
|
11182
|
+
var services = _a.services,
|
|
11183
|
+
serviceIds = _a.serviceIds,
|
|
11184
|
+
layerSelectHeight = _a.layerSelectHeight;
|
|
11185
|
+
var classes = useStyles$p();
|
|
11186
|
+
|
|
11187
|
+
var _b = __read(React__namespace.useState(0), 2),
|
|
11188
|
+
numberOfLayers = _b[0],
|
|
11189
|
+
setNumberOfLayers = _b[1];
|
|
11190
|
+
|
|
11191
|
+
React__namespace.useEffect(function () {
|
|
11192
|
+
setNumberOfLayers(serviceIds.reduce(function (totalNumberOfLayers, serviceId) {
|
|
11193
|
+
return totalNumberOfLayers + services[serviceId].layers.length;
|
|
11194
|
+
}, 0));
|
|
11195
|
+
}, [serviceIds, services]);
|
|
11196
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11197
|
+
"data-testid": "layerList"
|
|
11198
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11199
|
+
className: classes.resultCount
|
|
11200
|
+
}, numberOfLayers, " results"), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11201
|
+
style: {
|
|
11202
|
+
height: layerSelectHeight - 199,
|
|
11203
|
+
overflow: 'auto'
|
|
11204
|
+
}
|
|
11205
|
+
}, serviceIds.map(function (serviceId) {
|
|
11206
|
+
return services[serviceId].layers.map(function (layer) {
|
|
11207
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11208
|
+
key: serviceId + "-" + layer.name,
|
|
11209
|
+
className: classes.layerRow,
|
|
11210
|
+
"data-testid": "layerListLayerRow"
|
|
11211
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11212
|
+
className: classes.layerText
|
|
11213
|
+
}, layer.text), /*#__PURE__*/React__namespace.createElement("div", null, layer["abstract"] ? /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11214
|
+
className: classes.layerName + " " + classes.layerNameMaxWidth
|
|
11215
|
+
}, layer.name), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11216
|
+
className: classes.layerAbstract,
|
|
11217
|
+
"data-testid": "layerAbstract"
|
|
11218
|
+
}, layer["abstract"])) : /*#__PURE__*/React__namespace.createElement("div", {
|
|
11219
|
+
className: classes.layerName
|
|
11220
|
+
}, layer.name)));
|
|
11221
|
+
});
|
|
11222
|
+
})));
|
|
11223
|
+
};
|
|
11224
|
+
|
|
11225
|
+
/* *
|
|
11226
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11227
|
+
* you may not use this file except in compliance with the License.
|
|
11228
|
+
* You may obtain a copy of the License at
|
|
11229
|
+
*
|
|
11230
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11231
|
+
*
|
|
11232
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11233
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11234
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11235
|
+
* See the License for the specific language governing permissions and
|
|
11236
|
+
* limitations under the License.
|
|
11237
|
+
*
|
|
11238
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11239
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11240
|
+
* */
|
|
11241
|
+
|
|
11242
|
+
var LayerListConnect = function LayerListConnect(_a) {
|
|
11243
|
+
var layerSelectHeight = _a.layerSelectHeight;
|
|
11244
|
+
var allServiceIds = reactRedux.useSelector(function (store) {
|
|
11245
|
+
return getServiceIds(store);
|
|
11246
|
+
});
|
|
11247
|
+
var allServices = reactRedux.useSelector(function (store) {
|
|
11248
|
+
return getServices(store);
|
|
11249
|
+
});
|
|
11250
|
+
return /*#__PURE__*/React__namespace.createElement(LayerList, {
|
|
11251
|
+
services: allServices,
|
|
11252
|
+
serviceIds: allServiceIds,
|
|
11253
|
+
layerSelectHeight: layerSelectHeight
|
|
11254
|
+
});
|
|
11255
|
+
};
|
|
11256
|
+
|
|
11257
|
+
/* *
|
|
11258
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11259
|
+
* you may not use this file except in compliance with the License.
|
|
11260
|
+
* You may obtain a copy of the License at
|
|
11261
|
+
*
|
|
11262
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11263
|
+
*
|
|
11264
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11265
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11266
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11267
|
+
* See the License for the specific language governing permissions and
|
|
11268
|
+
* limitations under the License.
|
|
11269
|
+
*
|
|
11270
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11271
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11272
|
+
* */
|
|
11273
|
+
var useStyles$o = core.makeStyles(function (theme) {
|
|
11274
|
+
return core.createStyles({
|
|
11275
|
+
chip: {
|
|
11276
|
+
height: '32px',
|
|
11277
|
+
margin: '0 8px 0 0',
|
|
11278
|
+
padding: '5px 12px 7px',
|
|
11279
|
+
borderRadius: '20px',
|
|
11280
|
+
border: "solid 1px " + theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
|
|
11281
|
+
backgroundColor: theme.palette.geowebColors.buttons.surfaceIconDefault.fill,
|
|
11282
|
+
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
|
|
11283
|
+
"float": 'left',
|
|
11284
|
+
whiteSpace: 'nowrap',
|
|
11285
|
+
'&:hover': {
|
|
11286
|
+
backgroundColor: theme.palette.geowebColors.buttons.flatMouseover.fill,
|
|
11287
|
+
cursor: 'pointer'
|
|
11288
|
+
}
|
|
11289
|
+
}
|
|
11290
|
+
});
|
|
11291
|
+
});
|
|
11292
|
+
|
|
11293
|
+
var ServiceChip = function ServiceChip(_a) {
|
|
11294
|
+
var _b = _a.all,
|
|
11295
|
+
all = _b === void 0 ? false : _b,
|
|
11296
|
+
service = _a.service;
|
|
11297
|
+
var classes = useStyles$o();
|
|
11298
|
+
|
|
11299
|
+
if (all) {
|
|
11300
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11301
|
+
className: classes.chip,
|
|
11302
|
+
"data-testid": "serviceChipAll"
|
|
11303
|
+
}, "All");
|
|
11304
|
+
}
|
|
11305
|
+
|
|
11306
|
+
if (service && service.name) {
|
|
11307
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11308
|
+
className: classes.chip,
|
|
11309
|
+
"data-testid": "serviceChip"
|
|
11310
|
+
}, service.name);
|
|
11311
|
+
}
|
|
11312
|
+
|
|
11313
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11314
|
+
className: classes.chip
|
|
11315
|
+
});
|
|
11316
|
+
};
|
|
11317
|
+
|
|
11318
|
+
/* *
|
|
11319
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11320
|
+
* you may not use this file except in compliance with the License.
|
|
11321
|
+
* You may obtain a copy of the License at
|
|
11322
|
+
*
|
|
11323
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11324
|
+
*
|
|
11325
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11326
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11327
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11328
|
+
* See the License for the specific language governing permissions and
|
|
11329
|
+
* limitations under the License.
|
|
11330
|
+
*
|
|
11331
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11332
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11333
|
+
* */
|
|
11334
|
+
var useStyles$n = core.makeStyles(function (theme) {
|
|
11335
|
+
return core.createStyles({
|
|
11336
|
+
serviceChips: {
|
|
11337
|
+
width: '100%',
|
|
11338
|
+
display: 'inline-flex',
|
|
11339
|
+
alignItems: 'center',
|
|
11340
|
+
overflowX: 'visible',
|
|
11341
|
+
"float": 'left',
|
|
11342
|
+
paddingLeft: '40px',
|
|
11343
|
+
marginRight: function marginRight(_a) {
|
|
11344
|
+
var margin = _a.margin;
|
|
11345
|
+
return margin;
|
|
11346
|
+
},
|
|
11347
|
+
marginLeft: function marginLeft(_a) {
|
|
11348
|
+
var margin = _a.margin;
|
|
11349
|
+
return -margin;
|
|
11350
|
+
},
|
|
11351
|
+
maxWidth: function maxWidth(_a) {
|
|
11352
|
+
var maxWidthValue = _a.maxWidthValue;
|
|
11353
|
+
return maxWidthValue;
|
|
11354
|
+
}
|
|
11355
|
+
},
|
|
11356
|
+
scrollArrowLeft: {
|
|
11357
|
+
width: '120px',
|
|
11358
|
+
marginBottom: '-12px',
|
|
11359
|
+
height: '34px',
|
|
11360
|
+
backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), " + theme.palette.geowebColors.background.surfaceApp + " 51%)",
|
|
11361
|
+
cursor: 'pointer',
|
|
11362
|
+
marginRight: '-120px',
|
|
11363
|
+
"float": 'left',
|
|
11364
|
+
zIndex: 1,
|
|
11365
|
+
position: 'relative'
|
|
11366
|
+
},
|
|
11367
|
+
serviceList: {
|
|
11368
|
+
height: '32px',
|
|
11369
|
+
marginTop: '8px',
|
|
11370
|
+
width: '100%',
|
|
11371
|
+
overflow: 'hidden'
|
|
11372
|
+
},
|
|
11373
|
+
scrollArrowRight: {
|
|
11374
|
+
width: '120px',
|
|
11375
|
+
marginBottom: '-12px',
|
|
11376
|
+
height: '34px',
|
|
11377
|
+
backgroundImage: "linear-gradient(to right, rgba(0, 0, 0, 0), " + theme.palette.geowebColors.background.surfaceApp + " 51%)",
|
|
11378
|
+
right: '0px',
|
|
11379
|
+
position: 'fixed',
|
|
11380
|
+
cursor: 'pointer'
|
|
11381
|
+
}
|
|
11382
|
+
});
|
|
11383
|
+
});
|
|
11384
|
+
|
|
11385
|
+
var ServiceList = function ServiceList(_a) {
|
|
11386
|
+
var layerSelectWidth = _a.layerSelectWidth,
|
|
11387
|
+
services = _a.services;
|
|
11388
|
+
|
|
11389
|
+
var _b = __read(React__namespace.useState(0), 2),
|
|
11390
|
+
margin = _b[0],
|
|
11391
|
+
setMargin = _b[1];
|
|
11392
|
+
|
|
11393
|
+
var _c = __read(React__namespace.useState(0), 2),
|
|
11394
|
+
width = _c[0],
|
|
11395
|
+
setWidth = _c[1];
|
|
11396
|
+
|
|
11397
|
+
var ref = React__namespace.useRef(null);
|
|
11398
|
+
var maxWidthValue = ref && ref.current && ref.current.scrollWidth && ref.current.scrollWidth >= layerSelectWidth - margin && ref.current.scrollWidth || layerSelectWidth - 50;
|
|
11399
|
+
var classes = useStyles$n({
|
|
11400
|
+
margin: margin,
|
|
11401
|
+
maxWidthValue: maxWidthValue
|
|
11402
|
+
});
|
|
11403
|
+
var onLeftArrowClick = React__namespace.useCallback(function () {
|
|
11404
|
+
setMargin(Math.max(0, margin - 100));
|
|
11405
|
+
}, [margin]);
|
|
11406
|
+
var onRightArrowClick = React__namespace.useCallback(function () {
|
|
11407
|
+
setMargin(Math.min(width - layerSelectWidth, margin + 100));
|
|
11408
|
+
}, [margin, layerSelectWidth, width]);
|
|
11409
|
+
React__namespace.useEffect(function () {
|
|
11410
|
+
setWidth(ref.current.scrollWidth + 50);
|
|
11411
|
+
setMargin(Math.max(0, Math.min(width - layerSelectWidth, margin)));
|
|
11412
|
+
}, [services, layerSelectWidth, width, margin]);
|
|
11413
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
11414
|
+
className: classes.serviceList,
|
|
11415
|
+
"data-testid": "serviceList"
|
|
11416
|
+
}, margin !== 0 && /*#__PURE__*/React__namespace.createElement(icons.ChevronLeft, {
|
|
11417
|
+
className: classes.scrollArrowLeft,
|
|
11418
|
+
onClick: onLeftArrowClick,
|
|
11419
|
+
"data-testid": "leftScrollArrow"
|
|
11420
|
+
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11421
|
+
className: classes.serviceChips,
|
|
11422
|
+
ref: ref
|
|
11423
|
+
}, services && Object.keys(services) && Object.keys(services).length > 0 && /*#__PURE__*/React__namespace.createElement(ServiceChip, {
|
|
11424
|
+
key: "All",
|
|
11425
|
+
all: true
|
|
11426
|
+
}), Object.keys(services).map(function (service) {
|
|
11427
|
+
return /*#__PURE__*/React__namespace.createElement(ServiceChip, {
|
|
11428
|
+
key: services[service].id,
|
|
11429
|
+
service: services[service]
|
|
11430
|
+
});
|
|
11431
|
+
})), layerSelectWidth + margin < width && /*#__PURE__*/React__namespace.createElement(icons.ChevronRight, {
|
|
11432
|
+
className: classes.scrollArrowRight,
|
|
11433
|
+
onClick: onRightArrowClick,
|
|
11434
|
+
"data-testid": "rightScrollArrow"
|
|
11435
|
+
}));
|
|
11436
|
+
};
|
|
11437
|
+
|
|
11438
|
+
/* *
|
|
11439
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11440
|
+
* you may not use this file except in compliance with the License.
|
|
11441
|
+
* You may obtain a copy of the License at
|
|
11442
|
+
*
|
|
11443
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11444
|
+
*
|
|
11445
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11446
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11447
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11448
|
+
* See the License for the specific language governing permissions and
|
|
11449
|
+
* limitations under the License.
|
|
11450
|
+
*
|
|
11451
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11452
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11453
|
+
* */
|
|
11454
|
+
|
|
11455
|
+
var ServiceListConnect = function ServiceListConnect(_a) {
|
|
11456
|
+
var layerSelectWidth = _a.layerSelectWidth;
|
|
11457
|
+
var services = reactRedux.useSelector(function (store) {
|
|
11458
|
+
return getServices(store);
|
|
11459
|
+
});
|
|
11460
|
+
return /*#__PURE__*/React__namespace.createElement(ServiceList, {
|
|
11461
|
+
layerSelectWidth: layerSelectWidth,
|
|
11462
|
+
services: services
|
|
11463
|
+
});
|
|
11464
|
+
};
|
|
11465
|
+
|
|
11466
|
+
/* *
|
|
11467
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11468
|
+
* you may not use this file except in compliance with the License.
|
|
11469
|
+
* You may obtain a copy of the License at
|
|
11470
|
+
*
|
|
11471
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11472
|
+
*
|
|
11473
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11474
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11475
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11476
|
+
* See the License for the specific language governing permissions and
|
|
11477
|
+
* limitations under the License.
|
|
11478
|
+
*
|
|
11479
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11480
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11481
|
+
* */
|
|
11482
|
+
var useStyles$m = core.makeStyles(function (theme) {
|
|
11483
|
+
return core.createStyles({
|
|
11484
|
+
servicesContainer: {
|
|
11485
|
+
width: '300px',
|
|
11486
|
+
height: '380px',
|
|
11487
|
+
position: 'fixed',
|
|
11488
|
+
top: '140px',
|
|
11489
|
+
right: '-72px',
|
|
11490
|
+
backgroundColor: theme.palette.geowebColors.background.surface,
|
|
11491
|
+
boxShadow: theme.shadows[6]
|
|
11492
|
+
},
|
|
11493
|
+
servicesText: {
|
|
11494
|
+
paddingTop: '12px',
|
|
11495
|
+
paddingLeft: '12px'
|
|
11496
|
+
}
|
|
11497
|
+
});
|
|
11498
|
+
});
|
|
11499
|
+
|
|
11500
|
+
var ServiceOptionsButton = function ServiceOptionsButton() {
|
|
11501
|
+
var classes = useStyles$m();
|
|
11502
|
+
|
|
11503
|
+
var _a = __read(React__namespace.useState(false), 2),
|
|
11504
|
+
containerOpen = _a[0],
|
|
11505
|
+
setContainerOpen = _a[1];
|
|
11506
|
+
|
|
11507
|
+
var toggleContainer = function toggleContainer() {
|
|
11508
|
+
setContainerOpen(!containerOpen);
|
|
11509
|
+
};
|
|
11510
|
+
|
|
11511
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(ToggleIconButton, {
|
|
11512
|
+
onClick: toggleContainer,
|
|
11513
|
+
active: containerOpen,
|
|
11514
|
+
"data-testid": "serviceOptionsButton"
|
|
11515
|
+
}, /*#__PURE__*/React__namespace.createElement(core.SvgIcon, {
|
|
11516
|
+
viewBox: "0 0 24 24",
|
|
11517
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11518
|
+
}, /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
11519
|
+
d: "M12 16c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0-2c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm0-6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z",
|
|
11520
|
+
fill: "#FFF",
|
|
11521
|
+
fillRule: "evenodd"
|
|
11522
|
+
})))), containerOpen ? /*#__PURE__*/React__namespace.createElement(core.Box, {
|
|
11523
|
+
className: classes.servicesContainer,
|
|
11524
|
+
"data-testid": "container"
|
|
11525
|
+
}, /*#__PURE__*/React__namespace.createElement(core.Typography, {
|
|
11526
|
+
className: classes.servicesText
|
|
11527
|
+
}, "Services")) : null);
|
|
11528
|
+
};
|
|
11529
|
+
|
|
11530
|
+
/* *
|
|
11531
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11532
|
+
* you may not use this file except in compliance with the License.
|
|
11533
|
+
* You may obtain a copy of the License at
|
|
11534
|
+
*
|
|
11535
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11536
|
+
*
|
|
11537
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11538
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11539
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11540
|
+
* See the License for the specific language governing permissions and
|
|
11541
|
+
* limitations under the License.
|
|
11542
|
+
*
|
|
11543
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11544
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11545
|
+
* */
|
|
11546
|
+
var useStyles$l = core.makeStyles({
|
|
11547
|
+
serviceList: {
|
|
11548
|
+
height: '48px'
|
|
11549
|
+
},
|
|
11550
|
+
keywordFilterButton: {
|
|
11551
|
+
"float": 'left',
|
|
11552
|
+
position: 'absolute',
|
|
11553
|
+
margin: '12px 0 0 8px',
|
|
11554
|
+
zIndex: 2
|
|
11555
|
+
},
|
|
11556
|
+
serviceOptionsButton: {
|
|
11557
|
+
position: 'absolute',
|
|
11558
|
+
margin: '12px 0 0 calc(100% - 36px)',
|
|
11559
|
+
zIndex: 2
|
|
11560
|
+
},
|
|
11561
|
+
layerSelectContainer: {
|
|
11562
|
+
padding: '0 8px'
|
|
11563
|
+
}
|
|
11564
|
+
});
|
|
11565
|
+
|
|
11566
|
+
var LayerSelect = function LayerSelect(_a) {
|
|
11567
|
+
var mapId = _a.mapId,
|
|
11568
|
+
bounds = _a.bounds,
|
|
11569
|
+
_b = _a.onClose,
|
|
11570
|
+
onClose = _b === void 0 ? function () {} : _b,
|
|
11571
|
+
showTitle = _a.showTitle,
|
|
11572
|
+
isOpen = _a.isOpen,
|
|
11573
|
+
_c = _a.onMouseDown,
|
|
11574
|
+
onMouseDown = _c === void 0 ? function () {} : _c,
|
|
11575
|
+
_d = _a.order,
|
|
11576
|
+
order = _d === void 0 ? 0 : _d,
|
|
11577
|
+
_e = _a.source,
|
|
11578
|
+
source = _e === void 0 ? 'module' : _e;
|
|
11579
|
+
var classes = useStyles$l();
|
|
11580
|
+
|
|
11581
|
+
var _f = __read(React__namespace.useState(500), 2),
|
|
11582
|
+
height = _f[0],
|
|
11583
|
+
setHeight = _f[1];
|
|
11584
|
+
|
|
11585
|
+
var _g = __read(React__namespace.useState(750), 2),
|
|
11586
|
+
width = _g[0],
|
|
11587
|
+
setWidth = _g[1];
|
|
11588
|
+
|
|
11589
|
+
var onChangeSize = function onChangeSize(_a) {
|
|
11590
|
+
var height = _a.height,
|
|
11591
|
+
width = _a.width;
|
|
11592
|
+
setHeight(height);
|
|
11593
|
+
setWidth(width);
|
|
11594
|
+
};
|
|
11595
|
+
|
|
11596
|
+
return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
|
|
11597
|
+
title: showTitle ? "Layer Select " + mapId : 'Layer Select',
|
|
11598
|
+
startSize: {
|
|
11599
|
+
width: width,
|
|
11600
|
+
height: height
|
|
11601
|
+
},
|
|
11602
|
+
minWidth: 390,
|
|
11603
|
+
minHeight: 126,
|
|
11604
|
+
startPosition: {
|
|
11605
|
+
top: 150,
|
|
11606
|
+
left: 100
|
|
10528
11607
|
},
|
|
10529
|
-
|
|
10530
|
-
|
|
10531
|
-
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
return setSearchString('');
|
|
10542
|
-
}
|
|
10543
|
-
}, clearIcon)) : /*#__PURE__*/React__namespace.createElement(core.Tooltip, {
|
|
10544
|
-
title: "Search",
|
|
10545
|
-
placement: "top"
|
|
10546
|
-
}, /*#__PURE__*/React__namespace.createElement(core.IconButton, {
|
|
10547
|
-
className: classes.iconButton,
|
|
10548
|
-
edge: "end"
|
|
10549
|
-
}, searchIcon)))
|
|
11608
|
+
isOpen: isOpen,
|
|
11609
|
+
onChangeSize: onChangeSize,
|
|
11610
|
+
onClose: onClose,
|
|
11611
|
+
headerSize: "small",
|
|
11612
|
+
bounds: bounds,
|
|
11613
|
+
"data-testid": "layerSelectWindow",
|
|
11614
|
+
onMouseDown: onMouseDown,
|
|
11615
|
+
order: order,
|
|
11616
|
+
source: source
|
|
11617
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11618
|
+
style: {
|
|
11619
|
+
padding: '6px'
|
|
10550
11620
|
}
|
|
10551
|
-
})
|
|
11621
|
+
}, /*#__PURE__*/React__namespace.createElement(SearchFieldConnect, null)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11622
|
+
className: classes.keywordFilterButton
|
|
11623
|
+
}, /*#__PURE__*/React__namespace.createElement(KeywordFilterButtonConnect, {
|
|
11624
|
+
mapId: mapId
|
|
11625
|
+
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11626
|
+
className: classes.serviceOptionsButton
|
|
11627
|
+
}, /*#__PURE__*/React__namespace.createElement(ServiceOptionsButton, null)), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11628
|
+
className: classes.serviceList
|
|
11629
|
+
}, /*#__PURE__*/React__namespace.createElement(ServiceListConnect, {
|
|
11630
|
+
layerSelectWidth: width
|
|
11631
|
+
})), /*#__PURE__*/React__namespace.createElement("div", {
|
|
11632
|
+
className: classes.layerSelectContainer
|
|
11633
|
+
}, /*#__PURE__*/React__namespace.createElement(LayerListConnect, {
|
|
11634
|
+
layerSelectHeight: height
|
|
11635
|
+
})));
|
|
10552
11636
|
};
|
|
10553
11637
|
|
|
10554
11638
|
/* *
|
|
@@ -10567,50 +11651,23 @@
|
|
|
10567
11651
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10568
11652
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10569
11653
|
* */
|
|
10570
|
-
var
|
|
10571
|
-
return
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
backgroundColor: theme.palette.geowebColors.buttons.surfaceIconDefault.fill,
|
|
10579
|
-
color: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat,
|
|
10580
|
-
"float": 'left',
|
|
10581
|
-
whiteSpace: 'nowrap',
|
|
10582
|
-
'&:hover': {
|
|
10583
|
-
backgroundColor: theme.palette.geowebColors.buttons.flatMouseover.fill,
|
|
10584
|
-
cursor: 'pointer'
|
|
11654
|
+
var CustomSwitch = core.withStyles(function (theme) {
|
|
11655
|
+
return {
|
|
11656
|
+
switchBase: {
|
|
11657
|
+
'&$checked': {
|
|
11658
|
+
color: theme.palette.geowebColors.customSlider.thumb
|
|
11659
|
+
},
|
|
11660
|
+
'&$checked + $track': {
|
|
11661
|
+
backgroundColor: theme.palette.geowebColors.buttons.primary.fill
|
|
10585
11662
|
}
|
|
11663
|
+
},
|
|
11664
|
+
checked: {},
|
|
11665
|
+
track: {
|
|
11666
|
+
backgroundColor: theme.palette.geowebColors.customSlider.switchTrackDisabled,
|
|
11667
|
+
opacity: '1 !important'
|
|
10586
11668
|
}
|
|
10587
|
-
}
|
|
10588
|
-
});
|
|
10589
|
-
|
|
10590
|
-
var ServiceChip = function ServiceChip(_a) {
|
|
10591
|
-
var _b = _a.all,
|
|
10592
|
-
all = _b === void 0 ? false : _b,
|
|
10593
|
-
service = _a.service;
|
|
10594
|
-
var classes = useStyles$l();
|
|
10595
|
-
|
|
10596
|
-
if (all) {
|
|
10597
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
10598
|
-
className: classes.chip,
|
|
10599
|
-
"data-testid": "serviceChipAll"
|
|
10600
|
-
}, "All");
|
|
10601
|
-
}
|
|
10602
|
-
|
|
10603
|
-
if (service && service.name) {
|
|
10604
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
10605
|
-
className: classes.chip,
|
|
10606
|
-
"data-testid": "serviceChip"
|
|
10607
|
-
}, service.name);
|
|
10608
|
-
}
|
|
10609
|
-
|
|
10610
|
-
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
10611
|
-
className: classes.chip
|
|
10612
|
-
});
|
|
10613
|
-
};
|
|
11669
|
+
};
|
|
11670
|
+
})(core.Switch);
|
|
10614
11671
|
|
|
10615
11672
|
/* *
|
|
10616
11673
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -10630,92 +11687,86 @@
|
|
|
10630
11687
|
* */
|
|
10631
11688
|
var useStyles$k = core.makeStyles(function (theme) {
|
|
10632
11689
|
return core.createStyles({
|
|
10633
|
-
|
|
11690
|
+
listItem: {
|
|
10634
11691
|
width: '100%',
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10639
|
-
|
|
11692
|
+
minWidth: '300px',
|
|
11693
|
+
padding: '0px',
|
|
11694
|
+
paddingLeft: '10px',
|
|
11695
|
+
paddingRight: '50px',
|
|
11696
|
+
fontSize: '12px'
|
|
10640
11697
|
},
|
|
10641
|
-
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
backgroundImage: "linear-gradient(to left, rgba(0, 0, 0, 0), " + theme.palette.geowebColors.background.surfaceApp + " 51%)",
|
|
10646
|
-
marginLeft: '-100%',
|
|
10647
|
-
cursor: 'pointer'
|
|
11698
|
+
onlyByttonText: {
|
|
11699
|
+
color: theme.palette.geowebColors.buttons.primary.fill,
|
|
11700
|
+
fontSize: '14px',
|
|
11701
|
+
fontWeight: 500
|
|
10648
11702
|
},
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10653
|
-
|
|
10654
|
-
|
|
11703
|
+
checkbox: {
|
|
11704
|
+
paddingTop: '6px',
|
|
11705
|
+
paddingBottom: '7px',
|
|
11706
|
+
'&&:hover': {
|
|
11707
|
+
backgroundColor: 'transparent'
|
|
11708
|
+
}
|
|
10655
11709
|
},
|
|
10656
|
-
|
|
10657
|
-
|
|
10658
|
-
|
|
10659
|
-
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
cursor: 'pointer'
|
|
11710
|
+
listItemIcon: {
|
|
11711
|
+
minWidth: '42px'
|
|
11712
|
+
},
|
|
11713
|
+
listItemText: {
|
|
11714
|
+
textOverflow: 'ellipsis',
|
|
11715
|
+
whiteSpace: 'nowrap',
|
|
11716
|
+
overflow: 'hidden'
|
|
10664
11717
|
}
|
|
10665
11718
|
});
|
|
10666
11719
|
});
|
|
10667
11720
|
|
|
10668
|
-
var
|
|
10669
|
-
var
|
|
10670
|
-
|
|
11721
|
+
var FilterListItem = function FilterListItem(_a) {
|
|
11722
|
+
var index = _a.index,
|
|
11723
|
+
text = _a.text,
|
|
11724
|
+
checked = _a.checked,
|
|
11725
|
+
toggleCheckbox = _a.toggleCheckbox,
|
|
11726
|
+
selectOnlyOne = _a.selectOnlyOne;
|
|
10671
11727
|
var classes = useStyles$k();
|
|
10672
11728
|
|
|
10673
|
-
var _b = __read(React__namespace.useState(
|
|
10674
|
-
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
var _c = __read(React__namespace.useState(0), 2),
|
|
10678
|
-
width = _c[0],
|
|
10679
|
-
setWidth = _c[1];
|
|
11729
|
+
var _b = __read(React__namespace.useState(false), 2),
|
|
11730
|
+
hovering = _b[0],
|
|
11731
|
+
setHovering = _b[1];
|
|
10680
11732
|
|
|
10681
|
-
var
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
}, [margin, layerSelectWidth, width]);
|
|
10688
|
-
var gapRight = 35;
|
|
10689
|
-
React__namespace.useEffect(function () {
|
|
10690
|
-
setWidth(ref.current.scrollWidth + gapRight);
|
|
10691
|
-
}, [services, layerSelectWidth]);
|
|
11733
|
+
var handleMouseOver = React__namespace.useCallback(function () {
|
|
11734
|
+
setHovering(true);
|
|
11735
|
+
}, []);
|
|
11736
|
+
var handleMouseLeave = React__namespace.useCallback(function () {
|
|
11737
|
+
setHovering(false);
|
|
11738
|
+
}, []);
|
|
10692
11739
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
11740
|
+
onMouseOver: handleMouseOver,
|
|
11741
|
+
onMouseLeave: handleMouseLeave,
|
|
11742
|
+
onFocus: handleMouseOver,
|
|
11743
|
+
onBlur: handleMouseLeave,
|
|
11744
|
+
"data-testid": "filterResultListItem"
|
|
11745
|
+
}, /*#__PURE__*/React__namespace.createElement(core.ListItem, {
|
|
11746
|
+
className: classes.listItem
|
|
11747
|
+
}, /*#__PURE__*/React__namespace.createElement(core.ListItemIcon, {
|
|
11748
|
+
className: classes.listItemIcon
|
|
11749
|
+
}, /*#__PURE__*/React__namespace.createElement(core.Checkbox, {
|
|
11750
|
+
checked: checked,
|
|
11751
|
+
onChange: function onChange() {
|
|
11752
|
+
return toggleCheckbox(index);
|
|
11753
|
+
},
|
|
11754
|
+
className: classes.checkbox
|
|
11755
|
+
})), /*#__PURE__*/React__namespace.createElement(core.Typography, {
|
|
11756
|
+
variant: "body2",
|
|
11757
|
+
className: classes.listItemText
|
|
11758
|
+
}, text), hovering ? /*#__PURE__*/React__namespace.createElement(core.ListItemSecondaryAction, null, /*#__PURE__*/React__namespace.createElement(core.IconButton, {
|
|
10701
11759
|
style: {
|
|
10702
|
-
|
|
10703
|
-
marginRight: margin + "px"
|
|
11760
|
+
backgroundColor: 'transparent'
|
|
10704
11761
|
},
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
10708
|
-
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
});
|
|
10714
|
-
})), margin < width - layerSelectWidth - gapRight && /*#__PURE__*/React__namespace.createElement(icons.ChevronRight, {
|
|
10715
|
-
className: classes.scrollArrowRight,
|
|
10716
|
-
onClick: onRightArrowClick,
|
|
10717
|
-
"data-testid": "rightScrollArrow"
|
|
10718
|
-
}));
|
|
11762
|
+
edge: "end",
|
|
11763
|
+
size: "small",
|
|
11764
|
+
onClick: function onClick() {
|
|
11765
|
+
return selectOnlyOne(index);
|
|
11766
|
+
}
|
|
11767
|
+
}, /*#__PURE__*/React__namespace.createElement(core.Typography, {
|
|
11768
|
+
className: classes.onlyByttonText
|
|
11769
|
+
}, "ONLY"))) : null));
|
|
10719
11770
|
};
|
|
10720
11771
|
|
|
10721
11772
|
/* *
|
|
@@ -10734,16 +11785,146 @@
|
|
|
10734
11785
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10735
11786
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10736
11787
|
* */
|
|
10737
|
-
|
|
10738
|
-
|
|
10739
|
-
|
|
10740
|
-
|
|
10741
|
-
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
|
|
10745
|
-
|
|
11788
|
+
var useStyles$j = core.makeStyles(function (theme) {
|
|
11789
|
+
return core.createStyles({
|
|
11790
|
+
selectAll: {
|
|
11791
|
+
padding: '15px',
|
|
11792
|
+
paddingLeft: '20px'
|
|
11793
|
+
},
|
|
11794
|
+
"switch": {
|
|
11795
|
+
padding: '15px'
|
|
11796
|
+
},
|
|
11797
|
+
selectAllContainer: {
|
|
11798
|
+
backgroundColor: theme.palette.background.paper,
|
|
11799
|
+
position: 'sticky',
|
|
11800
|
+
top: 0,
|
|
11801
|
+
zIndex: 100
|
|
11802
|
+
}
|
|
10746
11803
|
});
|
|
11804
|
+
});
|
|
11805
|
+
|
|
11806
|
+
var KeywordFilterResults = function KeywordFilterResults(_a) {
|
|
11807
|
+
var arrayOfKeywordObjects = _a.arrayOfKeywordObjects,
|
|
11808
|
+
mapId = _a.mapId,
|
|
11809
|
+
bounds = _a.bounds,
|
|
11810
|
+
_b = _a.onClose,
|
|
11811
|
+
onClose = _b === void 0 ? function () {} : _b,
|
|
11812
|
+
showTitle = _a.showTitle,
|
|
11813
|
+
isOpen = _a.isOpen,
|
|
11814
|
+
_c = _a.onMouseDown,
|
|
11815
|
+
onMouseDown = _c === void 0 ? function () {} : _c,
|
|
11816
|
+
_d = _a.order,
|
|
11817
|
+
order = _d === void 0 ? 0 : _d,
|
|
11818
|
+
_e = _a.source,
|
|
11819
|
+
source = _e === void 0 ? 'module' : _e;
|
|
11820
|
+
var classes = useStyles$j();
|
|
11821
|
+
|
|
11822
|
+
var _f = __read(React__namespace.useState(true), 2),
|
|
11823
|
+
allSelected = _f[0],
|
|
11824
|
+
setAllSelected = _f[1];
|
|
11825
|
+
|
|
11826
|
+
var _g = __read(React__namespace.useState(arrayOfKeywordObjects), 2),
|
|
11827
|
+
keywordObjects = _g[0],
|
|
11828
|
+
setKeywordObjects = _g[1];
|
|
11829
|
+
|
|
11830
|
+
var toggleSelectAll = function toggleSelectAll() {
|
|
11831
|
+
var editedKeywords = keywordObjects.map(function (object) {
|
|
11832
|
+
return __assign(__assign({}, object), {
|
|
11833
|
+
checked: !allSelected
|
|
11834
|
+
});
|
|
11835
|
+
});
|
|
11836
|
+
setKeywordObjects(editedKeywords);
|
|
11837
|
+
setAllSelected(!allSelected);
|
|
11838
|
+
};
|
|
11839
|
+
|
|
11840
|
+
var toggleCheckbox = function toggleCheckbox(listIndex) {
|
|
11841
|
+
var editedKeywords = keywordObjects.map(function (object, index) {
|
|
11842
|
+
return listIndex === index ? __assign(__assign({}, object), {
|
|
11843
|
+
checked: !object.checked
|
|
11844
|
+
}) : object;
|
|
11845
|
+
});
|
|
11846
|
+
setKeywordObjects(editedKeywords);
|
|
11847
|
+
};
|
|
11848
|
+
|
|
11849
|
+
var selectOnlyOne = function selectOnlyOne(listIndex) {
|
|
11850
|
+
var editedKeywords = keywordObjects.map(function (object, index) {
|
|
11851
|
+
return listIndex === index ? __assign(__assign({}, object), {
|
|
11852
|
+
checked: true
|
|
11853
|
+
}) : __assign(__assign({}, object), {
|
|
11854
|
+
checked: false
|
|
11855
|
+
});
|
|
11856
|
+
});
|
|
11857
|
+
setKeywordObjects(editedKeywords);
|
|
11858
|
+
}; // If even one checkbox is unchecked, switch toggleAll off
|
|
11859
|
+
// If all checkboxes becomes checked, switch toggleAll on
|
|
11860
|
+
|
|
11861
|
+
|
|
11862
|
+
React__namespace.useEffect(function () {
|
|
11863
|
+
var checked = keywordObjects.every(function (object) {
|
|
11864
|
+
return object.checked === true;
|
|
11865
|
+
});
|
|
11866
|
+
setAllSelected(checked);
|
|
11867
|
+
}, [keywordObjects]);
|
|
11868
|
+
React__namespace.useEffect(function () {
|
|
11869
|
+
setKeywordObjects(arrayOfKeywordObjects);
|
|
11870
|
+
}, [arrayOfKeywordObjects]);
|
|
11871
|
+
return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
|
|
11872
|
+
title: showTitle ? "Filter Results " + mapId : 'Filter Results',
|
|
11873
|
+
"data-testid": "keywordFilterResults",
|
|
11874
|
+
startSize: {
|
|
11875
|
+
width: 349,
|
|
11876
|
+
height: 600
|
|
11877
|
+
},
|
|
11878
|
+
minWidth: 312,
|
|
11879
|
+
minHeight: 192,
|
|
11880
|
+
isOpen: isOpen,
|
|
11881
|
+
onClose: onClose,
|
|
11882
|
+
headerSize: "small",
|
|
11883
|
+
bounds: bounds,
|
|
11884
|
+
onMouseDown: onMouseDown,
|
|
11885
|
+
order: order,
|
|
11886
|
+
source: source
|
|
11887
|
+
}, /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
11888
|
+
container: true,
|
|
11889
|
+
item: true,
|
|
11890
|
+
xs: 12,
|
|
11891
|
+
justify: "space-between",
|
|
11892
|
+
alignItems: "center",
|
|
11893
|
+
className: classes.selectAllContainer
|
|
11894
|
+
}, /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
11895
|
+
container: true,
|
|
11896
|
+
item: true,
|
|
11897
|
+
xs: 6,
|
|
11898
|
+
justify: "flex-start",
|
|
11899
|
+
alignItems: "center",
|
|
11900
|
+
className: classes.selectAll
|
|
11901
|
+
}, "Select all"), /*#__PURE__*/React__namespace.createElement(core.Grid, {
|
|
11902
|
+
container: true,
|
|
11903
|
+
item: true,
|
|
11904
|
+
xs: 6,
|
|
11905
|
+
justify: "flex-end",
|
|
11906
|
+
alignContent: "center",
|
|
11907
|
+
className: classes["switch"]
|
|
11908
|
+
}, /*#__PURE__*/React__namespace.createElement(CustomSwitch, {
|
|
11909
|
+
checked: allSelected,
|
|
11910
|
+
onChange: toggleSelectAll
|
|
11911
|
+
}))), /*#__PURE__*/React__namespace.createElement(core.List, {
|
|
11912
|
+
dense: true,
|
|
11913
|
+
style: {
|
|
11914
|
+
padding: '0px'
|
|
11915
|
+
}
|
|
11916
|
+
}, keywordObjects.map(function (_a, index) {
|
|
11917
|
+
var id = _a.id,
|
|
11918
|
+
checked = _a.checked;
|
|
11919
|
+
return /*#__PURE__*/React__namespace.createElement(FilterListItem, {
|
|
11920
|
+
key: id + "-" + index,
|
|
11921
|
+
index: index,
|
|
11922
|
+
text: id,
|
|
11923
|
+
checked: checked,
|
|
11924
|
+
toggleCheckbox: toggleCheckbox,
|
|
11925
|
+
selectOnlyOne: selectOnlyOne
|
|
11926
|
+
});
|
|
11927
|
+
})));
|
|
10747
11928
|
};
|
|
10748
11929
|
|
|
10749
11930
|
/* *
|
|
@@ -10761,67 +11942,82 @@
|
|
|
10761
11942
|
*
|
|
10762
11943
|
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10763
11944
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
10764
|
-
* */
|
|
10765
|
-
var useStyles$j = core.makeStyles({
|
|
10766
|
-
serviceList: {
|
|
10767
|
-
height: '48px'
|
|
10768
|
-
}
|
|
10769
|
-
});
|
|
10770
|
-
|
|
10771
|
-
var LayerSelect = function LayerSelect(_a) {
|
|
10772
|
-
var mapId = _a.mapId,
|
|
10773
|
-
bounds = _a.bounds,
|
|
10774
|
-
_b = _a.onClose,
|
|
10775
|
-
onClose = _b === void 0 ? function () {} : _b,
|
|
10776
|
-
showTitle = _a.showTitle,
|
|
10777
|
-
isOpen = _a.isOpen,
|
|
10778
|
-
_c = _a.onMouseDown,
|
|
10779
|
-
onMouseDown = _c === void 0 ? function () {} : _c,
|
|
10780
|
-
_d = _a.order,
|
|
10781
|
-
order = _d === void 0 ? 0 : _d,
|
|
10782
|
-
_e = _a.source,
|
|
10783
|
-
source = _e === void 0 ? 'module' : _e;
|
|
10784
|
-
var classes = useStyles$j();
|
|
11945
|
+
* */
|
|
10785
11946
|
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
11947
|
+
var KeywordFilterResultsConnect = function KeywordFilterResultsConnect(_a) {
|
|
11948
|
+
var bounds = _a.bounds,
|
|
11949
|
+
_b = _a.showTitle,
|
|
11950
|
+
showTitle = _b === void 0 ? false : _b;
|
|
11951
|
+
var dispatch = reactRedux.useDispatch();
|
|
11952
|
+
var mapId = reactRedux.useSelector(function (store) {
|
|
11953
|
+
return getDialogMapId(store, 'keywordFilter');
|
|
11954
|
+
});
|
|
11955
|
+
var isOpenInStore = reactRedux.useSelector(function (store) {
|
|
11956
|
+
return getisDialogOpen(store, 'keywordFilter');
|
|
11957
|
+
});
|
|
11958
|
+
var onClose = React__namespace.useCallback(function () {
|
|
11959
|
+
return dispatch(setToggleOpenDialog({
|
|
11960
|
+
type: 'keywordFilter',
|
|
11961
|
+
setOpen: false
|
|
11962
|
+
}));
|
|
11963
|
+
}, [dispatch]);
|
|
11964
|
+
var isMapPresent = reactRedux.useSelector(function (store) {
|
|
11965
|
+
return getIsMapPresent(store, mapId);
|
|
11966
|
+
});
|
|
11967
|
+
var uiOrder = reactRedux.useSelector(function (store) {
|
|
11968
|
+
return getDialogOrder(store, 'keywordFilter');
|
|
11969
|
+
});
|
|
11970
|
+
var uiSource = reactRedux.useSelector(function (store) {
|
|
11971
|
+
return getDialogSource(store, 'keywordFilter');
|
|
11972
|
+
});
|
|
11973
|
+
var uiIsOrderedOnTop = reactRedux.useSelector(function (store) {
|
|
11974
|
+
return getDialogIsOrderedOnTop(store, 'keywordFilter');
|
|
11975
|
+
}); // Check to ensure the currently active map is still present on screen - if not, close the dialog
|
|
10789
11976
|
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
|
|
10793
|
-
|
|
11977
|
+
React__namespace.useEffect(function () {
|
|
11978
|
+
if (mapId !== '' && !isMapPresent) {
|
|
11979
|
+
onClose();
|
|
11980
|
+
}
|
|
11981
|
+
}, [mapId, isMapPresent, onClose]);
|
|
11982
|
+
var registerDialog$1 = React__namespace.useCallback(function () {
|
|
11983
|
+
return dispatch(registerDialog({
|
|
11984
|
+
type: 'keywordFilter',
|
|
11985
|
+
setOpen: false
|
|
11986
|
+
}));
|
|
11987
|
+
}, [dispatch]);
|
|
11988
|
+
var unregisterDialog$1 = React__namespace.useCallback(function () {
|
|
11989
|
+
return dispatch(unregisterDialog({
|
|
11990
|
+
type: 'keywordFilter'
|
|
11991
|
+
}));
|
|
11992
|
+
}, [dispatch]);
|
|
11993
|
+
var onOrderDialog = React__namespace.useCallback(function () {
|
|
11994
|
+
if (!uiIsOrderedOnTop) {
|
|
11995
|
+
dispatch(orderDialog({
|
|
11996
|
+
type: 'keywordFilter'
|
|
11997
|
+
}));
|
|
11998
|
+
}
|
|
11999
|
+
}, [dispatch, uiIsOrderedOnTop]); // Register this dialog in the store
|
|
10794
12000
|
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
isOpen: isOpen,
|
|
10808
|
-
onChangeSize: onChangeSize,
|
|
10809
|
-
onClose: onClose,
|
|
10810
|
-
headerSize: "small",
|
|
12001
|
+
React__namespace.useEffect(function () {
|
|
12002
|
+
registerDialog$1();
|
|
12003
|
+
return function () {
|
|
12004
|
+
unregisterDialog$1();
|
|
12005
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12006
|
+
}, []);
|
|
12007
|
+
var keywords = reactRedux.useSelector(function (store) {
|
|
12008
|
+
return getKeywords(store);
|
|
12009
|
+
});
|
|
12010
|
+
return /*#__PURE__*/React__namespace.createElement(KeywordFilterResults, {
|
|
12011
|
+
arrayOfKeywordObjects: keywords,
|
|
12012
|
+
mapId: mapId,
|
|
10811
12013
|
bounds: bounds,
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
}
|
|
10820
|
-
}, /*#__PURE__*/React__namespace.createElement(SearchField, null), /*#__PURE__*/React__namespace.createElement("div", {
|
|
10821
|
-
className: classes.serviceList
|
|
10822
|
-
}, /*#__PURE__*/React__namespace.createElement(ServiceListConnect, {
|
|
10823
|
-
layerSelectWidth: width
|
|
10824
|
-
}))));
|
|
12014
|
+
isOpen: isOpenInStore,
|
|
12015
|
+
onClose: onClose,
|
|
12016
|
+
showTitle: showTitle,
|
|
12017
|
+
onMouseDown: onOrderDialog,
|
|
12018
|
+
order: uiOrder,
|
|
12019
|
+
source: uiSource
|
|
12020
|
+
});
|
|
10825
12021
|
};
|
|
10826
12022
|
|
|
10827
12023
|
/* *
|
|
@@ -10933,7 +12129,7 @@
|
|
|
10933
12129
|
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10934
12130
|
|
|
10935
12131
|
}, [isOpenInStore, preloadedServices, serviceSetLayers$1]);
|
|
10936
|
-
return /*#__PURE__*/React__namespace.createElement(LayerSelect, {
|
|
12132
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(LayerSelect, {
|
|
10937
12133
|
mapId: mapId,
|
|
10938
12134
|
bounds: bounds,
|
|
10939
12135
|
isOpen: isOpenInStore,
|
|
@@ -10942,7 +12138,7 @@
|
|
|
10942
12138
|
onMouseDown: onOrderDialog,
|
|
10943
12139
|
order: uiOrder,
|
|
10944
12140
|
source: uiSource
|
|
10945
|
-
});
|
|
12141
|
+
}), /*#__PURE__*/React__namespace.createElement(KeywordFilterResultsConnect, null));
|
|
10946
12142
|
};
|
|
10947
12143
|
|
|
10948
12144
|
/* *
|
|
@@ -11054,79 +12250,6 @@
|
|
|
11054
12250
|
}), layerSelect && /*#__PURE__*/React__namespace.createElement(LayerSelectConnect, null));
|
|
11055
12251
|
};
|
|
11056
12252
|
|
|
11057
|
-
/* *
|
|
11058
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11059
|
-
* you may not use this file except in compliance with the License.
|
|
11060
|
-
* You may obtain a copy of the License at
|
|
11061
|
-
*
|
|
11062
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11063
|
-
*
|
|
11064
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11065
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11066
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11067
|
-
* See the License for the specific language governing permissions and
|
|
11068
|
-
* limitations under the License.
|
|
11069
|
-
*
|
|
11070
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11071
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11072
|
-
* */
|
|
11073
|
-
var useButtonStyles = core.makeStyles(function (theme) {
|
|
11074
|
-
return core.createStyles({
|
|
11075
|
-
button: {
|
|
11076
|
-
height: '24px',
|
|
11077
|
-
width: function width(_a) {
|
|
11078
|
-
var width = _a.width;
|
|
11079
|
-
return width ? width + "px" : '24px';
|
|
11080
|
-
},
|
|
11081
|
-
border: 0,
|
|
11082
|
-
backgroundColor: theme.palette.geowebColors.buttons.surfaceIconDefault.fill,
|
|
11083
|
-
borderRadius: '4.5px',
|
|
11084
|
-
textTransform: 'none',
|
|
11085
|
-
'& svg path, svg text': {
|
|
11086
|
-
fill: theme.palette.geowebColors.typographyAndIcons.buttonIconTertiaryFlat
|
|
11087
|
-
},
|
|
11088
|
-
'&:hover': {
|
|
11089
|
-
backgroundColor: theme.palette.geowebColors.buttons.flatMouseover.fill
|
|
11090
|
-
},
|
|
11091
|
-
'&:disabled': {
|
|
11092
|
-
backgroundColor: theme.palette.geowebColors.buttons.disabled.fill,
|
|
11093
|
-
'& svg path, svg text': {
|
|
11094
|
-
fill: theme.palette.geowebColors.typographyAndIcons.iconLinkDisabled
|
|
11095
|
-
}
|
|
11096
|
-
},
|
|
11097
|
-
'&.Mui-selected': {
|
|
11098
|
-
backgroundColor: theme.palette.geowebColors.buttons.primaryActive.fill,
|
|
11099
|
-
'&:hover': {
|
|
11100
|
-
backgroundColor: theme.palette.geowebColors.buttons.primaryMouseover.fill
|
|
11101
|
-
},
|
|
11102
|
-
'& svg': {
|
|
11103
|
-
backgroundColor: 'transparent'
|
|
11104
|
-
},
|
|
11105
|
-
'& svg path, svg text': {
|
|
11106
|
-
fill: theme.palette.geowebColors.typographyAndIcons.buttonIcon
|
|
11107
|
-
}
|
|
11108
|
-
}
|
|
11109
|
-
}
|
|
11110
|
-
});
|
|
11111
|
-
});
|
|
11112
|
-
|
|
11113
|
-
var ToggleIconButton = function ToggleIconButton(_a) {
|
|
11114
|
-
var active = _a.active,
|
|
11115
|
-
width = _a.width,
|
|
11116
|
-
children = _a.children,
|
|
11117
|
-
props = __rest(_a, ["active", "width", "children"]);
|
|
11118
|
-
|
|
11119
|
-
var classes = useButtonStyles({
|
|
11120
|
-
width: width
|
|
11121
|
-
});
|
|
11122
|
-
return /*#__PURE__*/React__namespace.createElement(lab.ToggleButton, __assign({
|
|
11123
|
-
className: classes.button,
|
|
11124
|
-
disableRipple: true,
|
|
11125
|
-
selected: active,
|
|
11126
|
-
value: 0
|
|
11127
|
-
}, props), children);
|
|
11128
|
-
};
|
|
11129
|
-
|
|
11130
12253
|
/* *
|
|
11131
12254
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11132
12255
|
* you may not use this file except in compliance with the License.
|
|
@@ -11734,7 +12857,9 @@
|
|
|
11734
12857
|
onMouseDown = _a.onMouseDown,
|
|
11735
12858
|
onToggleDialog = _a.onToggleDialog,
|
|
11736
12859
|
_c = _a.index,
|
|
11737
|
-
index = _c === void 0 ? 0 : _c
|
|
12860
|
+
index = _c === void 0 ? 0 : _c,
|
|
12861
|
+
_d = _a.source,
|
|
12862
|
+
source = _d === void 0 ? 'app' : _d;
|
|
11738
12863
|
var dispatch = reactRedux.useDispatch();
|
|
11739
12864
|
var mapDimension = reactRedux.useSelector(function (store) {
|
|
11740
12865
|
return getMapDimension(store, mapId, dimensionName);
|
|
@@ -11789,7 +12914,8 @@
|
|
|
11789
12914
|
},
|
|
11790
12915
|
bounds: "parent",
|
|
11791
12916
|
onMouseDown: onMouseDown,
|
|
11792
|
-
order: order
|
|
12917
|
+
order: order,
|
|
12918
|
+
source: source
|
|
11793
12919
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
11794
12920
|
style: {
|
|
11795
12921
|
padding: 4
|
|
@@ -11840,6 +12966,9 @@
|
|
|
11840
12966
|
var uiOrder = reactRedux.useSelector(function (store) {
|
|
11841
12967
|
return getDialogOrder(store, uiDialogType);
|
|
11842
12968
|
});
|
|
12969
|
+
var uiSource = reactRedux.useSelector(function (store) {
|
|
12970
|
+
return getDialogSource(store, uiDialogType);
|
|
12971
|
+
});
|
|
11843
12972
|
var uiIsOrderedOnTop = reactRedux.useSelector(function (store) {
|
|
11844
12973
|
return getDialogIsOrderedOnTop(store, uiDialogType);
|
|
11845
12974
|
});
|
|
@@ -11892,6 +13021,7 @@
|
|
|
11892
13021
|
onMouseDown: onOrderDialog,
|
|
11893
13022
|
onToggleDialog: onToggleDialog,
|
|
11894
13023
|
order: uiOrder,
|
|
13024
|
+
source: uiSource,
|
|
11895
13025
|
isOpen: isOpen,
|
|
11896
13026
|
index: index
|
|
11897
13027
|
});
|
|
@@ -11916,7 +13046,9 @@
|
|
|
11916
13046
|
|
|
11917
13047
|
var DimensionSelectMapButtonConnect = function DimensionSelectMapButtonConnect(_a) {
|
|
11918
13048
|
var mapId = _a.mapId,
|
|
11919
|
-
dimension = _a.dimension
|
|
13049
|
+
dimension = _a.dimension,
|
|
13050
|
+
_b = _a.source,
|
|
13051
|
+
source = _b === void 0 ? 'app' : _b;
|
|
11920
13052
|
var dispatch = reactRedux.useDispatch();
|
|
11921
13053
|
var uiDialogType = getDimensionType(dimension);
|
|
11922
13054
|
var currentActiveMapId = reactRedux.useSelector(function (store) {
|
|
@@ -11930,9 +13062,10 @@
|
|
|
11930
13062
|
dispatch(setActiveMapIdForDialog({
|
|
11931
13063
|
type: uiDialogType,
|
|
11932
13064
|
activeMapId: mapId,
|
|
11933
|
-
setOpen: setOpen
|
|
13065
|
+
setOpen: setOpen,
|
|
13066
|
+
source: source
|
|
11934
13067
|
}));
|
|
11935
|
-
}, [currentActiveMapId, dispatch, isOpenInStore, uiDialogType, mapId]);
|
|
13068
|
+
}, [currentActiveMapId, dispatch, isOpenInStore, uiDialogType, mapId, source]);
|
|
11936
13069
|
var isOpen = currentActiveMapId === mapId && isOpenInStore;
|
|
11937
13070
|
return /*#__PURE__*/React__namespace.createElement(DimensionSelectButton, {
|
|
11938
13071
|
dimension: dimension,
|
|
@@ -11959,7 +13092,9 @@
|
|
|
11959
13092
|
* */
|
|
11960
13093
|
|
|
11961
13094
|
var MultiDimensionSelectMapButtonsConnect = function MultiDimensionSelectMapButtonsConnect(_a) {
|
|
11962
|
-
var mapId = _a.mapId
|
|
13095
|
+
var mapId = _a.mapId,
|
|
13096
|
+
_b = _a.source,
|
|
13097
|
+
source = _b === void 0 ? 'app' : _b;
|
|
11963
13098
|
var dimensions = reactRedux.useSelector(function (store) {
|
|
11964
13099
|
return getMapDimensions(store, mapId);
|
|
11965
13100
|
});
|
|
@@ -11975,7 +13110,8 @@
|
|
|
11975
13110
|
return /*#__PURE__*/React__namespace.createElement(DimensionSelectMapButtonConnect, {
|
|
11976
13111
|
mapId: mapId,
|
|
11977
13112
|
dimension: dimension.name,
|
|
11978
|
-
key: dimension.name
|
|
13113
|
+
key: dimension.name,
|
|
13114
|
+
source: source
|
|
11979
13115
|
});
|
|
11980
13116
|
}));
|
|
11981
13117
|
};
|
|
@@ -14069,41 +15205,41 @@
|
|
|
14069
15205
|
};
|
|
14070
15206
|
|
|
14071
15207
|
var marks = [{
|
|
14072
|
-
value: 0.1,
|
|
14073
15208
|
text: '5 min scale',
|
|
14074
|
-
paddingLeft: '2px'
|
|
15209
|
+
paddingLeft: '2px',
|
|
15210
|
+
value: Scale.Minutes5
|
|
14075
15211
|
}, {
|
|
14076
|
-
value: 0.35,
|
|
14077
15212
|
text: '1 h scale',
|
|
14078
|
-
paddingLeft: '25px'
|
|
15213
|
+
paddingLeft: '25px',
|
|
15214
|
+
value: Scale.Hour
|
|
14079
15215
|
}, {
|
|
14080
|
-
value: 0.6,
|
|
14081
15216
|
text: '3 h scale',
|
|
14082
|
-
paddingLeft: '45px'
|
|
15217
|
+
paddingLeft: '45px',
|
|
15218
|
+
value: Scale.Hours3
|
|
14083
15219
|
}, {
|
|
14084
|
-
value: 0.85,
|
|
14085
15220
|
text: '6 h scale',
|
|
14086
|
-
paddingLeft: '65px'
|
|
15221
|
+
paddingLeft: '65px',
|
|
15222
|
+
value: Scale.Hours6
|
|
14087
15223
|
}, {
|
|
14088
|
-
value: 1.1,
|
|
14089
15224
|
text: 'day scale',
|
|
14090
|
-
paddingLeft: '80px'
|
|
15225
|
+
paddingLeft: '80px',
|
|
15226
|
+
value: Scale.Day
|
|
14091
15227
|
}, {
|
|
14092
|
-
value: 1.35,
|
|
14093
15228
|
text: 'week scale',
|
|
14094
|
-
paddingLeft: '92px'
|
|
15229
|
+
paddingLeft: '92px',
|
|
15230
|
+
value: Scale.Week
|
|
14095
15231
|
}, {
|
|
14096
|
-
value: 1.6,
|
|
14097
15232
|
text: 'month scale',
|
|
14098
|
-
paddingLeft: '107px'
|
|
15233
|
+
paddingLeft: '107px',
|
|
15234
|
+
value: Scale.Month
|
|
14099
15235
|
}, {
|
|
14100
|
-
value: 1.85,
|
|
14101
15236
|
text: 'year scale',
|
|
14102
|
-
paddingLeft: '130px'
|
|
15237
|
+
paddingLeft: '130px',
|
|
15238
|
+
value: Scale.Year
|
|
14103
15239
|
}, {
|
|
14104
|
-
value: 2.1,
|
|
14105
15240
|
text: 'data scale',
|
|
14106
|
-
paddingLeft: '140px'
|
|
15241
|
+
paddingLeft: '140px',
|
|
15242
|
+
value: Scale.DataScale
|
|
14107
15243
|
}];
|
|
14108
15244
|
|
|
14109
15245
|
var valueLabelFormat = function valueLabelFormat(value) {
|
|
@@ -14166,77 +15302,59 @@
|
|
|
14166
15302
|
}
|
|
14167
15303
|
};
|
|
14168
15304
|
})(core.Slider);
|
|
14169
|
-
|
|
14170
|
-
var getScaleSliderValue = function getScaleSliderValue(value) {
|
|
14171
|
-
if (Math.abs(value - marks[0].value) < 0.0001) {
|
|
14172
|
-
return Scale.Minutes5;
|
|
14173
|
-
}
|
|
14174
|
-
|
|
14175
|
-
if (Math.abs(value - marks[1].value) < 0.0001) {
|
|
14176
|
-
return Scale.Hour;
|
|
14177
|
-
}
|
|
14178
|
-
|
|
14179
|
-
if (Math.abs(value - marks[2].value) < 0.0001) {
|
|
14180
|
-
return Scale.Hours3;
|
|
14181
|
-
}
|
|
14182
|
-
|
|
14183
|
-
if (Math.abs(value - marks[3].value) < 0.0001) {
|
|
14184
|
-
return Scale.Hours6;
|
|
14185
|
-
}
|
|
14186
|
-
|
|
14187
|
-
if (Math.abs(value - marks[4].value) < 0.0001) {
|
|
14188
|
-
return Scale.Day;
|
|
14189
|
-
}
|
|
14190
|
-
|
|
14191
|
-
if (Math.abs(value - marks[5].value) < 0.0001) {
|
|
14192
|
-
return Scale.Week;
|
|
14193
|
-
}
|
|
14194
|
-
|
|
14195
|
-
if (Math.abs(value - marks[6].value) < 0.0001) {
|
|
14196
|
-
return Scale.Month;
|
|
14197
|
-
}
|
|
14198
|
-
|
|
14199
|
-
if (Math.abs(value - marks[7].value) < 0.0001) {
|
|
14200
|
-
return Scale.Year;
|
|
14201
|
-
}
|
|
14202
|
-
|
|
14203
|
-
if (Math.abs(value - marks[8].value) < 0.0001) {
|
|
14204
|
-
return Scale.DataScale;
|
|
14205
|
-
}
|
|
14206
|
-
|
|
14207
|
-
return Scale.Hour;
|
|
14208
|
-
};
|
|
14209
|
-
|
|
14210
|
-
var scaleValues = Object.keys(Scale).map(function (scale) {
|
|
14211
|
-
return Number(scale);
|
|
14212
|
-
});
|
|
15305
|
+
var RAIL_GUTTER_OFFSET = 0.4;
|
|
14213
15306
|
|
|
14214
15307
|
var TimeSliderScaleSlider = function TimeSliderScaleSlider(_a) {
|
|
14215
15308
|
var layers = _a.layers,
|
|
14216
|
-
|
|
15309
|
+
_b = _a.timeSliderScale,
|
|
15310
|
+
timeSliderScale = _b === void 0 ? Scale.Hour : _b,
|
|
14217
15311
|
centerTime = _a.centerTime,
|
|
14218
15312
|
secondsPerPx = _a.secondsPerPx,
|
|
14219
15313
|
selectedTime = _a.selectedTime,
|
|
14220
15314
|
onChangeTimeSliderScale = _a.onChangeTimeSliderScale;
|
|
14221
15315
|
var classes = useStyles$c();
|
|
14222
|
-
var
|
|
14223
|
-
var
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
};
|
|
14227
|
-
var newScaleObjectIndex = scaleObjectIndex !== -1 ? scaleObjectIndex : 1;
|
|
14228
|
-
var value = newScaleObject.value,
|
|
14229
|
-
text = newScaleObject.text;
|
|
15316
|
+
var min = 0;
|
|
15317
|
+
var max = marks.length - 1;
|
|
15318
|
+
var value = marks.findIndex(function (mark) {
|
|
15319
|
+
return mark.value === timeSliderScale;
|
|
15320
|
+
});
|
|
14230
15321
|
|
|
14231
|
-
var
|
|
14232
|
-
var
|
|
14233
|
-
var
|
|
15322
|
+
var onChangeSliderValue = function onChangeSliderValue(newSliderValue) {
|
|
15323
|
+
var newValue = newSliderValue ? Math.round(newSliderValue) : 0;
|
|
15324
|
+
var newScale = marks.find(function (el) {
|
|
15325
|
+
return el.value === newValue;
|
|
15326
|
+
}).value;
|
|
15327
|
+
var scaleToSecPerPx = newScale === Scale.DataScale ? getScaleToSecondsPerPxForDataScale(layers) : scaleToSecondsPerPx[newScale];
|
|
14234
15328
|
var newCenterTime = getNewCenterOfFixedPointZoom(selectedTime, secondsPerPx, scaleToSecPerPx, centerTime);
|
|
14235
15329
|
onChangeTimeSliderScale(newScale, newCenterTime, scaleToSecPerPx);
|
|
14236
15330
|
};
|
|
14237
15331
|
|
|
15332
|
+
var onChange = function onChange(event, value) {
|
|
15333
|
+
if (event.type !== 'keydown') {
|
|
15334
|
+
onChangeSliderValue(value);
|
|
15335
|
+
}
|
|
15336
|
+
};
|
|
15337
|
+
|
|
15338
|
+
var onKeyDown = function onKeyDown(event) {
|
|
15339
|
+
// disable default Slider behavior
|
|
15340
|
+
event.preventDefault();
|
|
15341
|
+
event.stopPropagation(); // custom logic
|
|
15342
|
+
|
|
15343
|
+
var newValue = getValueFromKeyboardEvent(event, value, min, max, true);
|
|
15344
|
+
|
|
15345
|
+
if (newValue !== null) {
|
|
15346
|
+
onChangeSliderValue(newValue);
|
|
15347
|
+
}
|
|
15348
|
+
};
|
|
15349
|
+
|
|
15350
|
+
var _c = marks.find(function (mark) {
|
|
15351
|
+
return mark.value === value;
|
|
15352
|
+
}),
|
|
15353
|
+
paddingLeft = _c.paddingLeft,
|
|
15354
|
+
text = _c.text;
|
|
15355
|
+
|
|
14238
15356
|
var scaleTextPadding = {
|
|
14239
|
-
paddingLeft:
|
|
15357
|
+
paddingLeft: paddingLeft
|
|
14240
15358
|
};
|
|
14241
15359
|
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
14242
15360
|
className: classes.Background,
|
|
@@ -14247,14 +15365,14 @@
|
|
|
14247
15365
|
style: scaleTextPadding
|
|
14248
15366
|
}, text)), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement(GeoWebScaleSlider, {
|
|
14249
15367
|
"data-testid": "scaleSliderSlider",
|
|
14250
|
-
defaultValue:
|
|
15368
|
+
defaultValue: Scale.Hour,
|
|
14251
15369
|
value: value,
|
|
14252
|
-
min:
|
|
14253
|
-
step:
|
|
14254
|
-
max:
|
|
15370
|
+
min: min - RAIL_GUTTER_OFFSET,
|
|
15371
|
+
step: 1,
|
|
15372
|
+
max: max + RAIL_GUTTER_OFFSET,
|
|
14255
15373
|
getAriaValueText: valueLabelFormat,
|
|
14256
|
-
onChange:
|
|
14257
|
-
|
|
15374
|
+
onChange: onChange,
|
|
15375
|
+
onKeyDown: onKeyDown,
|
|
14258
15376
|
"aria-labelledby": "scale-slider",
|
|
14259
15377
|
ThumbComponent: thumbComponent,
|
|
14260
15378
|
marks: marks,
|
|
@@ -14847,7 +15965,7 @@
|
|
|
14847
15965
|
className: styles.scaleSlider
|
|
14848
15966
|
}, scaleSlider || /*#__PURE__*/React__namespace.createElement(TimeSliderScaleSlider, __assign({}, defaultProps, {
|
|
14849
15967
|
selectedTime: defaultProps.selectedTime.unix(),
|
|
14850
|
-
timeSliderScale:
|
|
15968
|
+
timeSliderScale: Scale.Hour,
|
|
14851
15969
|
onChangeTimeSliderScale: function onChangeTimeSliderScale() {
|
|
14852
15970
|
return null;
|
|
14853
15971
|
}
|
|
@@ -18308,7 +19426,6 @@
|
|
|
18308
19426
|
};
|
|
18309
19427
|
|
|
18310
19428
|
var ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION = 'ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION';
|
|
18311
|
-
var defaultxml2jsonrequestURL = 'http://localhost:10000/XML2JSON?';
|
|
18312
19429
|
|
|
18313
19430
|
var ReactMapView =
|
|
18314
19431
|
/** @class */
|
|
@@ -18372,17 +19489,15 @@
|
|
|
18372
19489
|
onLayerSetDimensions = _a.onLayerSetDimensions,
|
|
18373
19490
|
onServiceSetLayers = _a.onServiceSetLayers,
|
|
18374
19491
|
onLayerSetStyles = _a.onLayerSetStyles,
|
|
18375
|
-
xml2jsonrequestURL_1 = _a.xml2jsonrequestURL,
|
|
18376
19492
|
mapId = _a.mapId;
|
|
18377
|
-
setServiceMetadata(wmLayer, mapId,
|
|
19493
|
+
setServiceMetadata(wmLayer, mapId, _this.adaguc.webMapJS, _this.props, onMapUpdateAllDimensions, onLayerChangeStyle, onServiceSetLayers, onLayerSetStyles, onLayerSetDimensions);
|
|
18378
19494
|
}
|
|
18379
19495
|
|
|
18380
19496
|
if (updateStrategy === 'onlydims') {
|
|
18381
19497
|
var _b = _this.props,
|
|
18382
19498
|
onLayerSetDimensions = _b.onLayerSetDimensions,
|
|
18383
|
-
xml2jsonrequestURL_2 = _b.xml2jsonrequestURL,
|
|
18384
19499
|
mapId = _b.mapId;
|
|
18385
|
-
setServiceMetadata(wmLayer, mapId,
|
|
19500
|
+
setServiceMetadata(wmLayer, mapId, _this.adaguc.webMapJS, _this.props, null, null, null, null, onLayerSetDimensions);
|
|
18386
19501
|
}
|
|
18387
19502
|
|
|
18388
19503
|
if (child) {
|
|
@@ -18396,8 +19511,7 @@
|
|
|
18396
19511
|
}
|
|
18397
19512
|
};
|
|
18398
19513
|
|
|
18399
|
-
|
|
18400
|
-
wmLayer.parseLayer(callback, forceReload, xml2jsonrequestURL);
|
|
19514
|
+
wmLayer.parseLayer(callback, forceReload);
|
|
18401
19515
|
};
|
|
18402
19516
|
|
|
18403
19517
|
_this.state = {
|
|
@@ -18796,7 +19910,6 @@
|
|
|
18796
19910
|
}
|
|
18797
19911
|
|
|
18798
19912
|
if (!isBaselayer) {
|
|
18799
|
-
newWMLayer.reactWebMapJSLayer = child;
|
|
18800
19913
|
this_3.parseWMJSLayer(newWMLayer, false, 'all', child);
|
|
18801
19914
|
}
|
|
18802
19915
|
|
|
@@ -18904,7 +20017,6 @@
|
|
|
18904
20017
|
var _a = this.props,
|
|
18905
20018
|
mapId = _a.mapId,
|
|
18906
20019
|
listeners = _a.listeners,
|
|
18907
|
-
xml2jsonrequestURL = _a.xml2jsonrequestURL,
|
|
18908
20020
|
srs = _a.srs,
|
|
18909
20021
|
bbox = _a.bbox,
|
|
18910
20022
|
onMapPinChangeLocation = _a.onMapPinChangeLocation;
|
|
@@ -18920,7 +20032,6 @@
|
|
|
18920
20032
|
|
|
18921
20033
|
registerWMJSMap(this.adaguc.webMapJS, mapId);
|
|
18922
20034
|
this.adaguc.webMapJS.removeAllLayers();
|
|
18923
|
-
this.adaguc.webMapJS.setXML2JSONURL(xml2jsonrequestURL);
|
|
18924
20035
|
this.adaguc.webMapJS.setProjection(srs, new webmap.WMBBOX(bbox));
|
|
18925
20036
|
this.adaguc.webMapJS.setWMTileRendererTileSettings(tileRenderSettings);
|
|
18926
20037
|
|
|
@@ -19047,7 +20158,6 @@
|
|
|
19047
20158
|
};
|
|
19048
20159
|
|
|
19049
20160
|
ReactMapView.defaultProps = {
|
|
19050
|
-
xml2jsonrequestURL: defaultxml2jsonrequestURL,
|
|
19051
20161
|
srs: 'EPSG:3857',
|
|
19052
20162
|
bbox: {
|
|
19053
20163
|
left: -2324980.5498391856,
|
|
@@ -19352,7 +20462,7 @@
|
|
|
19352
20462
|
},
|
|
19353
20463
|
srs: srs,
|
|
19354
20464
|
bbox: bbox,
|
|
19355
|
-
mapPinLocation: displayMapPin &&
|
|
20465
|
+
mapPinLocation: displayMapPin && mapPinLocation,
|
|
19356
20466
|
dimensions: mapDimensions,
|
|
19357
20467
|
activeLayerId: activeLayerId,
|
|
19358
20468
|
animationDelay: animationDelay,
|
|
@@ -19696,7 +20806,9 @@
|
|
|
19696
20806
|
_c = _a.showMapId,
|
|
19697
20807
|
showMapId = _c === void 0 ? false : _c,
|
|
19698
20808
|
_d = _a.order,
|
|
19699
|
-
order = _d === void 0 ? 0 : _d
|
|
20809
|
+
order = _d === void 0 ? 0 : _d,
|
|
20810
|
+
_e = _a.source,
|
|
20811
|
+
source = _e === void 0 ? 'app' : _e;
|
|
19700
20812
|
var classes = useStyles$5();
|
|
19701
20813
|
return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
|
|
19702
20814
|
startPosition: {
|
|
@@ -19712,7 +20824,8 @@
|
|
|
19712
20824
|
"data-testid": "moveable-legend",
|
|
19713
20825
|
bounds: "parent",
|
|
19714
20826
|
onMouseDown: onMouseDown,
|
|
19715
|
-
order: order
|
|
20827
|
+
order: order,
|
|
20828
|
+
source: source
|
|
19716
20829
|
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
19717
20830
|
className: classes.legendContainer
|
|
19718
20831
|
}, layers && layers.length > 0 ? /*#__PURE__*/React__namespace.createElement("div", {
|
|
@@ -19752,7 +20865,9 @@
|
|
|
19752
20865
|
|
|
19753
20866
|
var LegendConnectComponent = function LegendConnectComponent(_a) {
|
|
19754
20867
|
var _b = _a.showMapId,
|
|
19755
|
-
showMapId = _b === void 0 ? false : _b
|
|
20868
|
+
showMapId = _b === void 0 ? false : _b,
|
|
20869
|
+
_c = _a.source,
|
|
20870
|
+
source = _c === void 0 ? 'app' : _c;
|
|
19756
20871
|
var dispatch = reactRedux.useDispatch();
|
|
19757
20872
|
var initialActiveMapId = reactRedux.useSelector(function (store) {
|
|
19758
20873
|
return getFirstMapId(store);
|
|
@@ -19770,6 +20885,9 @@
|
|
|
19770
20885
|
var uiOrder = reactRedux.useSelector(function (store) {
|
|
19771
20886
|
return getDialogOrder(store, 'legend');
|
|
19772
20887
|
});
|
|
20888
|
+
var uiSource = reactRedux.useSelector(function (store) {
|
|
20889
|
+
return getDialogSource(store, 'legend');
|
|
20890
|
+
});
|
|
19773
20891
|
var uiIsOrderedOnTop = reactRedux.useSelector(function (store) {
|
|
19774
20892
|
return getDialogIsOrderedOnTop(store, 'legend');
|
|
19775
20893
|
});
|
|
@@ -19784,9 +20902,10 @@
|
|
|
19784
20902
|
var registerDialog$1 = React__namespace.useCallback(function (setOpen) {
|
|
19785
20903
|
return dispatch(registerDialog({
|
|
19786
20904
|
type: 'legend',
|
|
19787
|
-
setOpen: setOpen
|
|
20905
|
+
setOpen: setOpen,
|
|
20906
|
+
source: source
|
|
19788
20907
|
}));
|
|
19789
|
-
}, [dispatch]);
|
|
20908
|
+
}, [dispatch, source]);
|
|
19790
20909
|
var unregisterDialog$1 = React__namespace.useCallback(function () {
|
|
19791
20910
|
return dispatch(unregisterDialog({
|
|
19792
20911
|
type: 'legend'
|
|
@@ -19813,7 +20932,8 @@
|
|
|
19813
20932
|
mapId: mapId,
|
|
19814
20933
|
showMapId: showMapId,
|
|
19815
20934
|
onMouseDown: onOrderDialog,
|
|
19816
|
-
order: uiOrder
|
|
20935
|
+
order: uiOrder,
|
|
20936
|
+
source: uiSource
|
|
19817
20937
|
});
|
|
19818
20938
|
};
|
|
19819
20939
|
/**
|
|
@@ -19823,6 +20943,7 @@
|
|
|
19823
20943
|
*
|
|
19824
20944
|
* Expects the following props:
|
|
19825
20945
|
* @param {boolean} showMapId (optional) showMapId: boolean - show the id of the map in the dialog title of which the legend is shown in te dialog
|
|
20946
|
+
* @param {Source} source (optional) source: Source - default is 'app', 'module' makes sure it will be shown on top of the module
|
|
19826
20947
|
|
|
19827
20948
|
* ``` <LegendConnect legendDialogId={legendDialogId} />```
|
|
19828
20949
|
*/
|
|
@@ -19856,7 +20977,9 @@
|
|
|
19856
20977
|
* */
|
|
19857
20978
|
|
|
19858
20979
|
var LegendMapButtonConnect = function LegendMapButtonConnect(_a) {
|
|
19859
|
-
var mapId = _a.mapId
|
|
20980
|
+
var mapId = _a.mapId,
|
|
20981
|
+
_b = _a.source,
|
|
20982
|
+
source = _b === void 0 ? 'app' : _b;
|
|
19860
20983
|
var dispatch = reactRedux.useDispatch();
|
|
19861
20984
|
var currentActiveMapId = reactRedux.useSelector(function (store) {
|
|
19862
20985
|
return getDialogMapId(store, 'legend');
|
|
@@ -19868,9 +20991,10 @@
|
|
|
19868
20991
|
dispatch(setActiveMapIdForDialog({
|
|
19869
20992
|
type: 'legend',
|
|
19870
20993
|
activeMapId: mapId,
|
|
19871
|
-
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore
|
|
20994
|
+
setOpen: currentActiveMapId !== mapId ? true : !isOpenInStore,
|
|
20995
|
+
source: source
|
|
19872
20996
|
}));
|
|
19873
|
-
}, [currentActiveMapId, dispatch, isOpenInStore, mapId]);
|
|
20997
|
+
}, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
|
|
19874
20998
|
var isOpen = currentActiveMapId === mapId && isOpenInStore;
|
|
19875
20999
|
return /*#__PURE__*/React__namespace.createElement(MapControlButton, {
|
|
19876
21000
|
title: "Legend",
|
|
@@ -19977,36 +21101,43 @@
|
|
|
19977
21101
|
activeLayerId = _a.activeLayerId,
|
|
19978
21102
|
_b = _a.baseLayer,
|
|
19979
21103
|
baseLayer = _b === void 0 ? baseLayerGrey$1 : _b,
|
|
21104
|
+
_c = _a.overLayers,
|
|
21105
|
+
overLayers = _c === void 0 ? [overLayer$1] : _c,
|
|
19980
21106
|
bbox = _a.bbox,
|
|
19981
21107
|
srs = _a.srs,
|
|
19982
|
-
|
|
19983
|
-
displayTimeInMap =
|
|
19984
|
-
|
|
19985
|
-
displayLayerManagerButtonInMap =
|
|
19986
|
-
|
|
19987
|
-
displayDimensionSelectButtonInMap =
|
|
19988
|
-
|
|
19989
|
-
shouldAutoUpdate =
|
|
19990
|
-
|
|
19991
|
-
shouldAnimate =
|
|
19992
|
-
|
|
19993
|
-
animationPayload =
|
|
19994
|
-
|
|
19995
|
-
shouldShowZoomControls =
|
|
19996
|
-
|
|
19997
|
-
displayMapPin =
|
|
21108
|
+
_d = _a.displayTimeInMap,
|
|
21109
|
+
displayTimeInMap = _d === void 0 ? false : _d,
|
|
21110
|
+
_e = _a.displayLayerManagerButtonInMap,
|
|
21111
|
+
displayLayerManagerButtonInMap = _e === void 0 ? true : _e,
|
|
21112
|
+
_f = _a.displayDimensionSelectButtonInMap,
|
|
21113
|
+
displayDimensionSelectButtonInMap = _f === void 0 ? true : _f,
|
|
21114
|
+
_g = _a.shouldAutoUpdate,
|
|
21115
|
+
shouldAutoUpdate = _g === void 0 ? false : _g,
|
|
21116
|
+
_h = _a.shouldAnimate,
|
|
21117
|
+
shouldAnimate = _h === void 0 ? false : _h,
|
|
21118
|
+
_j = _a.animationPayload,
|
|
21119
|
+
animationPayload = _j === void 0 ? undefined : _j,
|
|
21120
|
+
_k = _a.shouldShowZoomControls,
|
|
21121
|
+
shouldShowZoomControls = _k === void 0 ? false : _k,
|
|
21122
|
+
_l = _a.displayMapPin,
|
|
21123
|
+
displayMapPin = _l === void 0 ? false : _l;
|
|
19998
21124
|
var classes = useStyles$4();
|
|
19999
21125
|
var dispatch = reactRedux.useDispatch();
|
|
20000
21126
|
var mapId = React__default["default"].useRef(id || generateMapId()).current;
|
|
20001
21127
|
|
|
20002
21128
|
var baseLayerWithUniqueId = __assign(__assign({}, baseLayer), {
|
|
20003
21129
|
id: "baseLayer-" + mapId
|
|
20004
|
-
});
|
|
21130
|
+
});
|
|
20005
21131
|
|
|
21132
|
+
var overLayersWithUniqueId = overLayers.map(function (layer) {
|
|
21133
|
+
return __assign(__assign({}, layer), {
|
|
21134
|
+
id: generateLayerId()
|
|
21135
|
+
});
|
|
21136
|
+
}); // make sure all layers have a unique id before going forward
|
|
20006
21137
|
|
|
20007
|
-
var
|
|
20008
|
-
layersNewIds =
|
|
20009
|
-
activeLayerNewId =
|
|
21138
|
+
var _m = generateUniqueLayerIds(layers, activeLayerId),
|
|
21139
|
+
layersNewIds = _m.layersNewIds,
|
|
21140
|
+
activeLayerNewId = _m.activeLayerNewId;
|
|
20010
21141
|
|
|
20011
21142
|
React__default["default"].useEffect(function () {
|
|
20012
21143
|
// set layers
|
|
@@ -20022,9 +21153,7 @@
|
|
|
20022
21153
|
|
|
20023
21154
|
dispatch(setBaseLayers({
|
|
20024
21155
|
mapId: mapId,
|
|
20025
|
-
layers: [baseLayerWithUniqueId,
|
|
20026
|
-
id: generateLayerId()
|
|
20027
|
-
})]
|
|
21156
|
+
layers: __spreadArray([baseLayerWithUniqueId], __read(overLayersWithUniqueId))
|
|
20028
21157
|
})); // bbox
|
|
20029
21158
|
|
|
20030
21159
|
dispatch(setBbox$1({
|
|
@@ -20466,20 +21595,22 @@
|
|
|
20466
21595
|
layers = _a.layers,
|
|
20467
21596
|
_b = _a.baseLayer,
|
|
20468
21597
|
baseLayer = _b === void 0 ? undefined : _b,
|
|
20469
|
-
_c = _a.
|
|
20470
|
-
|
|
20471
|
-
_d = _a.
|
|
20472
|
-
|
|
20473
|
-
_e = _a.
|
|
20474
|
-
|
|
21598
|
+
_c = _a.overLayers,
|
|
21599
|
+
overLayers = _c === void 0 ? undefined : _c,
|
|
21600
|
+
_d = _a.activeLayerId,
|
|
21601
|
+
activeLayerId = _d === void 0 ? undefined : _d,
|
|
21602
|
+
_e = _a.shouldAutoUpdate,
|
|
21603
|
+
shouldAutoUpdate = _e === void 0 ? false : _e,
|
|
21604
|
+
_f = _a.shouldAnimate,
|
|
21605
|
+
shouldAnimate = _f === void 0 ? false : _f,
|
|
20475
21606
|
bbox = _a.bbox,
|
|
20476
21607
|
srs = _a.srs,
|
|
20477
|
-
|
|
20478
|
-
shouldShowZoomControls =
|
|
20479
|
-
|
|
20480
|
-
animationPayload =
|
|
20481
|
-
|
|
20482
|
-
displayMapPin =
|
|
21608
|
+
_g = _a.shouldShowZoomControls,
|
|
21609
|
+
shouldShowZoomControls = _g === void 0 ? true : _g,
|
|
21610
|
+
_h = _a.animationPayload,
|
|
21611
|
+
animationPayload = _h === void 0 ? undefined : _h,
|
|
21612
|
+
_j = _a.displayMapPin,
|
|
21613
|
+
displayMapPin = _j === void 0 ? false : _j;
|
|
20483
21614
|
var classes = useStyles$2();
|
|
20484
21615
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
20485
21616
|
className: classes.mapSliderConnect,
|
|
@@ -20499,6 +21630,7 @@
|
|
|
20499
21630
|
layers: layers || [],
|
|
20500
21631
|
activeLayerId: activeLayerId,
|
|
20501
21632
|
baseLayer: baseLayer,
|
|
21633
|
+
overLayers: overLayers,
|
|
20502
21634
|
bbox: bbox,
|
|
20503
21635
|
srs: srs,
|
|
20504
21636
|
shouldAutoUpdate: shouldAutoUpdate,
|