@opengeoweb/webmap-react 21.1.0-nightly-20261105 → 21.1.0-nightly-20261107

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 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(wmLayerDimension) {
8436
- var dimensionName = getShortenedDimensionName(wmLayerDimension.name);
8437
- var formattedValue = formatDimensionVal(wmLayerDimension.name, wmLayerDimension.currentValue);
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,84 +8570,22 @@ 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
- var tooltipText = jsxs("span", {
8499
- children: [wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title, ": ", jsx("br", {}), wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions.map(function (dim, index) {
8500
- return jsxs("span", {
8501
- children: [dim.name, ": ", formatDimensionVal(dim.name, dim.currentValue), index < wmLayer.dimensions.length - 1 && jsx("br", {})]
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
- position: 'relative',
8511
- width: 'calc(100% - 60px)',
8512
- left: '50px',
8513
- right: '10px',
8514
- marginTop: '12px',
8515
- marginBottom: '-10px'
8578
+ width: '100%'
8516
8579
  },
8517
- children: [jsx("div", {
8518
- style: {
8519
- width: '100%'
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
  };
8574
8586
 
8575
8587
  var getWMSStyleName = function getWMSStyleName(styleName, styles) {
8588
+ var _styles$0$name, _styles$;
8576
8589
  if (styleName && styles.some(function (style) {
8577
8590
  return style.name === styleName;
8578
8591
  })) {
@@ -8580,7 +8593,7 @@ var getWMSStyleName = function getWMSStyleName(styleName, styles) {
8580
8593
  }
8581
8594
  return styles.some(function (style) {
8582
8595
  return style.name === WMDefaultStyleName;
8583
- }) ? WMDefaultStyleName : '';
8596
+ }) ? WMDefaultStyleName : (_styles$0$name = (_styles$ = styles[0]) === null || _styles$ === void 0 ? void 0 : _styles$.name) !== null && _styles$0$name !== void 0 ? _styles$0$name : '';
8584
8597
  };
8585
8598
  var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
8586
8599
  var _wmLayer$dimensions$f, _wmLayer$dimensions4;
@@ -8754,13 +8767,13 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
8754
8767
  // After a layer name change, this waits until the wmLayer is parsed for the new name. Until then the wmLayer still has the styles and dimensions of the previous layer.
8755
8768
  // Name, style and dimensions are set in the source at once, so it never requests the new layer with the style or dimensions of the previous one.
8756
8769
  useEffect(function () {
8757
- var _styles$, _layer$getSource;
8770
+ var _layer$getSource;
8758
8771
  if (!wmLayer || !isParsedForName) {
8759
8772
  return;
8760
8773
  }
8761
8774
  var styles = wmLayer.getStyles();
8762
8775
  var style = getWMSStyleName(styleName, styles);
8763
- wmLayer.setStyle(style || ((_styles$ = styles[0]) === null || _styles$ === void 0 ? void 0 : _styles$.name) || '');
8776
+ wmLayer.setStyle(style);
8764
8777
  dimensionsValues && (layer === null || layer === void 0 || (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 ? void 0 : _layer$getSource.setLayerProps({
8765
8778
  layerName: layerName,
8766
8779
  styleName: style,
@@ -9820,8 +9833,15 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
9820
9833
  });
9821
9834
  };
9822
9835
 
9836
+ var makeEDRLayerInfoTitle = function makeEDRLayerInfoTitle(edrBaseUrl, parameter) {
9837
+ var _edrBaseUrl$split = edrBaseUrl.split('/collections/'),
9838
+ _edrBaseUrl$split2 = _slicedToArray(_edrBaseUrl$split, 2),
9839
+ serviceUrl = _edrBaseUrl$split2[0],
9840
+ collectionId = _edrBaseUrl$split2[1];
9841
+ return "".concat(parameter, " | ").concat(collectionId, " | ").concat(serviceUrl);
9842
+ };
9823
9843
  var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
9824
- var _wmLayer$getDimension, _wmLayer$getDimension2;
9844
+ var _wmLayer$getDimension, _wmLayer$getDimension2, _wmLayer$dimensions;
9825
9845
  var edrBaseUrl = _ref.edrBaseUrl,
9826
9846
  parameter = _ref.parameter,
9827
9847
  style = _ref.style,
@@ -9832,7 +9852,8 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
9832
9852
  layerId = _ref.layerId,
9833
9853
  _ref$visible = _ref.visible,
9834
9854
  visible = _ref$visible === void 0 ? true : _ref$visible,
9835
- onInitializeLayer = _ref.onInitializeLayer;
9855
+ onInitializeLayer = _ref.onInitializeLayer,
9856
+ debugMode = _ref.debugMode;
9836
9857
  // get a wmLayer instance
9837
9858
  var wmLayer = useEDRWMLayer(edrBaseUrl, parameter, layerId, onInitializeLayer);
9838
9859
  // dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests. We re-use it here for EDR.
@@ -9850,13 +9871,18 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
9850
9871
  };
9851
9872
  // Don't show anything if no parameter is selected
9852
9873
  var isVisible = visible && parameter.length > 0;
9853
- return jsx(OpenLayersFeatureLayer, {
9854
- declutter: true,
9855
- featureCollection: featureCollection,
9856
- opacity: opacity,
9857
- style: isFetching ? loadingStyle : style,
9858
- visible: isVisible,
9859
- zIndex: zIndex
9874
+ return jsxs(Fragment, {
9875
+ children: [jsx(OpenLayersFeatureLayer, {
9876
+ declutter: true,
9877
+ featureCollection: featureCollection,
9878
+ opacity: opacity,
9879
+ style: isFetching ? loadingStyle : style,
9880
+ visible: isVisible,
9881
+ zIndex: zIndex
9882
+ }), !!debugMode && jsx(ShowLayerInfo, {
9883
+ dimensions: (_wmLayer$dimensions = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions) !== null && _wmLayer$dimensions !== void 0 ? _wmLayer$dimensions : [],
9884
+ title: makeEDRLayerInfoTitle(edrBaseUrl, parameter)
9885
+ })]
9860
9886
  });
9861
9887
  };
9862
9888
 
@@ -12103,6 +12129,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
12103
12129
  var multiParam = Array.isArray(edrOptions === null || edrOptions === void 0 ? void 0 : edrOptions.parameterNames) && edrOptions.parameterNames.length > 1;
12104
12130
  var styleLike = style !== undefined ? styleNameToStyleLike(style, multiParam) : undefined;
12105
12131
  return jsx(TimeAwareEDRLocationLayer, {
12132
+ debugMode: debugMode,
12106
12133
  dimensions: dimensions,
12107
12134
  edrBaseUrl: service,
12108
12135
  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: (showLegend: boolean) => void;
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: (showLegend: boolean) => void;
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-20261105",
3
+ "version": "21.1.0-nightly-20261107",
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-20261105",
24
- "@opengeoweb/theme": "21.1.0-nightly-20261105",
25
- "@opengeoweb/shared": "21.1.0-nightly-20261105",
23
+ "@opengeoweb/webmap": "21.1.0-nightly-20261107",
24
+ "@opengeoweb/theme": "21.1.0-nightly-20261107",
25
+ "@opengeoweb/shared": "21.1.0-nightly-20261107",
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",