@opengeoweb/core 6.1.0 → 7.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.
Files changed (48) hide show
  1. package/index.esm.js +472 -2732
  2. package/package.json +14 -17
  3. package/src/lib/components/FeatureInfo/GetFeatureInfoDialog.d.ts +3 -2
  4. package/src/lib/components/Legend/index.d.ts +0 -1
  5. package/src/lib/components/MapControls/index.d.ts +0 -3
  6. package/src/lib/components/MapDraw/DrawingTool/index.d.ts +1 -0
  7. package/src/lib/components/MapDraw/DrawingTool/useAreaDrawDialogAction.d.ts +10 -0
  8. package/src/lib/components/MapDraw/DrawingToolForm/DrawingToolForm.d.ts +2 -1
  9. package/src/lib/components/MapDraw/storyComponents/StoryLayout.d.ts +1 -2
  10. package/src/lib/components/MapDraw/useMapDrawTool.d.ts +1 -2
  11. package/src/lib/components/MapView/index.d.ts +0 -3
  12. package/src/lib/components/MapView/types.d.ts +1 -1
  13. package/src/lib/components/TimeSlider/TimeSliderButtons/TimeSliderMenu/TimeSliderMenu.d.ts +0 -1
  14. package/src/lib/index.d.ts +1 -6
  15. package/src/lib/storybookUtils/defaultStorySettings.d.ts +2 -1
  16. package/src/lib/utils/defaultTestSettings.d.ts +1 -2
  17. package/src/lib/components/Legend/LegendDialog.d.ts +0 -14
  18. package/src/lib/components/MapControls/MapControlButton.d.ts +0 -10
  19. package/src/lib/components/MapControls/MapControlButton.spec.d.ts +0 -1
  20. package/src/lib/components/MapControls/MapControls.d.ts +0 -7
  21. package/src/lib/components/MapControls/MapControls.spec.d.ts +0 -1
  22. package/src/lib/components/MapControls/ZoomControls.d.ts +0 -8
  23. package/src/lib/components/MapControls/ZoomControls.spec.d.ts +0 -1
  24. package/src/lib/components/MapTime/MapTime.d.ts +0 -11
  25. package/src/lib/components/MapTime/MapTime.spec.d.ts +0 -1
  26. package/src/lib/components/MapView/MapView.Error.stories.d.ts +0 -14
  27. package/src/lib/components/MapView/MapView.MapPin.stories.d.ts +0 -10
  28. package/src/lib/components/MapView/MapView.Passive.stories.d.ts +0 -10
  29. package/src/lib/components/MapView/MapView.RadarAnimation.stories.d.ts +0 -10
  30. package/src/lib/components/MapView/MapView.RadarData.stories.d.ts +0 -10
  31. package/src/lib/components/MapView/MapView.SetProjectionBBox.stories.d.ts +0 -10
  32. package/src/lib/components/MapView/MapView.SetProjectionBBoxLocalState.stories.d.ts +0 -10
  33. package/src/lib/components/MapView/MapView.ShowLayerInfo.stories.d.ts +0 -10
  34. package/src/lib/components/MapView/MapView.d.ts +0 -4
  35. package/src/lib/components/MapView/MapView.spec.d.ts +0 -1
  36. package/src/lib/components/MapView/MapViewLayer.d.ts +0 -19
  37. package/src/lib/components/ReactMapView/ReactMapView.d.ts +0 -58
  38. package/src/lib/components/ReactMapView/ReactMapView.spec.d.ts +0 -1
  39. package/src/lib/components/ReactMapView/ReactMapViewLayer.d.ts +0 -8
  40. package/src/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +0 -4
  41. package/src/lib/components/ReactMapView/ReactMapViewParseLayer.spec.d.ts +0 -1
  42. package/src/lib/components/ReactMapView/index.d.ts +0 -2
  43. package/src/lib/components/ReactMapView/types.d.ts +0 -34
  44. package/src/lib/components/ReactMapView/utils.d.ts +0 -23
  45. package/src/lib/components/ReactMapView/utils.spec.d.ts +0 -1
  46. package/src/lib/utils/publicLayers.d.ts +0 -310
  47. package/src/lib/utils/publicServices.d.ts +0 -95
  48. /package/src/lib/components/{Legend/LegendDialog.spec.d.ts → MapDraw/DrawingTool/useAreaDrawDialogAction.spec.d.ts} +0 -0
package/index.esm.js CHANGED
@@ -1,383 +1,354 @@
1
1
  import * as React from 'react';
2
- import React__default, { forwardRef, useContext, useCallback, useEffect, createElement, PureComponent, useState, cloneElement, useRef, isValidElement, createRef, useLayoutEffect } from 'react';
2
+ import React__default, { forwardRef, useContext, useCallback, useEffect, createElement, PureComponent, useState, useRef, useLayoutEffect } from 'react';
3
3
  import { Grid, Box as Box$2, MenuItem, Typography, useTheme as useTheme$2, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, Paper, List, ListItemButton, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, LinearProgress, Backdrop, ListItem, ListItemSecondaryAction, Checkbox, Switch, styled as styled$1, Slider, Menu, Card, IconButton, Select, CardContent, RadioGroup, FormControlLabel, Radio, ToggleButtonGroup, ToggleButton, Divider, Tooltip, ButtonGroup, Snackbar } from '@mui/material';
4
4
  import { CustomIconButton, TooltipSelect, AlertIcon, useControlledTooltip, CustomTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, AlertBanner, CustomAccordion, ToolContainerDraggable, calculateDialogSizeAndPosition, CustomToggleButton, SearchHighlight, dateUtils, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
5
- import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit, Close, Home, Minus, Layers, Equalizer, Link, LinkOff, AutoUpdateInActive, Speed, Clock, Now, Animation, Options, Pause, Play, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain, Location, DrawPolygon, DrawRegion, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
5
+ import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit, Close, Layers, Equalizer, Link, LinkOff, AutoUpdateInActive, Speed, Clock, Now, Animation, Options, Pause, Play, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain, Location, DrawPolygon, DrawRegion, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
6
6
  import { useDispatch, useSelector, connect, Provider } from 'react-redux';
7
- import { uiTypes, uiSelectors, uiActions, layerTypes, layerUtils, layerActions, layerSelectors, serviceSelectors, serviceActions, mapSelectors, mapActions, mapEnums, mapConstants, filterLayers, getUserAddedServices, layerSelectSelectors, layerSelectActions, storeUtils, snackbarActions, layerSelectTypes, mapUtils, genericActions, syncConstants, drawSelectors, drawActions, defaultLayers, syncGroupsSelectors, syncGroupsSelector, snackbarModuleConfig, snackbarSelectors, coreModuleConfig, routerUtils, routerModuleConfig, appModuleConfig, appActions } from '@opengeoweb/store';
7
+ import { uiTypes, uiSelectors, uiActions, layerTypes, layerUtils, layerActions, layerSelectors, serviceSelectors, serviceActions, mapSelectors, mapActions, mapEnums, mapConstants, filterLayers, getUserAddedServices, layerSelectSelectors, layerSelectActions, storeUtils, snackbarActions, layerSelectTypes, mapUtils, genericActions, syncConstants, drawActions, mapStoreActions, drawSelectors, defaultLayers, syncGroupsSelectors, syncGroupsSelector, snackbarModuleConfig, snackbarSelectors, coreModuleConfig, routerUtils, routerModuleConfig, appModuleConfig, appActions } from '@opengeoweb/store';
8
8
  import { ReactSortable } from 'react-sortablejs';
9
- import { webmapUtils, WMGetServiceFromStore, getCapabilities, LayerType, clearImageCache, WMBBOX, debug, DebugType, WMJSMap, tilesettings, WMLayer } from '@opengeoweb/webmap';
9
+ import { webmapUtils, WMGetServiceFromStore, getCapabilities, LayerType, clearImageCache, WMLayer } from '@opengeoweb/webmap';
10
10
  import { jsx } from 'react/jsx-runtime';
11
11
  import _, { isEqual as isEqual$1, debounce, groupBy, throttle as throttle$1, clamp as clamp$1, range } from 'lodash';
12
12
  import Box$3 from '@mui/material/Box';
13
13
  import Typography$1 from '@mui/material/Typography';
14
14
  import Grid$1 from '@mui/material/Grid';
15
- import { LegendLayout, CanvasComponent, MapDrawContainer, Legend, defaultStyleProperties, lineString, featurePoint, featurePolygon, emptyGeoJSON, DRAWMODE, addFeatureProperties, isGeoJSONFeatureCreatedByTool, getFeatureCollection, getGeoJson, createInterSections } from '@opengeoweb/webmap-react';
15
+ import { LegendLayout, MapControlButton, ZoomControls, CanvasComponent, MapView, MapViewLayer, LegendDialog, defaultStyleProperties, lineString, featurePoint, featurePolygon, emptyGeoJSON, DRAWMODE, addFeatureProperties, isGeoJSONFeatureCreatedByTool, getFeatureCollection, getGeoJson, createInterSections, MapControls, publicLayers } from '@opengeoweb/webmap-react';
16
16
  import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField, ReactHookFormSelect, ReactHookFormHiddenInput } from '@opengeoweb/form-fields';
17
17
  import moment from 'moment';
18
- import { findDOMNode, flushSync } from 'react-dom';
19
- import debounce$1 from 'lodash/debounce';
20
- import throttle$2 from 'lodash/throttle';
21
- import { debounce as debounce$2 } from 'throttle-debounce';
22
18
  import Draggable from 'react-draggable';
19
+ import { flushSync } from 'react-dom';
23
20
  import axios from 'axios';
24
21
  import { useDebounce } from '@opengeoweb/api';
25
22
  import { createStore } from '@redux-eggs/redux-toolkit';
26
23
  import { getSagaExtension } from '@redux-eggs/saga-extension';
27
24
 
28
- function _iterableToArrayLimit(arr, i) {
29
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
30
- if (null != _i) {
31
- var _s,
32
- _e,
33
- _x,
34
- _r,
35
- _arr = [],
36
- _n = !0,
37
- _d = !1;
25
+ function _iterableToArrayLimit(r, l) {
26
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
27
+ if (null != t) {
28
+ var e,
29
+ n,
30
+ i,
31
+ u,
32
+ a = [],
33
+ f = !0,
34
+ o = !1;
38
35
  try {
39
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
40
- if (Object(_i) !== _i) return;
41
- _n = !1;
42
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
43
- } catch (err) {
44
- _d = !0, _e = err;
36
+ if (i = (t = t.call(r)).next, 0 === l) {
37
+ if (Object(t) !== t) return;
38
+ f = !1;
39
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
40
+ } catch (r) {
41
+ o = !0, n = r;
45
42
  } finally {
46
43
  try {
47
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
44
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
48
45
  } finally {
49
- if (_d) throw _e;
46
+ if (o) throw n;
50
47
  }
51
48
  }
52
- return _arr;
49
+ return a;
53
50
  }
54
51
  }
55
52
  function _regeneratorRuntime() {
56
53
  _regeneratorRuntime = function () {
57
- return exports;
54
+ return e;
58
55
  };
59
- var exports = {},
60
- Op = Object.prototype,
61
- hasOwn = Op.hasOwnProperty,
62
- defineProperty = Object.defineProperty || function (obj, key, desc) {
63
- obj[key] = desc.value;
56
+ var t,
57
+ e = {},
58
+ r = Object.prototype,
59
+ n = r.hasOwnProperty,
60
+ o = Object.defineProperty || function (t, e, r) {
61
+ t[e] = r.value;
64
62
  },
65
- $Symbol = "function" == typeof Symbol ? Symbol : {},
66
- iteratorSymbol = $Symbol.iterator || "@@iterator",
67
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
68
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
69
- function define(obj, key, value) {
70
- return Object.defineProperty(obj, key, {
71
- value: value,
63
+ i = "function" == typeof Symbol ? Symbol : {},
64
+ a = i.iterator || "@@iterator",
65
+ c = i.asyncIterator || "@@asyncIterator",
66
+ u = i.toStringTag || "@@toStringTag";
67
+ function define(t, e, r) {
68
+ return Object.defineProperty(t, e, {
69
+ value: r,
72
70
  enumerable: !0,
73
71
  configurable: !0,
74
72
  writable: !0
75
- }), obj[key];
73
+ }), t[e];
76
74
  }
77
75
  try {
78
76
  define({}, "");
79
- } catch (err) {
80
- define = function (obj, key, value) {
81
- return obj[key] = value;
77
+ } catch (t) {
78
+ define = function (t, e, r) {
79
+ return t[e] = r;
82
80
  };
83
81
  }
84
- function wrap(innerFn, outerFn, self, tryLocsList) {
85
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
86
- generator = Object.create(protoGenerator.prototype),
87
- context = new Context(tryLocsList || []);
88
- return defineProperty(generator, "_invoke", {
89
- value: makeInvokeMethod(innerFn, self, context)
90
- }), generator;
82
+ function wrap(t, e, r, n) {
83
+ var i = e && e.prototype instanceof Generator ? e : Generator,
84
+ a = Object.create(i.prototype),
85
+ c = new Context(n || []);
86
+ return o(a, "_invoke", {
87
+ value: makeInvokeMethod(t, r, c)
88
+ }), a;
91
89
  }
92
- function tryCatch(fn, obj, arg) {
90
+ function tryCatch(t, e, r) {
93
91
  try {
94
92
  return {
95
93
  type: "normal",
96
- arg: fn.call(obj, arg)
94
+ arg: t.call(e, r)
97
95
  };
98
- } catch (err) {
96
+ } catch (t) {
99
97
  return {
100
98
  type: "throw",
101
- arg: err
99
+ arg: t
102
100
  };
103
101
  }
104
102
  }
105
- exports.wrap = wrap;
106
- var ContinueSentinel = {};
103
+ e.wrap = wrap;
104
+ var h = "suspendedStart",
105
+ l = "suspendedYield",
106
+ f = "executing",
107
+ s = "completed",
108
+ y = {};
107
109
  function Generator() {}
108
110
  function GeneratorFunction() {}
109
111
  function GeneratorFunctionPrototype() {}
110
- var IteratorPrototype = {};
111
- define(IteratorPrototype, iteratorSymbol, function () {
112
+ var p = {};
113
+ define(p, a, function () {
112
114
  return this;
113
115
  });
114
- var getProto = Object.getPrototypeOf,
115
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
116
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
117
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
118
- function defineIteratorMethods(prototype) {
119
- ["next", "throw", "return"].forEach(function (method) {
120
- define(prototype, method, function (arg) {
121
- return this._invoke(method, arg);
116
+ var d = Object.getPrototypeOf,
117
+ v = d && d(d(values([])));
118
+ v && v !== r && n.call(v, a) && (p = v);
119
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
120
+ function defineIteratorMethods(t) {
121
+ ["next", "throw", "return"].forEach(function (e) {
122
+ define(t, e, function (t) {
123
+ return this._invoke(e, t);
122
124
  });
123
125
  });
124
126
  }
125
- function AsyncIterator(generator, PromiseImpl) {
126
- function invoke(method, arg, resolve, reject) {
127
- var record = tryCatch(generator[method], generator, arg);
128
- if ("throw" !== record.type) {
129
- var result = record.arg,
130
- value = result.value;
131
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
132
- invoke("next", value, resolve, reject);
133
- }, function (err) {
134
- invoke("throw", err, resolve, reject);
135
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
136
- result.value = unwrapped, resolve(result);
137
- }, function (error) {
138
- return invoke("throw", error, resolve, reject);
127
+ function AsyncIterator(t, e) {
128
+ function invoke(r, o, i, a) {
129
+ var c = tryCatch(t[r], t, o);
130
+ if ("throw" !== c.type) {
131
+ var u = c.arg,
132
+ h = u.value;
133
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
134
+ invoke("next", t, i, a);
135
+ }, function (t) {
136
+ invoke("throw", t, i, a);
137
+ }) : e.resolve(h).then(function (t) {
138
+ u.value = t, i(u);
139
+ }, function (t) {
140
+ return invoke("throw", t, i, a);
139
141
  });
140
142
  }
141
- reject(record.arg);
143
+ a(c.arg);
142
144
  }
143
- var previousPromise;
144
- defineProperty(this, "_invoke", {
145
- value: function (method, arg) {
145
+ var r;
146
+ o(this, "_invoke", {
147
+ value: function (t, n) {
146
148
  function callInvokeWithMethodAndArg() {
147
- return new PromiseImpl(function (resolve, reject) {
148
- invoke(method, arg, resolve, reject);
149
+ return new e(function (e, r) {
150
+ invoke(t, n, e, r);
149
151
  });
150
152
  }
151
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
153
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
152
154
  }
153
155
  });
154
156
  }
155
- function makeInvokeMethod(innerFn, self, context) {
156
- var state = "suspendedStart";
157
- return function (method, arg) {
158
- if ("executing" === state) throw new Error("Generator is already running");
159
- if ("completed" === state) {
160
- if ("throw" === method) throw arg;
157
+ function makeInvokeMethod(e, r, n) {
158
+ var o = h;
159
+ return function (i, a) {
160
+ if (o === f) throw new Error("Generator is already running");
161
+ if (o === s) {
162
+ if ("throw" === i) throw a;
161
163
  return {
162
- value: void 0,
164
+ value: t,
163
165
  done: !0
164
166
  };
165
167
  }
166
- for (context.method = method, context.arg = arg;;) {
167
- var delegate = context.delegate;
168
- if (delegate) {
169
- var delegateResult = maybeInvokeDelegate(delegate, context);
170
- if (delegateResult) {
171
- if (delegateResult === ContinueSentinel) continue;
172
- return delegateResult;
168
+ for (n.method = i, n.arg = a;;) {
169
+ var c = n.delegate;
170
+ if (c) {
171
+ var u = maybeInvokeDelegate(c, n);
172
+ if (u) {
173
+ if (u === y) continue;
174
+ return u;
173
175
  }
174
176
  }
175
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
176
- if ("suspendedStart" === state) throw state = "completed", context.arg;
177
- context.dispatchException(context.arg);
178
- } else "return" === context.method && context.abrupt("return", context.arg);
179
- state = "executing";
180
- var record = tryCatch(innerFn, self, context);
181
- if ("normal" === record.type) {
182
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
177
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
178
+ if (o === h) throw o = s, n.arg;
179
+ n.dispatchException(n.arg);
180
+ } else "return" === n.method && n.abrupt("return", n.arg);
181
+ o = f;
182
+ var p = tryCatch(e, r, n);
183
+ if ("normal" === p.type) {
184
+ if (o = n.done ? s : l, p.arg === y) continue;
183
185
  return {
184
- value: record.arg,
185
- done: context.done
186
+ value: p.arg,
187
+ done: n.done
186
188
  };
187
189
  }
188
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
190
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
189
191
  }
190
192
  };
191
193
  }
192
- function maybeInvokeDelegate(delegate, context) {
193
- var methodName = context.method,
194
- method = delegate.iterator[methodName];
195
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
196
- var record = tryCatch(method, delegate.iterator, context.arg);
197
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
198
- var info = record.arg;
199
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
200
- }
201
- function pushTryEntry(locs) {
202
- var entry = {
203
- tryLoc: locs[0]
194
+ function maybeInvokeDelegate(e, r) {
195
+ var n = r.method,
196
+ o = e.iterator[n];
197
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
198
+ var i = tryCatch(o, e.iterator, r.arg);
199
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
200
+ var a = i.arg;
201
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
202
+ }
203
+ function pushTryEntry(t) {
204
+ var e = {
205
+ tryLoc: t[0]
204
206
  };
205
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
207
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
206
208
  }
207
- function resetTryEntry(entry) {
208
- var record = entry.completion || {};
209
- record.type = "normal", delete record.arg, entry.completion = record;
209
+ function resetTryEntry(t) {
210
+ var e = t.completion || {};
211
+ e.type = "normal", delete e.arg, t.completion = e;
210
212
  }
211
- function Context(tryLocsList) {
213
+ function Context(t) {
212
214
  this.tryEntries = [{
213
215
  tryLoc: "root"
214
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
215
- }
216
- function values(iterable) {
217
- if (iterable || "" === iterable) {
218
- var iteratorMethod = iterable[iteratorSymbol];
219
- if (iteratorMethod) return iteratorMethod.call(iterable);
220
- if ("function" == typeof iterable.next) return iterable;
221
- if (!isNaN(iterable.length)) {
222
- var i = -1,
223
- next = function next() {
224
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
225
- return next.value = undefined, next.done = !0, next;
216
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
217
+ }
218
+ function values(e) {
219
+ if (e || "" === e) {
220
+ var r = e[a];
221
+ if (r) return r.call(e);
222
+ if ("function" == typeof e.next) return e;
223
+ if (!isNaN(e.length)) {
224
+ var o = -1,
225
+ i = function next() {
226
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
227
+ return next.value = t, next.done = !0, next;
226
228
  };
227
- return next.next = next;
229
+ return i.next = i;
228
230
  }
229
231
  }
230
- throw new TypeError(typeof iterable + " is not iterable");
232
+ throw new TypeError(typeof e + " is not iterable");
231
233
  }
232
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
234
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
233
235
  value: GeneratorFunctionPrototype,
234
236
  configurable: !0
235
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
237
+ }), o(GeneratorFunctionPrototype, "constructor", {
236
238
  value: GeneratorFunction,
237
239
  configurable: !0
238
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
239
- var ctor = "function" == typeof genFun && genFun.constructor;
240
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
241
- }, exports.mark = function (genFun) {
242
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
243
- }, exports.awrap = function (arg) {
240
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
241
+ var e = "function" == typeof t && t.constructor;
242
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
243
+ }, e.mark = function (t) {
244
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
245
+ }, e.awrap = function (t) {
244
246
  return {
245
- __await: arg
247
+ __await: t
246
248
  };
247
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
249
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
248
250
  return this;
249
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
250
- void 0 === PromiseImpl && (PromiseImpl = Promise);
251
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
252
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
253
- return result.done ? result.value : iter.next();
251
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
252
+ void 0 === i && (i = Promise);
253
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
254
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
255
+ return t.done ? t.value : a.next();
254
256
  });
255
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
257
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
256
258
  return this;
257
- }), define(Gp, "toString", function () {
259
+ }), define(g, "toString", function () {
258
260
  return "[object Generator]";
259
- }), exports.keys = function (val) {
260
- var object = Object(val),
261
- keys = [];
262
- for (var key in object) keys.push(key);
263
- return keys.reverse(), function next() {
264
- for (; keys.length;) {
265
- var key = keys.pop();
266
- if (key in object) return next.value = key, next.done = !1, next;
261
+ }), e.keys = function (t) {
262
+ var e = Object(t),
263
+ r = [];
264
+ for (var n in e) r.push(n);
265
+ return r.reverse(), function next() {
266
+ for (; r.length;) {
267
+ var t = r.pop();
268
+ if (t in e) return next.value = t, next.done = !1, next;
267
269
  }
268
270
  return next.done = !0, next;
269
271
  };
270
- }, exports.values = values, Context.prototype = {
272
+ }, e.values = values, Context.prototype = {
271
273
  constructor: Context,
272
- reset: function (skipTempReset) {
273
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
274
+ reset: function (e) {
275
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
274
276
  },
275
277
  stop: function () {
276
278
  this.done = !0;
277
- var rootRecord = this.tryEntries[0].completion;
278
- if ("throw" === rootRecord.type) throw rootRecord.arg;
279
+ var t = this.tryEntries[0].completion;
280
+ if ("throw" === t.type) throw t.arg;
279
281
  return this.rval;
280
282
  },
281
- dispatchException: function (exception) {
282
- if (this.done) throw exception;
283
- var context = this;
284
- function handle(loc, caught) {
285
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
286
- }
287
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
288
- var entry = this.tryEntries[i],
289
- record = entry.completion;
290
- if ("root" === entry.tryLoc) return handle("end");
291
- if (entry.tryLoc <= this.prev) {
292
- var hasCatch = hasOwn.call(entry, "catchLoc"),
293
- hasFinally = hasOwn.call(entry, "finallyLoc");
294
- if (hasCatch && hasFinally) {
295
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
296
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
297
- } else if (hasCatch) {
298
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
283
+ dispatchException: function (e) {
284
+ if (this.done) throw e;
285
+ var r = this;
286
+ function handle(n, o) {
287
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
288
+ }
289
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
290
+ var i = this.tryEntries[o],
291
+ a = i.completion;
292
+ if ("root" === i.tryLoc) return handle("end");
293
+ if (i.tryLoc <= this.prev) {
294
+ var c = n.call(i, "catchLoc"),
295
+ u = n.call(i, "finallyLoc");
296
+ if (c && u) {
297
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
298
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
299
+ } else if (c) {
300
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
299
301
  } else {
300
- if (!hasFinally) throw new Error("try statement without catch or finally");
301
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
302
+ if (!u) throw new Error("try statement without catch or finally");
303
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
302
304
  }
303
305
  }
304
306
  }
305
307
  },
306
- abrupt: function (type, arg) {
307
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
308
- var entry = this.tryEntries[i];
309
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
310
- var finallyEntry = entry;
308
+ abrupt: function (t, e) {
309
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
310
+ var o = this.tryEntries[r];
311
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
312
+ var i = o;
311
313
  break;
312
314
  }
313
315
  }
314
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
315
- var record = finallyEntry ? finallyEntry.completion : {};
316
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
316
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
317
+ var a = i ? i.completion : {};
318
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
317
319
  },
318
- complete: function (record, afterLoc) {
319
- if ("throw" === record.type) throw record.arg;
320
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
320
+ complete: function (t, e) {
321
+ if ("throw" === t.type) throw t.arg;
322
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
321
323
  },
322
- finish: function (finallyLoc) {
323
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
324
- var entry = this.tryEntries[i];
325
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
324
+ finish: function (t) {
325
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
326
+ var r = this.tryEntries[e];
327
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
326
328
  }
327
329
  },
328
- catch: function (tryLoc) {
329
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
330
- var entry = this.tryEntries[i];
331
- if (entry.tryLoc === tryLoc) {
332
- var record = entry.completion;
333
- if ("throw" === record.type) {
334
- var thrown = record.arg;
335
- resetTryEntry(entry);
330
+ catch: function (t) {
331
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
332
+ var r = this.tryEntries[e];
333
+ if (r.tryLoc === t) {
334
+ var n = r.completion;
335
+ if ("throw" === n.type) {
336
+ var o = n.arg;
337
+ resetTryEntry(r);
336
338
  }
337
- return thrown;
339
+ return o;
338
340
  }
339
341
  }
340
342
  throw new Error("illegal catch attempt");
341
343
  },
342
- delegateYield: function (iterable, resultName, nextLoc) {
344
+ delegateYield: function (e, r, n) {
343
345
  return this.delegate = {
344
- iterator: values(iterable),
345
- resultName: resultName,
346
- nextLoc: nextLoc
347
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
346
+ iterator: values(e),
347
+ resultName: r,
348
+ nextLoc: n
349
+ }, "next" === this.method && (this.arg = t), y;
348
350
  }
349
- }, exports;
350
- }
351
- function _typeof$2(obj) {
352
- "@babel/helpers - typeof";
353
-
354
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
355
- return typeof obj;
356
- } : function (obj) {
357
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
358
- }, _typeof$2(obj);
359
- }
360
- function _classCallCheck(instance, Constructor) {
361
- if (!(instance instanceof Constructor)) {
362
- throw new TypeError("Cannot call a class as a function");
363
- }
364
- }
365
- function _defineProperties(target, props) {
366
- for (var i = 0; i < props.length; i++) {
367
- var descriptor = props[i];
368
- descriptor.enumerable = descriptor.enumerable || false;
369
- descriptor.configurable = true;
370
- if ("value" in descriptor) descriptor.writable = true;
371
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
372
- }
373
- }
374
- function _createClass(Constructor, protoProps, staticProps) {
375
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
376
- if (staticProps) _defineProperties(Constructor, staticProps);
377
- Object.defineProperty(Constructor, "prototype", {
378
- writable: false
379
- });
380
- return Constructor;
351
+ }, e;
381
352
  }
382
353
  function _defineProperty$1(obj, key, value) {
383
354
  key = _toPropertyKey(key);
@@ -393,74 +364,6 @@ function _defineProperty$1(obj, key, value) {
393
364
  }
394
365
  return obj;
395
366
  }
396
- function _inherits(subClass, superClass) {
397
- if (typeof superClass !== "function" && superClass !== null) {
398
- throw new TypeError("Super expression must either be null or a function");
399
- }
400
- subClass.prototype = Object.create(superClass && superClass.prototype, {
401
- constructor: {
402
- value: subClass,
403
- writable: true,
404
- configurable: true
405
- }
406
- });
407
- Object.defineProperty(subClass, "prototype", {
408
- writable: false
409
- });
410
- if (superClass) _setPrototypeOf$1(subClass, superClass);
411
- }
412
- function _getPrototypeOf(o) {
413
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
414
- return o.__proto__ || Object.getPrototypeOf(o);
415
- };
416
- return _getPrototypeOf(o);
417
- }
418
- function _setPrototypeOf$1(o, p) {
419
- _setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
420
- o.__proto__ = p;
421
- return o;
422
- };
423
- return _setPrototypeOf$1(o, p);
424
- }
425
- function _isNativeReflectConstruct() {
426
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
427
- if (Reflect.construct.sham) return false;
428
- if (typeof Proxy === "function") return true;
429
- try {
430
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
431
- return true;
432
- } catch (e) {
433
- return false;
434
- }
435
- }
436
- function _assertThisInitialized$1(self) {
437
- if (self === void 0) {
438
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
439
- }
440
- return self;
441
- }
442
- function _possibleConstructorReturn(self, call) {
443
- if (call && (typeof call === "object" || typeof call === "function")) {
444
- return call;
445
- } else if (call !== void 0) {
446
- throw new TypeError("Derived constructors may only return object or undefined");
447
- }
448
- return _assertThisInitialized$1(self);
449
- }
450
- function _createSuper(Derived) {
451
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
452
- return function _createSuperInternal() {
453
- var Super = _getPrototypeOf(Derived),
454
- result;
455
- if (hasNativeReflectConstruct) {
456
- var NewTarget = _getPrototypeOf(this).constructor;
457
- result = Reflect.construct(Super, arguments, NewTarget);
458
- } else {
459
- result = Super.apply(this, arguments);
460
- }
461
- return _possibleConstructorReturn(this, result);
462
- };
463
- }
464
367
  function _slicedToArray(arr, i) {
465
368
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
466
369
  }
@@ -1035,20 +938,20 @@ function _objectSpread2(target) {
1035
938
  return target;
1036
939
  }
1037
940
 
1038
- function _typeof$1(obj) {
941
+ function _typeof(obj) {
1039
942
  "@babel/helpers - typeof";
1040
943
 
1041
944
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1042
- _typeof$1 = function (obj) {
945
+ _typeof = function (obj) {
1043
946
  return typeof obj;
1044
947
  };
1045
948
  } else {
1046
- _typeof$1 = function (obj) {
949
+ _typeof = function (obj) {
1047
950
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1048
951
  };
1049
952
  }
1050
953
 
1051
- return _typeof$1(obj);
954
+ return _typeof(obj);
1052
955
  }
1053
956
 
1054
957
  function _defineProperty(obj, key, value) {
@@ -2087,7 +1990,7 @@ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
2087
1990
  var group = {};
2088
1991
  var originalGroup = options.group;
2089
1992
 
2090
- if (!originalGroup || _typeof$1(originalGroup) != 'object') {
1993
+ if (!originalGroup || _typeof(originalGroup) != 'object') {
2091
1994
  originalGroup = {
2092
1995
  name: originalGroup
2093
1996
  };
@@ -5481,7 +5384,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5481
5384
  PERFORMANCE OF THIS SOFTWARE.
5482
5385
  ***************************************************************************** */
5483
5386
 
5484
- function __rest$1(s, e) {
5387
+ function __rest(s, e) {
5485
5388
  var t = {};
5486
5389
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5487
5390
  t[p] = s[p];
@@ -9068,7 +8971,7 @@ tags.forEach(function (tagName) {
9068
8971
  });
9069
8972
 
9070
8973
  /**
9071
- * @mui/styled-engine v5.13.2
8974
+ * @mui/styled-engine v5.14.8
9072
8975
  *
9073
8976
  * @license MIT
9074
8977
  * This source code is licensed under the MIT license found in the
@@ -9723,10 +9626,20 @@ const width = style$3({
9723
9626
  const maxWidth = props => {
9724
9627
  if (props.maxWidth !== undefined && props.maxWidth !== null) {
9725
9628
  const styleFromPropValue = propValue => {
9726
- var _props$theme;
9629
+ var _props$theme, _props$theme2;
9727
9630
  const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values[propValue];
9631
+ if (!breakpoint) {
9632
+ return {
9633
+ maxWidth: sizingTransform(propValue)
9634
+ };
9635
+ }
9636
+ if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
9637
+ return {
9638
+ maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
9639
+ };
9640
+ }
9728
9641
  return {
9729
- maxWidth: breakpoint || sizingTransform(propValue)
9642
+ maxWidth: breakpoint
9730
9643
  };
9731
9644
  };
9732
9645
  return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
@@ -10620,7 +10533,7 @@ var CustomDimensionSelectConnect = function CustomDimensionSelectConnect(_a) {
10620
10533
  mapId = _a.mapId,
10621
10534
  dimensionsToShow = _a.dimensionsToShow,
10622
10535
  SingleValueComponent = _a.SingleValueComponent,
10623
- props = __rest$1(_a, ["layerId", "mapId", "dimensionsToShow", "SingleValueComponent"]);
10536
+ props = __rest(_a, ["layerId", "mapId", "dimensionsToShow", "SingleValueComponent"]);
10624
10537
  var _useLayerDimensions = useLayerDimensions(layerId, mapId),
10625
10538
  layerDimensions = _useLayerDimensions.layerDimensions,
10626
10539
  isLayerEnabled = _useLayerDimensions.isLayerEnabled,
@@ -15786,7 +15699,7 @@ var ServicePopup = function ServicePopup(_ref2) {
15786
15699
  }, "save")))));
15787
15700
  };
15788
15701
  var ServicePopupWrapper = function ServicePopupWrapper(_a) {
15789
- var props = __rest$1(_a, []);
15702
+ var props = __rest(_a, []);
15790
15703
  return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
15791
15704
  options: Object.assign(Object.assign({}, defaultFormOptions), {
15792
15705
  defaultValues: {
@@ -15951,162 +15864,6 @@ var LayerSelectConnect = function LayerSelectConnect(_ref) {
15951
15864
  }), /*#__PURE__*/React.createElement(LayerInfoDialogConnect, null), /*#__PURE__*/React.createElement(ServicePopupConnect, null));
15952
15865
  };
15953
15866
 
15954
- /* *
15955
- * Licensed under the Apache License, Version 2.0 (the "License");
15956
- * you may not use this file except in compliance with the License.
15957
- * You may obtain a copy of the License at
15958
- *
15959
- * http://www.apache.org/licenses/LICENSE-2.0
15960
- *
15961
- * Unless required by applicable law or agreed to in writing, software
15962
- * distributed under the License is distributed on an "AS IS" BASIS,
15963
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15964
- * See the License for the specific language governing permissions and
15965
- * limitations under the License.
15966
- *
15967
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15968
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
15969
- * */
15970
- var MapControlButton = function MapControlButton(_a) {
15971
- var onClick = _a.onClick,
15972
- children = _a.children,
15973
- title = _a.title,
15974
- _a$placement = _a.placement,
15975
- placement = _a$placement === void 0 ? 'right' : _a$placement,
15976
- _a$isActive = _a.isActive,
15977
- isActive = _a$isActive === void 0 ? false : _a$isActive,
15978
- props = __rest$1(_a, ["onClick", "children", "title", "placement", "isActive"]);
15979
- return /*#__PURE__*/React.createElement(CustomIconButton, Object.assign({
15980
- variant: "tool",
15981
- tooltipProps: {
15982
- placement: placement,
15983
- title: title
15984
- },
15985
- onClick: onClick,
15986
- isSelected: isActive
15987
- }, props), children);
15988
- };
15989
-
15990
- /* *
15991
- * Licensed under the Apache License, Version 2.0 (the "License");
15992
- * you may not use this file except in compliance with the License.
15993
- * You may obtain a copy of the License at
15994
- *
15995
- * http://www.apache.org/licenses/LICENSE-2.0
15996
- *
15997
- * Unless required by applicable law or agreed to in writing, software
15998
- * distributed under the License is distributed on an "AS IS" BASIS,
15999
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16000
- * See the License for the specific language governing permissions and
16001
- * limitations under the License.
16002
- *
16003
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16004
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16005
- * */
16006
- var ZoomControls = function ZoomControls(_ref) {
16007
- var onZoomIn = _ref.onZoomIn,
16008
- onZoomOut = _ref.onZoomOut,
16009
- onZoomReset = _ref.onZoomReset;
16010
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MapControlButton, {
16011
- title: "Reset zoom",
16012
- "data-testid": "zoom-reset",
16013
- onClick: onZoomReset
16014
- }, /*#__PURE__*/React.createElement(Home, null)), /*#__PURE__*/React.createElement(MapControlButton, {
16015
- title: "Zoom in",
16016
- "data-testid": "zoom-in",
16017
- onClick: onZoomIn
16018
- }, /*#__PURE__*/React.createElement(Add, null)), /*#__PURE__*/React.createElement(MapControlButton, {
16019
- title: "Zoom out",
16020
- "data-testid": "zoom-out",
16021
- onClick: onZoomOut
16022
- }, /*#__PURE__*/React.createElement(Minus, null)));
16023
- };
16024
-
16025
- /* *
16026
- * Licensed under the Apache License, Version 2.0 (the "License");
16027
- * you may not use this file except in compliance with the License.
16028
- * You may obtain a copy of the License at
16029
- *
16030
- * http://www.apache.org/licenses/LICENSE-2.0
16031
- *
16032
- * Unless required by applicable law or agreed to in writing, software
16033
- * distributed under the License is distributed on an "AS IS" BASIS,
16034
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16035
- * See the License for the specific language governing permissions and
16036
- * limitations under the License.
16037
- *
16038
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16039
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
16040
- * */
16041
- var ZoomControlConnect = function ZoomControlConnect(_ref) {
16042
- var mapId = _ref.mapId;
16043
- var isVisible = useSelector(function (store) {
16044
- return mapSelectors.isZoomControlsVisible(store, mapId);
16045
- });
16046
- var adagucRef = React.useRef(null);
16047
- React.useEffect(function () {
16048
- adagucRef.current = webmapUtils.getWMJSMapById(mapId);
16049
- }, [mapId]);
16050
- var onZoomIn = function onZoomIn() {
16051
- return adagucRef.current.zoomIn(undefined);
16052
- };
16053
- var onZoomOut = function onZoomOut() {
16054
- return adagucRef.current.zoomOut();
16055
- };
16056
- var onZoomReset = function onZoomReset() {
16057
- return adagucRef.current.zoomToLayer(adagucRef.current.getActiveLayer());
16058
- };
16059
- if (!isVisible) {
16060
- return null;
16061
- }
16062
- return /*#__PURE__*/React.createElement(ZoomControls, {
16063
- onZoomIn: onZoomIn,
16064
- onZoomOut: onZoomOut,
16065
- onZoomReset: onZoomReset
16066
- });
16067
- };
16068
-
16069
- /* *
16070
- * Licensed under the Apache License, Version 2.0 (the "License");
16071
- * you may not use this file except in compliance with the License.
16072
- * You may obtain a copy of the License at
16073
- *
16074
- * http://www.apache.org/licenses/LICENSE-2.0
16075
- *
16076
- * Unless required by applicable law or agreed to in writing, software
16077
- * distributed under the License is distributed on an "AS IS" BASIS,
16078
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16079
- * See the License for the specific language governing permissions and
16080
- * limitations under the License.
16081
- *
16082
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16083
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
16084
- * */
16085
- var MapControls = function MapControls(_a) {
16086
- var children = _a.children,
16087
- props = __rest$1(_a, ["children"]);
16088
- return /*#__PURE__*/React.createElement(Box$2, Object.assign({
16089
- sx: {
16090
- position: 'absolute',
16091
- overflow: 'visible',
16092
- display: 'block',
16093
- left: 0,
16094
- margin: 1,
16095
- zIndex: 50,
16096
- top: '96px',
16097
- userSelect: 'none'
16098
- }
16099
- }, props), /*#__PURE__*/React.createElement(Grid, {
16100
- sx: {
16101
- '& > button': {
16102
- marginBottom: 1
16103
- }
16104
- },
16105
- container: true,
16106
- direction: "column"
16107
- }, children));
16108
- };
16109
-
16110
15867
  /* *
16111
15868
  * Licensed under the Apache License, Version 2.0 (the "License");
16112
15869
  * you may not use this file except in compliance with the License.
@@ -16710,6 +16467,50 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
16710
16467
  }));
16711
16468
  };
16712
16469
 
16470
+ /* *
16471
+ * Licensed under the Apache License, Version 2.0 (the "License");
16472
+ * you may not use this file except in compliance with the License.
16473
+ * You may obtain a copy of the License at
16474
+ *
16475
+ * http://www.apache.org/licenses/LICENSE-2.0
16476
+ *
16477
+ * Unless required by applicable law or agreed to in writing, software
16478
+ * distributed under the License is distributed on an "AS IS" BASIS,
16479
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16480
+ * See the License for the specific language governing permissions and
16481
+ * limitations under the License.
16482
+ *
16483
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16484
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
16485
+ * */
16486
+ var ZoomControlConnect = function ZoomControlConnect(_ref) {
16487
+ var mapId = _ref.mapId;
16488
+ var isVisible = useSelector(function (store) {
16489
+ return mapSelectors.isZoomControlsVisible(store, mapId);
16490
+ });
16491
+ var adagucRef = React.useRef(null);
16492
+ React.useEffect(function () {
16493
+ adagucRef.current = webmapUtils.getWMJSMapById(mapId);
16494
+ }, [mapId]);
16495
+ var onZoomIn = function onZoomIn() {
16496
+ return adagucRef.current.zoomIn(undefined);
16497
+ };
16498
+ var onZoomOut = function onZoomOut() {
16499
+ return adagucRef.current.zoomOut();
16500
+ };
16501
+ var onZoomReset = function onZoomReset() {
16502
+ return adagucRef.current.zoomToLayer(adagucRef.current.getActiveLayer());
16503
+ };
16504
+ if (!isVisible) {
16505
+ return null;
16506
+ }
16507
+ return /*#__PURE__*/React.createElement(ZoomControls, {
16508
+ onZoomIn: onZoomIn,
16509
+ onZoomOut: onZoomOut,
16510
+ onZoomReset: onZoomReset
16511
+ });
16512
+ };
16513
+
16713
16514
  /* *
16714
16515
  * Licensed under the Apache License, Version 2.0 (the "License");
16715
16516
  * you may not use this file except in compliance with the License.
@@ -20189,1566 +19990,6 @@ var TimeSliderConnect = function TimeSliderConnect(_ref) {
20189
19990
  });
20190
19991
  };
20191
19992
 
20192
- /* *
20193
- * Licensed under the Apache License, Version 2.0 (the "License");
20194
- * you may not use this file except in compliance with the License.
20195
- * You may obtain a copy of the License at
20196
- *
20197
- * http://www.apache.org/licenses/LICENSE-2.0
20198
- *
20199
- * Unless required by applicable law or agreed to in writing, software
20200
- * distributed under the License is distributed on an "AS IS" BASIS,
20201
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20202
- * See the License for the specific language governing permissions and
20203
- * limitations under the License.
20204
- *
20205
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20206
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
20207
- * */
20208
- var MapViewLayer = function MapViewLayer(props) {
20209
- var id = props.id;
20210
- return /*#__PURE__*/React.createElement(Box$2, {
20211
- "data-testid": "mapViewLayer",
20212
- sx: {
20213
- width: '100%',
20214
- padding: '2px',
20215
- margin: 0,
20216
- wordWrap: 'break-word',
20217
- border: '1px solid rgba(0, 0, 0, 0.5)',
20218
- lineHeight: '14px',
20219
- fontSize: '10px',
20220
- background: 'rgba(255, 255, 255, 0.5)',
20221
- display: 'none'
20222
- }
20223
- }, /*#__PURE__*/React.createElement("div", null, id), /*#__PURE__*/React.createElement("div", {
20224
- // eslint-disable-next-line react/no-danger
20225
- dangerouslySetInnerHTML: {
20226
- __html: JSON.stringify(props, null, '--').replace(/\n/g, '<br/>')
20227
- }
20228
- }));
20229
- };
20230
-
20231
- /* global Reflect, Promise */
20232
-
20233
- var extendStatics = function(d, b) {
20234
- extendStatics = Object.setPrototypeOf ||
20235
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20236
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
20237
- return extendStatics(d, b);
20238
- };
20239
-
20240
- function __extends$2(d, b) {
20241
- extendStatics(d, b);
20242
- function __() { this.constructor = d; }
20243
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
20244
- }
20245
-
20246
- var __assign$2 = function() {
20247
- __assign$2 = Object.assign || function __assign(t) {
20248
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20249
- s = arguments[i];
20250
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
20251
- }
20252
- return t;
20253
- };
20254
- return __assign$2.apply(this, arguments);
20255
- };
20256
-
20257
- function __rest(s, e) {
20258
- var t = {};
20259
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20260
- t[p] = s[p];
20261
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
20262
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
20263
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20264
- t[p[i]] = s[p[i]];
20265
- }
20266
- return t;
20267
- }var patchResizeCallback = function (resizeCallback, refreshMode, refreshRate, refreshOptions) {
20268
- switch (refreshMode) {
20269
- case 'debounce':
20270
- return debounce$1(resizeCallback, refreshRate, refreshOptions);
20271
- case 'throttle':
20272
- return throttle$2(resizeCallback, refreshRate, refreshOptions);
20273
- default:
20274
- return resizeCallback;
20275
- }
20276
- };
20277
- var isFunction = function (fn) { return typeof fn === 'function'; };
20278
- var isSSR = function () { return typeof window === 'undefined'; };
20279
- var isDOMElement = function (element) {
20280
- return element instanceof Element || element instanceof HTMLDocument;
20281
- };/** @class */ ((function (_super) {
20282
- __extends$2(ResizeDetector, _super);
20283
- function ResizeDetector(props) {
20284
- var _this = _super.call(this, props) || this;
20285
- _this.cancelHandler = function () {
20286
- if (_this.resizeHandler && _this.resizeHandler.cancel) {
20287
- // cancel debounced handler
20288
- _this.resizeHandler.cancel();
20289
- _this.resizeHandler = null;
20290
- }
20291
- };
20292
- _this.attachObserver = function () {
20293
- var _a = _this.props, targetRef = _a.targetRef, observerOptions = _a.observerOptions;
20294
- if (isSSR()) {
20295
- return;
20296
- }
20297
- if (targetRef && targetRef.current) {
20298
- _this.targetRef.current = targetRef.current;
20299
- }
20300
- var element = _this.getElement();
20301
- if (!element) {
20302
- // can't find element to observe
20303
- return;
20304
- }
20305
- if (_this.observableElement && _this.observableElement === element) {
20306
- // element is already observed
20307
- return;
20308
- }
20309
- _this.observableElement = element;
20310
- _this.resizeObserver.observe(element, observerOptions);
20311
- };
20312
- _this.getElement = function () {
20313
- var _a = _this.props, querySelector = _a.querySelector, targetDomEl = _a.targetDomEl;
20314
- if (isSSR())
20315
- return null;
20316
- // in case we pass a querySelector
20317
- if (querySelector)
20318
- return document.querySelector(querySelector);
20319
- // in case we pass a DOM element
20320
- if (targetDomEl && isDOMElement(targetDomEl))
20321
- return targetDomEl;
20322
- // in case we pass a React ref using React.createRef()
20323
- if (_this.targetRef && isDOMElement(_this.targetRef.current))
20324
- return _this.targetRef.current;
20325
- // the worse case when we don't receive any information from the parent and the library doesn't add any wrappers
20326
- // we have to use a deprecated `findDOMNode` method in order to find a DOM element to attach to
20327
- var currentElement = findDOMNode(_this);
20328
- if (!currentElement)
20329
- return null;
20330
- var renderType = _this.getRenderType();
20331
- switch (renderType) {
20332
- case 'renderProp':
20333
- return currentElement;
20334
- case 'childFunction':
20335
- return currentElement;
20336
- case 'child':
20337
- return currentElement;
20338
- case 'childArray':
20339
- return currentElement;
20340
- default:
20341
- return currentElement.parentElement;
20342
- }
20343
- };
20344
- _this.createResizeHandler = function (entries) {
20345
- var _a = _this.props, _b = _a.handleWidth, handleWidth = _b === void 0 ? true : _b, _c = _a.handleHeight, handleHeight = _c === void 0 ? true : _c, onResize = _a.onResize;
20346
- if (!handleWidth && !handleHeight)
20347
- return;
20348
- var notifyResize = function (_a) {
20349
- var width = _a.width, height = _a.height;
20350
- if (_this.state.width === width && _this.state.height === height) {
20351
- // skip if dimensions haven't changed
20352
- return;
20353
- }
20354
- if ((_this.state.width === width && !handleHeight) || (_this.state.height === height && !handleWidth)) {
20355
- // process `handleHeight/handleWidth` props
20356
- return;
20357
- }
20358
- onResize === null || onResize === void 0 ? void 0 : onResize(width, height);
20359
- _this.setState({ width: width, height: height });
20360
- };
20361
- entries.forEach(function (entry) {
20362
- var _a = (entry && entry.contentRect) || {}, width = _a.width, height = _a.height;
20363
- var shouldSetSize = !_this.skipOnMount && !isSSR();
20364
- if (shouldSetSize) {
20365
- notifyResize({ width: width, height: height });
20366
- }
20367
- _this.skipOnMount = false;
20368
- });
20369
- };
20370
- _this.getRenderType = function () {
20371
- var _a = _this.props, render = _a.render, children = _a.children;
20372
- if (isFunction(render)) {
20373
- // DEPRECATED. Use `Child Function Pattern` instead
20374
- return 'renderProp';
20375
- }
20376
- if (isFunction(children)) {
20377
- return 'childFunction';
20378
- }
20379
- if (isValidElement(children)) {
20380
- return 'child';
20381
- }
20382
- if (Array.isArray(children)) {
20383
- // DEPRECATED. Wrap children with a single parent
20384
- return 'childArray';
20385
- }
20386
- // DEPRECATED. Use `Child Function Pattern` instead
20387
- return 'parent';
20388
- };
20389
- var skipOnMount = props.skipOnMount, refreshMode = props.refreshMode, _a = props.refreshRate, refreshRate = _a === void 0 ? 1000 : _a, refreshOptions = props.refreshOptions;
20390
- _this.state = {
20391
- width: undefined,
20392
- height: undefined
20393
- };
20394
- _this.sizeRef = {
20395
- current: _this.state
20396
- };
20397
- _this.skipOnMount = skipOnMount;
20398
- _this.targetRef = createRef();
20399
- _this.observableElement = null;
20400
- if (isSSR()) {
20401
- return _this;
20402
- }
20403
- _this.resizeHandler = patchResizeCallback(_this.createResizeHandler, refreshMode, refreshRate, refreshOptions);
20404
- _this.resizeObserver = new window.ResizeObserver(_this.resizeHandler);
20405
- return _this;
20406
- }
20407
- ResizeDetector.prototype.componentDidMount = function () {
20408
- this.attachObserver();
20409
- };
20410
- ResizeDetector.prototype.componentDidUpdate = function () {
20411
- this.attachObserver();
20412
- this.sizeRef.current = this.state;
20413
- };
20414
- ResizeDetector.prototype.componentWillUnmount = function () {
20415
- if (isSSR()) {
20416
- return;
20417
- }
20418
- this.observableElement = null;
20419
- this.resizeObserver.disconnect();
20420
- this.cancelHandler();
20421
- };
20422
- ResizeDetector.prototype.render = function () {
20423
- var _a = this.props, render = _a.render, children = _a.children, _b = _a.nodeType, WrapperTag = _b === void 0 ? 'div' : _b;
20424
- var _c = this.state, width = _c.width, height = _c.height;
20425
- var childProps = { width: width, height: height, targetRef: this.targetRef };
20426
- var renderType = this.getRenderType();
20427
- switch (renderType) {
20428
- case 'renderProp':
20429
- return render === null || render === void 0 ? void 0 : render(childProps);
20430
- case 'childFunction': {
20431
- var childFunction = children;
20432
- return childFunction === null || childFunction === void 0 ? void 0 : childFunction(childProps);
20433
- }
20434
- case 'child': {
20435
- // @TODO bug prone logic
20436
- var child = children;
20437
- if (child.type && typeof child.type === 'string') {
20438
- // child is a native DOM elements such as div, span etc
20439
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
20440
- childProps.targetRef; var nativeProps = __rest(childProps, ["targetRef"]);
20441
- return cloneElement(child, nativeProps);
20442
- }
20443
- // class or functional component otherwise
20444
- return cloneElement(child, childProps);
20445
- }
20446
- case 'childArray': {
20447
- var childArray = children;
20448
- return childArray.map(function (el) { return !!el && cloneElement(el, childProps); });
20449
- }
20450
- default:
20451
- return React__default.createElement(WrapperTag, null);
20452
- }
20453
- };
20454
- return ResizeDetector;
20455
- })(PureComponent));function useResizeDetector(_a) {
20456
- var _b = _a === void 0 ? {} : _a, _c = _b.skipOnMount, skipOnMount = _c === void 0 ? false : _c, refreshMode = _b.refreshMode, _d = _b.refreshRate, refreshRate = _d === void 0 ? 1000 : _d, refreshOptions = _b.refreshOptions, _e = _b.handleWidth, handleWidth = _e === void 0 ? true : _e, _f = _b.handleHeight, handleHeight = _f === void 0 ? true : _f, targetRef = _b.targetRef, observerOptions = _b.observerOptions, onResize = _b.onResize;
20457
- var skipResize = useRef(skipOnMount);
20458
- var _g = useState({
20459
- width: undefined,
20460
- height: undefined
20461
- }), size = _g[0], setSize = _g[1];
20462
- // we are going to use this ref to store the last element that was passed to the hook
20463
- var _h = useState((targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) || null), refElement = _h[0], setRefElement = _h[1];
20464
- // if targetRef is passed, we need to update the refElement
20465
- // we have to use setTimeout because ref get assigned after the hook is called
20466
- // in the future releases we are going to remove targetRef and force users to use ref returned by the hook
20467
- if (targetRef) {
20468
- setTimeout(function () {
20469
- if (targetRef.current !== refElement) {
20470
- setRefElement(targetRef.current);
20471
- }
20472
- }, 0);
20473
- }
20474
- // this is a callback that will be called every time the ref is changed
20475
- // we call setState inside to trigger rerender
20476
- var onRefChange = useCallback(function (node) {
20477
- if (node !== refElement) {
20478
- setRefElement(node);
20479
- }
20480
- }, [refElement]);
20481
- // adding `current` to make it compatible with useRef shape
20482
- onRefChange.current = refElement;
20483
- useEffect(function () {
20484
- return function () {
20485
- // component is unmounted
20486
- // clear ref to avoid memory leaks
20487
- setRefElement(null);
20488
- onRefChange.current = null;
20489
- };
20490
- }, []);
20491
- var shouldSetSize = useCallback(function (prevSize, nextSize) {
20492
- if (prevSize.width === nextSize.width && prevSize.height === nextSize.height) {
20493
- // skip if dimensions haven't changed
20494
- return false;
20495
- }
20496
- if ((prevSize.width === nextSize.width && !handleHeight) ||
20497
- (prevSize.height === nextSize.height && !handleWidth)) {
20498
- // process `handleHeight/handleWidth` props
20499
- return false;
20500
- }
20501
- return true;
20502
- }, [handleWidth, handleHeight]);
20503
- var resizeCallback = useCallback(function (entries) {
20504
- if (!handleWidth && !handleHeight)
20505
- return;
20506
- if (skipResize.current) {
20507
- skipResize.current = false;
20508
- return;
20509
- }
20510
- entries.forEach(function (entry) {
20511
- var _a = (entry === null || entry === void 0 ? void 0 : entry.contentRect) || {}, width = _a.width, height = _a.height;
20512
- setSize(function (prevSize) {
20513
- if (!shouldSetSize(prevSize, { width: width, height: height }))
20514
- return prevSize;
20515
- return { width: width, height: height };
20516
- });
20517
- });
20518
- }, [handleWidth, handleHeight, skipResize, shouldSetSize]);
20519
- var resizeHandler = useCallback(patchResizeCallback(resizeCallback, refreshMode, refreshRate, refreshOptions), [
20520
- resizeCallback,
20521
- refreshMode,
20522
- refreshRate,
20523
- refreshOptions
20524
- ]);
20525
- // on refElement change
20526
- useEffect(function () {
20527
- var resizeObserver;
20528
- if (refElement) {
20529
- resizeObserver = new window.ResizeObserver(resizeHandler);
20530
- resizeObserver.observe(refElement, observerOptions);
20531
- }
20532
- else {
20533
- if (size.width || size.height) {
20534
- setSize({ width: undefined, height: undefined });
20535
- }
20536
- }
20537
- return function () {
20538
- var _a, _b, _c;
20539
- (_a = resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.disconnect) === null || _a === void 0 ? void 0 : _a.call(resizeObserver);
20540
- (_c = (_b = resizeHandler).cancel) === null || _c === void 0 ? void 0 : _c.call(_b);
20541
- };
20542
- }, [resizeHandler, refElement]);
20543
- useEffect(function () {
20544
- onResize === null || onResize === void 0 ? void 0 : onResize(size.width, size.height);
20545
- }, [size]);
20546
- return __assign$2({ ref: onRefChange }, size);
20547
- }
20548
-
20549
- /* *
20550
- * Licensed under the Apache License, Version 2.0 (the "License");
20551
- * you may not use this file except in compliance with the License.
20552
- * You may obtain a copy of the License at
20553
- *
20554
- * http://www.apache.org/licenses/LICENSE-2.0
20555
- *
20556
- * Unless required by applicable law or agreed to in writing, software
20557
- * distributed under the License is distributed on an "AS IS" BASIS,
20558
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20559
- * See the License for the specific language governing permissions and
20560
- * limitations under the License.
20561
- *
20562
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20563
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
20564
- * */
20565
- var ReactMapViewLayer = function ReactMapViewLayer(props) {
20566
- var id = props.id;
20567
- return /*#__PURE__*/React.createElement("div", {
20568
- style: {
20569
- width: '100%',
20570
- padding: '2px',
20571
- margin: 0,
20572
- wordWrap: 'break-word',
20573
- border: '1px solid rgba(0, 0, 0, 0.5)',
20574
- lineHeight: '14px',
20575
- fontSize: '10px',
20576
- background: 'rgba(255, 255, 255, 0.5)',
20577
- display: 'none'
20578
- }
20579
- }, /*#__PURE__*/React.createElement("div", null, id), /*#__PURE__*/React.createElement("div", {
20580
- // eslint-disable-next-line react/no-danger
20581
- dangerouslySetInnerHTML: {
20582
- __html: JSON.stringify(props, null, '--').replace(/\n/g, '<br/>')
20583
- }
20584
- }));
20585
- };
20586
-
20587
- /* *
20588
- * Licensed under the Apache License, Version 2.0 (the "License");
20589
- * you may not use this file except in compliance with the License.
20590
- * You may obtain a copy of the License at
20591
- *
20592
- * http://www.apache.org/licenses/LICENSE-2.0
20593
- *
20594
- * Unless required by applicable law or agreed to in writing, software
20595
- * distributed under the License is distributed on an "AS IS" BASIS,
20596
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20597
- * See the License for the specific language governing permissions and
20598
- * limitations under the License.
20599
- *
20600
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20601
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
20602
- * */
20603
- var setLayerInfo = function setLayerInfo(wmLayer, mapId, onUpdateLayerInformation) {
20604
- var origin = layerTypes.LayerActionOrigin.ReactMapViewParseLayer;
20605
- var map = webmapUtils.getWMJSMapById(mapId);
20606
- /* Update list of layers for service */
20607
- var updateObject = {
20608
- origin: origin,
20609
- layerStyle: {
20610
- origin: origin,
20611
- layerId: wmLayer.ReactWMJSLayerId,
20612
- style: wmLayer.currentStyle
20613
- },
20614
- mapDimensions: {
20615
- mapId: mapId,
20616
- origin: origin,
20617
- dimensions: map && map.mapdimensions.map(function (mapdim) {
20618
- return {
20619
- units: mapdim.units,
20620
- currentValue: mapdim.currentValue,
20621
- name: mapdim.name
20622
- };
20623
- }) || []
20624
- },
20625
- layerDimensions: {
20626
- origin: origin,
20627
- layerId: wmLayer.id,
20628
- dimensions: wmLayer.dimensions.map(function (dim) {
20629
- var name = dim.name,
20630
- units = dim.units,
20631
- synced = dim.synced;
20632
- return {
20633
- name: name,
20634
- units: units,
20635
- currentValue: dim.getValue(),
20636
- minValue: dim.getFirstValue(),
20637
- maxValue: dim.getLastValue(),
20638
- timeInterval: dim.getDimInterval(),
20639
- values: dim.getValues(),
20640
- synced: synced
20641
- };
20642
- })
20643
- }
20644
- };
20645
- onUpdateLayerInformation === null || onUpdateLayerInformation === void 0 ? void 0 : onUpdateLayerInformation(updateObject);
20646
- };
20647
-
20648
- function _typeof(obj) {
20649
- "@babel/helpers - typeof";
20650
-
20651
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
20652
- return typeof obj;
20653
- } : function (obj) {
20654
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
20655
- }, _typeof(obj);
20656
- }
20657
-
20658
- function requiredArgs(required, args) {
20659
- if (args.length < required) {
20660
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
20661
- }
20662
- }
20663
-
20664
- /**
20665
- * @name toDate
20666
- * @category Common Helpers
20667
- * @summary Convert the given argument to an instance of Date.
20668
- *
20669
- * @description
20670
- * Convert the given argument to an instance of Date.
20671
- *
20672
- * If the argument is an instance of Date, the function returns its clone.
20673
- *
20674
- * If the argument is a number, it is treated as a timestamp.
20675
- *
20676
- * If the argument is none of the above, the function returns Invalid Date.
20677
- *
20678
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
20679
- *
20680
- * @param {Date|Number} argument - the value to convert
20681
- * @returns {Date} the parsed date in the local time zone
20682
- * @throws {TypeError} 1 argument required
20683
- *
20684
- * @example
20685
- * // Clone the date:
20686
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
20687
- * //=> Tue Feb 11 2014 11:30:30
20688
- *
20689
- * @example
20690
- * // Convert the timestamp to date:
20691
- * const result = toDate(1392098430000)
20692
- * //=> Tue Feb 11 2014 11:30:30
20693
- */
20694
- function toDate(argument) {
20695
- requiredArgs(1, arguments);
20696
- var argStr = Object.prototype.toString.call(argument);
20697
-
20698
- // Clone the date
20699
- if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
20700
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
20701
- return new Date(argument.getTime());
20702
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
20703
- return new Date(argument);
20704
- } else {
20705
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
20706
- // eslint-disable-next-line no-console
20707
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
20708
- // eslint-disable-next-line no-console
20709
- console.warn(new Error().stack);
20710
- }
20711
- return new Date(NaN);
20712
- }
20713
- }
20714
-
20715
- /**
20716
- * Days in 1 week.
20717
- *
20718
- * @name daysInWeek
20719
- * @constant
20720
- * @type {number}
20721
- * @default
20722
- */
20723
-
20724
- /**
20725
- * Milliseconds in 1 minute
20726
- *
20727
- * @name millisecondsInMinute
20728
- * @constant
20729
- * @type {number}
20730
- * @default
20731
- */
20732
- var millisecondsInMinute = 60000;
20733
-
20734
- /**
20735
- * @name differenceInMilliseconds
20736
- * @category Millisecond Helpers
20737
- * @summary Get the number of milliseconds between the given dates.
20738
- *
20739
- * @description
20740
- * Get the number of milliseconds between the given dates.
20741
- *
20742
- * @param {Date|Number} dateLeft - the later date
20743
- * @param {Date|Number} dateRight - the earlier date
20744
- * @returns {Number} the number of milliseconds
20745
- * @throws {TypeError} 2 arguments required
20746
- *
20747
- * @example
20748
- * // How many milliseconds are between
20749
- * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?
20750
- * const result = differenceInMilliseconds(
20751
- * new Date(2014, 6, 2, 12, 30, 21, 700),
20752
- * new Date(2014, 6, 2, 12, 30, 20, 600)
20753
- * )
20754
- * //=> 1100
20755
- */
20756
- function differenceInMilliseconds(dateLeft, dateRight) {
20757
- requiredArgs(2, arguments);
20758
- return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
20759
- }
20760
-
20761
- var roundingMap = {
20762
- ceil: Math.ceil,
20763
- round: Math.round,
20764
- floor: Math.floor,
20765
- trunc: function trunc(value) {
20766
- return value < 0 ? Math.ceil(value) : Math.floor(value);
20767
- } // Math.trunc is not supported by IE
20768
- };
20769
-
20770
- var defaultRoundingMethod = 'trunc';
20771
- function getRoundingMethod(method) {
20772
- return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
20773
- }
20774
-
20775
- /**
20776
- * @name differenceInMinutes
20777
- * @category Minute Helpers
20778
- * @summary Get the number of minutes between the given dates.
20779
- *
20780
- * @description
20781
- * Get the signed number of full (rounded towards 0) minutes between the given dates.
20782
- *
20783
- * @param {Date|Number} dateLeft - the later date
20784
- * @param {Date|Number} dateRight - the earlier date
20785
- * @param {Object} [options] - an object with options.
20786
- * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)
20787
- * @returns {Number} the number of minutes
20788
- * @throws {TypeError} 2 arguments required
20789
- *
20790
- * @example
20791
- * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?
20792
- * const result = differenceInMinutes(
20793
- * new Date(2014, 6, 2, 12, 20, 0),
20794
- * new Date(2014, 6, 2, 12, 7, 59)
20795
- * )
20796
- * //=> 12
20797
- *
20798
- * @example
20799
- * // How many minutes are between 10:01:59 and 10:00:00
20800
- * const result = differenceInMinutes(
20801
- * new Date(2000, 0, 1, 10, 0, 0),
20802
- * new Date(2000, 0, 1, 10, 1, 59)
20803
- * )
20804
- * //=> -1
20805
- */
20806
- function differenceInMinutes(dateLeft, dateRight, options) {
20807
- requiredArgs(2, arguments);
20808
- var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
20809
- return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
20810
- }
20811
-
20812
- /* *
20813
- * Licensed under the Apache License, Version 2.0 (the "License");
20814
- * you may not use this file except in compliance with the License.
20815
- * You may obtain a copy of the License at
20816
- *
20817
- * http://www.apache.org/licenses/LICENSE-2.0
20818
- *
20819
- * Unless required by applicable law or agreed to in writing, software
20820
- * distributed under the License is distributed on an "AS IS" BASIS,
20821
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20822
- * See the License for the specific language governing permissions and
20823
- * limitations under the License.
20824
- *
20825
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20826
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
20827
- * */
20828
- /**
20829
- * Returns filtered list of props with geoJson
20830
- * @param children React.ReactNode, layers with geoJson
20831
- */
20832
- var getFeatureLayers = function getFeatureLayers(children) {
20833
- return children && Array.isArray(children) ? children
20834
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
20835
- // @ts-ignore
20836
- .reduce(function (acc, val) {
20837
- return acc.concat(val);
20838
- }, []).filter(function (c) {
20839
- return c && c.props && c.props.geojson;
20840
- }).map(function (c) {
20841
- return c.props;
20842
- }).reverse() : [];
20843
- };
20844
- /**
20845
- * Returns true if this is a maplayer and not a baselayer or overlayer
20846
- * @param layer The layerTypes.Layer object, or the props from the ReactWMJSLayer
20847
- */
20848
- var isAMapLayer = function isAMapLayer(layer) {
20849
- return layer.layerType === LayerType.mapLayer;
20850
- };
20851
- /**
20852
- * Returns true if this is a geojsonlayer (layer containing geojson field)
20853
- * @param layer The layerTypes.Layer object, or the props from the ReactWMJSLayer
20854
- */
20855
- var isAGeoJSONLayer = function isAGeoJSONLayer(layer) {
20856
- return layer.geojson !== undefined;
20857
- };
20858
- var getWMJSLayerFromReactLayer = function getWMJSLayerFromReactLayer(mapId, wmLayers, reactWebMapJSLayer, wmLayerIndex) {
20859
- var _reactWebMapJSLayer$p = reactWebMapJSLayer.props,
20860
- reactLayerId = _reactWebMapJSLayer$p.id,
20861
- layerName = _reactWebMapJSLayer$p.name;
20862
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
20863
- /* Some safety checks */
20864
- if (!wmjsMap || !wmLayers || !reactLayerId || !layerName) {
20865
- return {
20866
- layer: null,
20867
- layerArrayMutated: false
20868
- };
20869
- }
20870
- /* Find the wmlayer by its react layer id */
20871
- var matchingLayerIndex = wmLayers.findIndex(function (wmLayer) {
20872
- return wmLayer.id === reactLayerId;
20873
- });
20874
- if (matchingLayerIndex === -1) {
20875
- return {
20876
- layer: null,
20877
- layerArrayMutated: false
20878
- };
20879
- }
20880
- /*
20881
- The layer order in the react children array index is
20882
- reversed compared to the layer order in the wmLayer array index
20883
- */
20884
- var reactLayerIndex = wmLayers.length - 1 - wmLayerIndex;
20885
- var isMapLayer = isAMapLayer(reactWebMapJSLayer.props);
20886
- var mapLayerArrayShouldBeMutated = isMapLayer && matchingLayerIndex !== reactLayerIndex;
20887
- /* It seems that a layer was moved in the layerlist, move it in the wmjsMap too */
20888
- if (mapLayerArrayShouldBeMutated) {
20889
- wmjsMap.swapLayers(wmLayers[matchingLayerIndex], wmLayers[reactLayerIndex]);
20890
- wmjsMap.draw();
20891
- }
20892
- return {
20893
- layer: wmLayers[matchingLayerIndex],
20894
- layerArrayMutated: mapLayerArrayShouldBeMutated
20895
- };
20896
- };
20897
- function getIsInsideAcceptanceTime(acceptanceTimeInMinutes, mapDimensions, layerDimensions) {
20898
- var _a, _b;
20899
- var mapCurrentTime = (_a = mapDimensions === null || mapDimensions === void 0 ? void 0 : mapDimensions.find(function (dimension) {
20900
- return dimension.name === 'time';
20901
- })) === null || _a === void 0 ? void 0 : _a.currentValue;
20902
- var layerCurrentTime = (_b = layerDimensions === null || layerDimensions === void 0 ? void 0 : layerDimensions.find(function (dimension) {
20903
- return dimension.name === 'time';
20904
- })) === null || _b === void 0 ? void 0 : _b.currentValue;
20905
- if (acceptanceTimeInMinutes === undefined || !mapCurrentTime || !layerCurrentTime) {
20906
- return true;
20907
- }
20908
- var minutesBetween = differenceInMinutes(new Date(mapCurrentTime), new Date(layerCurrentTime));
20909
- if (Math.abs(minutesBetween) > acceptanceTimeInMinutes) {
20910
- return false;
20911
- }
20912
- return true;
20913
- }
20914
-
20915
- var getDisplayText = function getDisplayText(currentAdagucTime) {
20916
- var timeFormat = 'eee dd MMM yyyy HH:mm [UTC]';
20917
- var adagucTime = dateUtils.utc(currentAdagucTime);
20918
- var adagucTimeFormatted = dateUtils.dateToString(adagucTime, timeFormat);
20919
- return adagucTimeFormatted;
20920
- };
20921
- var ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION = 'ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION';
20922
- var ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO = 'ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO';
20923
- var ReactMapView = /*#__PURE__*/function (_React$Component) {
20924
- _inherits(ReactMapView, _React$Component);
20925
- var _super = _createSuper(ReactMapView);
20926
- function ReactMapView(props) {
20927
- var _this;
20928
- _classCallCheck(this, ReactMapView);
20929
- _this = _super.call(this, props);
20930
- _this.adaguc = {
20931
- initialized: false,
20932
- baseLayers: [],
20933
- oldbbox: undefined,
20934
- currentWidth: -1,
20935
- currentHeight: -1,
20936
- currentMapProps: {
20937
- children: []
20938
- }
20939
- };
20940
- _this.refetchTimer = null;
20941
- _this.onStartRefetchTimer = function () {
20942
- /*
20943
- TODO, Maarten Plieger, 2021-09-02, https://gitlab.com/opengeoweb/opengeoweb/-/issues/1159:
20944
- This causes many issues, we should improve the update strategy.
20945
- Certain presets have >20 layers. This causes 20 times parsing the GetCapabilities for a minor update of the store.
20946
-
20947
- */
20948
- _this.clearRefetchTimer();
20949
- var fetchSpeed = 60000; // 1 minute
20950
- _this.refetchTimer = setInterval(function () {
20951
- var mapId = _this.props.mapId;
20952
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
20953
- var layers = wmjsMap.getLayers();
20954
- layers.forEach(function (layer) {
20955
- if (layer.enabled !== false) {
20956
- _this.parseWMJSLayer(layer, true);
20957
- }
20958
- });
20959
- }, fetchSpeed);
20960
- };
20961
- _this.clearRefetchTimer = function () {
20962
- if (_this.refetchTimer) {
20963
- clearInterval(_this.refetchTimer);
20964
- }
20965
- };
20966
- _this.parseWMJSLayer = function (wmLayer, forceReload, child) {
20967
- var callback = function callback() {
20968
- var _this$props = _this.props,
20969
- onUpdateLayerInformation = _this$props.onUpdateLayerInformation,
20970
- mapId = _this$props.mapId;
20971
- try {
20972
- setLayerInfo(wmLayer, mapId, onUpdateLayerInformation);
20973
- } catch (e) {
20974
- /* Provide a hint on what is going wrong */
20975
- console.error(e);
20976
- }
20977
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
20978
- if (child) {
20979
- if (wmLayer.hasError) {
20980
- if (child.props.onLayerError) {
20981
- child.props.onLayerError(wmLayer, new Error(wmLayer.lastError), wmjsMap);
20982
- }
20983
- } else if (child.props.onLayerReady) {
20984
- child.props.onLayerReady(wmLayer, wmjsMap);
20985
- }
20986
- }
20987
- };
20988
- wmLayer.parseLayer(callback, forceReload, 'ReactMapView parseWMJSLayer');
20989
- };
20990
- _this.state = {
20991
- adagucInitialised: false
20992
- };
20993
- _this.resize = _this.resize.bind(_assertThisInitialized$1(_this));
20994
- _this.handleWindowResize = _this.handleWindowResize.bind(_assertThisInitialized$1(_this));
20995
- _this.drawDebounced = debounce$2(600, _this.drawDebounced);
20996
- _this.updateWMJSMapProps = _this.updateWMJSMapProps.bind(_assertThisInitialized$1(_this));
20997
- _this.mountWMJSMap = _this.mountWMJSMap.bind(_assertThisInitialized$1(_this));
20998
- _this.onAfterSetBBoxListener = _this.onAfterSetBBoxListener.bind(_assertThisInitialized$1(_this));
20999
- _this.onUpdateBBoxListener = _this.onUpdateBBoxListener.bind(_assertThisInitialized$1(_this));
21000
- _this.onDimChangeListener = _this.onDimChangeListener.bind(_assertThisInitialized$1(_this));
21001
- _this.adagucContainerRef = /*#__PURE__*/React.createRef();
21002
- _this.adagucWebMapJSRef = /*#__PURE__*/React.createRef();
21003
- return _this;
21004
- }
21005
- _createClass(ReactMapView, [{
21006
- key: "componentDidMount",
21007
- value: function componentDidMount() {
21008
- var _this$props2 = this.props,
21009
- shouldAutoFetch = _this$props2.shouldAutoFetch,
21010
- onWMJSMount = _this$props2.onWMJSMount,
21011
- mapId = _this$props2.mapId;
21012
- /* If this components re-mounts, make sure that the initialized state is set back to false */
21013
- this.setState({
21014
- adagucInitialised: false
21015
- });
21016
- window.addEventListener('resize', this.handleWindowResize);
21017
- this.mountWMJSMap();
21018
- if (shouldAutoFetch) {
21019
- this.onStartRefetchTimer();
21020
- }
21021
- onWMJSMount(mapId);
21022
- }
21023
- }, {
21024
- key: "componentDidUpdate",
21025
- value: function componentDidUpdate(prevProps) {
21026
- this.updateWMJSMapProps(prevProps, this.props);
21027
- }
21028
- }, {
21029
- key: "componentWillUnmount",
21030
- value: function componentWillUnmount() {
21031
- var mapId = this.props.mapId;
21032
- window.removeEventListener('resize', this.handleWindowResize);
21033
- this.clearRefetchTimer();
21034
- webmapUtils.unRegisterWMJSMap(mapId);
21035
- /* Reset adaguc properties */
21036
- this.adaguc.initialized = false;
21037
- this.adaguc.currentHeight = -1;
21038
- this.adaguc.currentWidth = -1;
21039
- this.adaguc.baseLayers = [];
21040
- this.adaguc.oldbbox = new WMBBOX();
21041
- this.adaguc.currentMapProps.children = null;
21042
- }
21043
- }, {
21044
- key: "handleWindowResize",
21045
- value: function handleWindowResize() {
21046
- this.resize();
21047
- }
21048
- }, {
21049
- key: "onDimChangeListener",
21050
- value: function onDimChangeListener() {
21051
- var _this$props3 = this.props,
21052
- mapId = _this$props3.mapId,
21053
- onMapChangeDimension = _this$props3.onMapChangeDimension;
21054
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21055
- if (wmjsMap) {
21056
- var timeDimension = wmjsMap.getDimension('time');
21057
- if (timeDimension) {
21058
- onMapChangeDimension({
21059
- mapId: mapId,
21060
- origin: ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION,
21061
- dimension: {
21062
- name: 'time',
21063
- currentValue: timeDimension.currentValue
21064
- }
21065
- });
21066
- }
21067
- }
21068
- }
21069
- }, {
21070
- key: "onAfterSetBBoxListener",
21071
- value: function onAfterSetBBoxListener() {
21072
- var _this2 = this;
21073
- /* Update the map after 100 ms */
21074
- window.setTimeout(function () {
21075
- var _this2$props = _this2.props,
21076
- MapViewBBOX = _this2$props.bbox,
21077
- mapId = _this2$props.mapId,
21078
- onMapZoomEnd = _this2$props.onMapZoomEnd;
21079
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21080
- if (!wmjsMap) {
21081
- return;
21082
- }
21083
- var projectionInfo = wmjsMap.getProjection();
21084
- /* Trigger onMapZoomEnd callback */
21085
- var mapBBOX = projectionInfo.bbox;
21086
- if (MapViewBBOX.left !== mapBBOX.left || MapViewBBOX.right !== mapBBOX.right || MapViewBBOX.bottom !== mapBBOX.bottom || MapViewBBOX.top !== mapBBOX.top) {
21087
- onMapZoomEnd({
21088
- mapId: mapId,
21089
- bbox: {
21090
- left: projectionInfo.bbox.left,
21091
- bottom: projectionInfo.bbox.bottom,
21092
- right: projectionInfo.bbox.right,
21093
- top: projectionInfo.bbox.top
21094
- },
21095
- srs: projectionInfo.srs
21096
- });
21097
- }
21098
- }, 100);
21099
- }
21100
- }, {
21101
- key: "onUpdateBBoxListener",
21102
- value: function onUpdateBBoxListener(newBbox) {
21103
- var oldbbox = this.adaguc.oldbbox || new WMBBOX(ReactMapView.defaultProps.bbox);
21104
- if (oldbbox.left !== newBbox.left || oldbbox.right !== newBbox.right || oldbbox.top !== newBbox.top || oldbbox.bottom !== newBbox.bottom) {
21105
- oldbbox.left = newBbox.left;
21106
- oldbbox.right = newBbox.right;
21107
- oldbbox.top = newBbox.top;
21108
- oldbbox.bottom = newBbox.bottom;
21109
- this.adaguc.oldbbox = new WMBBOX(oldbbox);
21110
- }
21111
- }
21112
- }, {
21113
- key: "updateWMJSMapProps",
21114
- value: function updateWMJSMapProps(prevProps, props) {
21115
- var _this3 = this;
21116
- if (!props) {
21117
- return;
21118
- }
21119
- var mapId = props.mapId,
21120
- children = props.children;
21121
- if (prevProps && prevProps.mapId !== props.mapId) {
21122
- console.warn('MapId has changed on an already mounted map!');
21123
- var prevWMJSMap = webmapUtils.getWMJSMapById(prevProps.mapId);
21124
- if (prevWMJSMap) {
21125
- webmapUtils.registerWMJSMap(prevWMJSMap, mapId);
21126
- }
21127
- }
21128
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21129
- if (!wmjsMap) {
21130
- console.warn("No wmjsMap ".concat(mapId));
21131
- return;
21132
- }
21133
- var needsRedraw = false;
21134
- /* Check map props */
21135
- if (!prevProps || prevProps.showLegend !== props.showLegend) {
21136
- wmjsMap.displayLegendInMap(props.showLegend !== false);
21137
- }
21138
- if (!prevProps || prevProps.showScaleBar !== props.showScaleBar) {
21139
- wmjsMap.displayScaleBarInMap(props.showScaleBar !== false);
21140
- needsRedraw = true;
21141
- }
21142
- /* Check map dimensions */
21143
- if (!prevProps || prevProps.dimensions !== props.dimensions) {
21144
- if (props.dimensions) {
21145
- for (var d = 0; d < props.dimensions.length; d += 1) {
21146
- var propDimension = props.dimensions[d];
21147
- var mapDim = wmjsMap.getDimension(propDimension.name);
21148
- if (mapDim && mapDim.currentValue !== propDimension.currentValue || !mapDim) {
21149
- wmjsMap.setDimension(propDimension.name, propDimension.currentValue, false, false);
21150
- }
21151
- if (props.displayTimeInMap && propDimension.name === 'time' && propDimension.currentValue !== undefined) {
21152
- needsRedraw = true;
21153
- var displayText = getDisplayText(propDimension.currentValue);
21154
- wmjsMap.setTimeOffset(displayText);
21155
- }
21156
- }
21157
- }
21158
- }
21159
- /* Check if srs and BBOX is updated */
21160
- if (!prevProps || prevProps.bbox !== props.bbox) {
21161
- if (props.bbox.left !== undefined) {
21162
- var projectionInfo = wmjsMap.getProjection();
21163
- var mapBBOX = projectionInfo.bbox;
21164
- if (props.bbox.left !== mapBBOX.left || props.bbox.right !== mapBBOX.right || props.bbox.bottom !== mapBBOX.bottom || props.bbox.top !== mapBBOX.top) {
21165
- wmjsMap.suspendEvent('onupdatebbox');
21166
- wmjsMap.setProjection(props.srs, new WMBBOX(props.bbox));
21167
- wmjsMap.resumeEvent('onupdatebbox');
21168
- wmjsMap.draw();
21169
- }
21170
- }
21171
- }
21172
- /* Check display/hide map cursor */
21173
- if (!prevProps || prevProps.displayMapPin !== props.displayMapPin) {
21174
- if (props.displayMapPin === true) {
21175
- wmjsMap.getMapPin().showMapPin();
21176
- } else if (props.displayMapPin === false) {
21177
- wmjsMap.getMapPin().hideMapPin();
21178
- }
21179
- }
21180
- /* Set map cursor location */
21181
- if (!prevProps || prevProps.mapPinLocation !== props.mapPinLocation) {
21182
- if (props.mapPinLocation) {
21183
- wmjsMap.getMapPin().positionMapPinByLatLon({
21184
- x: props.mapPinLocation.lon,
21185
- y: props.mapPinLocation.lat
21186
- });
21187
- }
21188
- }
21189
- /* Set disable map pin */
21190
- if (!prevProps || prevProps.disableMapPin !== props.disableMapPin) {
21191
- if (props.disableMapPin === true) {
21192
- wmjsMap.getMapPin().setMapPinDisabled();
21193
- } else if (props.disableMapPin === false) {
21194
- wmjsMap.getMapPin().setMapPinEnabled();
21195
- }
21196
- }
21197
- /* Change the animation delay */
21198
- if (!prevProps || prevProps.animationDelay !== props.animationDelay) {
21199
- if (props.animationDelay) {
21200
- if (typeof wmjsMap.setAnimationDelay === 'function') {
21201
- wmjsMap.setAnimationDelay(props.animationDelay);
21202
- }
21203
- }
21204
- }
21205
- /* Check if layer metadata should be shown */
21206
- if (!prevProps || prevProps.showLayerInfo !== props.showLayerInfo) {
21207
- if (props.showLayerInfo) {
21208
- wmjsMap.showLayerInfo = props.showLayerInfo;
21209
- }
21210
- }
21211
- if (children !== this.adaguc.currentMapProps.children) {
21212
- var myChildren = [];
21213
- var takenIds = new Set();
21214
- React.Children.forEach(children, function (child) {
21215
- if (child) {
21216
- var childProps = child.props;
21217
- if (childProps && childProps.id) {
21218
- if (!takenIds.has(childProps.id)) {
21219
- myChildren.push(child);
21220
- takenIds.add(childProps.id);
21221
- } else {
21222
- childProps.onLayerError(childProps, new Error("Duplicate layer id \"".concat(childProps.id, "\" encountered within this mapTypes.WebMap")), wmjsMap);
21223
- console.warn('ReactWMJSLayer has a duplicate id', child);
21224
- }
21225
- } else {
21226
- debug(DebugType.Warning, 'ReactElement child ignored: has no props or id', child);
21227
- }
21228
- }
21229
- });
21230
- myChildren.reverse();
21231
- var wmjsLayers = wmjsMap.getLayers();
21232
- /* ReactWMJSLayer Layer Childs: Detect all ReactLayers connected to WMJSLayers, remove WMJSLayer if there is no ReactLayer */
21233
- var _loop = function _loop(l) {
21234
- if (myChildren.filter(function (c) {
21235
- return c && c.props && c.props.id === wmjsLayers[l].ReactWMJSLayerId;
21236
- }).length === 0) {
21237
- /* This will call the remove property of the WMJSLayer, which will adjust the layers array of WebMapJS */
21238
- wmjsLayers[l].remove();
21239
- /* Trigger update of all map dimensions */
21240
- var onUpdateLayerInformation = props.onUpdateLayerInformation,
21241
- _mapId = props.mapId;
21242
- onUpdateLayerInformation === null || onUpdateLayerInformation === void 0 ? void 0 : onUpdateLayerInformation({
21243
- origin: ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO,
21244
- layerStyle: null,
21245
- layerDimensions: null,
21246
- mapDimensions: {
21247
- origin: origin,
21248
- mapId: _mapId,
21249
- dimensions: wmjsMap.mapdimensions.map(function (_ref) {
21250
- var name = _ref.name,
21251
- units = _ref.units,
21252
- currentValue = _ref.currentValue,
21253
- synced = _ref.synced;
21254
- return {
21255
- name: name,
21256
- units: units,
21257
- currentValue: currentValue,
21258
- synced: synced
21259
- };
21260
- })
21261
- }
21262
- });
21263
- _this3.updateWMJSMapProps(prevProps, props);
21264
- return {
21265
- v: void 0
21266
- };
21267
- }
21268
- },
21269
- _ret;
21270
- for (var l = 0; l < wmjsLayers.length; l += 1) {
21271
- _ret = _loop(l);
21272
- if (_ret) return _ret.v;
21273
- }
21274
- /* ReactWMJSLayer BaseLayer Childs: For the baseLayers, detect all ReactLayers connected to WMJSLayers, remove WMJSLayer if there is no ReactLayer */
21275
- var webmapJSBaselayers = wmjsMap.getBaseLayers();
21276
- var _loop2 = function _loop2(_l) {
21277
- var wmjsBaseLayers = wmjsMap.getBaseLayers();
21278
- if (myChildren.filter(function (c) {
21279
- return c && c.props ? c.props.id === wmjsBaseLayers[_l].ReactWMJSLayerId : false;
21280
- }).length === 0) {
21281
- /* TODO (Maarten Plieger, 2020-03-19):The remove property for the baselayer is not working yet */
21282
- wmjsBaseLayers.splice(_l, 1);
21283
- wmjsMap.setBaseLayers(wmjsBaseLayers);
21284
- wmjsBaseLayers = wmjsMap.getBaseLayers();
21285
- _this3.updateWMJSMapProps(prevProps, props);
21286
- return {
21287
- v: void 0
21288
- };
21289
- }
21290
- },
21291
- _ret2;
21292
- for (var _l = 0; _l < webmapJSBaselayers.length; _l += 1) {
21293
- _ret2 = _loop2(_l);
21294
- if (_ret2) return _ret2.v;
21295
- }
21296
- var adagucWMJSLayerIndex = 0;
21297
- var adagucWMJSBaseLayerIndex = 0;
21298
- /* Loop through all React layers and update WMJSLayer properties where needed */
21299
- var _loop3 = function _loop3() {
21300
- var child = myChildren[c];
21301
- if (child && child.type) {
21302
- /* Check layers */
21303
- if (_typeof$2(child.type) === _typeof$2(MapViewLayer)) {
21304
- /* Feature layer (with child.props.geojson), these are handled collectively by the setState commando above. */
21305
- var isBaselayer = !isAMapLayer(child.props) && !isAGeoJSONLayer(child.props);
21306
- var adagucWMJSLayers = isBaselayer ? wmjsMap.getBaseLayers() : wmjsMap.getLayers();
21307
- var obj = getWMJSLayerFromReactLayer(mapId, adagucWMJSLayers, child, isBaselayer ? adagucWMJSBaseLayerIndex : adagucWMJSLayerIndex);
21308
- if (obj.layerArrayMutated) {
21309
- _this3.updateWMJSMapProps(prevProps, props);
21310
- return {
21311
- v: void 0
21312
- };
21313
- }
21314
- var wmLayer = obj.layer;
21315
- if (isBaselayer) {
21316
- adagucWMJSBaseLayerIndex += 1;
21317
- } else {
21318
- adagucWMJSLayerIndex += 1;
21319
- }
21320
- /* Layer was not yet added */
21321
- if (wmLayer === null) {
21322
- var keepOnTop = child.props.layerType === LayerType.overLayer || false;
21323
- var newWMLayer = new WMLayer(Object.assign(Object.assign({}, child.props), {
21324
- keepOnTop: keepOnTop
21325
- }));
21326
- webmapUtils.registerWMLayer(newWMLayer, child.props.id);
21327
- newWMLayer.ReactWMJSLayerId = child.props.id;
21328
- if (isBaselayer) {
21329
- /* Add ADAGUC WebMapJS Baselayer */
21330
- _this3.adaguc.baseLayers.push(newWMLayer);
21331
- wmjsMap.setBaseLayers(_this3.adaguc.baseLayers.reverse());
21332
- } else {
21333
- /* Add ADAGUC WebMapJS Layer */
21334
- wmjsMap.addLayer(newWMLayer).then(function () {
21335
- wmjsMap.draw();
21336
- });
21337
- }
21338
- if (!isBaselayer) {
21339
- _this3.parseWMJSLayer(newWMLayer, false, child);
21340
- }
21341
- needsRedraw = true;
21342
- } else {
21343
- /* Set the name of the ADAGUC WMJSLayer */
21344
- if (child.props.name !== undefined && wmLayer.name !== child.props.name) {
21345
- wmLayer.setName(child.props.name).then(function () {
21346
- _this3.parseWMJSLayer(wmLayer, false, child);
21347
- });
21348
- needsRedraw = true;
21349
- }
21350
- /* Set the Opacity of the ADAGUC WMJSLayer */
21351
- if (child.props.opacity !== undefined && wmLayer.opacity !== child.props.opacity) {
21352
- wmLayer.setOpacity(child.props.opacity);
21353
- needsRedraw = false;
21354
- }
21355
- /* Set the Style of the ADAGUC WMJSLayer */
21356
- if (child.props.style !== undefined && wmLayer.currentStyle !== child.props.style) {
21357
- wmLayer.setStyle(child.props.style);
21358
- needsRedraw = true;
21359
- }
21360
- var _child$props = child.props,
21361
- enabled = _child$props.enabled,
21362
- acceptanceTimeInMinutes = _child$props.acceptanceTimeInMinutes,
21363
- layerDimensions = _child$props.dimensions;
21364
- var isInsideAcceptanceTime = getIsInsideAcceptanceTime(acceptanceTimeInMinutes, props.dimensions, layerDimensions);
21365
- if (enabled !== undefined) {
21366
- var wmLayerShouldBeShown = isInsideAcceptanceTime && enabled;
21367
- if (wmLayerShouldBeShown !== wmLayer.enabled) {
21368
- wmLayer.display(wmLayerShouldBeShown);
21369
- needsRedraw = true;
21370
- }
21371
- }
21372
- /* Set the dimensions of the ADAGUC WMJSLayer */
21373
- if (child.props.dimensions !== undefined) {
21374
- for (var _d = 0; _d < child.props.dimensions.length; _d += 1) {
21375
- var dim = child.props.dimensions[_d];
21376
- var wmjsDim = wmLayer.getDimension(dim.name);
21377
- if (wmjsDim) {
21378
- if (wmjsDim.currentValue !== dim.currentValue) {
21379
- wmLayer.setDimension(dim.name, dim.currentValue, false);
21380
- needsRedraw = true;
21381
- }
21382
- if (wmjsDim.synced !== dim.synced) {
21383
- wmjsDim.synced = dim.synced;
21384
- needsRedraw = true;
21385
- }
21386
- } else {
21387
- debug(DebugType.Warning, "MapView: Dimension does not exist, skipping ".concat(child.props.name, " :: ").concat(dim.name, " = ").concat(dim.currentValue));
21388
- }
21389
- }
21390
- }
21391
- }
21392
- }
21393
- }
21394
- },
21395
- _ret3;
21396
- for (var c = 0; c < myChildren.length; c += 1) {
21397
- _ret3 = _loop3();
21398
- if (_ret3) return _ret3.v;
21399
- }
21400
- if (needsRedraw) {
21401
- wmjsMap.draw();
21402
- }
21403
- /* Children have been processed */
21404
- this.adaguc.currentMapProps.children = children;
21405
- }
21406
- }
21407
- }, {
21408
- key: "drawDebounced",
21409
- value: function drawDebounced() {
21410
- var mapId = this.props.mapId;
21411
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21412
- wmjsMap.getListener().suspendEvents();
21413
- wmjsMap.draw();
21414
- wmjsMap.getListener().resumeEvents();
21415
- }
21416
- }, {
21417
- key: "mountWMJSMap",
21418
- value: function mountWMJSMap() {
21419
- var _this4 = this;
21420
- var _this$props4 = this.props,
21421
- mapId = _this$props4.mapId,
21422
- listeners = _this$props4.listeners,
21423
- srs = _this$props4.srs,
21424
- bbox = _this$props4.bbox,
21425
- onMapPinChangeLocation = _this$props4.onMapPinChangeLocation;
21426
- /* Check if we have something to mount WMJSMap on */
21427
- if (this.adagucWebMapJSRef.current === null) {
21428
- console.warn('No this.adagucWebMapJSRef.current yet ');
21429
- return null;
21430
- }
21431
- /* Check if webmapjs was not already initialized */
21432
- var existingWMJSMap = webmapUtils.getWMJSMapById(mapId);
21433
- if (existingWMJSMap) {
21434
- console.warn("Somehow ".concat(mapId, "webmapUtils.unRegisterWMJSMap already exists"));
21435
- webmapUtils.unRegisterWMJSMap(mapId);
21436
- }
21437
- var wmjsMap = new WMJSMap(this.adagucWebMapJSRef.current);
21438
- this.adaguc.currentMapProps = {};
21439
- this.adaguc.currentMapProps.children = null;
21440
- this.adaguc.baseLayers = [];
21441
- webmapUtils.registerWMJSMap(wmjsMap, mapId);
21442
- this.adaguc.initialized = true;
21443
- /* Enable to show actual layer properties in the map */
21444
- wmjsMap.showLayerInfo = false;
21445
- wmjsMap.removeAllLayers();
21446
- if (srs) {
21447
- wmjsMap.setProjection(srs, new WMBBOX(bbox));
21448
- }
21449
- wmjsMap.setWMTileRendererTileSettings(tilesettings);
21450
- if (listeners) {
21451
- listeners.forEach(function (listener) {
21452
- wmjsMap.addListener(listener.name, function (data) {
21453
- listener.callbackfunction(wmjsMap, data);
21454
- }, listener.keep);
21455
- });
21456
- }
21457
- wmjsMap.addListener('ondimchange', function () {
21458
- _this4.onDimChangeListener();
21459
- }, true);
21460
- wmjsMap.addListener('onmapready', function () {
21461
- _this4.setState({
21462
- adagucInitialised: true
21463
- });
21464
- });
21465
- wmjsMap.addListener('aftersetbbox', function () {
21466
- _this4.onAfterSetBBoxListener();
21467
- }, true);
21468
- wmjsMap.addListener('onupdatebbox', function (newBbox) {
21469
- _this4.onUpdateBBoxListener(newBbox);
21470
- }, true);
21471
- wmjsMap.addListener('onsetmappin', function (mapPinLatLonCoordinate) {
21472
- // only change location when mapPin is visible and enabled
21473
- if (onMapPinChangeLocation &&
21474
- // eslint-disable-next-line react/destructuring-assignment
21475
- _this4.props.displayMapPin &&
21476
- // eslint-disable-next-line react/destructuring-assignment
21477
- !_this4.props.disableMapPin) {
21478
- onMapPinChangeLocation({
21479
- mapPinLocation: {
21480
- lat: mapPinLatLonCoordinate.lat,
21481
- lon: mapPinLatLonCoordinate.lon
21482
- },
21483
- mapId: mapId
21484
- });
21485
- }
21486
- }, true);
21487
- this.resize();
21488
- wmjsMap.draw();
21489
- this.updateWMJSMapProps(null, this.props);
21490
- return wmjsMap;
21491
- }
21492
- }, {
21493
- key: "resize",
21494
- value: function resize() {
21495
- var element = this.adagucContainerRef.current;
21496
- if (element) {
21497
- var newWidth = element.clientWidth;
21498
- var newHeight = element.clientHeight;
21499
- if (this.adaguc.currentWidth !== newWidth || this.adaguc.currentHeight !== newHeight) {
21500
- this.adaguc.currentWidth = newWidth;
21501
- this.adaguc.currentHeight = newHeight;
21502
- var mapId = this.props.mapId;
21503
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21504
- wmjsMap.setSize(newWidth, newHeight);
21505
- }
21506
- }
21507
- }
21508
- }, {
21509
- key: "render",
21510
- value: function render() {
21511
- var _this$props5 = this.props,
21512
- passiveMap = _this$props5.passiveMap,
21513
- children = _this$props5.children,
21514
- onClick = _this$props5.onClick,
21515
- mapId = _this$props5.mapId;
21516
- var adagucInitialised = this.state.adagucInitialised;
21517
- var featureLayers = getFeatureLayers(children);
21518
- return /*#__PURE__*/React.createElement("div", {
21519
- className: "MapView",
21520
- style: {
21521
- height: '100%',
21522
- width: '100%',
21523
- border: 'none',
21524
- display: 'block',
21525
- overflow: 'hidden'
21526
- }
21527
- }, /*#__PURE__*/React.createElement("div", {
21528
- ref: this.adagucContainerRef,
21529
- style: {
21530
- minWidth: 'inherit',
21531
- minHeight: 'inherit',
21532
- width: 'inherit',
21533
- height: 'inherit',
21534
- overflow: 'hidden',
21535
- display: 'block',
21536
- border: 'none'
21537
- }
21538
- }, /*#__PURE__*/React.createElement("div", {
21539
- className: "MapViewComponent",
21540
- style: {
21541
- position: 'absolute',
21542
- overflow: 'hidden',
21543
- display: 'block',
21544
- padding: '0',
21545
- margin: '0',
21546
- zIndex: 10
21547
- }
21548
- }, /*#__PURE__*/React.createElement("div", {
21549
- ref: this.adagucWebMapJSRef
21550
- })), /*#__PURE__*/React.createElement("div", {
21551
- style: {
21552
- position: 'absolute',
21553
- overflow: 'hidden',
21554
- display: 'block',
21555
- padding: '0',
21556
- margin: '0',
21557
- zIndex: 100
21558
- }
21559
- }, /*#__PURE__*/React.createElement("div", null, children), adagucInitialised && featureLayers && featureLayers.length ? /*#__PURE__*/React.createElement(MapDrawContainer, {
21560
- featureLayers: featureLayers,
21561
- mapId: mapId
21562
- }) : null), passiveMap &&
21563
- /*#__PURE__*/
21564
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/control-has-associated-label, jsx-a11y/interactive-supports-focus
21565
- React.createElement("div", {
21566
- style: {
21567
- position: 'absolute',
21568
- overflow: 'hidden',
21569
- display: 'block',
21570
- padding: '0',
21571
- margin: '0',
21572
- zIndex: 100,
21573
- width: '100%',
21574
- height: '100%'
21575
- },
21576
- onClick: onClick,
21577
- role: "button"
21578
- })));
21579
- }
21580
- }]);
21581
- return ReactMapView;
21582
- }(React.Component);
21583
- ReactMapView.defaultProps = {
21584
- srs: 'EPSG:3857',
21585
- bbox: {
21586
- left: -2324980.5498391856,
21587
- bottom: 5890854.775012179,
21588
- right: 6393377.702660825,
21589
- top: 11652109.058827976
21590
- },
21591
- shouldAutoFetch: true,
21592
- displayMapPin: false,
21593
- disableMapPin: false,
21594
- onWMJSMount: function onWMJSMount() {},
21595
- onMapChangeDimension: function onMapChangeDimension() {
21596
- /* nothing */
21597
- },
21598
- onUpdateLayerInformation: function onUpdateLayerInformation() {
21599
- /* nothing */
21600
- },
21601
- onMapZoomEnd: function onMapZoomEnd() {
21602
- /* nothing */
21603
- }
21604
- };
21605
-
21606
- /* *
21607
- * Licensed under the Apache License, Version 2.0 (the "License");
21608
- * you may not use this file except in compliance with the License.
21609
- * You may obtain a copy of the License at
21610
- *
21611
- * http://www.apache.org/licenses/LICENSE-2.0
21612
- *
21613
- * Unless required by applicable law or agreed to in writing, software
21614
- * distributed under the License is distributed on an "AS IS" BASIS,
21615
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21616
- * See the License for the specific language governing permissions and
21617
- * limitations under the License.
21618
- *
21619
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21620
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
21621
- * */
21622
- var getTimeDimension = function getTimeDimension(dimensions) {
21623
- return dimensions.find(function (dimension) {
21624
- return dimension.name === 'time' && dimension.currentValue !== undefined;
21625
- });
21626
- };
21627
- var formatTime = function formatTime(time, timeFormat) {
21628
- return dateUtils.dateToString(dateUtils.utc(time), timeFormat);
21629
- };
21630
- var defaultTimeFormat = "EEE dd MMM yyyy HH:mm 'UTC'";
21631
- var MapTime = function MapTime(_ref) {
21632
- var dimensions = _ref.dimensions,
21633
- _ref$timeFormat = _ref.timeFormat,
21634
- timeFormat = _ref$timeFormat === void 0 ? defaultTimeFormat : _ref$timeFormat;
21635
- var timeDimension = getTimeDimension(dimensions);
21636
- if (!timeDimension) {
21637
- return null;
21638
- }
21639
- var mapTime = formatTime(timeDimension.currentValue, timeFormat);
21640
- return /*#__PURE__*/React.createElement(Box$2, {
21641
- "data-testid": "map-time",
21642
- sx: {
21643
- zIndex: 10,
21644
- justifySelf: 'center',
21645
- bottom: '12px',
21646
- position: 'absolute'
21647
- }
21648
- }, /*#__PURE__*/React.createElement(Box$2, null, /*#__PURE__*/React.createElement(Typography, {
21649
- variant: "caption",
21650
- sx: {
21651
- fontWeight: 500
21652
- }
21653
- }, mapTime)));
21654
- };
21655
-
21656
- /* *
21657
- * Licensed under the Apache License, Version 2.0 (the "License");
21658
- * you may not use this file except in compliance with the License.
21659
- * You may obtain a copy of the License at
21660
- *
21661
- * http://www.apache.org/licenses/LICENSE-2.0
21662
- *
21663
- * Unless required by applicable law or agreed to in writing, software
21664
- * distributed under the License is distributed on an "AS IS" BASIS,
21665
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21666
- * See the License for the specific language governing permissions and
21667
- * limitations under the License.
21668
- *
21669
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
21670
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
21671
- * */
21672
- var MapView = function MapView(_a) {
21673
- var children = _a.children,
21674
- _a$controls = _a.controls,
21675
- controls = _a$controls === void 0 ? {
21676
- zoomControls: true
21677
- } : _a$controls,
21678
- _a$displayTimeInMap = _a.displayTimeInMap,
21679
- displayTimeInMap = _a$displayTimeInMap === void 0 ? true : _a$displayTimeInMap,
21680
- _onWMJSMount = _a.onWMJSMount,
21681
- props = __rest$1(_a, ["children", "controls", "displayTimeInMap", "onWMJSMount"]);
21682
- var dimensions = props.dimensions,
21683
- mapIdProp = props.mapId;
21684
- var wmjsMapRef = React.useRef(null);
21685
- var mapId = React.useRef(mapIdProp).current;
21686
- if (mapIdProp !== mapId) {
21687
- console.warn("Warning, MapId ".concat(mapId, " has been updated to ").concat(mapIdProp, " on an already mounted component. Keeping ").concat(mapId));
21688
- }
21689
- var _useResizeDetector = useResizeDetector(),
21690
- ref = _useResizeDetector.ref,
21691
- height = _useResizeDetector.height,
21692
- width = _useResizeDetector.width;
21693
- React.useEffect(function () {
21694
- if (wmjsMapRef.current && !!width && !!height) {
21695
- var _wmjsMapRef$current$g = wmjsMapRef.current.getSize(),
21696
- mapHeight = _wmjsMapRef$current$g.height,
21697
- mapWidth = _wmjsMapRef$current$g.width;
21698
- if (width !== mapWidth || height !== mapHeight) {
21699
- wmjsMapRef.current.setSize(Math.ceil(width), Math.ceil(height));
21700
- }
21701
- }
21702
- }, [width, height]);
21703
- var reactMapViewProps = Object.assign(Object.assign({}, props), {
21704
- mapId: mapId
21705
- });
21706
- return /*#__PURE__*/React.createElement(Box$2, {
21707
- ref: ref,
21708
- sx: {
21709
- display: 'grid',
21710
- width: '100%',
21711
- height: '100%',
21712
- position: 'relative',
21713
- overflow: 'hidden'
21714
- }
21715
- }, controls && controls.zoomControls && /*#__PURE__*/React.createElement(MapControls, {
21716
- style: {
21717
- top: 0,
21718
- position: 'absolute'
21719
- }
21720
- }, /*#__PURE__*/React.createElement(ZoomControls, {
21721
- onZoomIn: function onZoomIn() {
21722
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21723
- wmjsMap.zoomIn(undefined);
21724
- },
21725
- onZoomOut: function onZoomOut() {
21726
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21727
- wmjsMap.zoomOut();
21728
- },
21729
- onZoomReset: function onZoomReset() {
21730
- var wmjsMap = webmapUtils.getWMJSMapById(mapId);
21731
- wmjsMap.zoomToLayer(wmjsMap.getActiveLayer());
21732
- }
21733
- })), /*#__PURE__*/React.createElement(Box$2, {
21734
- sx: {
21735
- gridColumnStart: 1,
21736
- gridRowStart: 1
21737
- }
21738
- }, /*#__PURE__*/React.createElement(ReactMapView, Object.assign({}, reactMapViewProps, {
21739
- showLegend: false,
21740
- displayTimeInMap: false,
21741
- onWMJSMount: function onWMJSMount(id) {
21742
- wmjsMapRef.current = webmapUtils.getWMJSMapById(id);
21743
- if (_onWMJSMount) {
21744
- _onWMJSMount(id);
21745
- }
21746
- }
21747
- }), children)), displayTimeInMap && dimensions && /*#__PURE__*/React.createElement(MapTime, {
21748
- dimensions: dimensions
21749
- }));
21750
- };
21751
-
21752
19993
  var useTouchZoomPan = function useTouchZoomPan(mapIsActive, mapId) {
21753
19994
  var _React$useState = React.useState(0),
21754
19995
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -21990,7 +20231,7 @@ var ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION = 'ORIGIN_REACTMAPVIEWCONNEC
21990
20231
  var MapViewConnect = function MapViewConnect(_a) {
21991
20232
  var mapId = _a.mapId,
21992
20233
  children = _a.children,
21993
- props = __rest$1(_a, ["mapId", "children"]);
20234
+ props = __rest(_a, ["mapId", "children"]);
21994
20235
  var mapDimensions = useSelector(function (store) {
21995
20236
  return mapSelectors.getMapDimensions(store, mapId);
21996
20237
  });
@@ -22027,9 +20268,6 @@ var MapViewConnect = function MapViewConnect(_a) {
22027
20268
  var displayMapPin = useSelector(function (store) {
22028
20269
  return mapSelectors.getDisplayMapPin(store, mapId);
22029
20270
  });
22030
- var services = useSelector(function (store) {
22031
- return serviceSelectors.getServices(store);
22032
- });
22033
20271
  var dispatch = useDispatch();
22034
20272
  var mapChangeDimension = React.useCallback(function (mapDimensionPayload) {
22035
20273
  if (mapDimensionPayload.dimension) {
@@ -22119,7 +20357,6 @@ var MapViewConnect = function MapViewConnect(_a) {
22119
20357
  animationDelay: animationDelay,
22120
20358
  displayMapPin: displayMapPin,
22121
20359
  disableMapPin: disableMapPin,
22122
- services: services,
22123
20360
  onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
22124
20361
  if (mapDimensionPayload && mapDimensionPayload.dimension && mapDimensionPayload.dimension.name && mapDimensionPayload.dimension.name === 'time') {
22125
20362
  setTime({
@@ -22207,78 +20444,6 @@ var MapViewConnect = function MapViewConnect(_a) {
22207
20444
  }), children));
22208
20445
  };
22209
20446
 
22210
- /* *
22211
- * Licensed under the Apache License, Version 2.0 (the "License");
22212
- * you may not use this file except in compliance with the License.
22213
- * You may obtain a copy of the License at
22214
- *
22215
- * http://www.apache.org/licenses/LICENSE-2.0
22216
- *
22217
- * Unless required by applicable law or agreed to in writing, software
22218
- * distributed under the License is distributed on an "AS IS" BASIS,
22219
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22220
- * See the License for the specific language governing permissions and
22221
- * limitations under the License.
22222
- *
22223
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22224
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
22225
- * */
22226
- var LegendDialog = function LegendDialog(_ref) {
22227
- var layers = _ref.layers,
22228
- isOpen = _ref.isOpen,
22229
- onClose = _ref.onClose,
22230
- _ref$onMouseDown = _ref.onMouseDown,
22231
- onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
22232
- mapId = _ref.mapId,
22233
- _ref$showMapId = _ref.showMapId,
22234
- showMapId = _ref$showMapId === void 0 ? false : _ref$showMapId,
22235
- _ref$order = _ref.order,
22236
- order = _ref$order === void 0 ? 0 : _ref$order,
22237
- _ref$source = _ref.source,
22238
- source = _ref$source === void 0 ? 'app' : _ref$source;
22239
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
22240
- startPosition: {
22241
- right: 20,
22242
- top: 50
22243
- },
22244
- minWidth: 100,
22245
- onClose: onClose,
22246
- title: showMapId ? "Legend ".concat(mapId) : 'Legend',
22247
- initialMaxHeight: 440,
22248
- isOpen: isOpen,
22249
- "data-testid": "moveable-legend",
22250
- bounds: "parent",
22251
- onMouseDown: onMouseDown,
22252
- order: order,
22253
- source: source
22254
- }, /*#__PURE__*/React.createElement(Box$2, {
22255
- sx: {
22256
- padding: 0.5
22257
- }
22258
- }, layers && layers.length > 0 ? /*#__PURE__*/React.createElement(Box$2, {
22259
- "data-testid": "LegendList",
22260
- sx: {
22261
- display: 'flex',
22262
- flexDirection: 'column',
22263
- '&>div:last-child': {
22264
- marginBottom: 0
22265
- }
22266
- }
22267
- }, layers.map(function (layer) {
22268
- return /*#__PURE__*/React.createElement(Legend, {
22269
- key: layer.id,
22270
- layer: layer
22271
- });
22272
- })) : /*#__PURE__*/React.createElement(Typography, {
22273
- "data-testid": "NoLayers",
22274
- variant: "body1",
22275
- style: {
22276
- fontWeight: 500,
22277
- fontSize: 14
22278
- }
22279
- }, "No layers")));
22280
- };
22281
-
22282
20447
  var LegendConnectComponent = function LegendConnectComponent(_ref) {
22283
20448
  var _ref$showMapId = _ref.showMapId,
22284
20449
  showMapId = _ref$showMapId === void 0 ? false : _ref$showMapId,
@@ -22376,7 +20541,7 @@ var LegendConnectComponent = function LegendConnectComponent(_ref) {
22376
20541
  var LegendConnect = function LegendConnect(_a) {
22377
20542
  var _a$showMapId = _a.showMapId,
22378
20543
  showMapId = _a$showMapId === void 0 ? false : _a$showMapId,
22379
- props = __rest$1(_a, ["showMapId"]);
20544
+ props = __rest(_a, ["showMapId"]);
22380
20545
  return /*#__PURE__*/React.createElement(LegendConnectComponent, Object.assign({
22381
20546
  showMapId: showMapId
22382
20547
  }, props));
@@ -25969,75 +24134,172 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
25969
24134
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
25970
24135
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
25971
24136
  * */
25972
- var MapDrawToolContext = /*#__PURE__*/React.createContext({});
25973
- // currently used options
25974
- var drawOptions = {
25975
- defaultEditModes: [defaultPolygon, defaultDelete]
25976
- };
25977
- var MapDrawToolProvider = function MapDrawToolProvider(_ref) {
25978
- var children = _ref.children,
25979
- _ref$options = _ref.options,
25980
- options = _ref$options === void 0 ? {} : _ref$options;
25981
- var value = useMapDrawTool(options);
25982
- return /*#__PURE__*/React.createElement(MapDrawToolContext.Provider, {
25983
- value: value
25984
- }, children);
25985
- };
25986
- function useMapDrawContext() {
25987
- return React.useContext(MapDrawToolContext);
25988
- }
25989
-
25990
- /* *
25991
- * Licensed under the Apache License, Version 2.0 (the "License");
25992
- * you may not use this file except in compliance with the License.
25993
- * You may obtain a copy of the License at
25994
- *
25995
- * http://www.apache.org/licenses/LICENSE-2.0
25996
- *
25997
- * Unless required by applicable law or agreed to in writing, software
25998
- * distributed under the License is distributed on an "AS IS" BASIS,
25999
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26000
- * See the License for the specific language governing permissions and
26001
- * limitations under the License.
26002
- *
26003
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26004
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
26005
- * */
24137
+ var MapDrawToolContext = /*#__PURE__*/React.createContext({});
24138
+ // currently used options
24139
+ var drawOptions = {
24140
+ defaultEditModes: [defaultPolygon, defaultDelete]
24141
+ };
24142
+ var MapDrawToolProvider = function MapDrawToolProvider(_ref) {
24143
+ var children = _ref.children,
24144
+ _ref$options = _ref.options,
24145
+ options = _ref$options === void 0 ? {} : _ref$options;
24146
+ var value = useMapDrawTool(options);
24147
+ return /*#__PURE__*/React.createElement(MapDrawToolContext.Provider, {
24148
+ value: value
24149
+ }, children);
24150
+ };
24151
+ function useMapDrawContext() {
24152
+ return React.useContext(MapDrawToolContext);
24153
+ }
24154
+
24155
+ /* *
24156
+ * Licensed under the Apache License, Version 2.0 (the "License");
24157
+ * you may not use this file except in compliance with the License.
24158
+ * You may obtain a copy of the License at
24159
+ *
24160
+ * http://www.apache.org/licenses/LICENSE-2.0
24161
+ *
24162
+ * Unless required by applicable law or agreed to in writing, software
24163
+ * distributed under the License is distributed on an "AS IS" BASIS,
24164
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24165
+ * See the License for the specific language governing permissions and
24166
+ * limitations under the License.
24167
+ *
24168
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
24169
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
24170
+ * */
24171
+ var areaDialogType$1 = uiTypes.DialogTypes.AreaManager;
24172
+ var useAreaDrawDialogAction = function useAreaDrawDialogAction(_ref) {
24173
+ var mapId = _ref.mapId,
24174
+ source = _ref.source;
24175
+ var dispatch = useDispatch();
24176
+ var drawingDialogType = "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
24177
+ var geoJSONLayerId = "".concat(mapId, "-geosjon");
24178
+ var currentLayer = useSelector(function (store) {
24179
+ return layerSelectors.getLayerById(store, geoJSONLayerId);
24180
+ });
24181
+ var openAreaDialog = React__default.useCallback(function () {
24182
+ dispatch(uiActions.setActiveMapIdForDialog({
24183
+ type: areaDialogType$1,
24184
+ mapId: mapId,
24185
+ setOpen: true,
24186
+ source: source
24187
+ }));
24188
+ }, [dispatch, mapId, source]);
24189
+ var openDrawDialog = React__default.useCallback(function () {
24190
+ dispatch(uiActions.setActiveMapIdForDialog({
24191
+ type: drawingDialogType,
24192
+ mapId: mapId,
24193
+ setOpen: true,
24194
+ source: source
24195
+ }));
24196
+ }, [dispatch, mapId, source, drawingDialogType]);
24197
+ var closeDrawDialog = React__default.useCallback(function () {
24198
+ dispatch(drawActions.setDrawValues({
24199
+ mapId: mapId,
24200
+ area: undefined,
24201
+ areaName: '',
24202
+ id: ''
24203
+ }));
24204
+ dispatch(uiActions.setActiveMapIdForDialog({
24205
+ type: drawingDialogType,
24206
+ mapId: mapId,
24207
+ setOpen: false,
24208
+ source: source
24209
+ }));
24210
+ }, [dispatch, mapId, drawingDialogType, source]);
24211
+ var closeAreaDialog = React__default.useCallback(function () {
24212
+ if (currentLayer) {
24213
+ dispatch(mapStoreActions.layerDelete({
24214
+ layerId: geoJSONLayerId,
24215
+ mapId: mapId,
24216
+ layerIndex: 0
24217
+ }));
24218
+ }
24219
+ dispatch(uiActions.setActiveMapIdForDialog({
24220
+ type: areaDialogType$1,
24221
+ mapId: mapId,
24222
+ setOpen: false,
24223
+ source: source
24224
+ }));
24225
+ dispatch(drawActions.setDrawValues({
24226
+ mapId: mapId,
24227
+ area: undefined,
24228
+ areaName: '',
24229
+ id: ''
24230
+ }));
24231
+ }, [dispatch, mapId, source, currentLayer, geoJSONLayerId]);
24232
+ return {
24233
+ closeDrawDialog: closeDrawDialog,
24234
+ closeAreaDialog: closeAreaDialog,
24235
+ openAreaDialog: openAreaDialog,
24236
+ openDrawDialog: openDrawDialog
24237
+ };
24238
+ };
24239
+
24240
+ /* *
24241
+ * Licensed under the Apache License, Version 2.0 (the "License");
24242
+ * you may not use this file except in compliance with the License.
24243
+ * You may obtain a copy of the License at
24244
+ *
24245
+ * http://www.apache.org/licenses/LICENSE-2.0
24246
+ *
24247
+ * Unless required by applicable law or agreed to in writing, software
24248
+ * distributed under the License is distributed on an "AS IS" BASIS,
24249
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24250
+ * See the License for the specific language governing permissions and
24251
+ * limitations under the License.
24252
+ *
24253
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
24254
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
24255
+ * */
24256
+ var areaDialogType = uiTypes.DialogTypes.AreaManager;
26006
24257
  var DrawingToolMapButtonConnect = function DrawingToolMapButtonConnect(_ref) {
26007
24258
  var mapId = _ref.mapId,
26008
24259
  _ref$source = _ref.source,
26009
24260
  source = _ref$source === void 0 ? 'app' : _ref$source;
26010
- var dispatch = useDispatch();
26011
24261
  var _useMapDrawContext = useMapDrawContext(),
26012
24262
  deactivateTool = _useMapDrawContext.deactivateTool;
26013
24263
  // TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
26014
- var dialogType = "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
26015
- // const dialogType = isMultiMap
24264
+ var drawingDialogType = "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
24265
+ // const drawingDialogType = isMultiMap
26016
24266
  // ? `${uiTypes.DialogTypes.DrawingTool}-${mapId}`
26017
24267
  // : uiTypes.DialogTypes.DrawingTool;
24268
+ var _useAreaDrawDialogAct = useAreaDrawDialogAction({
24269
+ mapId: mapId,
24270
+ source: source
24271
+ }),
24272
+ closeAreaDialog = _useAreaDrawDialogAct.closeAreaDialog,
24273
+ openDrawDialog = _useAreaDrawDialogAct.openDrawDialog,
24274
+ closeDrawDialog = _useAreaDrawDialogAct.closeDrawDialog;
26018
24275
  var currentActiveMapId = useSelector(function (store) {
26019
- return uiSelectors.getDialogMapId(store, dialogType);
24276
+ return uiSelectors.getDialogMapId(store, drawingDialogType);
26020
24277
  });
26021
- var isOpenInStore = useSelector(function (store) {
26022
- return uiSelectors.getisDialogOpen(store, dialogType);
24278
+ var isDrawDialogOpen = useSelector(function (store) {
24279
+ return uiSelectors.getisDialogOpen(store, drawingDialogType);
26023
24280
  });
26024
- var openDrawingToolDialog = React.useCallback(function () {
26025
- var shouldOpen = currentActiveMapId !== mapId ? true : !isOpenInStore;
26026
- if (!shouldOpen) {
26027
- deactivateTool();
24281
+ var isAreaDialogOpen = useSelector(function (store) {
24282
+ return uiSelectors.getisDialogOpen(store, areaDialogType);
24283
+ });
24284
+ var openDrawingDialog = React.useCallback(function () {
24285
+ if (isAreaDialogOpen) {
24286
+ closeAreaDialog();
26028
24287
  }
26029
- dispatch(uiActions.setActiveMapIdForDialog({
26030
- type: dialogType,
26031
- mapId: mapId,
26032
- setOpen: shouldOpen,
26033
- source: source
26034
- }));
26035
- }, [currentActiveMapId, dialogType, dispatch, isOpenInStore, mapId, source, deactivateTool]);
26036
- var isOpen = currentActiveMapId === mapId && isOpenInStore;
24288
+ openDrawDialog();
24289
+ }, [isAreaDialogOpen, closeAreaDialog, openDrawDialog]);
24290
+ var closeDrawingDialog = React.useCallback(function () {
24291
+ deactivateTool();
24292
+ closeDrawDialog();
24293
+ }, [deactivateTool, closeDrawDialog]);
24294
+ var onClick = React.useCallback(function () {
24295
+ var shouldOpen = currentActiveMapId !== mapId ? true : !isDrawDialogOpen;
24296
+ shouldOpen ? openDrawingDialog() : closeDrawingDialog();
24297
+ }, [currentActiveMapId, isDrawDialogOpen, mapId, closeDrawingDialog, openDrawingDialog]);
24298
+ var isOpen = currentActiveMapId === mapId && isDrawDialogOpen;
26037
24299
  return /*#__PURE__*/React.createElement(MapControlButton, {
26038
24300
  title: "Drawing Toolbox",
26039
24301
  "data-testid": "drawingToolButton",
26040
- onClick: openDrawingToolDialog,
24302
+ onClick: onClick,
26041
24303
  isActive: isOpen
26042
24304
  }, /*#__PURE__*/React.createElement(DrawPolygon, null));
26043
24305
  };
@@ -26177,7 +24439,8 @@ var opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
26177
24439
  var getAreaName = function getAreaName(areaName) {
26178
24440
  return areaName || "".concat(dateUtils.dateToString(new Date(), 'dd/MM/yyyy HH:mm', true), " UTC");
26179
24441
  };
26180
- var SAVE_AREA_BUTTON = 'Save area';
24442
+ var SAVE_AREA_BUTTON = 'Save new area';
24443
+ var UPDATE_AREA_BUTTON = 'Update area';
26181
24444
  var INPUT_AREA = 'Area name';
26182
24445
  var INPUT_OPACITY = 'Opacity';
26183
24446
  var DRAW_EXIT_MODE_MESSAGE = 'press ESC to exit draw mode';
@@ -26205,7 +24468,7 @@ var DrawingToolForm = function DrawingToolForm(_ref) {
26205
24468
  handleSubmit(function (formValues) {
26206
24469
  // remove unneeded properties
26207
24470
  formValues.opacity;
26208
- var allFormValues = __rest$1(formValues, ["opacity"]);
24471
+ var allFormValues = __rest(formValues, ["opacity"]);
26209
24472
  onSubmitForm(Object.assign(Object.assign({}, allFormValues), {
26210
24473
  area: geoJSON,
26211
24474
  id: id
@@ -26353,11 +24616,14 @@ var DrawingToolForm = function DrawingToolForm(_ref) {
26353
24616
  variant: "primary",
26354
24617
  onClick: onSubmit,
26355
24618
  sx: {
26356
- width: '100%'
24619
+ width: '100%',
24620
+ textTransform: 'none'
26357
24621
  },
26358
24622
  "data-testid": "saveDrawingFormButton",
26359
- disabled: isLoading || hasErrors
26360
- }, SAVE_AREA_BUTTON))));
24623
+ // TODO: re-enable for: https://gitlab.com/opengeoweb/opengeoweb/-/issues/4080
24624
+ // disabled={isLoading || hasErrors}
24625
+ disabled: isLoading || id !== '' || hasErrors
24626
+ }, id !== '' ? UPDATE_AREA_BUTTON : SAVE_AREA_BUTTON))));
26361
24627
  };
26362
24628
  var Wrapper = function Wrapper(props) {
26363
24629
  var _props$id = props.id,
@@ -26402,24 +24668,13 @@ var DrawingToolFormConnect = function DrawingToolFormConnect(_ref) {
26402
24668
  return uiSelectors.getDialogIsLoading(store, "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId));
26403
24669
  });
26404
24670
  var onSubmitForm = function onSubmitForm(formValues) {
26405
- dispatch(drawActions.submitDrawValues(Object.assign({
26406
- mapId: mapId
26407
- }, formValues)));
26408
- };
26409
- var onUnMount = function onUnMount() {
26410
- dispatch(drawActions.setDrawValues({
24671
+ dispatch(drawActions.submitDrawValues({
26411
24672
  mapId: mapId,
26412
- area: undefined,
26413
- areaName: '',
26414
- id: ''
24673
+ area: formValues.area,
24674
+ name: formValues.areaName,
24675
+ scope: 'user'
26415
24676
  }));
26416
24677
  };
26417
- React.useEffect(function () {
26418
- return function () {
26419
- onUnMount();
26420
- };
26421
- // eslint-disable-next-line react-hooks/exhaustive-deps
26422
- }, []);
26423
24678
  return /*#__PURE__*/React.createElement(Wrapper, {
26424
24679
  id: drawing === null || drawing === void 0 ? void 0 : drawing.id,
26425
24680
  onSubmitForm: onSubmitForm,
@@ -26468,7 +24723,6 @@ var DrawingToolConnect = function DrawingToolConnect(_ref) {
26468
24723
  isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
26469
24724
  _ref$source = _ref.source,
26470
24725
  source = _ref$source === void 0 ? 'app' : _ref$source;
26471
- // const dispatch = useDispatch();
26472
24726
  var dialogType = getDialogType(initialMapId, isMultiMap, isDocked);
26473
24727
  var _useMapDrawContext = useMapDrawContext(),
26474
24728
  deactivateTool = _useMapDrawContext.deactivateTool;
@@ -26478,10 +24732,14 @@ var DrawingToolConnect = function DrawingToolConnect(_ref) {
26478
24732
  // In case of a docked drawing toolbox or multimap, use the map id that is passed
26479
24733
  // For floating drawingtoolbox, use the currently active, selected mapid
26480
24734
  var mapId = initialMapId || activeMapId;
24735
+ var _useAreaDrawDialogAct = useAreaDrawDialogAction({
24736
+ mapId: mapId,
24737
+ source: source
24738
+ }),
24739
+ closeDrawDialog = _useAreaDrawDialogAct.closeDrawDialog;
26481
24740
  var _useSetupDialog = useSetupDialog(dialogType, source),
26482
24741
  dialogOrder = _useSetupDialog.dialogOrder,
26483
24742
  setDialogOrder = _useSetupDialog.setDialogOrder,
26484
- onCloseDialog = _useSetupDialog.onCloseDialog,
26485
24743
  isDialogOpen = _useSetupDialog.isDialogOpen,
26486
24744
  uiSource = _useSetupDialog.uiSource,
26487
24745
  uiIsLoading = _useSetupDialog.uiIsLoading,
@@ -26512,8 +24770,8 @@ var DrawingToolConnect = function DrawingToolConnect(_ref) {
26512
24770
  // };
26513
24771
  var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
26514
24772
  var onClose = function onClose() {
26515
- onCloseDialog();
26516
24773
  deactivateTool();
24774
+ closeDrawDialog();
26517
24775
  };
26518
24776
  if (!isDialogOpen) {
26519
24777
  return null;
@@ -26602,7 +24860,7 @@ var BaseConfigurableMapConnect = function BaseConfigurableMapConnect(_a) {
26602
24860
  shouldDisplayDrawControls = _a$shouldDisplayDrawC === void 0 ? false : _a$shouldDisplayDrawC,
26603
24861
  mapControls = _a.mapControls,
26604
24862
  children = _a.children,
26605
- props = __rest$1(_a, ["id", "dockedLayerManagerSize", "title", "layers", "dimensions", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "shouldDisplayDrawControls", "mapControls", "children"]);
24863
+ props = __rest(_a, ["id", "dockedLayerManagerSize", "title", "layers", "dimensions", "shouldAutoUpdate", "shouldAnimate", "bbox", "srs", "shouldShowZoomControls", "displayMapPin", "showTimeSlider", "disableTimeSlider", "displayTimeInMap", "displayLayerManagerAndLegendButtonInMap", "displayDimensionSelectButtonInMap", "multiLegend", "shouldShowLayerManager", "shouldShowDockedLayerManager", "showClock", "displayGetFeatureInfoButtonInMap", "shouldDisplayDrawControls", "mapControls", "children"]);
26606
24864
  var dispatch = useDispatch();
26607
24865
  var mapId = React__default.useRef(id || webmapUtils.generateMapId()).current;
26608
24866
  React__default.useEffect(function () {
@@ -26857,524 +25115,6 @@ var MultiMapViewConnect = function MultiMapViewConnect(_ref) {
26857
25115
  }));
26858
25116
  };
26859
25117
 
26860
- /* *
26861
- * Licensed under the Apache License, Version 2.0 (the "License");
26862
- * you may not use this file except in compliance with the License.
26863
- * You may obtain a copy of the License at
26864
- *
26865
- * http://www.apache.org/licenses/LICENSE-2.0
26866
- *
26867
- * Unless required by applicable law or agreed to in writing, software
26868
- * distributed under the License is distributed on an "AS IS" BASIS,
26869
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26870
- * See the License for the specific language governing permissions and
26871
- * limitations under the License.
26872
- *
26873
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26874
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
26875
- * */
26876
- var DWD = {
26877
- name: 'DWD',
26878
- url: 'https://maps.dwd.de/geoserver/ows?',
26879
- id: 'dwd'
26880
- };
26881
- var nationaalgeoregister = {
26882
- name: 'nationaalgeoregister.nl',
26883
- url: 'https://geodata.nationaalgeoregister.nl/cbsgebiedsindelingen/wms?request=GetCapabilities&service=wms',
26884
- id: 'nationaalgeoregister'
26885
- };
26886
- var KNMImsgcpp = {
26887
- name: 'KNMImsgcpp',
26888
- url: 'https://adaguc-server-msg-cpp-portal.pmc.knmi.cloud/wms?DATASET=msgrt&',
26889
- id: 'msgcpp-ogc-realtime'
26890
- };
26891
- var HeiGit = {
26892
- name: 'HeiGit',
26893
- url: 'https://maps.heigit.org/osm-wms/service',
26894
- id: 'HeiGit-osm-wms'
26895
- };
26896
- var ArcGisCanvas = {
26897
- name: 'ArcGisCanvas',
26898
- url: 'https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/',
26899
- id: 'ArcGisCanvas'
26900
- };
26901
- var KNMIgeoservicesRadar = {
26902
- name: 'KNMIgeoservicesRadar',
26903
- url: 'https://geoservices.knmi.nl/wms?dataset=RADAR&',
26904
- id: 'KNMIgeoservicesRadar'
26905
- };
26906
- var KNMIgeoservicesObs = {
26907
- name: 'KNMIgeoservicesObs',
26908
- url: 'https://geoservices.knmi.nl/adagucserver?dataset=OBS',
26909
- id: 'KNMIgeoservicesObs'
26910
- };
26911
- var KNMIgeoservicesKlimaatAtlas = {
26912
- name: 'KNMIgeoservicesKlimaatAtlas',
26913
- url: 'https://geoservices.knmi.nl/wms?DATASET=gsie-dataset&SERVICE=WMS&',
26914
- id: 'KNMIgeoservicesKlimaatAtlas'
26915
- };
26916
- var KNMIgeoservicesHarmonie = {
26917
- name: 'KNMIgeoservicesHarmonie',
26918
- url: 'https://geoservices.knmi.nl/wms?DATASET=HARM_N25&',
26919
- id: 'KNMIgeoservicesKliKNMIgeoservicesHarmoniemaatAtlas'
26920
- };
26921
- var KNMIgeoservicesHarmonieMLService = {
26922
- name: 'KNMI Harmonie ML',
26923
- url: 'https://geoservices.knmi.nl/wms?DATASET=HARM_N25_ML&SERVICE=WMS&',
26924
- id: 'harmonieML'
26925
- };
26926
- var MetNorwayService = {
26927
- name: 'MetNorwayService',
26928
- url: 'https://wms-e1.geoweb.met.no/wms?',
26929
- id: 'MetNorwayService'
26930
- };
26931
- var FMIopenwms = {
26932
- name: 'FMIopenwms',
26933
- url: 'https://openwms.fmi.fi/geoserver/wms?',
26934
- id: 'FMIopenwms'
26935
- };
26936
- var DWDObservations = {
26937
- name: 'DWDObservations',
26938
- url: 'https://maps.dwd.de/geoserver/dwd/Wetter_Beobachtungen/ows?',
26939
- id: 'DWDObservations'
26940
- };
26941
- var DWDWarnings = {
26942
- name: 'DWDWarnings',
26943
- url: 'https://maps.dwd.de/geoserver/dwd/Warnungen_Gemeinden_vereinigt/ows?',
26944
- id: 'DWDWarnings'
26945
- };
26946
- var DWDWXProdukt = {
26947
- name: 'DWDWXProdukt',
26948
- url: 'https://maps.dwd.de/geoserver/dwd/WX-Produkt/ows?',
26949
- id: 'DWDWXProdukt'
26950
- };
26951
- var EUMETSAT = {
26952
- name: 'EUMETSAT',
26953
- url: 'https://view.eumetsat.int/geoserver/wms?',
26954
- id: 'EUMETSAT'
26955
- };
26956
- var eumetviewEUMETSAT = {
26957
- name: 'eumetviewEUMETSAT',
26958
- url: 'https://eumetview.eumetsat.int/geoserv/wms?',
26959
- id: 'eumetviewEUMETSAT'
26960
- };
26961
- var ECMWFPublicService = {
26962
- name: 'ECMWF',
26963
- url: 'https://eccharts.ecmwf.int/wms/?token=public',
26964
- id: 'ecmwf'
26965
- };
26966
- var MeteoCanada = {
26967
- name: 'Meteo Canada',
26968
- url: 'https://geo.weather.gc.ca/geomet/?lang=en&',
26969
- id: 'MeteoCanada'
26970
- };
26971
-
26972
- var publicServices = /*#__PURE__*/Object.freeze({
26973
- __proto__: null,
26974
- DWD: DWD,
26975
- nationaalgeoregister: nationaalgeoregister,
26976
- KNMImsgcpp: KNMImsgcpp,
26977
- HeiGit: HeiGit,
26978
- ArcGisCanvas: ArcGisCanvas,
26979
- KNMIgeoservicesRadar: KNMIgeoservicesRadar,
26980
- KNMIgeoservicesObs: KNMIgeoservicesObs,
26981
- KNMIgeoservicesKlimaatAtlas: KNMIgeoservicesKlimaatAtlas,
26982
- KNMIgeoservicesHarmonie: KNMIgeoservicesHarmonie,
26983
- KNMIgeoservicesHarmonieMLService: KNMIgeoservicesHarmonieMLService,
26984
- MetNorwayService: MetNorwayService,
26985
- FMIopenwms: FMIopenwms,
26986
- DWDObservations: DWDObservations,
26987
- DWDWarnings: DWDWarnings,
26988
- DWDWXProdukt: DWDWXProdukt,
26989
- EUMETSAT: EUMETSAT,
26990
- eumetviewEUMETSAT: eumetviewEUMETSAT,
26991
- ECMWFPublicService: ECMWFPublicService,
26992
- MeteoCanada: MeteoCanada
26993
- });
26994
-
26995
- /* *
26996
- * Licensed under the Apache License, Version 2.0 (the "License");
26997
- * you may not use this file except in compliance with the License.
26998
- * You may obtain a copy of the License at
26999
- *
27000
- * http://www.apache.org/licenses/LICENSE-2.0
27001
- *
27002
- * Unless required by applicable law or agreed to in writing, software
27003
- * distributed under the License is distributed on an "AS IS" BASIS,
27004
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27005
- * See the License for the specific language governing permissions and
27006
- * limitations under the License.
27007
- *
27008
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27009
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
27010
- * */
27011
- var baseLayer$1 = {
27012
- name: 'arcGisSat',
27013
- title: 'arcGisSat',
27014
- type: 'twms',
27015
- layerType: LayerType.baseLayer,
27016
- enabled: true,
27017
- id: webmapUtils.generateLayerId()
27018
- };
27019
- // Base Layers List
27020
- var baseLayerOpenStreetMapNL$1 = {
27021
- id: 'base-layer-2',
27022
- name: 'OpenStreetMap_NL',
27023
- type: 'twms',
27024
- layerType: LayerType.baseLayer,
27025
- enabled: true
27026
- };
27027
- var baseLayerArcGisCanvas$1 = {
27028
- service: ArcGisCanvas.url,
27029
- id: webmapUtils.generateLayerId(),
27030
- name: 'arcGisCanvas',
27031
- type: 'twms',
27032
- enabled: true,
27033
- layerType: LayerType.baseLayer
27034
- };
27035
- var baseLayerWorldMap$1 = {
27036
- id: webmapUtils.generateLayerId(),
27037
- name: 'WorldMap',
27038
- type: 'twms',
27039
- layerType: LayerType.baseLayer,
27040
- enabled: true
27041
- };
27042
- var baseLayerHeiGit = {
27043
- service: HeiGit.url,
27044
- id: webmapUtils.generateLayerId(),
27045
- name: 'osm_auto:all',
27046
- layerType: LayerType.baseLayer
27047
- };
27048
- // KNMI msgcpp List
27049
- var msgCppLayer = {
27050
- // doesn't work with https
27051
- service: KNMImsgcpp.url,
27052
- name: 'lwe_precipitation_rate',
27053
- format: 'image/png',
27054
- enabled: true,
27055
- style: 'precip-transparent/nearest',
27056
- id: webmapUtils.generateLayerId(),
27057
- layerType: LayerType.mapLayer
27058
- };
27059
- // Nederlandse Nationaal Georegister Layers list
27060
- var veiligheidsRegiosGebiedsIndelingenLabels = {
27061
- service: nationaalgeoregister.url,
27062
- name: 'cbsgebiedsindelingen:cbs_veiligheidsregio_2020_labelpoint',
27063
- style: 'CBS_Label',
27064
- enabled: false,
27065
- layerType: LayerType.mapLayer
27066
- };
27067
- var veiligheidsRegiosGebiedsIndelingen = {
27068
- service: nationaalgeoregister.url,
27069
- name: 'cbsgebiedsindelingen:cbs_veiligheidsregio_2020_gegeneraliseerd',
27070
- style: 'CBS_Gebiedsindeling',
27071
- enabled: false,
27072
- layerType: LayerType.mapLayer
27073
- };
27074
- // KNMI Geoservices Layers List
27075
- var radarLayer$1 = {
27076
- service: KNMIgeoservicesRadar.url,
27077
- name: 'RAD_NL25_PCP_CM',
27078
- format: 'image/png',
27079
- enabled: true,
27080
- style: 'radar/nearest',
27081
- id: webmapUtils.generateLayerId(),
27082
- layerType: LayerType.mapLayer
27083
- };
27084
- var radarLayerWithError = {
27085
- service: KNMIgeoservicesRadar.url,
27086
- name: 'radarLayer',
27087
- format: 'image/png',
27088
- enabled: true,
27089
- style: 'knmiradar/nearest',
27090
- id: webmapUtils.generateLayerId(),
27091
- layerType: LayerType.mapLayer
27092
- };
27093
- var obsAirTemperature = {
27094
- service: KNMIgeoservicesObs.url,
27095
- name: '10M/ta',
27096
- id: webmapUtils.generateLayerId(),
27097
- layerType: LayerType.mapLayer
27098
- };
27099
- var obsWind = {
27100
- service: KNMIgeoservicesObs.url,
27101
- name: '10M/wind',
27102
- id: webmapUtils.generateLayerId(),
27103
- layerType: LayerType.mapLayer
27104
- };
27105
- var obsAirPressureAtSeaLevel = {
27106
- service: KNMIgeoservicesObs.url,
27107
- name: '10M/pp',
27108
- id: webmapUtils.generateLayerId(),
27109
- layerType: LayerType.mapLayer
27110
- };
27111
- var obsRelativeHumidity = {
27112
- service: KNMIgeoservicesObs.url,
27113
- name: '10M/rh',
27114
- id: webmapUtils.generateLayerId(),
27115
- layerType: LayerType.mapLayer
27116
- };
27117
- var obsGlobalSolarRadiation = {
27118
- service: KNMIgeoservicesObs.url,
27119
- name: '10M/qg',
27120
- id: webmapUtils.generateLayerId(),
27121
- layerType: LayerType.mapLayer
27122
- };
27123
- var obsPrecipitationIntensityPWS = {
27124
- service: KNMIgeoservicesObs.url,
27125
- name: '10M/pg',
27126
- id: webmapUtils.generateLayerId(),
27127
- layerType: LayerType.mapLayer
27128
- };
27129
- var harmonieRelativeHumidityPl = {
27130
- service: KNMIgeoservicesHarmonie.url,
27131
- name: 'relative_humidity__at_pl',
27132
- id: webmapUtils.generateLayerId(),
27133
- layerType: LayerType.mapLayer,
27134
- enabled: true
27135
- };
27136
- var harmonieWindPl = {
27137
- service: KNMIgeoservicesHarmonie.url,
27138
- name: 'wind__at_pl',
27139
- id: webmapUtils.generateLayerId(),
27140
- layerType: LayerType.mapLayer,
27141
- enabled: true
27142
- };
27143
- var harmonieAirTemperature = {
27144
- service: KNMIgeoservicesHarmonie.url,
27145
- name: 'air_temperature__at_2m',
27146
- id: webmapUtils.generateLayerId(),
27147
- layerType: LayerType.mapLayer,
27148
- enabled: true
27149
- };
27150
- var harmoniePrecipitation = {
27151
- service: KNMIgeoservicesHarmonie.url,
27152
- name: 'precipitation_flux',
27153
- id: webmapUtils.generateLayerId(),
27154
- layerType: LayerType.mapLayer,
27155
- enabled: true
27156
- };
27157
- var harmoniePressure = {
27158
- service: KNMIgeoservicesHarmonie.url,
27159
- name: 'air_pressure_at_sea_level',
27160
- id: webmapUtils.generateLayerId(),
27161
- layerType: LayerType.mapLayer,
27162
- enabled: true
27163
- };
27164
- var harmonieWindFlags = {
27165
- service: KNMIgeoservicesHarmonie.url,
27166
- name: 'wind__at_10m',
27167
- enabled: true,
27168
- id: webmapUtils.generateLayerId(),
27169
- layerType: LayerType.mapLayer
27170
- };
27171
- var klimaatAtlasTG3 = {
27172
- service: KNMIgeoservicesKlimaatAtlas.url,
27173
- name: 'TG3',
27174
- enabled: true,
27175
- id: webmapUtils.generateLayerId(),
27176
- layerType: LayerType.mapLayer
27177
- };
27178
- // DWD Layers List
27179
- var dwdWarningLayer = {
27180
- service: DWDWarnings.url,
27181
- name: 'Warnungen_Gemeinden_vereinigt',
27182
- format: 'image/png',
27183
- // style: 'warnungen_gemeinden_vereinigt_event_seamless_param',
27184
- enabled: true,
27185
- id: webmapUtils.generateLayerId(),
27186
- layerType: LayerType.mapLayer
27187
- };
27188
- var dwdRadarLayer = {
27189
- service: DWDWXProdukt.url,
27190
- name: 'WX-Produkt',
27191
- format: 'image/png',
27192
- enabled: true,
27193
- id: webmapUtils.generateLayerId(),
27194
- layerType: LayerType.mapLayer
27195
- };
27196
- // this needs authentication to work
27197
- var dwdObservationsWetterLayer = {
27198
- service: DWDObservations.url,
27199
- name: 'Wetter_Beobachtungen',
27200
- style: 'Wetter_Symbole',
27201
- format: 'image/png',
27202
- enabled: true,
27203
- id: webmapUtils.generateLayerId(),
27204
- layerType: LayerType.mapLayer
27205
- // headers: [{ name: 'Authorization', value: 'Basic ...' }]
27206
- };
27207
-
27208
- var dwdObservationsWetterLayerWithHeader = {
27209
- service: DWDObservations.url,
27210
- name: 'Wetter_Beobachtungen',
27211
- style: 'Wetter_Symbole',
27212
- format: 'image/png',
27213
- enabled: true,
27214
- id: webmapUtils.generateLayerId(),
27215
- layerType: LayerType.mapLayer,
27216
- headers: [{
27217
- name: 'authorization',
27218
- value: 'Basic aW50cmFuZXQtdXNlcjpDQnMjMTEh'
27219
- }]
27220
- };
27221
- // this needs authentication to work
27222
- var dwdObservationsWindLayer = {
27223
- service: DWDObservations.url,
27224
- name: 'Wetter_Beobachtungen',
27225
- style: 'Wetter_Wind',
27226
- format: 'image/png',
27227
- enabled: true,
27228
- id: webmapUtils.generateLayerId(),
27229
- layerType: LayerType.mapLayer
27230
- };
27231
- // FMI open wms Layers List
27232
- var FMITemp = {
27233
- service: FMIopenwms.url,
27234
- name: 'temperature-forecast',
27235
- format: 'image/png',
27236
- enabled: true,
27237
- id: webmapUtils.generateLayerId(),
27238
- layerType: LayerType.mapLayer
27239
- };
27240
- // Met Norway Layers List
27241
- var MetNoTemp = {
27242
- service: MetNorwayService.url,
27243
- name: 'thredds_meps_latest_wind',
27244
- format: 'image/png',
27245
- enabled: true,
27246
- id: webmapUtils.generateLayerId(),
27247
- layerType: LayerType.mapLayer
27248
- };
27249
- var metNorwayWind1 = {
27250
- service: MetNorwayService.url,
27251
- name: 'thredds_meps_latest_wind',
27252
- format: 'image/png',
27253
- enabled: true,
27254
- id: webmapUtils.generateLayerId(),
27255
- layerType: LayerType.mapLayer
27256
- };
27257
- var metNorwayWind2 = {
27258
- service: MetNorwayService.url,
27259
- name: 'thredds_aromearctic_extracted_t',
27260
- format: 'image/png',
27261
- enabled: true,
27262
- id: webmapUtils.generateLayerId(),
27263
- layerType: LayerType.mapLayer
27264
- };
27265
- var metNorwayWind3 = {
27266
- service: MetNorwayService.url,
27267
- name: 'thredds_nk800_temperature',
27268
- format: 'image/png',
27269
- enabled: true,
27270
- id: webmapUtils.generateLayerId(),
27271
- layerType: LayerType.mapLayer
27272
- };
27273
- var metNorwayLatestT = {
27274
- service: MetNorwayService.url,
27275
- name: 'thredds_meps_latest_t',
27276
- format: 'image/png',
27277
- enabled: true,
27278
- id: webmapUtils.generateLayerId(),
27279
- layerType: LayerType.mapLayer
27280
- };
27281
- var metNorwaySalinaty = {
27282
- service: MetNorwayService.url,
27283
- name: 'thredds_barents_2_5km_1h_salinity',
27284
- format: 'image/png',
27285
- enabled: true,
27286
- id: webmapUtils.generateLayerId(),
27287
- layerType: LayerType.mapLayer
27288
- };
27289
- var msgFesEUMETSAT = {
27290
- service: EUMETSAT.url,
27291
- name: 'msg_fes:rgb_eview',
27292
- enabled: true,
27293
- id: webmapUtils.generateLayerId(),
27294
- layerType: LayerType.mapLayer
27295
- };
27296
- var msgNaturalenhncdEUMETSAT = {
27297
- service: eumetviewEUMETSAT.url,
27298
- name: 'meteosat:msg_naturalenhncd',
27299
- enabled: true,
27300
- id: webmapUtils.generateLayerId(),
27301
- layerType: LayerType.mapLayer
27302
- };
27303
- var msgAshEUMETSAT = {
27304
- service: eumetviewEUMETSAT.url,
27305
- name: 'meteosat:msg_ash',
27306
- enabled: true,
27307
- id: webmapUtils.generateLayerId(),
27308
- layerType: LayerType.mapLayer
27309
- };
27310
- var msgCthEUMETSAT = {
27311
- service: eumetviewEUMETSAT.url,
27312
- name: 'meteosat:msg_cth',
27313
- enabled: true,
27314
- id: webmapUtils.generateLayerId(),
27315
- layerType: LayerType.mapLayer
27316
- };
27317
- var msgFogEUMETSAT = {
27318
- service: eumetviewEUMETSAT.url,
27319
- name: 'meteosat:msg_fog',
27320
- enabled: true,
27321
- id: webmapUtils.generateLayerId(),
27322
- layerType: LayerType.mapLayer
27323
- };
27324
- var msgNaturalEUMETSAT = {
27325
- service: eumetviewEUMETSAT.url,
27326
- name: 'meteosat:msg_natural',
27327
- enabled: true,
27328
- id: webmapUtils.generateLayerId(),
27329
- layerType: LayerType.mapLayer
27330
- };
27331
-
27332
- var publicLayers = /*#__PURE__*/Object.freeze({
27333
- __proto__: null,
27334
- defaultLayers: defaultLayers,
27335
- baseLayer: baseLayer$1,
27336
- baseLayerOpenStreetMapNL: baseLayerOpenStreetMapNL$1,
27337
- baseLayerArcGisCanvas: baseLayerArcGisCanvas$1,
27338
- baseLayerWorldMap: baseLayerWorldMap$1,
27339
- baseLayerHeiGit: baseLayerHeiGit,
27340
- msgCppLayer: msgCppLayer,
27341
- veiligheidsRegiosGebiedsIndelingenLabels: veiligheidsRegiosGebiedsIndelingenLabels,
27342
- veiligheidsRegiosGebiedsIndelingen: veiligheidsRegiosGebiedsIndelingen,
27343
- radarLayer: radarLayer$1,
27344
- radarLayerWithError: radarLayerWithError,
27345
- obsAirTemperature: obsAirTemperature,
27346
- obsWind: obsWind,
27347
- obsAirPressureAtSeaLevel: obsAirPressureAtSeaLevel,
27348
- obsRelativeHumidity: obsRelativeHumidity,
27349
- obsGlobalSolarRadiation: obsGlobalSolarRadiation,
27350
- obsPrecipitationIntensityPWS: obsPrecipitationIntensityPWS,
27351
- harmonieRelativeHumidityPl: harmonieRelativeHumidityPl,
27352
- harmonieWindPl: harmonieWindPl,
27353
- harmonieAirTemperature: harmonieAirTemperature,
27354
- harmoniePrecipitation: harmoniePrecipitation,
27355
- harmoniePressure: harmoniePressure,
27356
- harmonieWindFlags: harmonieWindFlags,
27357
- klimaatAtlasTG3: klimaatAtlasTG3,
27358
- dwdWarningLayer: dwdWarningLayer,
27359
- dwdRadarLayer: dwdRadarLayer,
27360
- dwdObservationsWetterLayer: dwdObservationsWetterLayer,
27361
- dwdObservationsWetterLayerWithHeader: dwdObservationsWetterLayerWithHeader,
27362
- dwdObservationsWindLayer: dwdObservationsWindLayer,
27363
- FMITemp: FMITemp,
27364
- MetNoTemp: MetNoTemp,
27365
- metNorwayWind1: metNorwayWind1,
27366
- metNorwayWind2: metNorwayWind2,
27367
- metNorwayWind3: metNorwayWind3,
27368
- metNorwayLatestT: metNorwayLatestT,
27369
- metNorwaySalinaty: metNorwaySalinaty,
27370
- msgFesEUMETSAT: msgFesEUMETSAT,
27371
- msgNaturalenhncdEUMETSAT: msgNaturalenhncdEUMETSAT,
27372
- msgAshEUMETSAT: msgAshEUMETSAT,
27373
- msgCthEUMETSAT: msgCthEUMETSAT,
27374
- msgFogEUMETSAT: msgFogEUMETSAT,
27375
- msgNaturalEUMETSAT: msgNaturalEUMETSAT
27376
- });
27377
-
27378
25118
  var useGetLatestReferenceTime = function useGetLatestReferenceTime(inputLayer) {
27379
25119
  var _React$useState = React.useState(''),
27380
25120
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -27446,7 +25186,7 @@ var makeMapPreset = function makeMapPreset(timeIncrement, uniqueId, referenceTim
27446
25186
  };
27447
25187
  var ModelRunInterval = function ModelRunInterval(_ref) {
27448
25188
  var _ref$layers = _ref.layers,
27449
- layers = _ref$layers === void 0 ? [harmoniePressure, harmonieWindFlags, harmoniePrecipitation] : _ref$layers,
25189
+ layers = _ref$layers === void 0 ? [publicLayers.harmoniePressure, publicLayers.harmonieWindFlags, publicLayers.harmoniePrecipitation] : _ref$layers,
27450
25190
  syncGroupsIds = _ref.syncGroupsIds,
27451
25191
  _ref$interval = _ref.interval,
27452
25192
  interval = _ref$interval === void 0 ? 3 : _ref$interval,
@@ -28021,7 +25761,7 @@ var SubmenuWrapper = function SubmenuWrapper(_a) {
28021
25761
  sx = _a.sx,
28022
25762
  setSubmenu = _a.setSubmenu,
28023
25763
  title = _a.title,
28024
- props = __rest$1(_a, ["children", "closeButtonIcon", "sx", "setSubmenu", "title"]);
25764
+ props = __rest(_a, ["children", "closeButtonIcon", "sx", "setSubmenu", "title"]);
28025
25765
  return /*#__PURE__*/React__default.createElement(Card, Object.assign({}, props, {
28026
25766
  sx: Object.assign({
28027
25767
  position: 'relative'
@@ -28308,7 +26048,7 @@ var TimeStepSelector = function TimeStepSelector(_a) {
28308
26048
  value = _a.value,
28309
26049
  setValue = _a.setValue,
28310
26050
  defaultTimeStep = _a.defaultTimeStep,
28311
- props = __rest$1(_a, ["dropdownButtonIcon", "value", "setValue", "defaultTimeStep"]);
26051
+ props = __rest(_a, ["dropdownButtonIcon", "value", "setValue", "defaultTimeStep"]);
28312
26052
  var availableOptions = allOptions.filter(function (option) {
28313
26053
  return Number(option) >= defaultTimeStep;
28314
26054
  });
@@ -28480,7 +26220,7 @@ var CustomSelect = function CustomSelect(_a) {
28480
26220
  itemPostFix = _a.itemPostFix,
28481
26221
  value = _a.value,
28482
26222
  setValue = _a.setValue,
28483
- props = __rest$1(_a, ["amountOfOptions", "dropdownButtonIcon", "itemPostFix", "value", "setValue"]);
26223
+ props = __rest(_a, ["amountOfOptions", "dropdownButtonIcon", "itemPostFix", "value", "setValue"]);
28484
26224
  var availableOptions = Array.from(Array(amountOfOptions).keys());
28485
26225
  return /*#__PURE__*/React__default.createElement(Select, Object.assign({}, props, {
28486
26226
  "data-testid": "TimeSliderLite-customSelect-".concat(itemPostFix),
@@ -29071,7 +26811,7 @@ var ControlButtonGroup = function ControlButtonGroup(_a) {
29071
26811
  var children = _a.children,
29072
26812
  right = _a.right,
29073
26813
  left = _a.left,
29074
- props = __rest$1(_a, ["children", "right", "left"]);
26814
+ props = __rest(_a, ["children", "right", "left"]);
29075
26815
  return /*#__PURE__*/React__default.createElement(ButtonGroup, Object.assign({
29076
26816
  orientation: "horizontal",
29077
26817
  fullWidth: true
@@ -29945,7 +27685,7 @@ var TimeSliderLiteConnect = function TimeSliderLiteConnect(_a) {
29945
27685
  isAlwaysVisible = _a$isAlwaysVisible === void 0 ? false : _a$isAlwaysVisible,
29946
27686
  menuSx = _a.menuSx,
29947
27687
  subMenuSx = _a.subMenuSx,
29948
- timeSliderProps = __rest$1(_a, ["overrideUseTimeRange", "overrideUseTimeStep", "sourceId", "mapId", "isAlwaysVisible", "menuSx", "subMenuSx"]);
27688
+ timeSliderProps = __rest(_a, ["overrideUseTimeRange", "overrideUseTimeStep", "sourceId", "mapId", "isAlwaysVisible", "menuSx", "subMenuSx"]);
29949
27689
  var _React$useState = React.useState(false),
29950
27690
  _React$useState2 = _slicedToArray(_React$useState, 2),
29951
27691
  menuOpen = _React$useState2[0],
@@ -30230,7 +27970,7 @@ var SnackbarWrapper = function SnackbarWrapper(_a) {
30230
27970
  isOpen = _a.isOpen,
30231
27971
  onCloseSnackbar = _a.onCloseSnackbar,
30232
27972
  id = _a.id,
30233
- props = __rest$1(_a, ["children", "isOpen", "onCloseSnackbar", "id"]);
27973
+ props = __rest(_a, ["children", "isOpen", "onCloseSnackbar", "id"]);
30234
27974
  return /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(Snackbar, Object.assign({
30235
27975
  "data-testid": "snackbarComponent",
30236
27976
  open: isOpen,
@@ -30966,4 +28706,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
30966
28706
  }, "Identifier: ", selectedFeatureProperties.identifier)));
30967
28707
  };
30968
28708
 
30969
- export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DrawingToolConnect, DrawingToolMapButtonConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, LegendConnect, LegendMapButtonConnect, MapControlButton, MapControls, MapDrawToolProvider, MapView, MapViewConnect, MapViewLayer, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, ReactMapView, ReactMapViewLayer, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnectMemo as TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, TimeSliderLiteConnect, TimeSliderLiteOptionsMenu, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, ZoomControls, componentsLookUp, defaultBbox, defaultBox, defaultConfigurations, defaultDelete, defaultIntersectionStyleProperties, defaultPoint, defaultPolygon, drawOptions, filterMapPresets, filterServices, publicLayers, publicServices, store, testLayers, timeSliderUtils, useFetchServices, useMapDrawContext, useMapDrawTool, useSetupDialog };
28709
+ export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DrawingToolConnect, DrawingToolMapButtonConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, LegendConnect, LegendMapButtonConnect, MapDrawToolProvider, MapViewConnect, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnectMemo as TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, TimeSliderLiteConnect, TimeSliderLiteOptionsMenu, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, componentsLookUp, defaultBbox, defaultBox, defaultConfigurations, defaultDelete, defaultIntersectionStyleProperties, defaultPoint, defaultPolygon, drawOptions, filterMapPresets, filterServices, store, testLayers, timeSliderUtils, useAreaDrawDialogAction, useFetchServices, useMapDrawContext, useMapDrawTool, useSetupDialog };