@opengeoweb/webmap-react 21.1.0-nightly-20261105 → 21.1.0-nightly-20261106
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/dist/index.esm.js +110 -84
- package/dist/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +1 -1
- package/dist/src/lib/components/LayerInfo/LayerInfoLegend.d.ts +1 -1
- package/dist/src/lib/components/OpenLayers/layers/TimeAwareEDRLocationLayer.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/utils/ShowLayerInfo.d.ts +10 -0
- package/package.json +5 -5
package/dist/index.esm.js
CHANGED
|
@@ -4884,7 +4884,7 @@ var LayerInfoLegend = function LayerInfoLegend(_ref) {
|
|
|
4884
4884
|
sx: textStyleWithMargin,
|
|
4885
4885
|
variant: "subtitle2",
|
|
4886
4886
|
children: t('webmap-react-legend')
|
|
4887
|
-
}), jsx(FormGroup, {
|
|
4887
|
+
}), !!onToggleLayerLegendVisibility && jsx(FormGroup, {
|
|
4888
4888
|
children: jsx(FormControlLabel, {
|
|
4889
4889
|
control: jsx(Checkbox, {
|
|
4890
4890
|
checked: showLayerLegend,
|
|
@@ -8432,11 +8432,86 @@ var formatDimensionVal = function formatDimensionVal(dimName, dimVal) {
|
|
|
8432
8432
|
}
|
|
8433
8433
|
}
|
|
8434
8434
|
};
|
|
8435
|
-
var getDimensionInfo = function getDimensionInfo(
|
|
8436
|
-
var dimensionName = getShortenedDimensionName(
|
|
8437
|
-
var formattedValue = formatDimensionVal(
|
|
8435
|
+
var getDimensionInfo = function getDimensionInfo(dimension) {
|
|
8436
|
+
var dimensionName = getShortenedDimensionName(dimension.name);
|
|
8437
|
+
var formattedValue = formatDimensionVal(dimension.name, dimension.currentValue);
|
|
8438
8438
|
return "".concat(dimensionName, " ").concat(formattedValue);
|
|
8439
8439
|
};
|
|
8440
|
+
/** Debug overlay row with the layer title and its current dimension values. */
|
|
8441
|
+
var ShowLayerInfo = function ShowLayerInfo(_ref) {
|
|
8442
|
+
var title = _ref.title,
|
|
8443
|
+
dimensions = _ref.dimensions,
|
|
8444
|
+
children = _ref.children;
|
|
8445
|
+
var tooltipText = jsxs("span", {
|
|
8446
|
+
children: [title, ": ", jsx("br", {}), dimensions.map(function (dim, index) {
|
|
8447
|
+
return jsxs("span", {
|
|
8448
|
+
children: [dim.name, ": ", formatDimensionVal(dim.name, dim.currentValue), index < dimensions.length - 1 && jsx("br", {})]
|
|
8449
|
+
}, "".concat(dim.name, "-").concat(dim.currentValue));
|
|
8450
|
+
})]
|
|
8451
|
+
});
|
|
8452
|
+
return jsx(CustomTooltip, {
|
|
8453
|
+
title: tooltipText,
|
|
8454
|
+
children: jsxs("div", {
|
|
8455
|
+
"data-testid": "debug-info",
|
|
8456
|
+
style: {
|
|
8457
|
+
position: 'relative',
|
|
8458
|
+
width: 'calc(100% - 60px)',
|
|
8459
|
+
left: '50px',
|
|
8460
|
+
right: '10px',
|
|
8461
|
+
marginTop: '12px',
|
|
8462
|
+
marginBottom: '-10px'
|
|
8463
|
+
},
|
|
8464
|
+
children: [children, jsxs("div", {
|
|
8465
|
+
style: {
|
|
8466
|
+
left: '10px',
|
|
8467
|
+
paddingTop: '3px',
|
|
8468
|
+
fontSize: '12px',
|
|
8469
|
+
fontFamily: 'Roboto',
|
|
8470
|
+
opacity: 0.85,
|
|
8471
|
+
width: '100%'
|
|
8472
|
+
},
|
|
8473
|
+
children: [jsx("span", {
|
|
8474
|
+
style: {
|
|
8475
|
+
display: 'inline-block',
|
|
8476
|
+
verticalAlign: 'top',
|
|
8477
|
+
width: '25%',
|
|
8478
|
+
overflow: 'hidden',
|
|
8479
|
+
textOverflow: 'ellipsis',
|
|
8480
|
+
whiteSpace: 'nowrap',
|
|
8481
|
+
fontSize: '12px',
|
|
8482
|
+
paddingRight: '4px',
|
|
8483
|
+
paddingLeft: '4px',
|
|
8484
|
+
color: '#051039',
|
|
8485
|
+
backgroundColor: 'rgba(236, 237, 238, 0.7)',
|
|
8486
|
+
borderRadius: 2
|
|
8487
|
+
},
|
|
8488
|
+
children: title
|
|
8489
|
+
}), jsx("span", {
|
|
8490
|
+
style: {
|
|
8491
|
+
display: 'inline-block',
|
|
8492
|
+
width: '75%',
|
|
8493
|
+
opacity: '0.7'
|
|
8494
|
+
},
|
|
8495
|
+
children: dimensions.map(function (dimension) {
|
|
8496
|
+
return jsx("span", {
|
|
8497
|
+
style: {
|
|
8498
|
+
margin: '0 0 0 0px',
|
|
8499
|
+
padding: '1px 5px',
|
|
8500
|
+
background: 'blue',
|
|
8501
|
+
borderRadius: 2,
|
|
8502
|
+
color: 'white',
|
|
8503
|
+
fontSize: '11px'
|
|
8504
|
+
},
|
|
8505
|
+
title: "".concat(dimension.name, " ").concat(formatDimensionVal(dimension.name, dimension.currentValue)),
|
|
8506
|
+
children: getDimensionInfo(dimension)
|
|
8507
|
+
}, dimension.name);
|
|
8508
|
+
})
|
|
8509
|
+
})]
|
|
8510
|
+
})]
|
|
8511
|
+
})
|
|
8512
|
+
});
|
|
8513
|
+
};
|
|
8514
|
+
|
|
8440
8515
|
var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
8441
8516
|
var _wmLayer$dimensions;
|
|
8442
8517
|
var wmLayer = _ref.wmLayer,
|
|
@@ -8495,79 +8570,16 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
8495
8570
|
});
|
|
8496
8571
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8497
8572
|
}, [layer, timeStepsToCheck, visible, wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.currentValue, render]);
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
}, "".concat(dim.name, "-").concat(dim.currentValue));
|
|
8503
|
-
})]
|
|
8504
|
-
});
|
|
8505
|
-
return jsx(CustomTooltip, {
|
|
8506
|
-
title: tooltipText,
|
|
8507
|
-
children: jsxs("div", {
|
|
8508
|
-
"data-testid": "debug-info",
|
|
8573
|
+
return jsx(ShowLayerInfo, {
|
|
8574
|
+
dimensions: wmLayer.dimensions,
|
|
8575
|
+
title: wmLayer.title,
|
|
8576
|
+
children: jsx("div", {
|
|
8509
8577
|
style: {
|
|
8510
|
-
|
|
8511
|
-
width: 'calc(100% - 60px)',
|
|
8512
|
-
left: '50px',
|
|
8513
|
-
right: '10px',
|
|
8514
|
-
marginTop: '12px',
|
|
8515
|
-
marginBottom: '-10px'
|
|
8578
|
+
width: '100%'
|
|
8516
8579
|
},
|
|
8517
|
-
children:
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
},
|
|
8521
|
-
children: jsx("div", {
|
|
8522
|
-
children: items
|
|
8523
|
-
})
|
|
8524
|
-
}), jsxs("div", {
|
|
8525
|
-
style: {
|
|
8526
|
-
left: '10px',
|
|
8527
|
-
paddingTop: '3px',
|
|
8528
|
-
fontSize: '12px',
|
|
8529
|
-
fontFamily: 'Roboto',
|
|
8530
|
-
opacity: 0.85,
|
|
8531
|
-
width: '100%'
|
|
8532
|
-
},
|
|
8533
|
-
children: [jsx("span", {
|
|
8534
|
-
style: {
|
|
8535
|
-
display: 'inline-block',
|
|
8536
|
-
verticalAlign: 'top',
|
|
8537
|
-
width: '25%',
|
|
8538
|
-
overflow: 'hidden',
|
|
8539
|
-
textOverflow: 'ellipsis',
|
|
8540
|
-
whiteSpace: 'nowrap',
|
|
8541
|
-
fontSize: '12px',
|
|
8542
|
-
paddingRight: '4px',
|
|
8543
|
-
paddingLeft: '4px',
|
|
8544
|
-
color: '#051039',
|
|
8545
|
-
backgroundColor: 'rgba(236, 237, 238, 0.7)',
|
|
8546
|
-
borderRadius: 2
|
|
8547
|
-
},
|
|
8548
|
-
children: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title
|
|
8549
|
-
}), jsx("span", {
|
|
8550
|
-
style: {
|
|
8551
|
-
display: 'inline-block',
|
|
8552
|
-
width: '75%',
|
|
8553
|
-
opacity: '0.7'
|
|
8554
|
-
},
|
|
8555
|
-
children: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions.map(function (wmLayerDimension) {
|
|
8556
|
-
return jsx("span", {
|
|
8557
|
-
style: {
|
|
8558
|
-
margin: '0 0 0 0px',
|
|
8559
|
-
padding: '1px 5px',
|
|
8560
|
-
background: 'blue',
|
|
8561
|
-
borderRadius: 2,
|
|
8562
|
-
color: 'white',
|
|
8563
|
-
fontSize: '11px'
|
|
8564
|
-
},
|
|
8565
|
-
title: "".concat(wmLayerDimension.name, " ").concat(formatDimensionVal(wmLayerDimension.name, wmLayerDimension.currentValue)),
|
|
8566
|
-
children: getDimensionInfo(wmLayerDimension)
|
|
8567
|
-
}, wmLayerDimension.name);
|
|
8568
|
-
})
|
|
8569
|
-
})]
|
|
8570
|
-
})]
|
|
8580
|
+
children: jsx("div", {
|
|
8581
|
+
children: items
|
|
8582
|
+
})
|
|
8571
8583
|
})
|
|
8572
8584
|
}, wmLayer.id);
|
|
8573
8585
|
};
|
|
@@ -9820,8 +9832,15 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
9820
9832
|
});
|
|
9821
9833
|
};
|
|
9822
9834
|
|
|
9835
|
+
var makeEDRLayerInfoTitle = function makeEDRLayerInfoTitle(edrBaseUrl, parameter) {
|
|
9836
|
+
var _edrBaseUrl$split = edrBaseUrl.split('/collections/'),
|
|
9837
|
+
_edrBaseUrl$split2 = _slicedToArray(_edrBaseUrl$split, 2),
|
|
9838
|
+
serviceUrl = _edrBaseUrl$split2[0],
|
|
9839
|
+
collectionId = _edrBaseUrl$split2[1];
|
|
9840
|
+
return "".concat(parameter, " | ").concat(collectionId, " | ").concat(serviceUrl);
|
|
9841
|
+
};
|
|
9823
9842
|
var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
9824
|
-
var _wmLayer$getDimension, _wmLayer$getDimension2;
|
|
9843
|
+
var _wmLayer$getDimension, _wmLayer$getDimension2, _wmLayer$dimensions;
|
|
9825
9844
|
var edrBaseUrl = _ref.edrBaseUrl,
|
|
9826
9845
|
parameter = _ref.parameter,
|
|
9827
9846
|
style = _ref.style,
|
|
@@ -9832,7 +9851,8 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
9832
9851
|
layerId = _ref.layerId,
|
|
9833
9852
|
_ref$visible = _ref.visible,
|
|
9834
9853
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
9835
|
-
onInitializeLayer = _ref.onInitializeLayer
|
|
9854
|
+
onInitializeLayer = _ref.onInitializeLayer,
|
|
9855
|
+
debugMode = _ref.debugMode;
|
|
9836
9856
|
// get a wmLayer instance
|
|
9837
9857
|
var wmLayer = useEDRWMLayer(edrBaseUrl, parameter, layerId, onInitializeLayer);
|
|
9838
9858
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests. We re-use it here for EDR.
|
|
@@ -9850,13 +9870,18 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
9850
9870
|
};
|
|
9851
9871
|
// Don't show anything if no parameter is selected
|
|
9852
9872
|
var isVisible = visible && parameter.length > 0;
|
|
9853
|
-
return
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9873
|
+
return jsxs(Fragment, {
|
|
9874
|
+
children: [jsx(OpenLayersFeatureLayer, {
|
|
9875
|
+
declutter: true,
|
|
9876
|
+
featureCollection: featureCollection,
|
|
9877
|
+
opacity: opacity,
|
|
9878
|
+
style: isFetching ? loadingStyle : style,
|
|
9879
|
+
visible: isVisible,
|
|
9880
|
+
zIndex: zIndex
|
|
9881
|
+
}), !!debugMode && jsx(ShowLayerInfo, {
|
|
9882
|
+
dimensions: (_wmLayer$dimensions = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions) !== null && _wmLayer$dimensions !== void 0 ? _wmLayer$dimensions : [],
|
|
9883
|
+
title: makeEDRLayerInfoTitle(edrBaseUrl, parameter)
|
|
9884
|
+
})]
|
|
9860
9885
|
});
|
|
9861
9886
|
};
|
|
9862
9887
|
|
|
@@ -12103,6 +12128,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
12103
12128
|
var multiParam = Array.isArray(edrOptions === null || edrOptions === void 0 ? void 0 : edrOptions.parameterNames) && edrOptions.parameterNames.length > 1;
|
|
12104
12129
|
var styleLike = style !== undefined ? styleNameToStyleLike(style, multiParam) : undefined;
|
|
12105
12130
|
return jsx(TimeAwareEDRLocationLayer, {
|
|
12131
|
+
debugMode: debugMode,
|
|
12106
12132
|
dimensions: dimensions,
|
|
12107
12133
|
edrBaseUrl: service,
|
|
12108
12134
|
layerId: id,
|
|
@@ -17,7 +17,7 @@ export interface LayerInfoDialogProps {
|
|
|
17
17
|
layerOpacity?: number;
|
|
18
18
|
stacLayer?: Pick<LayerFoundation, 'service' | 'id' | 'style'>;
|
|
19
19
|
showLayerLegend: boolean;
|
|
20
|
-
onToggleLayerLegendVisibility
|
|
20
|
+
onToggleLayerLegendVisibility?: (showLegend: boolean) => void;
|
|
21
21
|
edrParameterMetadata?: {
|
|
22
22
|
id?: string;
|
|
23
23
|
label?: string;
|
|
@@ -4,7 +4,7 @@ export interface LayerInfoLegendProps {
|
|
|
4
4
|
title: string;
|
|
5
5
|
legendURL?: string;
|
|
6
6
|
showLayerLegend: boolean;
|
|
7
|
-
onToggleLayerLegendVisibility
|
|
7
|
+
onToggleLayerLegendVisibility?: (showLegend: boolean) => void;
|
|
8
8
|
layerType?: LayerType;
|
|
9
9
|
stacLayer?: Pick<LayerFoundation, 'service' | 'id' | 'style'>;
|
|
10
10
|
layerOpacity?: number;
|
|
@@ -9,6 +9,7 @@ interface TimeAwareEDRLocationLayerProps extends OpenLayersFeatureLayerProps {
|
|
|
9
9
|
onInitializeLayer?: (payload: OnInitializeLayerProps) => void;
|
|
10
10
|
opacity?: number;
|
|
11
11
|
visible?: boolean;
|
|
12
|
+
debugMode?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const TimeAwareEDRLocationLayer: React.FC<TimeAwareEDRLocationLayerProps>;
|
|
14
15
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WMJSDimension } from '@opengeoweb/webmap';
|
|
2
|
+
type LayerInfoDimension = Pick<WMJSDimension, 'name' | 'currentValue'>;
|
|
3
|
+
export interface ShowLayerInfoProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
dimensions: LayerInfoDimension[];
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Debug overlay row with the layer title and its current dimension values. */
|
|
9
|
+
export declare const ShowLayerInfo: React.FC<ShowLayerInfoProps>;
|
|
10
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "21.1.0-nightly-
|
|
3
|
+
"version": "21.1.0-nightly-20261106",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opengeoweb/webmap": "21.1.0-nightly-
|
|
24
|
-
"@opengeoweb/theme": "21.1.0-nightly-
|
|
25
|
-
"@opengeoweb/shared": "21.1.0-nightly-
|
|
23
|
+
"@opengeoweb/webmap": "21.1.0-nightly-20261106",
|
|
24
|
+
"@opengeoweb/theme": "21.1.0-nightly-20261106",
|
|
25
|
+
"@opengeoweb/shared": "21.1.0-nightly-20261106",
|
|
26
26
|
"lodash": "^4.18.1",
|
|
27
27
|
"ol": "^10.4.0",
|
|
28
28
|
"proj4": "^2.9.2",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@emotion/styled": "*"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"eslint-plugin-storybook": "10.3.3"
|
|
43
|
+
"eslint-plugin-storybook": "^10.3.3"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"dist",
|