@opengeoweb/webmap-react 15.2.0 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +374 -193
- package/package.json +4 -4
- package/src/lib/components/Clock/Clock.d.ts +5 -2
- package/src/lib/components/Clock/ClockContainer.d.ts +5 -9
- package/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +2 -0
- package/src/lib/components/LayerInfo/LayerInfoLegend.d.ts +2 -3
- package/src/lib/components/Legend/Legend.d.ts +1 -0
- package/src/lib/components/Legend/LegendDialog.d.ts +1 -0
- package/src/lib/components/Legend/LegendLayout.d.ts +2 -4
- package/src/lib/components/OpenLayers/OpenLayersMapView.NoTimeDim.stories.d.ts +6 -0
- package/src/lib/components/OpenLayers/draw/index.d.ts +1 -1
- package/src/lib/components/OpenLayers/draw/types.d.ts +2 -1
- package/src/lib/components/OpenLayers/draw/useMapDrawTool.d.ts +1 -0
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.d.ts +9 -1
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.spec.d.ts +1 -0
- package/src/lib/components/OpenLayers/utils/makeDimValuesToPrefetch.d.ts +8 -1
package/index.esm.js
CHANGED
|
@@ -11,14 +11,14 @@ import ImageWrapper, { load } from 'ol/Image';
|
|
|
11
11
|
import { getImageSrc, getRequestParams, createLoader } from 'ol/source/wms';
|
|
12
12
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
13
13
|
import { CustomTooltip, CanvasComponent, useWheelStopPropagation, ToolContainerDraggable, CustomIconButton, dateUtils, useMakeSureContainerStaysInsideWindow, Draggable, Resizable } from '@opengeoweb/shared';
|
|
14
|
-
import {
|
|
14
|
+
import { useTheme, Card, Box, Typography, Grid, styled, Slider, FormGroup, FormControlLabel, Checkbox, TextField, FormControl, InputLabel, Select, MenuItem, Icon as Icon$2, FormLabel, Switch, Paper, ThemeProvider } from '@mui/material';
|
|
15
|
+
import { Visibility, VisibilityOff, arrowUpPath, Home, Add, Minus, List, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath, rotatePath, Location, DrawToolSmoothLine, DrawToolFreehand, DrawToolOval, DrawToolCircle, DrawToolSquare, Delete, DrawToolLineString, DrawToolRectangle, DrawToolPolygon, DrawToolPoint, DrawFIRLand, ArrowUp, darkTheme, ChevronRight, Options, Clock as Clock$1 } from '@opengeoweb/theme';
|
|
16
|
+
import 'i18next';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
15
18
|
import { queryOptions, useQuery } from '@tanstack/react-query';
|
|
16
19
|
import { Point, MultiPoint, LineString, Polygon } from 'ol/geom';
|
|
17
20
|
import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
|
|
18
|
-
import { arrowUpPath, Home, Add, Minus, List, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath, rotatePath, Location, DrawToolSmoothLine, DrawToolFreehand, DrawToolOval, DrawToolCircle, DrawToolSquare, Delete, DrawToolLineString, DrawToolRectangle, DrawToolPolygon, DrawToolPoint, DrawFIRLand, ArrowUp, darkTheme, ChevronRight, Clock as Clock$1, Resize } from '@opengeoweb/theme';
|
|
19
21
|
import { http, HttpResponse } from 'msw';
|
|
20
|
-
import 'i18next';
|
|
21
|
-
import { useTranslation } from 'react-i18next';
|
|
22
22
|
import Box$1 from '@mui/material/Box';
|
|
23
23
|
import Typography$1 from '@mui/material/Typography';
|
|
24
24
|
import { View, Map, Feature, Collection, Overlay } from 'ol';
|
|
@@ -91,6 +91,7 @@ var en = {
|
|
|
91
91
|
"webmap-react-point": "Point",
|
|
92
92
|
"webmap-react-polygon": "Polygon",
|
|
93
93
|
"webmap-react-box": "Rectangle",
|
|
94
|
+
"webmap-react-rotatable-box": "Rectangle",
|
|
94
95
|
"webmap-react-linestring": "Line String",
|
|
95
96
|
"webmap-react-circle": "Circle",
|
|
96
97
|
"webmap-react-square": "Square",
|
|
@@ -102,7 +103,11 @@ var en = {
|
|
|
102
103
|
"webmap-react-legend-no-image": "No legend graphic available",
|
|
103
104
|
"webmap-react-map-measure-help-tooltip": "Click to measure",
|
|
104
105
|
"clock-show": "Show clock",
|
|
105
|
-
"clock-hide": "Hide clock"
|
|
106
|
+
"clock-hide": "Hide clock",
|
|
107
|
+
"clock-animation-options": "Animation options",
|
|
108
|
+
"webmap-react-show-layer-legend": "Show layer legend",
|
|
109
|
+
"webmap-react-show-layer": "Show layer in legend",
|
|
110
|
+
"webmap-react-hide-layer": "Hide layer in legend"
|
|
106
111
|
};
|
|
107
112
|
var fi = {
|
|
108
113
|
"webmap-react-event": "tapahtuma:",
|
|
@@ -147,10 +152,15 @@ var fi = {
|
|
|
147
152
|
"webmap-react-point": "Piste",
|
|
148
153
|
"webmap-react-polygon": "Monikulmio",
|
|
149
154
|
"webmap-react-box": "Laatikko",
|
|
155
|
+
"webmap-react-rotatable-box": "Laatikko",
|
|
150
156
|
"webmap-react-linestring": "Viivajono",
|
|
151
157
|
"webmap-react-delete": "Poista",
|
|
152
158
|
"clock-show": "Näytä kello",
|
|
153
|
-
"clock-hide": "Piilota kello"
|
|
159
|
+
"clock-hide": "Piilota kello",
|
|
160
|
+
"clock-animation-options": "Animoinnin asetukset",
|
|
161
|
+
"webmap-react-show-layer-legend": "Näytä karttatason selite",
|
|
162
|
+
"webmap-react-show-layer": "Näytä karttataso selitteessä",
|
|
163
|
+
"webmap-react-hide-layer": "Piilota karttataso selitteestä"
|
|
154
164
|
};
|
|
155
165
|
var no = {
|
|
156
166
|
"webmap-react-event": "hendelse:",
|
|
@@ -195,10 +205,15 @@ var no = {
|
|
|
195
205
|
"webmap-react-point": "Punkt",
|
|
196
206
|
"webmap-react-polygon": "Polygon",
|
|
197
207
|
"webmap-react-box": "Boks",
|
|
208
|
+
"webmap-react-rotatable-box": "Boks",
|
|
198
209
|
"webmap-react-linestring": "Linje",
|
|
199
210
|
"webmap-react-delete": "Fjerne",
|
|
200
211
|
"clock-show": "Vis klokke",
|
|
201
|
-
"clock-hide": "Skjul klokke"
|
|
212
|
+
"clock-hide": "Skjul klokke",
|
|
213
|
+
"clock-animation-options": "Animasjonsinnstillinger",
|
|
214
|
+
"webmap-react-show-layer-legend": "Vis",
|
|
215
|
+
"webmap-react-show-layer": "Vis laget i tegnforklaringen",
|
|
216
|
+
"webmap-react-hide-layer": "Skjul laget i tegnforklaringen"
|
|
202
217
|
};
|
|
203
218
|
var nl = {
|
|
204
219
|
"webmap-react-event": "event:",
|
|
@@ -243,6 +258,7 @@ var nl = {
|
|
|
243
258
|
"webmap-react-point": "Punt",
|
|
244
259
|
"webmap-react-polygon": "Polygoon",
|
|
245
260
|
"webmap-react-box": "Rechthoek",
|
|
261
|
+
"webmap-react-rotatable-box": "Rechthoek",
|
|
246
262
|
"webmap-react-linestring": "Lijn",
|
|
247
263
|
"webmap-react-circle": "Cirkel",
|
|
248
264
|
"webmap-react-square": "Vierkant",
|
|
@@ -254,7 +270,11 @@ var nl = {
|
|
|
254
270
|
"webmap-react-legend-no-image": "Geen legenda beschikbaar",
|
|
255
271
|
"webmap-react-map-measure-help-tooltip": "Klik om te meten",
|
|
256
272
|
"clock-show": "Klok tonen",
|
|
257
|
-
"clock-hide": "Klok verbergen"
|
|
273
|
+
"clock-hide": "Klok verbergen",
|
|
274
|
+
"clock-animation-options": "Animatie opties",
|
|
275
|
+
"webmap-react-show-layer-legend": "Toon laag in legenda",
|
|
276
|
+
"webmap-react-show-layer": "Toon laag in legenda",
|
|
277
|
+
"webmap-react-hide-layer": "Verberg laag in legenda"
|
|
258
278
|
};
|
|
259
279
|
var webmapReactTranslations = {
|
|
260
280
|
en: en,
|
|
@@ -818,6 +838,13 @@ var TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = 'Image did not load succe
|
|
|
818
838
|
// export const WMS_EXTENT_RATIO_TO_VIEWPORT = 1.0;
|
|
819
839
|
// export const ENABLE_PREFETCH = false;
|
|
820
840
|
|
|
841
|
+
/**
|
|
842
|
+
*
|
|
843
|
+
* @param wmTimeDim WMDimension time containing dimension values
|
|
844
|
+
* @param stepsToCheck Array with timestamps as posix timestamps to check
|
|
845
|
+
* @param isAnimating If the application is running an animation loop
|
|
846
|
+
* @returns A string list with ISO8601 values to fetch
|
|
847
|
+
*/
|
|
821
848
|
var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsToCheck, isAnimating) {
|
|
822
849
|
if (wmTimeDim) {
|
|
823
850
|
if ((stepsToCheck === null || stepsToCheck === void 0 ? void 0 : stepsToCheck.length) > 0) {
|
|
@@ -866,44 +893,48 @@ var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsT
|
|
|
866
893
|
*/
|
|
867
894
|
var getDimensionParamsForWMS = function getDimensionParamsForWMS(dimensions, wmLayer) {
|
|
868
895
|
// Check if pre-requisites are OK. Possibly still fetching WMS GetCapabilities.
|
|
869
|
-
if (!
|
|
896
|
+
if (!(wmLayer !== null && wmLayer !== void 0 && wmLayer.isConfigured)) {
|
|
870
897
|
return undefined;
|
|
871
898
|
}
|
|
872
899
|
var dimProps = {};
|
|
873
|
-
|
|
874
|
-
// It is possible that a layer has no dimensions. In that case return a map without any key values.
|
|
875
|
-
return dimProps;
|
|
876
|
-
}
|
|
900
|
+
var wmLayerDims = wmLayer.getDimensions();
|
|
877
901
|
// Loop without forEach so we can exit and return.
|
|
878
|
-
var _iterator = _createForOfIteratorHelper(
|
|
902
|
+
var _iterator = _createForOfIteratorHelper(wmLayerDims),
|
|
879
903
|
_step;
|
|
880
904
|
try {
|
|
905
|
+
var _loop = function _loop() {
|
|
906
|
+
var wmLayerDim = _step.value;
|
|
907
|
+
// Check if passed as part of the list of dimensions
|
|
908
|
+
var layerDim = dimensions.find(function (dim) {
|
|
909
|
+
return dim.name === wmLayerDim.name;
|
|
910
|
+
});
|
|
911
|
+
if (layerDim) {
|
|
912
|
+
var closestValue = wmLayerDim.getClosestValue(layerDim.currentValue);
|
|
913
|
+
if (!WMInvalidDateValues.has(closestValue)) {
|
|
914
|
+
wmLayerDim.setValue(closestValue);
|
|
915
|
+
dimProps[getCorrectWMSDimName(wmLayerDim.name)] = closestValue;
|
|
916
|
+
} else {
|
|
917
|
+
// The requested value is not in the range of the dimension, image should not show
|
|
918
|
+
return {
|
|
919
|
+
v: undefined
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
} else {
|
|
923
|
+
// Not specified so fall back to current/default value from WMLayer
|
|
924
|
+
dimProps[getCorrectWMSDimName(wmLayerDim.name)] = wmLayerDim.currentValue ? wmLayerDim.currentValue : wmLayerDim.defaultValue;
|
|
925
|
+
}
|
|
926
|
+
},
|
|
927
|
+
_ret;
|
|
881
928
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
if (!wmLayerDimension) {
|
|
885
|
-
return undefined;
|
|
886
|
-
}
|
|
887
|
-
// Take the closest WMLayer dimension value
|
|
888
|
-
var closestValue = wmLayerDimension.getClosestValue(dimension.currentValue);
|
|
889
|
-
if (!WMInvalidDateValues.has(closestValue)) {
|
|
890
|
-
wmLayerDimension.setValue(closestValue);
|
|
891
|
-
dimProps[getCorrectWMSDimName(dimension.name)] = closestValue;
|
|
892
|
-
} else {
|
|
893
|
-
// The dimension name does not occur in the layer, or the requested value is not in the range of the dimension
|
|
894
|
-
return undefined;
|
|
895
|
-
}
|
|
929
|
+
_ret = _loop();
|
|
930
|
+
if (_ret) return _ret.v;
|
|
896
931
|
}
|
|
897
|
-
// Check if all dims where used which occur in the WMLayer
|
|
898
932
|
} catch (err) {
|
|
899
933
|
_iterator.e(err);
|
|
900
934
|
} finally {
|
|
901
935
|
_iterator.f();
|
|
902
936
|
}
|
|
903
|
-
return
|
|
904
|
-
var wmsName = getCorrectWMSDimName(wmLayerDim.name);
|
|
905
|
-
return wmsName in dimProps;
|
|
906
|
-
}) ? dimProps : undefined;
|
|
937
|
+
return dimProps;
|
|
907
938
|
};
|
|
908
939
|
/**
|
|
909
940
|
* Calculates number of timesteps for given timespan
|
|
@@ -1016,10 +1047,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1016
1047
|
src = _this$getWMSGetMapReq.src,
|
|
1017
1048
|
newExtent = _this$getWMSGetMapReq.extent,
|
|
1018
1049
|
newResolution = _this$getWMSGetMapReq.resolution;
|
|
1019
|
-
var geoRef = openLayersGetMapImageStore.getAltGeoReferencedImage(src, newExtent, newResolution)
|
|
1020
|
-
extent: newExtent,
|
|
1021
|
-
resolution: newResolution
|
|
1022
|
-
});
|
|
1050
|
+
var geoRef = openLayersGetMapImageStore.getAltGeoReferencedImage(src, newExtent, newResolution);
|
|
1023
1051
|
if (geoRef) {
|
|
1024
1052
|
return {
|
|
1025
1053
|
el: geoRef.getElement(),
|
|
@@ -1040,10 +1068,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1040
1068
|
src = _this$getWMSGetMapReq2.src,
|
|
1041
1069
|
newExtent = _this$getWMSGetMapReq2.extent,
|
|
1042
1070
|
newResolution = _this$getWMSGetMapReq2.resolution;
|
|
1043
|
-
var imageEl = openLayersGetMapImageStore.
|
|
1044
|
-
extent: newExtent,
|
|
1045
|
-
resolution: newResolution
|
|
1046
|
-
});
|
|
1071
|
+
var imageEl = openLayersGetMapImageStore.getImage(src);
|
|
1047
1072
|
if (imageEl) {
|
|
1048
1073
|
return {
|
|
1049
1074
|
el: imageEl.getElement(),
|
|
@@ -1066,7 +1091,6 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1066
1091
|
this.setImage(el);
|
|
1067
1092
|
this.extent = extent;
|
|
1068
1093
|
this.resolution = resolution;
|
|
1069
|
-
// this.projection = projection;/?TODO
|
|
1070
1094
|
}
|
|
1071
1095
|
}, {
|
|
1072
1096
|
key: "load",
|
|
@@ -1076,7 +1100,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1076
1100
|
src = _this$getWMSGetMapReq3.src,
|
|
1077
1101
|
newExtent = _this$getWMSGetMapReq3.extent,
|
|
1078
1102
|
newResolution = _this$getWMSGetMapReq3.resolution;
|
|
1079
|
-
var imageEl = openLayersGetMapImageStore.
|
|
1103
|
+
var imageEl = openLayersGetMapImageStore.getImageAndSetGeoReference(src, {
|
|
1080
1104
|
extent: newExtent,
|
|
1081
1105
|
resolution: newResolution
|
|
1082
1106
|
});
|
|
@@ -1437,7 +1461,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1437
1461
|
this.changed();
|
|
1438
1462
|
}
|
|
1439
1463
|
/**
|
|
1440
|
-
* Check if an image is available and loaded for requested date. Used for
|
|
1464
|
+
* Check if an image is available and loaded for requested date. Used for showlayerinfo to proceed.
|
|
1441
1465
|
* @param isoTime
|
|
1442
1466
|
* @returns
|
|
1443
1467
|
*/
|
|
@@ -1445,6 +1469,9 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1445
1469
|
key: "hasImageLoadedForTimeValue",
|
|
1446
1470
|
value: function hasImageLoadedForTimeValue(isoTime) {
|
|
1447
1471
|
var _this$_loadedExtent;
|
|
1472
|
+
if (!isoTime || WMInvalidDateValues.has(isoTime)) {
|
|
1473
|
+
return false;
|
|
1474
|
+
}
|
|
1448
1475
|
if (((_this$_loadedExtent = this._loadedExtent) === null || _this$_loadedExtent === void 0 ? void 0 : _this$_loadedExtent.length) !== 4) {
|
|
1449
1476
|
return false;
|
|
1450
1477
|
}
|
|
@@ -1456,24 +1483,44 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1456
1483
|
}
|
|
1457
1484
|
return true;
|
|
1458
1485
|
}
|
|
1459
|
-
// This function can be used to determine if the animation can proceed to the next step.
|
|
1460
1486
|
}, {
|
|
1461
|
-
key: "
|
|
1462
|
-
value: function
|
|
1487
|
+
key: "getAltGeoReferencedImages",
|
|
1488
|
+
value: function getAltGeoReferencedImages(isoTime) {
|
|
1463
1489
|
var _this$_loadedExtent2;
|
|
1490
|
+
if (!isoTime || WMInvalidDateValues.has(isoTime)) {
|
|
1491
|
+
return [];
|
|
1492
|
+
}
|
|
1464
1493
|
if (((_this$_loadedExtent2 = this._loadedExtent) === null || _this$_loadedExtent2 === void 0 ? void 0 : _this$_loadedExtent2.length) !== 4) {
|
|
1465
|
-
return
|
|
1494
|
+
return [];
|
|
1466
1495
|
}
|
|
1467
1496
|
var dimPropWithRequestedDate = _objectSpread2({}, this._dimProperties);
|
|
1468
1497
|
dimPropWithRequestedDate['TIME'] = isoTime;
|
|
1469
|
-
var
|
|
1470
|
-
|
|
1498
|
+
var _this$_imWrapperForOl = this._imWrapperForOlSource.getWMSGetMapRequestURL(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimPropWithRequestedDate),
|
|
1499
|
+
src = _this$_imWrapperForOl.src,
|
|
1500
|
+
newExtent = _this$_imWrapperForOl.extent,
|
|
1501
|
+
newResolution = _this$_imWrapperForOl.resolution;
|
|
1502
|
+
var geoRefs = openLayersGetMapImageStore.getAltGeoReferencedImages(src, newExtent, newResolution);
|
|
1503
|
+
return geoRefs;
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* This function can be used to determine if the animation can proceed to the next step.
|
|
1507
|
+
* @param isoTime ISO8601 string formatat like `YYYY-MM-DDTHH:MM:SSZ`
|
|
1508
|
+
* @returns Only specic case it returns false: when a image is available and is loading. That means we wait till it is loaded.
|
|
1509
|
+
* This function returns true if an image is not available in the store. Or true if it is available and already loaded.
|
|
1510
|
+
*/
|
|
1511
|
+
}, {
|
|
1512
|
+
key: "isImageLoadingForTimestep",
|
|
1513
|
+
value: function isImageLoadingForTimestep(isoTime) {
|
|
1514
|
+
var geoRefs = this.getAltGeoReferencedImages(isoTime);
|
|
1515
|
+
if (geoRefs.length === 0) {
|
|
1471
1516
|
// If there is no image at all for requested timestep, it means that the layer does not advertise data for that timestep.
|
|
1472
1517
|
// In that case the animation should proceed, so return true here to avoid blocking the animation.
|
|
1473
1518
|
return true;
|
|
1474
1519
|
}
|
|
1475
1520
|
// If it is still loading, we can block the animation going forward.
|
|
1476
|
-
return
|
|
1521
|
+
return geoRefs.filter(function (geoRef) {
|
|
1522
|
+
return !geoRef.isLoading();
|
|
1523
|
+
}).length !== 0;
|
|
1477
1524
|
}
|
|
1478
1525
|
}, {
|
|
1479
1526
|
key: "setImageForTimeValue",
|
|
@@ -1518,25 +1565,92 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1518
1565
|
}]);
|
|
1519
1566
|
}(ImageSource);
|
|
1520
1567
|
|
|
1568
|
+
var WEBMAP_REACT_NAMESPACE = 'webmapreact';
|
|
1569
|
+
var useWebmapReactTranslation = function useWebmapReactTranslation() {
|
|
1570
|
+
var ns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : WEBMAP_REACT_NAMESPACE;
|
|
1571
|
+
return useTranslation(ns);
|
|
1572
|
+
};
|
|
1573
|
+
|
|
1521
1574
|
var LegendLayout = function LegendLayout(_ref) {
|
|
1522
1575
|
var title = _ref.title,
|
|
1523
|
-
name = _ref.name,
|
|
1524
|
-
dimensions = _ref.dimensions,
|
|
1525
1576
|
children = _ref.children,
|
|
1526
1577
|
height = _ref.height,
|
|
1527
1578
|
width = _ref.width,
|
|
1528
|
-
|
|
1529
|
-
|
|
1579
|
+
_ref$showLayerLegend = _ref.showLayerLegend,
|
|
1580
|
+
showLayerLegend = _ref$showLayerLegend === void 0 ? true : _ref$showLayerLegend,
|
|
1581
|
+
toggleLayerLegendVisibility = _ref.toggleLayerLegendVisibility;
|
|
1582
|
+
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
1583
|
+
t = _useWebmapReactTransl.t;
|
|
1584
|
+
var theme = useTheme();
|
|
1585
|
+
return jsxs(Card, {
|
|
1530
1586
|
"data-testid": "legend",
|
|
1531
1587
|
sx: {
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
backgroundColor: '#FFF',
|
|
1588
|
+
border: 'none',
|
|
1589
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1590
|
+
backgroundColor: toggleLayerLegendVisibility ? showLayerLegend ? 'geowebColors.cards.cardContainer' : 'geowebColors.cards.cardContainerDisabled' : '#FFF',
|
|
1535
1591
|
overflow: 'hidden',
|
|
1536
|
-
marginBottom: 0.5
|
|
1592
|
+
marginBottom: 0.5,
|
|
1593
|
+
boxShadow: 0,
|
|
1594
|
+
borderRadius: '3px',
|
|
1595
|
+
padding: toggleLayerLegendVisibility ? 'none' : '10px'
|
|
1537
1596
|
},
|
|
1538
|
-
children: [jsx(Box, {
|
|
1597
|
+
children: [toggleLayerLegendVisibility ? jsx(Box, {
|
|
1598
|
+
"data-testid": "legend-title",
|
|
1599
|
+
children: jsx(CustomTooltip, {
|
|
1600
|
+
title: showLayerLegend ? t('webmap-react-hide-layer') : t('webmap-react-show-layer'),
|
|
1601
|
+
children: jsxs(Typography, {
|
|
1602
|
+
alignItems: "center",
|
|
1603
|
+
component: "button",
|
|
1604
|
+
display: "flex",
|
|
1605
|
+
gap: 1,
|
|
1606
|
+
onClick: function onClick(event) {
|
|
1607
|
+
event.stopPropagation();
|
|
1608
|
+
toggleLayerLegendVisibility(!showLayerLegend);
|
|
1609
|
+
},
|
|
1610
|
+
sx: {
|
|
1611
|
+
fontFamily: 'Roboto, Helvetica, Arial',
|
|
1612
|
+
fontSize: '12px',
|
|
1613
|
+
width: "".concat(width, "px"),
|
|
1614
|
+
minWidth: '100%',
|
|
1615
|
+
padding: '4px',
|
|
1616
|
+
margin: '0 0 1px',
|
|
1617
|
+
wordWrap: 'break-word',
|
|
1618
|
+
color: showLayerLegend ? 'geowebColors.typographyAndIcons.text' : 'geowebColors.typographyAndIcons.inactiveText',
|
|
1619
|
+
whiteSpace: 'nowrap',
|
|
1620
|
+
border: showLayerLegend ? 'none' : "1px solid ".concat(theme.palette.geowebColors.cards.cardContainerDisabledBorder),
|
|
1621
|
+
backgroundColor: showLayerLegend ? 'geowebColors.cards.cardContainer' : 'geowebColors.cards.cardContainerDisabled',
|
|
1622
|
+
textAlign: 'left',
|
|
1623
|
+
cursor: 'pointer',
|
|
1624
|
+
'&:hover': {
|
|
1625
|
+
backgroundColor: 'geowebColors.cards.cardContainerMouseOver',
|
|
1626
|
+
border: showLayerLegend ? 'none' : "1px solid ".concat(theme.palette.geowebColors.cards.cardContainerBorder)
|
|
1627
|
+
}
|
|
1628
|
+
},
|
|
1629
|
+
variant: "subtitle2",
|
|
1630
|
+
children: [showLayerLegend ? jsx(Visibility, {
|
|
1631
|
+
fontSize: "medium",
|
|
1632
|
+
sx: {
|
|
1633
|
+
margin: 'auto 0px'
|
|
1634
|
+
}
|
|
1635
|
+
}) : jsx(VisibilityOff, {
|
|
1636
|
+
fontSize: "medium",
|
|
1637
|
+
sx: {
|
|
1638
|
+
margin: 'auto 0px'
|
|
1639
|
+
}
|
|
1640
|
+
}), jsx("span", {
|
|
1641
|
+
style: {
|
|
1642
|
+
overflow: 'hidden',
|
|
1643
|
+
textOverflow: 'ellipsis'
|
|
1644
|
+
},
|
|
1645
|
+
children: title
|
|
1646
|
+
})]
|
|
1647
|
+
})
|
|
1648
|
+
})
|
|
1649
|
+
}) : jsx(Box, {
|
|
1539
1650
|
"data-testid": "legend-title",
|
|
1651
|
+
sx: {
|
|
1652
|
+
backgroundColor: '#FFF'
|
|
1653
|
+
},
|
|
1540
1654
|
children: jsx(Typography, {
|
|
1541
1655
|
sx: {
|
|
1542
1656
|
fontFamily: 'Roboto, Helvetica, Arial',
|
|
@@ -1549,41 +1663,19 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1549
1663
|
variant: "h3",
|
|
1550
1664
|
children: title
|
|
1551
1665
|
})
|
|
1552
|
-
}), jsx(CustomTooltip, {
|
|
1666
|
+
}), !!showLayerLegend && jsx(CustomTooltip, {
|
|
1553
1667
|
placement: "top",
|
|
1554
1668
|
title: title || 'loading',
|
|
1555
1669
|
children: jsx(Box, {
|
|
1556
1670
|
sx: {
|
|
1557
|
-
margin: '10px 0px 10px 0px',
|
|
1671
|
+
margin: toggleLayerLegendVisibility ? '2px 0 8px 12px' : '10px 0px 10px 0px',
|
|
1558
1672
|
height: "".concat(height, "px"),
|
|
1559
|
-
width: "".concat(width, "px")
|
|
1673
|
+
width: "".concat(width, "px"),
|
|
1674
|
+
minWidth: '100%',
|
|
1675
|
+
backgroundColor: '#FFF'
|
|
1560
1676
|
},
|
|
1561
1677
|
children: children
|
|
1562
1678
|
})
|
|
1563
|
-
}), jsx(Box, {
|
|
1564
|
-
"data-testid": "legend-info",
|
|
1565
|
-
sx: _objectSpread2({
|
|
1566
|
-
fontFamily: 'Roboto, Helvetica, Arial',
|
|
1567
|
-
fontSize: 10,
|
|
1568
|
-
color: 'common.black',
|
|
1569
|
-
overflowX: 'hidden',
|
|
1570
|
-
wordWrap: 'break-word',
|
|
1571
|
-
whiteSpace: 'nowrap'
|
|
1572
|
-
}, minWidth && {
|
|
1573
|
-
minWidth: "".concat(minWidth, "px")
|
|
1574
|
-
}),
|
|
1575
|
-
children: dimensions === null || dimensions === void 0 ? void 0 : dimensions.map(function (dim) {
|
|
1576
|
-
return jsx(Box, {
|
|
1577
|
-
children: dim.name === 'time' ? "".concat(dim.currentValue) : jsxs(Fragment, {
|
|
1578
|
-
children: [jsxs(Box, {
|
|
1579
|
-
style: {
|
|
1580
|
-
fontWeight: 500
|
|
1581
|
-
},
|
|
1582
|
-
children: [dim.name, ":"]
|
|
1583
|
-
}), dim.currentValue, " ", dim.units]
|
|
1584
|
-
})
|
|
1585
|
-
}, name + dim.name);
|
|
1586
|
-
})
|
|
1587
1679
|
})]
|
|
1588
1680
|
});
|
|
1589
1681
|
};
|
|
@@ -1666,6 +1758,12 @@ var joinUrlParams = function joinUrlParams(params) {
|
|
|
1666
1758
|
return x !== undefined && x.length > 0;
|
|
1667
1759
|
}).join('/');
|
|
1668
1760
|
};
|
|
1761
|
+
// This is a copy from libs/api/src/utils.ts due to circular dependency
|
|
1762
|
+
var withJsonFormat = function withJsonFormat(url) {
|
|
1763
|
+
var urlObj = new URL(url);
|
|
1764
|
+
urlObj.searchParams.set('f', 'json');
|
|
1765
|
+
return urlObj.toString();
|
|
1766
|
+
};
|
|
1669
1767
|
var fetchEDRCollectionDetails = /*#__PURE__*/function () {
|
|
1670
1768
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(edrBaseUrlWithCollection) {
|
|
1671
1769
|
var instanceId,
|
|
@@ -1674,7 +1772,7 @@ var fetchEDRCollectionDetails = /*#__PURE__*/function () {
|
|
|
1674
1772
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1675
1773
|
case 0:
|
|
1676
1774
|
instanceId = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : '';
|
|
1677
|
-
return _context3.abrupt("return", fetch(joinUrlParams([edrBaseUrlWithCollection, instanceId])).then(handleResponse));
|
|
1775
|
+
return _context3.abrupt("return", fetch(withJsonFormat(joinUrlParams([edrBaseUrlWithCollection, instanceId]))).then(handleResponse));
|
|
1678
1776
|
case 2:
|
|
1679
1777
|
case "end":
|
|
1680
1778
|
return _context3.stop();
|
|
@@ -10496,12 +10594,6 @@ var fakeEdrLayerApiHandlers = [http.get('https://gw-edr.pub.knmi.cloud/edr/colle
|
|
|
10496
10594
|
});
|
|
10497
10595
|
})];
|
|
10498
10596
|
|
|
10499
|
-
var WEBMAP_REACT_NAMESPACE = 'webmapreact';
|
|
10500
|
-
var useWebmapReactTranslation = function useWebmapReactTranslation() {
|
|
10501
|
-
var ns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : WEBMAP_REACT_NAMESPACE;
|
|
10502
|
-
return useTranslation(ns);
|
|
10503
|
-
};
|
|
10504
|
-
|
|
10505
10597
|
var defaultCanvasWidth = 150;
|
|
10506
10598
|
var defaultCanvasHeight = 30;
|
|
10507
10599
|
/**
|
|
@@ -10534,7 +10626,8 @@ var renderLegendGraphic = function renderLegendGraphic(wmImage, ctx, width, heig
|
|
|
10534
10626
|
};
|
|
10535
10627
|
var Legend = function Legend(_ref) {
|
|
10536
10628
|
var _layer$options;
|
|
10537
|
-
var layer = _ref.layer
|
|
10629
|
+
var layer = _ref.layer,
|
|
10630
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
10538
10631
|
/* Variable to remember the previous image */
|
|
10539
10632
|
var previousLegendImage = useRef(null);
|
|
10540
10633
|
/* Function to force rerender of this component when legend image loads */
|
|
@@ -10583,12 +10676,15 @@ var Legend = function Legend(_ref) {
|
|
|
10583
10676
|
var wmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
10584
10677
|
var isEdrLayer = layer.layerType === LayerType.edrFeatureLayer;
|
|
10585
10678
|
var title = isEdrLayer ? (_layer$options = layer.options) === null || _layer$options === void 0 ? void 0 : _layer$options.collectionId : wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title;
|
|
10679
|
+
/* Custom legend toggle for layer */
|
|
10680
|
+
var toggleLayerLegendVisibility = function toggleLayerLegendVisibility(showLegend) {
|
|
10681
|
+
return onToggleLayerLegendVisibility(layerId, showLegend);
|
|
10682
|
+
};
|
|
10586
10683
|
return jsx(LegendLayout, {
|
|
10587
|
-
dimensions: layer === null || layer === void 0 ? void 0 : layer.dimensions,
|
|
10588
10684
|
height: canvasContainerHeight,
|
|
10589
|
-
|
|
10590
|
-
name: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.name,
|
|
10685
|
+
showLayerLegend: layer === null || layer === void 0 ? void 0 : layer.showLayerLegend,
|
|
10591
10686
|
title: title,
|
|
10687
|
+
toggleLayerLegendVisibility: toggleLayerLegendVisibility,
|
|
10592
10688
|
width: canvasContainerWidth,
|
|
10593
10689
|
children: jsx(CanvasComponent, {
|
|
10594
10690
|
onRenderCanvas: function onRenderCanvas(ctx, width, height) {
|
|
@@ -10663,7 +10759,8 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
10663
10759
|
_ref$order = _ref.order,
|
|
10664
10760
|
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
10665
10761
|
_ref$source = _ref.source,
|
|
10666
|
-
source = _ref$source === void 0 ? 'app' : _ref$source
|
|
10762
|
+
source = _ref$source === void 0 ? 'app' : _ref$source,
|
|
10763
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
10667
10764
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
10668
10765
|
t = _useWebmapReactTransl.t;
|
|
10669
10766
|
var stopWheelEventPropagationRef = useWheelStopPropagation();
|
|
@@ -10692,13 +10789,18 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
10692
10789
|
sx: {
|
|
10693
10790
|
display: 'flex',
|
|
10694
10791
|
flexDirection: 'column',
|
|
10792
|
+
padding: '0 16px',
|
|
10695
10793
|
'&>div:last-child': {
|
|
10696
10794
|
marginBottom: 0
|
|
10795
|
+
},
|
|
10796
|
+
'&>div:first-child': {
|
|
10797
|
+
marginTop: '8px'
|
|
10697
10798
|
}
|
|
10698
10799
|
},
|
|
10699
10800
|
children: layers.map(function (layer) {
|
|
10700
10801
|
return jsx(Legend, {
|
|
10701
|
-
layer: layer
|
|
10802
|
+
layer: layer,
|
|
10803
|
+
onToggleLayerLegendVisibility: onToggleLayerLegendVisibility
|
|
10702
10804
|
}, layer.id);
|
|
10703
10805
|
})
|
|
10704
10806
|
}) : jsx(Typography, {
|
|
@@ -11261,19 +11363,36 @@ var LayerInfoText = function LayerInfoText(_ref) {
|
|
|
11261
11363
|
|
|
11262
11364
|
var LayerInfoLegend = function LayerInfoLegend(_ref) {
|
|
11263
11365
|
var title = _ref.title,
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11366
|
+
legendURL = _ref.legendURL,
|
|
11367
|
+
showLayerLegend = _ref.showLayerLegend,
|
|
11368
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
11267
11369
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
11268
11370
|
t = _useWebmapReactTransl.t;
|
|
11269
11371
|
return jsxs(Fragment, {
|
|
11270
|
-
children: [
|
|
11271
|
-
sx:
|
|
11272
|
-
|
|
11273
|
-
|
|
11372
|
+
children: [jsxs(Box, {
|
|
11373
|
+
sx: {
|
|
11374
|
+
display: 'flex',
|
|
11375
|
+
justifyContent: 'space-between',
|
|
11376
|
+
alignItems: 'center',
|
|
11377
|
+
width: '100%'
|
|
11378
|
+
},
|
|
11379
|
+
children: [jsx(Typography$1, {
|
|
11380
|
+
sx: textStyleWithMargin,
|
|
11381
|
+
variant: "subtitle2",
|
|
11382
|
+
children: t('webmap-react-legend')
|
|
11383
|
+
}), jsx(FormGroup, {
|
|
11384
|
+
children: jsx(FormControlLabel, {
|
|
11385
|
+
control: jsx(Checkbox, {
|
|
11386
|
+
checked: showLayerLegend,
|
|
11387
|
+
onChange: function onChange() {
|
|
11388
|
+
onToggleLayerLegendVisibility(!showLayerLegend);
|
|
11389
|
+
}
|
|
11390
|
+
}),
|
|
11391
|
+
label: t('webmap-react-show-layer-legend'),
|
|
11392
|
+
sx: textStyleWithMargin
|
|
11393
|
+
})
|
|
11394
|
+
})]
|
|
11274
11395
|
}), jsx(LegendLayout, {
|
|
11275
|
-
dimensions: dimensions,
|
|
11276
|
-
name: name,
|
|
11277
11396
|
title: title,
|
|
11278
11397
|
children: legendURL ? jsx("img", {
|
|
11279
11398
|
alt: title,
|
|
@@ -11437,7 +11556,9 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11437
11556
|
top: 150,
|
|
11438
11557
|
left: 900
|
|
11439
11558
|
} : _ref$startPosition,
|
|
11440
|
-
selectedStyle = _ref.selectedStyle
|
|
11559
|
+
selectedStyle = _ref.selectedStyle,
|
|
11560
|
+
showLayerLegend = _ref.showLayerLegend,
|
|
11561
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
11441
11562
|
var styles = getLayerStyles(layer);
|
|
11442
11563
|
var dimensions = getDimensionsList(layer.dimensions);
|
|
11443
11564
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
@@ -11445,7 +11566,7 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11445
11566
|
var bbox = getLayerBbox(t, layer);
|
|
11446
11567
|
var legendURL = ((_layer$styles = layer.styles) === null || _layer$styles === void 0 || (_layer$styles = _layer$styles.find(function (styleItem) {
|
|
11447
11568
|
return styleItem.name === selectedStyle;
|
|
11448
|
-
})) === null || _layer$styles === void 0 ? void 0 : _layer$styles.legendURL) || ((_layer$styles2 = layer.styles) === null || _layer$styles2 === void 0 ? void 0 : _layer$styles2
|
|
11569
|
+
})) === null || _layer$styles === void 0 ? void 0 : _layer$styles.legendURL) || ((_layer$styles2 = layer.styles) === null || _layer$styles2 === void 0 || (_layer$styles2 = _layer$styles2[0]) === null || _layer$styles2 === void 0 ? void 0 : _layer$styles2.legendURL) ||
|
|
11449
11570
|
// show first style if none selected
|
|
11450
11571
|
undefined;
|
|
11451
11572
|
return jsx(ToolContainerDraggable, {
|
|
@@ -11495,9 +11616,9 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11495
11616
|
label: t('webmap-react-keywords'),
|
|
11496
11617
|
value: ((_layer$keywords = layer.keywords) === null || _layer$keywords === void 0 ? void 0 : _layer$keywords.join(', ')) || '-'
|
|
11497
11618
|
}), jsx(LayerInfoLegend, {
|
|
11498
|
-
dimensions: layer.dimensions,
|
|
11499
11619
|
legendURL: legendURL,
|
|
11500
|
-
|
|
11620
|
+
onToggleLayerLegendVisibility: onToggleLayerLegendVisibility,
|
|
11621
|
+
showLayerLegend: showLayerLegend,
|
|
11501
11622
|
title: layer.title
|
|
11502
11623
|
})]
|
|
11503
11624
|
})
|
|
@@ -11629,7 +11750,7 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11629
11750
|
sx: {
|
|
11630
11751
|
zIndex: 10,
|
|
11631
11752
|
justifySelf: 'center',
|
|
11632
|
-
bottom: '
|
|
11753
|
+
bottom: '26px',
|
|
11633
11754
|
left: '6px',
|
|
11634
11755
|
position: 'absolute'
|
|
11635
11756
|
},
|
|
@@ -12771,12 +12892,13 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12771
12892
|
}
|
|
12772
12893
|
var itemWidth = Math.round(1000 / timeStepsToCheck.length);
|
|
12773
12894
|
return timeStepsToCheck.map(function (timeStep, index) {
|
|
12774
|
-
var _layer$getSource;
|
|
12895
|
+
var _layer$getSource, _layer$getSource2;
|
|
12775
12896
|
var closestValue = (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.getClosestValueForTime(timeStep)) || '';
|
|
12776
12897
|
var requestedStepIsOutsideRange = WMInvalidDateValues.has(closestValue);
|
|
12777
|
-
var
|
|
12898
|
+
var images = (layer === null || layer === void 0 || (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 ? void 0 : _layer$getSource.getAltGeoReferencedImages(closestValue)) || [];
|
|
12778
12899
|
var isSelectedStep = visible && (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.currentValue) === closestValue;
|
|
12779
|
-
var
|
|
12900
|
+
var colorImageIsLoading = layer !== null && layer !== void 0 && (_layer$getSource2 = layer.getSource()) !== null && _layer$getSource2 !== void 0 && _layer$getSource2.hasImageLoadedForTimeValue(closestValue) ? '#40AF50' : '#666666';
|
|
12901
|
+
var colorImageIsAvailable = (images === null || images === void 0 ? void 0 : images.length) > 0 ? colorImageIsLoading : '#FF0000';
|
|
12780
12902
|
var colorLayerIsOutsideRange = requestedStepIsOutsideRange ? '#5080FA' : colorImageIsAvailable;
|
|
12781
12903
|
var height = requestedStepIsOutsideRange ? '15px' : '20px';
|
|
12782
12904
|
var top = requestedStepIsOutsideRange ? '5px' : '2px';
|
|
@@ -12885,7 +13007,8 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
12885
13007
|
layerOptions = _ref.layerOptions,
|
|
12886
13008
|
styleName = _ref.styleName,
|
|
12887
13009
|
layerName = _ref.layerName,
|
|
12888
|
-
dimensions = _ref.dimensions,
|
|
13010
|
+
_ref$dimensions = _ref.dimensions,
|
|
13011
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
12889
13012
|
debugMode = _ref.debugMode,
|
|
12890
13013
|
_ref$visible = _ref.visible,
|
|
12891
13014
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
@@ -13861,7 +13984,8 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
13861
13984
|
style = _ref.style,
|
|
13862
13985
|
zIndex = _ref.zIndex,
|
|
13863
13986
|
opacity = _ref.opacity,
|
|
13864
|
-
dimensions = _ref.dimensions,
|
|
13987
|
+
_ref$dimensions = _ref.dimensions,
|
|
13988
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
13865
13989
|
layerId = _ref.layerId,
|
|
13866
13990
|
_ref$visible = _ref.visible,
|
|
13867
13991
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
@@ -14255,7 +14379,8 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14255
14379
|
_ref.style;
|
|
14256
14380
|
var zIndex = _ref.zIndex,
|
|
14257
14381
|
opacity = _ref.opacity,
|
|
14258
|
-
dimensions = _ref.dimensions,
|
|
14382
|
+
_ref$dimensions = _ref.dimensions,
|
|
14383
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
14259
14384
|
layerId = _ref.layerId,
|
|
14260
14385
|
_ref$visible = _ref.visible,
|
|
14261
14386
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
@@ -14347,7 +14472,8 @@ var registerProjection = function registerProjection(wkt2) {
|
|
|
14347
14472
|
var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
14348
14473
|
var getCapsURL = _ref.getCapsURL,
|
|
14349
14474
|
layerName = _ref.layerName,
|
|
14350
|
-
dimensions = _ref.dimensions,
|
|
14475
|
+
_ref$dimensions = _ref.dimensions,
|
|
14476
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
14351
14477
|
layerOptions = _ref.layerOptions,
|
|
14352
14478
|
layerId = _ref.layerId,
|
|
14353
14479
|
onInitializeLayer = _ref.onInitializeLayer,
|
|
@@ -16357,6 +16483,7 @@ var drawStyles = {
|
|
|
16357
16483
|
POINT: pointFeatureStyle,
|
|
16358
16484
|
MULTIPOINT: pointFeatureStyle,
|
|
16359
16485
|
LOCATION: locationFeatureStyle,
|
|
16486
|
+
ROTATABLEBOX: drawPolygonLikeFeatureStyle,
|
|
16360
16487
|
DELETE: [],
|
|
16361
16488
|
'': []
|
|
16362
16489
|
};
|
|
@@ -16372,6 +16499,7 @@ var modifyStyles = {
|
|
|
16372
16499
|
POINT: modifyPointFeatureStyle,
|
|
16373
16500
|
MULTIPOINT: modifyPointFeatureStyle,
|
|
16374
16501
|
LOCATION: locationFeatureStyle,
|
|
16502
|
+
ROTATABLEBOX: boxModificationStyle,
|
|
16375
16503
|
DELETE: [],
|
|
16376
16504
|
'': []
|
|
16377
16505
|
};
|
|
@@ -16406,6 +16534,7 @@ var DRAWMODE;
|
|
|
16406
16534
|
DRAWMODE["OVAL"] = "OVAL";
|
|
16407
16535
|
DRAWMODE["LOCATION"] = "LOCATION";
|
|
16408
16536
|
DRAWMODE["FREEHANDLINE"] = "FREEHANDLINE";
|
|
16537
|
+
DRAWMODE["ROTATABLEBOX"] = "ROTATABLEBOX";
|
|
16409
16538
|
})(DRAWMODE || (DRAWMODE = {}));
|
|
16410
16539
|
|
|
16411
16540
|
var createDrawOperation = function createDrawOperation(type) {
|
|
@@ -16425,6 +16554,7 @@ var createDrawOperation = function createDrawOperation(type) {
|
|
|
16425
16554
|
geometryFunction: createRegularPolygon(4)
|
|
16426
16555
|
};
|
|
16427
16556
|
case 'BOX':
|
|
16557
|
+
case 'ROTATABLEBOX':
|
|
16428
16558
|
return {
|
|
16429
16559
|
type: 'Circle',
|
|
16430
16560
|
geometryFunction: createBox()
|
|
@@ -16469,6 +16599,8 @@ var selectionTypeToDrawModeValue = function selectionTypeToDrawModeValue(selecti
|
|
|
16469
16599
|
return DRAWMODE.SQUARE;
|
|
16470
16600
|
case 'box':
|
|
16471
16601
|
return DRAWMODE.BOX;
|
|
16602
|
+
case 'rotatable-box':
|
|
16603
|
+
return DRAWMODE.ROTATABLEBOX;
|
|
16472
16604
|
case 'oval':
|
|
16473
16605
|
return DRAWMODE.OVAL;
|
|
16474
16606
|
case 'point':
|
|
@@ -16679,7 +16811,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16679
16811
|
var handlePoints = getBoxRotateHandlePoints(featureToRotate, resolution);
|
|
16680
16812
|
var prevIndex = featureToRotate.get('activeRotateHandleIndex');
|
|
16681
16813
|
var newIndex;
|
|
16682
|
-
if (!handlePoints || !resolution) {
|
|
16814
|
+
if (!handlePoints || !resolution || !isBoxOrSquareRotatable) {
|
|
16683
16815
|
newIndex = undefined;
|
|
16684
16816
|
} else {
|
|
16685
16817
|
var coord = map.getEventCoordinate(event);
|
|
@@ -16722,7 +16854,8 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16722
16854
|
};
|
|
16723
16855
|
window.addEventListener('keydown', deleteVertexOnDeleteKey);
|
|
16724
16856
|
var isSquare = actualDrawMode === DRAWMODE.SQUARE;
|
|
16725
|
-
var
|
|
16857
|
+
var isBoxOrSquareRotatable = actualDrawMode === DRAWMODE.ROTATABLEBOX || isSquare;
|
|
16858
|
+
var isBoxOrSquare = actualDrawMode === DRAWMODE.BOX || isBoxOrSquareRotatable;
|
|
16726
16859
|
// Modifying is a combination of Modify and Translate interactions
|
|
16727
16860
|
var modify = new Modify({
|
|
16728
16861
|
features: editFeatureCollection,
|
|
@@ -16838,7 +16971,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16838
16971
|
isPointerDownNearCorner = false;
|
|
16839
16972
|
};
|
|
16840
16973
|
var startRotateIfOnHandle = function startRotateIfOnHandle(event) {
|
|
16841
|
-
if (!
|
|
16974
|
+
if (!isBoxOrSquareRotatable || !selectedFeatureHasGeometry) {
|
|
16842
16975
|
return;
|
|
16843
16976
|
}
|
|
16844
16977
|
var featureToRotate = editFeatureCollection.item(0);
|
|
@@ -17099,6 +17232,7 @@ var getIcon = function getIcon(selectionType) {
|
|
|
17099
17232
|
case 'poly':
|
|
17100
17233
|
return jsx(DrawToolPolygon, {});
|
|
17101
17234
|
case 'box':
|
|
17235
|
+
case 'rotatable-box':
|
|
17102
17236
|
return jsx(DrawToolRectangle, {});
|
|
17103
17237
|
case 'linestring':
|
|
17104
17238
|
return jsx(DrawToolLineString, {});
|
|
@@ -17208,8 +17342,16 @@ var defaultSmoothLine = {
|
|
|
17208
17342
|
isSelectable: true,
|
|
17209
17343
|
selectionType: 'smooth-line'
|
|
17210
17344
|
};
|
|
17211
|
-
var
|
|
17212
|
-
|
|
17345
|
+
var defaultRotatableBox = {
|
|
17346
|
+
drawModeId: 'drawtools-rotatable-box',
|
|
17347
|
+
value: DRAWMODE.ROTATABLEBOX,
|
|
17348
|
+
title: "".concat(WEBMAP_REACT_NAMESPACE, ":webmap-react-rotatable-box"),
|
|
17349
|
+
shape: emptyPolygon,
|
|
17350
|
+
isSelectable: true,
|
|
17351
|
+
selectionType: 'rotatable-box'
|
|
17352
|
+
};
|
|
17353
|
+
var defaultModes = [defaultPolygon, defaultLineString, defaultFreehandLine, defaultOval, defaultCircle, defaultBox, defaultSquare, defaultPoint, defaultLocation, defaultDelete, defaultRotatableBox];
|
|
17354
|
+
var currentlySupportedDrawModes = [defaultPolygon, defaultLineString, defaultFreehandLine, defaultCircle, defaultSquare, defaultPoint, defaultDelete, defaultSmoothLine, defaultOval, defaultBox, defaultLocation, defaultRotatableBox];
|
|
17213
17355
|
var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
17214
17356
|
var _ref$defaultDrawModes = _ref.defaultDrawModes,
|
|
17215
17357
|
defaultDrawModes = _ref$defaultDrawModes === void 0 ? defaultModes : _ref$defaultDrawModes,
|
|
@@ -19047,84 +19189,124 @@ var dateToManualFormatString = function dateToManualFormatString(inDate) {
|
|
|
19047
19189
|
return "".concat(EEE, " ").concat(dd, " ").concat(MMM, " ").concat(HH, ":").concat(mm, " UTC");
|
|
19048
19190
|
};
|
|
19049
19191
|
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
|
|
19053
|
-
|
|
19054
|
-
|
|
19055
|
-
|
|
19056
|
-
|
|
19192
|
+
var getButtonSizes = function getButtonSizes(fontSize) {
|
|
19193
|
+
if (fontSize > 40) {
|
|
19194
|
+
return {
|
|
19195
|
+
buttonSize: 'large',
|
|
19196
|
+
iconSize: 40
|
|
19197
|
+
};
|
|
19198
|
+
}
|
|
19199
|
+
if (fontSize > 24) {
|
|
19200
|
+
return {
|
|
19201
|
+
buttonSize: 'medium',
|
|
19202
|
+
iconSize: 32
|
|
19203
|
+
};
|
|
19204
|
+
}
|
|
19205
|
+
return {
|
|
19206
|
+
buttonSize: 'small',
|
|
19207
|
+
iconSize: 24
|
|
19208
|
+
};
|
|
19209
|
+
};
|
|
19057
19210
|
var ClockContainer = function ClockContainer(_ref) {
|
|
19058
|
-
var
|
|
19059
|
-
|
|
19060
|
-
|
|
19211
|
+
var _ref$isOptionsMenuVis = _ref.isOptionsMenuVisible,
|
|
19212
|
+
isOptionsMenuVisible = _ref$isOptionsMenuVis === void 0 ? false : _ref$isOptionsMenuVis,
|
|
19213
|
+
fontSize = _ref.fontSize,
|
|
19214
|
+
onToggleClock = _ref.onToggleClock,
|
|
19215
|
+
time = _ref.time,
|
|
19216
|
+
onToggleOptions = _ref.onToggleOptions,
|
|
19217
|
+
optionsElement = _ref.optionsElement;
|
|
19061
19218
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
19062
19219
|
t = _useWebmapReactTransl.t;
|
|
19063
19220
|
var title = t('clock-hide');
|
|
19221
|
+
var optionsTitle = t('clock-animation-options');
|
|
19064
19222
|
var currentDateString = dateToManualFormatString(dateUtils.fromUnix(time));
|
|
19065
|
-
|
|
19066
|
-
|
|
19067
|
-
|
|
19068
|
-
|
|
19069
|
-
|
|
19070
|
-
|
|
19071
|
-
|
|
19072
|
-
width: '100%',
|
|
19073
|
-
backgroundColor: 'geowebColors.timeSlider.playerTimeMarkers.fill',
|
|
19074
|
-
borderRadius: '5px'
|
|
19075
|
-
},
|
|
19076
|
-
wrap: "nowrap",
|
|
19077
|
-
children: [jsx(Grid, {
|
|
19223
|
+
var _getButtonSizes = getButtonSizes(fontSize),
|
|
19224
|
+
buttonSize = _getButtonSizes.buttonSize,
|
|
19225
|
+
iconSize = _getButtonSizes.iconSize;
|
|
19226
|
+
return jsx(ThemeProvider, {
|
|
19227
|
+
theme: darkTheme,
|
|
19228
|
+
children: jsxs(Grid, {
|
|
19229
|
+
container: true,
|
|
19078
19230
|
sx: {
|
|
19079
|
-
|
|
19080
|
-
|
|
19081
|
-
|
|
19082
|
-
|
|
19083
|
-
|
|
19231
|
+
justifyContent: 'space-evenly',
|
|
19232
|
+
alignItems: 'center',
|
|
19233
|
+
cursor: 'move',
|
|
19234
|
+
height: '100%',
|
|
19235
|
+
width: '100%',
|
|
19236
|
+
backgroundColor: 'geowebColors.timeSlider.playerTimeMarkers.fill',
|
|
19237
|
+
borderRadius: '5px'
|
|
19238
|
+
},
|
|
19239
|
+
wrap: "nowrap",
|
|
19240
|
+
children: [jsx(Grid, {
|
|
19084
19241
|
sx: {
|
|
19085
|
-
|
|
19242
|
+
marginLeft: '12px',
|
|
19243
|
+
marginRight: '12px'
|
|
19086
19244
|
},
|
|
19087
|
-
children: jsx(
|
|
19088
|
-
|
|
19089
|
-
|
|
19090
|
-
|
|
19091
|
-
|
|
19092
|
-
|
|
19093
|
-
|
|
19245
|
+
children: jsx(CustomIconButton, {
|
|
19246
|
+
"aria-label": title,
|
|
19247
|
+
onClick: onToggleClock,
|
|
19248
|
+
size: buttonSize,
|
|
19249
|
+
tooltipTitle: title,
|
|
19250
|
+
variant: "boxed",
|
|
19251
|
+
children: jsx(ChevronRight, {
|
|
19252
|
+
sx: {
|
|
19253
|
+
width: iconSize,
|
|
19254
|
+
height: iconSize
|
|
19255
|
+
}
|
|
19094
19256
|
})
|
|
19095
19257
|
})
|
|
19096
|
-
})
|
|
19097
|
-
|
|
19098
|
-
|
|
19258
|
+
}), jsx(Grid, {
|
|
19259
|
+
children: jsx(Typography, {
|
|
19260
|
+
sx: {
|
|
19261
|
+
whiteSpace: 'nowrap',
|
|
19262
|
+
fontSize: fontSize,
|
|
19263
|
+
color: 'geowebColors.timeSlider.playerTimeText.color'
|
|
19264
|
+
},
|
|
19265
|
+
variant: "subtitle2",
|
|
19266
|
+
children: currentDateString
|
|
19267
|
+
})
|
|
19268
|
+
}), jsx(Grid, {
|
|
19099
19269
|
sx: {
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
color: '#fff'
|
|
19270
|
+
marginLeft: '12px',
|
|
19271
|
+
marginRight: '12px'
|
|
19103
19272
|
},
|
|
19104
|
-
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19273
|
+
children: jsx(CustomIconButton, {
|
|
19274
|
+
"aria-label": optionsTitle,
|
|
19275
|
+
isSelected: isOptionsMenuVisible,
|
|
19276
|
+
onClick: onToggleOptions,
|
|
19277
|
+
ref: optionsElement,
|
|
19278
|
+
size: buttonSize,
|
|
19279
|
+
tooltipTitle: optionsTitle,
|
|
19280
|
+
variant: "boxed",
|
|
19281
|
+
children: jsx(Options, {
|
|
19282
|
+
sx: {
|
|
19283
|
+
width: iconSize,
|
|
19284
|
+
height: iconSize
|
|
19285
|
+
}
|
|
19286
|
+
})
|
|
19287
|
+
})
|
|
19288
|
+
})]
|
|
19289
|
+
})
|
|
19108
19290
|
});
|
|
19109
19291
|
};
|
|
19110
19292
|
|
|
19111
|
-
var MIN_WIDTH =
|
|
19293
|
+
var MIN_WIDTH = 240;
|
|
19112
19294
|
var MIN_HEIGHT = 32;
|
|
19113
19295
|
var MIN_FONT_SIZE = 14; // bigger font size will cause render delay in LCP
|
|
19114
19296
|
var FONT_SIZE_WIDTH_RATIO = MIN_FONT_SIZE / MIN_WIDTH;
|
|
19115
|
-
var BUTTON_WIDTH = 40;
|
|
19116
19297
|
var resizeHandlePlacement = {
|
|
19117
19298
|
top: false,
|
|
19118
19299
|
right: false,
|
|
19119
19300
|
bottom: false,
|
|
19120
19301
|
left: false,
|
|
19121
|
-
topRight:
|
|
19122
|
-
bottomRight:
|
|
19302
|
+
topRight: true,
|
|
19303
|
+
bottomRight: true,
|
|
19123
19304
|
bottomLeft: true,
|
|
19124
|
-
topLeft:
|
|
19305
|
+
topLeft: true
|
|
19125
19306
|
};
|
|
19126
19307
|
var Clock = function Clock(_ref2) {
|
|
19127
|
-
var
|
|
19308
|
+
var optionsElement = _ref2.optionsElement,
|
|
19309
|
+
time = _ref2.time,
|
|
19128
19310
|
_ref2$isVisible = _ref2.isVisible,
|
|
19129
19311
|
isClockVisible = _ref2$isVisible === void 0 ? true : _ref2$isVisible,
|
|
19130
19312
|
onToggleClock = _ref2.onToggleClock,
|
|
@@ -19139,7 +19321,10 @@ var Clock = function Clock(_ref2) {
|
|
|
19139
19321
|
width: MIN_WIDTH,
|
|
19140
19322
|
height: MIN_HEIGHT
|
|
19141
19323
|
} : _ref2$size,
|
|
19142
|
-
onSetSize = _ref2.onSetSize
|
|
19324
|
+
onSetSize = _ref2.onSetSize,
|
|
19325
|
+
onToggleOptions = _ref2.onToggleOptions,
|
|
19326
|
+
_ref2$isOptionsMenuVi = _ref2.isOptionsMenuVisible,
|
|
19327
|
+
isOptionsMenuVisible = _ref2$isOptionsMenuVi === void 0 ? false : _ref2$isOptionsMenuVi;
|
|
19143
19328
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
19144
19329
|
t = _useWebmapReactTransl.t;
|
|
19145
19330
|
var clockElement = useRef(null);
|
|
@@ -19163,6 +19348,9 @@ var Clock = function Clock(_ref2) {
|
|
|
19163
19348
|
var setSize = function setSize(size) {
|
|
19164
19349
|
onSetSize === null || onSetSize === void 0 || onSetSize(size);
|
|
19165
19350
|
};
|
|
19351
|
+
var toggleOptions = function toggleOptions() {
|
|
19352
|
+
onToggleOptions === null || onToggleOptions === void 0 || onToggleOptions();
|
|
19353
|
+
};
|
|
19166
19354
|
return jsx(Fragment, {
|
|
19167
19355
|
children: !isClockVisible ? jsx(CustomIconButton, {
|
|
19168
19356
|
"aria-label": t('clock-show'),
|
|
@@ -19190,9 +19378,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19190
19378
|
},
|
|
19191
19379
|
position: position,
|
|
19192
19380
|
children: jsx("div", {
|
|
19193
|
-
ref:
|
|
19194
|
-
clockElement.current = _ref3;
|
|
19195
|
-
},
|
|
19381
|
+
ref: clockElement,
|
|
19196
19382
|
style: {
|
|
19197
19383
|
position: 'absolute',
|
|
19198
19384
|
zIndex: 1001,
|
|
@@ -19201,17 +19387,9 @@ var Clock = function Clock(_ref2) {
|
|
|
19201
19387
|
},
|
|
19202
19388
|
children: jsx(Resizable, {
|
|
19203
19389
|
enable: resizeHandlePlacement,
|
|
19204
|
-
handleComponent: {
|
|
19205
|
-
bottomLeft: jsx(Resize, {
|
|
19206
|
-
isRightAligned: true,
|
|
19207
|
-
style: {
|
|
19208
|
-
fill: '#FFFFFF'
|
|
19209
|
-
}
|
|
19210
|
-
})
|
|
19211
|
-
},
|
|
19212
19390
|
lockAspectRatio: true,
|
|
19213
19391
|
minHeight: MIN_HEIGHT,
|
|
19214
|
-
minWidth: MIN_WIDTH
|
|
19392
|
+
minWidth: MIN_WIDTH,
|
|
19215
19393
|
nodeRef: clockElement,
|
|
19216
19394
|
onResize: function onResize(_event, _direction, _ref, delta) {
|
|
19217
19395
|
var width = size.width + delta.width;
|
|
@@ -19235,9 +19413,12 @@ var Clock = function Clock(_ref2) {
|
|
|
19235
19413
|
size: size,
|
|
19236
19414
|
children: jsx(ClockContainer, {
|
|
19237
19415
|
fontSize: fontSize,
|
|
19238
|
-
|
|
19416
|
+
isOptionsMenuVisible: isOptionsMenuVisible,
|
|
19417
|
+
onToggleClock: function onToggleClock() {
|
|
19239
19418
|
toggleClock(false);
|
|
19240
19419
|
},
|
|
19420
|
+
onToggleOptions: toggleOptions,
|
|
19421
|
+
optionsElement: optionsElement,
|
|
19241
19422
|
time: time
|
|
19242
19423
|
})
|
|
19243
19424
|
})
|
|
@@ -19322,4 +19503,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
|
|
|
19322
19503
|
return updateObject;
|
|
19323
19504
|
};
|
|
19324
19505
|
|
|
19325
|
-
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultSmoothLine, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, fakeEdrLayerApiHandlers, featureMultiPoint, featurePoint, featurePolygon, fetchStacCollection, fetchStacItem, fetchStacItems, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getBoxRotateHandlePoints, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isPointFeatureCollection, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, rewindGeometry, roundCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useFetchGeoTIFFBlob, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCollection, useStacItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|
|
19506
|
+
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, fakeEdrLayerApiHandlers, featureMultiPoint, featurePoint, featurePolygon, fetchStacCollection, fetchStacItem, fetchStacItems, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getBoxRotateHandlePoints, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isPointFeatureCollection, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, rewindGeometry, roundCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useFetchGeoTIFFBlob, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCollection, useStacItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/webmap": "
|
|
12
|
-
"@opengeoweb/theme": "
|
|
13
|
-
"@opengeoweb/shared": "
|
|
11
|
+
"@opengeoweb/webmap": "16.0.0",
|
|
12
|
+
"@opengeoweb/theme": "16.0.0",
|
|
13
|
+
"@opengeoweb/shared": "16.0.0",
|
|
14
14
|
"lodash": "^4.17.21",
|
|
15
15
|
"ol": "^10.4.0",
|
|
16
16
|
"proj4": "^2.9.2",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
export declare const MIN_WIDTH =
|
|
1
|
+
import type { FC, Ref } from 'react';
|
|
2
|
+
export declare const MIN_WIDTH = 240;
|
|
3
3
|
export declare const MIN_HEIGHT = 32;
|
|
4
4
|
export interface Position {
|
|
5
5
|
x: number;
|
|
@@ -10,6 +10,7 @@ export interface Size {
|
|
|
10
10
|
height: number;
|
|
11
11
|
}
|
|
12
12
|
export declare const Clock: FC<{
|
|
13
|
+
optionsElement: Ref<HTMLButtonElement>;
|
|
13
14
|
time: number;
|
|
14
15
|
isVisible?: boolean;
|
|
15
16
|
onToggleClock?: (isVisible: boolean) => void;
|
|
@@ -17,4 +18,6 @@ export declare const Clock: FC<{
|
|
|
17
18
|
onSetPosition: (position: Position) => void;
|
|
18
19
|
size?: Size | undefined;
|
|
19
20
|
onSetSize: (size: Size) => void;
|
|
21
|
+
onToggleOptions?: () => void;
|
|
22
|
+
isOptionsMenuVisible?: boolean;
|
|
20
23
|
}>;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import type { FC } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Format a date to a string
|
|
4
|
-
*
|
|
5
|
-
* Expects the following props:
|
|
6
|
-
* @param {Date} inDate - date to be formatted
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
1
|
+
import type { FC, Ref } from 'react';
|
|
9
2
|
export declare const ClockContainer: FC<{
|
|
10
|
-
|
|
3
|
+
isOptionsMenuVisible?: boolean;
|
|
4
|
+
onToggleClock: () => void;
|
|
5
|
+
onToggleOptions: () => void;
|
|
6
|
+
optionsElement: Ref<HTMLButtonElement>;
|
|
11
7
|
fontSize: number;
|
|
12
8
|
time: number;
|
|
13
9
|
}>;
|
|
@@ -12,5 +12,7 @@ export interface LayerInfoDialogProps {
|
|
|
12
12
|
dialogHeight?: number;
|
|
13
13
|
startPosition?: Position;
|
|
14
14
|
selectedStyle?: string;
|
|
15
|
+
showLayerLegend: boolean;
|
|
16
|
+
onToggleLayerLegendVisibility: (showLegend: boolean) => void;
|
|
15
17
|
}
|
|
16
18
|
export declare const LayerInfoDialog: React.FC<LayerInfoDialogProps>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Dimension } from '@opengeoweb/webmap';
|
|
2
1
|
export interface LayerInfoLegendProps {
|
|
3
2
|
title: string;
|
|
4
|
-
name: string;
|
|
5
|
-
dimensions: Dimension[];
|
|
6
3
|
legendURL?: string;
|
|
4
|
+
showLayerLegend: boolean;
|
|
5
|
+
onToggleLayerLegendVisibility: (showLegend: boolean) => void;
|
|
7
6
|
}
|
|
8
7
|
export declare const LayerInfoLegend: React.FC<LayerInfoLegendProps>;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { LayerFoundation } from '@opengeoweb/webmap';
|
|
3
3
|
interface LegendProps {
|
|
4
4
|
layer: LayerFoundation;
|
|
5
|
+
onToggleLayerLegendVisibility: (layerId: string, showLegend: boolean) => void;
|
|
5
6
|
}
|
|
6
7
|
export declare const Legend: React.FC<LegendProps>;
|
|
7
8
|
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type { Dimension } from '@opengeoweb/webmap';
|
|
2
1
|
interface LegendLayoutProps {
|
|
3
2
|
title: string;
|
|
4
|
-
name: string;
|
|
5
|
-
dimensions: Dimension[];
|
|
6
3
|
children: React.ReactNode;
|
|
7
4
|
height?: number;
|
|
8
5
|
width?: number;
|
|
9
|
-
|
|
6
|
+
showLayerLegend?: boolean;
|
|
7
|
+
toggleLayerLegendVisibility?: (showLegend: boolean) => void;
|
|
10
8
|
}
|
|
11
9
|
export declare const LegendLayout: React.FC<LegendLayoutProps>;
|
|
12
10
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { OpenLayersMapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof OpenLayersMapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof OpenLayersMapView>;
|
|
6
|
+
export declare const MapViewNoTimeDim: Story;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './OpenLayersMapDraw';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export { useMapDrawTool, defaultPoint, defaultDelete, defaultPolygon, defaultBox, defaultLocation, defaultIntersectionStyleProperties, defaultSmoothLine, defaultCircle, defaultFreehandLine, defaultLineString, defaultOval, defaultSquare, getIcon, currentlySupportedDrawModes, defaultModes, } from './useMapDrawTool';
|
|
3
|
+
export { useMapDrawTool, defaultPoint, defaultDelete, defaultPolygon, defaultBox, defaultLocation, defaultIntersectionStyleProperties, defaultSmoothLine, defaultCircle, defaultFreehandLine, defaultLineString, defaultOval, defaultSquare, defaultRotatableBox, getIcon, currentlySupportedDrawModes, defaultModes, } from './useMapDrawTool';
|
|
4
4
|
export type { MapDrawToolOptions } from './useMapDrawTool';
|
|
5
5
|
export * from './utils';
|
|
6
6
|
export * from './storyExamplesMapDrawTool';
|
|
@@ -10,7 +10,8 @@ export declare enum DRAWMODE {
|
|
|
10
10
|
SQUARE = "SQUARE",
|
|
11
11
|
OVAL = "OVAL",
|
|
12
12
|
LOCATION = "LOCATION",
|
|
13
|
-
FREEHANDLINE = "FREEHANDLINE"
|
|
13
|
+
FREEHANDLINE = "FREEHANDLINE",
|
|
14
|
+
ROTATABLEBOX = "ROTATABLEBOX"
|
|
14
15
|
}
|
|
15
16
|
export interface FeatureEvent {
|
|
16
17
|
coordinateIndexInFeature: number;
|
|
@@ -53,6 +53,7 @@ export declare const defaultFreehandLine: DrawMode;
|
|
|
53
53
|
export declare const defaultOval: DrawMode;
|
|
54
54
|
export declare const defaultLocation: DrawMode;
|
|
55
55
|
export declare const defaultSmoothLine: DrawMode;
|
|
56
|
+
export declare const defaultRotatableBox: DrawMode;
|
|
56
57
|
export declare const defaultModes: DrawMode[];
|
|
57
58
|
export declare const currentlySupportedDrawModes: DrawMode[];
|
|
58
59
|
export declare const useMapDrawTool: ({ defaultDrawModes, shouldAllowMultipleShapes, defaultGeoJSON, defaultGeoJSONIntersection, defaultGeoJSONIntersectionBounds, defaultGeoJSONIntersectionProperties, geoJSONLayerId, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId, projection, }: MapDrawToolOptions) => MapDrawToolProps;
|
|
@@ -2,6 +2,7 @@ import type { Extent } from 'ol/extent';
|
|
|
2
2
|
import type ImageWrapper from 'ol/Image';
|
|
3
3
|
import type { Projection } from 'ol/proj';
|
|
4
4
|
import ImageSource from 'ol/source/Image';
|
|
5
|
+
import type { WMImage } from '@opengeoweb/webmap';
|
|
5
6
|
import TimeAwareImageWrapper from './TimeAwareImageWrapper';
|
|
6
7
|
export declare const initImageWrapper: () => TimeAwareImageWrapper;
|
|
7
8
|
interface TimeawareImageSourceOptions {
|
|
@@ -47,11 +48,18 @@ export declare class TimeawareImageSource extends ImageSource {
|
|
|
47
48
|
getImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection): ImageWrapper;
|
|
48
49
|
setDimProps(params: Record<string, string>): void;
|
|
49
50
|
/**
|
|
50
|
-
* Check if an image is available and loaded for requested date. Used for
|
|
51
|
+
* Check if an image is available and loaded for requested date. Used for showlayerinfo to proceed.
|
|
51
52
|
* @param isoTime
|
|
52
53
|
* @returns
|
|
53
54
|
*/
|
|
54
55
|
hasImageLoadedForTimeValue(isoTime: string): boolean;
|
|
56
|
+
getAltGeoReferencedImages(isoTime: string): WMImage[];
|
|
57
|
+
/**
|
|
58
|
+
* This function can be used to determine if the animation can proceed to the next step.
|
|
59
|
+
* @param isoTime ISO8601 string formatat like `YYYY-MM-DDTHH:MM:SSZ`
|
|
60
|
+
* @returns Only specic case it returns false: when a image is available and is loading. That means we wait till it is loaded.
|
|
61
|
+
* This function returns true if an image is not available in the store. Or true if it is available and already loaded.
|
|
62
|
+
*/
|
|
55
63
|
isImageLoadingForTimestep(isoTime: string): boolean;
|
|
56
64
|
setImageForTimeValue(timeStampsToPrefetch: string): void;
|
|
57
65
|
setStyle(styleName: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { WMJSDimension, Dimension, WMLayer } from '@opengeoweb/webmap';
|
|
2
2
|
import type { Timespan } from '../types/Timespan';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param wmTimeDim WMDimension time containing dimension values
|
|
6
|
+
* @param stepsToCheck Array with timestamps as posix timestamps to check
|
|
7
|
+
* @param isAnimating If the application is running an animation loop
|
|
8
|
+
* @returns A string list with ISO8601 values to fetch
|
|
9
|
+
*/
|
|
3
10
|
export declare const makeDimValuesToPrefetch: (wmTimeDim: WMJSDimension, stepsToCheck: number[], isAnimating: boolean) => string[];
|
|
4
11
|
export declare const extendPrefetchListWithModelRunTimeSteps: (wmLayer: WMLayer, stepsToCheck: number[]) => number[];
|
|
5
12
|
/**
|
|
@@ -10,7 +17,7 @@ export declare const extendPrefetchListWithModelRunTimeSteps: (wmLayer: WMLayer,
|
|
|
10
17
|
* @param wmLayer The layer for which we would like to do the request
|
|
11
18
|
* @returns A map which returns a key/value to use
|
|
12
19
|
*/
|
|
13
|
-
export declare const getDimensionParamsForWMS: (dimensions: Dimension[]
|
|
20
|
+
export declare const getDimensionParamsForWMS: (dimensions: Dimension[], wmLayer: WMLayer | null) => Record<string, string> | undefined;
|
|
14
21
|
/**
|
|
15
22
|
* Calculates number of timesteps for given timespan
|
|
16
23
|
* @param timespan Object of Timespan, with start/stop/end in milliseconds
|