@opengeoweb/core 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +242 -1427
- package/package.json +14 -16
- package/src/lib/components/FeatureInfo/GetFeatureInfoDialog.d.ts +3 -2
- package/src/lib/components/MapDraw/storyComponents/StoryLayout.d.ts +1 -2
- package/src/lib/components/MapDraw/useMapDrawTool.d.ts +1 -2
- package/src/lib/components/MapView/index.d.ts +0 -2
- package/src/lib/components/MapView/types.d.ts +1 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeSliderMenu/TimeSliderMenu.d.ts +0 -1
- package/src/lib/index.d.ts +0 -1
- package/src/lib/storybookUtils/defaultStorySettings.d.ts +2 -1
- package/src/lib/utils/defaultTestSettings.d.ts +1 -2
- package/src/lib/components/MapView/MapViewLayer.d.ts +0 -19
- package/src/lib/components/ReactMapView/ReactMapView.d.ts +0 -58
- package/src/lib/components/ReactMapView/ReactMapView.spec.d.ts +0 -1
- package/src/lib/components/ReactMapView/ReactMapViewLayer.d.ts +0 -8
- package/src/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +0 -4
- package/src/lib/components/ReactMapView/ReactMapViewParseLayer.spec.d.ts +0 -1
- package/src/lib/components/ReactMapView/index.d.ts +0 -2
- package/src/lib/components/ReactMapView/types.d.ts +0 -34
- package/src/lib/components/ReactMapView/utils.d.ts +0 -23
- package/src/lib/components/ReactMapView/utils.spec.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -6,378 +6,351 @@ import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWin
|
|
|
6
6
|
import { useDispatch, useSelector, connect, Provider } from 'react-redux';
|
|
7
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';
|
|
8
8
|
import { ReactSortable } from 'react-sortablejs';
|
|
9
|
-
import { webmapUtils, WMGetServiceFromStore, getCapabilities, LayerType, clearImageCache,
|
|
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,
|
|
15
|
+
import { LegendLayout, CanvasComponent, ReactMapView, MapViewLayer, Legend, defaultStyleProperties, lineString, featurePoint, featurePolygon, emptyGeoJSON, DRAWMODE, addFeatureProperties, isGeoJSONFeatureCreatedByTool, getFeatureCollection, getGeoJson, createInterSections } from '@opengeoweb/webmap-react';
|
|
16
16
|
import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField, ReactHookFormSelect, ReactHookFormHiddenInput } from '@opengeoweb/form-fields';
|
|
17
17
|
import moment from 'moment';
|
|
18
18
|
import { findDOMNode, flushSync } from 'react-dom';
|
|
19
19
|
import debounce$1 from 'lodash/debounce';
|
|
20
20
|
import throttle$2 from 'lodash/throttle';
|
|
21
|
-
import { debounce as debounce$2 } from 'throttle-debounce';
|
|
22
21
|
import Draggable from 'react-draggable';
|
|
23
22
|
import axios from 'axios';
|
|
24
23
|
import { useDebounce } from '@opengeoweb/api';
|
|
25
24
|
import { createStore } from '@redux-eggs/redux-toolkit';
|
|
26
25
|
import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
27
26
|
|
|
28
|
-
function _iterableToArrayLimit(
|
|
29
|
-
var
|
|
30
|
-
if (null !=
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
function _iterableToArrayLimit(r, l) {
|
|
28
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
29
|
+
if (null != t) {
|
|
30
|
+
var e,
|
|
31
|
+
n,
|
|
32
|
+
i,
|
|
33
|
+
u,
|
|
34
|
+
a = [],
|
|
35
|
+
f = !0,
|
|
36
|
+
o = !1;
|
|
38
37
|
try {
|
|
39
|
-
if (
|
|
40
|
-
if (Object(
|
|
41
|
-
|
|
42
|
-
} else for (; !(
|
|
43
|
-
} catch (
|
|
44
|
-
|
|
38
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
39
|
+
if (Object(t) !== t) return;
|
|
40
|
+
f = !1;
|
|
41
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
42
|
+
} catch (r) {
|
|
43
|
+
o = !0, n = r;
|
|
45
44
|
} finally {
|
|
46
45
|
try {
|
|
47
|
-
if (!
|
|
46
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
48
47
|
} finally {
|
|
49
|
-
if (
|
|
48
|
+
if (o) throw n;
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
|
-
return
|
|
51
|
+
return a;
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
function _regeneratorRuntime() {
|
|
56
55
|
_regeneratorRuntime = function () {
|
|
57
|
-
return
|
|
56
|
+
return e;
|
|
58
57
|
};
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
var t,
|
|
59
|
+
e = {},
|
|
60
|
+
r = Object.prototype,
|
|
61
|
+
n = r.hasOwnProperty,
|
|
62
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
63
|
+
t[e] = r.value;
|
|
64
64
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
function define(
|
|
70
|
-
return Object.defineProperty(
|
|
71
|
-
value:
|
|
65
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
66
|
+
a = i.iterator || "@@iterator",
|
|
67
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
68
|
+
u = i.toStringTag || "@@toStringTag";
|
|
69
|
+
function define(t, e, r) {
|
|
70
|
+
return Object.defineProperty(t, e, {
|
|
71
|
+
value: r,
|
|
72
72
|
enumerable: !0,
|
|
73
73
|
configurable: !0,
|
|
74
74
|
writable: !0
|
|
75
|
-
}),
|
|
75
|
+
}), t[e];
|
|
76
76
|
}
|
|
77
77
|
try {
|
|
78
78
|
define({}, "");
|
|
79
|
-
} catch (
|
|
80
|
-
define = function (
|
|
81
|
-
return
|
|
79
|
+
} catch (t) {
|
|
80
|
+
define = function (t, e, r) {
|
|
81
|
+
return t[e] = r;
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function wrap(
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
value: makeInvokeMethod(
|
|
90
|
-
}),
|
|
84
|
+
function wrap(t, e, r, n) {
|
|
85
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
86
|
+
a = Object.create(i.prototype),
|
|
87
|
+
c = new Context(n || []);
|
|
88
|
+
return o(a, "_invoke", {
|
|
89
|
+
value: makeInvokeMethod(t, r, c)
|
|
90
|
+
}), a;
|
|
91
91
|
}
|
|
92
|
-
function tryCatch(
|
|
92
|
+
function tryCatch(t, e, r) {
|
|
93
93
|
try {
|
|
94
94
|
return {
|
|
95
95
|
type: "normal",
|
|
96
|
-
arg:
|
|
96
|
+
arg: t.call(e, r)
|
|
97
97
|
};
|
|
98
|
-
} catch (
|
|
98
|
+
} catch (t) {
|
|
99
99
|
return {
|
|
100
100
|
type: "throw",
|
|
101
|
-
arg:
|
|
101
|
+
arg: t
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
|
|
106
|
-
var
|
|
105
|
+
e.wrap = wrap;
|
|
106
|
+
var h = "suspendedStart",
|
|
107
|
+
l = "suspendedYield",
|
|
108
|
+
f = "executing",
|
|
109
|
+
s = "completed",
|
|
110
|
+
y = {};
|
|
107
111
|
function Generator() {}
|
|
108
112
|
function GeneratorFunction() {}
|
|
109
113
|
function GeneratorFunctionPrototype() {}
|
|
110
|
-
var
|
|
111
|
-
define(
|
|
114
|
+
var p = {};
|
|
115
|
+
define(p, a, function () {
|
|
112
116
|
return this;
|
|
113
117
|
});
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
var
|
|
118
|
-
function defineIteratorMethods(
|
|
119
|
-
["next", "throw", "return"].forEach(function (
|
|
120
|
-
define(
|
|
121
|
-
return this._invoke(
|
|
118
|
+
var d = Object.getPrototypeOf,
|
|
119
|
+
v = d && d(d(values([])));
|
|
120
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
121
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
122
|
+
function defineIteratorMethods(t) {
|
|
123
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
124
|
+
define(t, e, function (t) {
|
|
125
|
+
return this._invoke(e, t);
|
|
122
126
|
});
|
|
123
127
|
});
|
|
124
128
|
}
|
|
125
|
-
function AsyncIterator(
|
|
126
|
-
function invoke(
|
|
127
|
-
var
|
|
128
|
-
if ("throw" !==
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
return
|
|
132
|
-
invoke("next",
|
|
133
|
-
}, function (
|
|
134
|
-
invoke("throw",
|
|
135
|
-
}) :
|
|
136
|
-
|
|
137
|
-
}, function (
|
|
138
|
-
return invoke("throw",
|
|
129
|
+
function AsyncIterator(t, e) {
|
|
130
|
+
function invoke(r, o, i, a) {
|
|
131
|
+
var c = tryCatch(t[r], t, o);
|
|
132
|
+
if ("throw" !== c.type) {
|
|
133
|
+
var u = c.arg,
|
|
134
|
+
h = u.value;
|
|
135
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
136
|
+
invoke("next", t, i, a);
|
|
137
|
+
}, function (t) {
|
|
138
|
+
invoke("throw", t, i, a);
|
|
139
|
+
}) : e.resolve(h).then(function (t) {
|
|
140
|
+
u.value = t, i(u);
|
|
141
|
+
}, function (t) {
|
|
142
|
+
return invoke("throw", t, i, a);
|
|
139
143
|
});
|
|
140
144
|
}
|
|
141
|
-
|
|
145
|
+
a(c.arg);
|
|
142
146
|
}
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
value: function (
|
|
147
|
+
var r;
|
|
148
|
+
o(this, "_invoke", {
|
|
149
|
+
value: function (t, n) {
|
|
146
150
|
function callInvokeWithMethodAndArg() {
|
|
147
|
-
return new
|
|
148
|
-
invoke(
|
|
151
|
+
return new e(function (e, r) {
|
|
152
|
+
invoke(t, n, e, r);
|
|
149
153
|
});
|
|
150
154
|
}
|
|
151
|
-
return
|
|
155
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
152
156
|
}
|
|
153
157
|
});
|
|
154
158
|
}
|
|
155
|
-
function makeInvokeMethod(
|
|
156
|
-
var
|
|
157
|
-
return function (
|
|
158
|
-
if (
|
|
159
|
-
if (
|
|
160
|
-
if ("throw" ===
|
|
159
|
+
function makeInvokeMethod(e, r, n) {
|
|
160
|
+
var o = h;
|
|
161
|
+
return function (i, a) {
|
|
162
|
+
if (o === f) throw new Error("Generator is already running");
|
|
163
|
+
if (o === s) {
|
|
164
|
+
if ("throw" === i) throw a;
|
|
161
165
|
return {
|
|
162
|
-
value:
|
|
166
|
+
value: t,
|
|
163
167
|
done: !0
|
|
164
168
|
};
|
|
165
169
|
}
|
|
166
|
-
for (
|
|
167
|
-
var
|
|
168
|
-
if (
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
return
|
|
170
|
+
for (n.method = i, n.arg = a;;) {
|
|
171
|
+
var c = n.delegate;
|
|
172
|
+
if (c) {
|
|
173
|
+
var u = maybeInvokeDelegate(c, n);
|
|
174
|
+
if (u) {
|
|
175
|
+
if (u === y) continue;
|
|
176
|
+
return u;
|
|
173
177
|
}
|
|
174
178
|
}
|
|
175
|
-
if ("next" ===
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
} else "return" ===
|
|
179
|
-
|
|
180
|
-
var
|
|
181
|
-
if ("normal" ===
|
|
182
|
-
if (
|
|
179
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
180
|
+
if (o === h) throw o = s, n.arg;
|
|
181
|
+
n.dispatchException(n.arg);
|
|
182
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
183
|
+
o = f;
|
|
184
|
+
var p = tryCatch(e, r, n);
|
|
185
|
+
if ("normal" === p.type) {
|
|
186
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
183
187
|
return {
|
|
184
|
-
value:
|
|
185
|
-
done:
|
|
188
|
+
value: p.arg,
|
|
189
|
+
done: n.done
|
|
186
190
|
};
|
|
187
191
|
}
|
|
188
|
-
"throw" ===
|
|
192
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
189
193
|
}
|
|
190
194
|
};
|
|
191
195
|
}
|
|
192
|
-
function maybeInvokeDelegate(
|
|
193
|
-
var
|
|
194
|
-
|
|
195
|
-
if (
|
|
196
|
-
var
|
|
197
|
-
if ("throw" ===
|
|
198
|
-
var
|
|
199
|
-
return
|
|
200
|
-
}
|
|
201
|
-
function pushTryEntry(
|
|
202
|
-
var
|
|
203
|
-
tryLoc:
|
|
196
|
+
function maybeInvokeDelegate(e, r) {
|
|
197
|
+
var n = r.method,
|
|
198
|
+
o = e.iterator[n];
|
|
199
|
+
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;
|
|
200
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
201
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
202
|
+
var a = i.arg;
|
|
203
|
+
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);
|
|
204
|
+
}
|
|
205
|
+
function pushTryEntry(t) {
|
|
206
|
+
var e = {
|
|
207
|
+
tryLoc: t[0]
|
|
204
208
|
};
|
|
205
|
-
1 in
|
|
209
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
206
210
|
}
|
|
207
|
-
function resetTryEntry(
|
|
208
|
-
var
|
|
209
|
-
|
|
211
|
+
function resetTryEntry(t) {
|
|
212
|
+
var e = t.completion || {};
|
|
213
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
210
214
|
}
|
|
211
|
-
function Context(
|
|
215
|
+
function Context(t) {
|
|
212
216
|
this.tryEntries = [{
|
|
213
217
|
tryLoc: "root"
|
|
214
|
-
}],
|
|
215
|
-
}
|
|
216
|
-
function values(
|
|
217
|
-
if (
|
|
218
|
-
var
|
|
219
|
-
if (
|
|
220
|
-
if ("function" == typeof
|
|
221
|
-
if (!isNaN(
|
|
222
|
-
var
|
|
223
|
-
|
|
224
|
-
for (; ++
|
|
225
|
-
return next.value =
|
|
218
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
219
|
+
}
|
|
220
|
+
function values(e) {
|
|
221
|
+
if (e || "" === e) {
|
|
222
|
+
var r = e[a];
|
|
223
|
+
if (r) return r.call(e);
|
|
224
|
+
if ("function" == typeof e.next) return e;
|
|
225
|
+
if (!isNaN(e.length)) {
|
|
226
|
+
var o = -1,
|
|
227
|
+
i = function next() {
|
|
228
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
229
|
+
return next.value = t, next.done = !0, next;
|
|
226
230
|
};
|
|
227
|
-
return
|
|
231
|
+
return i.next = i;
|
|
228
232
|
}
|
|
229
233
|
}
|
|
230
|
-
throw new TypeError(typeof
|
|
234
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
231
235
|
}
|
|
232
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
236
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
233
237
|
value: GeneratorFunctionPrototype,
|
|
234
238
|
configurable: !0
|
|
235
|
-
}),
|
|
239
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
236
240
|
value: GeneratorFunction,
|
|
237
241
|
configurable: !0
|
|
238
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
239
|
-
var
|
|
240
|
-
return !!
|
|
241
|
-
},
|
|
242
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
243
|
-
},
|
|
242
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
243
|
+
var e = "function" == typeof t && t.constructor;
|
|
244
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
245
|
+
}, e.mark = function (t) {
|
|
246
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
247
|
+
}, e.awrap = function (t) {
|
|
244
248
|
return {
|
|
245
|
-
__await:
|
|
249
|
+
__await: t
|
|
246
250
|
};
|
|
247
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
251
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
248
252
|
return this;
|
|
249
|
-
}),
|
|
250
|
-
void 0 ===
|
|
251
|
-
var
|
|
252
|
-
return
|
|
253
|
-
return
|
|
253
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
254
|
+
void 0 === i && (i = Promise);
|
|
255
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
256
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
257
|
+
return t.done ? t.value : a.next();
|
|
254
258
|
});
|
|
255
|
-
}, defineIteratorMethods(
|
|
259
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
256
260
|
return this;
|
|
257
|
-
}), define(
|
|
261
|
+
}), define(g, "toString", function () {
|
|
258
262
|
return "[object Generator]";
|
|
259
|
-
}),
|
|
260
|
-
var
|
|
261
|
-
|
|
262
|
-
for (var
|
|
263
|
-
return
|
|
264
|
-
for (;
|
|
265
|
-
var
|
|
266
|
-
if (
|
|
263
|
+
}), e.keys = function (t) {
|
|
264
|
+
var e = Object(t),
|
|
265
|
+
r = [];
|
|
266
|
+
for (var n in e) r.push(n);
|
|
267
|
+
return r.reverse(), function next() {
|
|
268
|
+
for (; r.length;) {
|
|
269
|
+
var t = r.pop();
|
|
270
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
267
271
|
}
|
|
268
272
|
return next.done = !0, next;
|
|
269
273
|
};
|
|
270
|
-
},
|
|
274
|
+
}, e.values = values, Context.prototype = {
|
|
271
275
|
constructor: Context,
|
|
272
|
-
reset: function (
|
|
273
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
276
|
+
reset: function (e) {
|
|
277
|
+
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
278
|
},
|
|
275
279
|
stop: function () {
|
|
276
280
|
this.done = !0;
|
|
277
|
-
var
|
|
278
|
-
if ("throw" ===
|
|
281
|
+
var t = this.tryEntries[0].completion;
|
|
282
|
+
if ("throw" === t.type) throw t.arg;
|
|
279
283
|
return this.rval;
|
|
280
284
|
},
|
|
281
|
-
dispatchException: function (
|
|
282
|
-
if (this.done) throw
|
|
283
|
-
var
|
|
284
|
-
function handle(
|
|
285
|
-
return
|
|
286
|
-
}
|
|
287
|
-
for (var
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
if ("root" ===
|
|
291
|
-
if (
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
if (
|
|
295
|
-
if (this.prev <
|
|
296
|
-
if (this.prev <
|
|
297
|
-
} else if (
|
|
298
|
-
if (this.prev <
|
|
285
|
+
dispatchException: function (e) {
|
|
286
|
+
if (this.done) throw e;
|
|
287
|
+
var r = this;
|
|
288
|
+
function handle(n, o) {
|
|
289
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
290
|
+
}
|
|
291
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
292
|
+
var i = this.tryEntries[o],
|
|
293
|
+
a = i.completion;
|
|
294
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
295
|
+
if (i.tryLoc <= this.prev) {
|
|
296
|
+
var c = n.call(i, "catchLoc"),
|
|
297
|
+
u = n.call(i, "finallyLoc");
|
|
298
|
+
if (c && u) {
|
|
299
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
300
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
301
|
+
} else if (c) {
|
|
302
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
299
303
|
} else {
|
|
300
|
-
if (!
|
|
301
|
-
if (this.prev <
|
|
304
|
+
if (!u) throw new Error("try statement without catch or finally");
|
|
305
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
302
306
|
}
|
|
303
307
|
}
|
|
304
308
|
}
|
|
305
309
|
},
|
|
306
|
-
abrupt: function (
|
|
307
|
-
for (var
|
|
308
|
-
var
|
|
309
|
-
if (
|
|
310
|
-
var
|
|
310
|
+
abrupt: function (t, e) {
|
|
311
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
312
|
+
var o = this.tryEntries[r];
|
|
313
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
314
|
+
var i = o;
|
|
311
315
|
break;
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
|
-
|
|
315
|
-
var
|
|
316
|
-
return
|
|
318
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
319
|
+
var a = i ? i.completion : {};
|
|
320
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
317
321
|
},
|
|
318
|
-
complete: function (
|
|
319
|
-
if ("throw" ===
|
|
320
|
-
return "break" ===
|
|
322
|
+
complete: function (t, e) {
|
|
323
|
+
if ("throw" === t.type) throw t.arg;
|
|
324
|
+
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
325
|
},
|
|
322
|
-
finish: function (
|
|
323
|
-
for (var
|
|
324
|
-
var
|
|
325
|
-
if (
|
|
326
|
+
finish: function (t) {
|
|
327
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
328
|
+
var r = this.tryEntries[e];
|
|
329
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
326
330
|
}
|
|
327
331
|
},
|
|
328
|
-
catch: function (
|
|
329
|
-
for (var
|
|
330
|
-
var
|
|
331
|
-
if (
|
|
332
|
-
var
|
|
333
|
-
if ("throw" ===
|
|
334
|
-
var
|
|
335
|
-
resetTryEntry(
|
|
332
|
+
catch: function (t) {
|
|
333
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
334
|
+
var r = this.tryEntries[e];
|
|
335
|
+
if (r.tryLoc === t) {
|
|
336
|
+
var n = r.completion;
|
|
337
|
+
if ("throw" === n.type) {
|
|
338
|
+
var o = n.arg;
|
|
339
|
+
resetTryEntry(r);
|
|
336
340
|
}
|
|
337
|
-
return
|
|
341
|
+
return o;
|
|
338
342
|
}
|
|
339
343
|
}
|
|
340
344
|
throw new Error("illegal catch attempt");
|
|
341
345
|
},
|
|
342
|
-
delegateYield: function (
|
|
346
|
+
delegateYield: function (e, r, n) {
|
|
343
347
|
return this.delegate = {
|
|
344
|
-
iterator: values(
|
|
345
|
-
resultName:
|
|
346
|
-
nextLoc:
|
|
347
|
-
}, "next" === this.method && (this.arg =
|
|
348
|
+
iterator: values(e),
|
|
349
|
+
resultName: r,
|
|
350
|
+
nextLoc: n
|
|
351
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
348
352
|
}
|
|
349
|
-
},
|
|
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;
|
|
353
|
+
}, e;
|
|
381
354
|
}
|
|
382
355
|
function _defineProperty$1(obj, key, value) {
|
|
383
356
|
key = _toPropertyKey(key);
|
|
@@ -393,74 +366,6 @@ function _defineProperty$1(obj, key, value) {
|
|
|
393
366
|
}
|
|
394
367
|
return obj;
|
|
395
368
|
}
|
|
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
369
|
function _slicedToArray(arr, i) {
|
|
465
370
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
466
371
|
}
|
|
@@ -1035,20 +940,20 @@ function _objectSpread2(target) {
|
|
|
1035
940
|
return target;
|
|
1036
941
|
}
|
|
1037
942
|
|
|
1038
|
-
function _typeof
|
|
943
|
+
function _typeof(obj) {
|
|
1039
944
|
"@babel/helpers - typeof";
|
|
1040
945
|
|
|
1041
946
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
1042
|
-
_typeof
|
|
947
|
+
_typeof = function (obj) {
|
|
1043
948
|
return typeof obj;
|
|
1044
949
|
};
|
|
1045
950
|
} else {
|
|
1046
|
-
_typeof
|
|
951
|
+
_typeof = function (obj) {
|
|
1047
952
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
1048
953
|
};
|
|
1049
954
|
}
|
|
1050
955
|
|
|
1051
|
-
return _typeof
|
|
956
|
+
return _typeof(obj);
|
|
1052
957
|
}
|
|
1053
958
|
|
|
1054
959
|
function _defineProperty(obj, key, value) {
|
|
@@ -2087,7 +1992,7 @@ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
|
|
|
2087
1992
|
var group = {};
|
|
2088
1993
|
var originalGroup = options.group;
|
|
2089
1994
|
|
|
2090
|
-
if (!originalGroup || _typeof
|
|
1995
|
+
if (!originalGroup || _typeof(originalGroup) != 'object') {
|
|
2091
1996
|
originalGroup = {
|
|
2092
1997
|
name: originalGroup
|
|
2093
1998
|
};
|
|
@@ -9068,7 +8973,7 @@ tags.forEach(function (tagName) {
|
|
|
9068
8973
|
});
|
|
9069
8974
|
|
|
9070
8975
|
/**
|
|
9071
|
-
* @mui/styled-engine v5.
|
|
8976
|
+
* @mui/styled-engine v5.14.8
|
|
9072
8977
|
*
|
|
9073
8978
|
* @license MIT
|
|
9074
8979
|
* This source code is licensed under the MIT license found in the
|
|
@@ -9723,10 +9628,20 @@ const width = style$3({
|
|
|
9723
9628
|
const maxWidth = props => {
|
|
9724
9629
|
if (props.maxWidth !== undefined && props.maxWidth !== null) {
|
|
9725
9630
|
const styleFromPropValue = propValue => {
|
|
9726
|
-
var _props$theme;
|
|
9631
|
+
var _props$theme, _props$theme2;
|
|
9727
9632
|
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];
|
|
9633
|
+
if (!breakpoint) {
|
|
9634
|
+
return {
|
|
9635
|
+
maxWidth: sizingTransform(propValue)
|
|
9636
|
+
};
|
|
9637
|
+
}
|
|
9638
|
+
if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {
|
|
9639
|
+
return {
|
|
9640
|
+
maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`
|
|
9641
|
+
};
|
|
9642
|
+
}
|
|
9728
9643
|
return {
|
|
9729
|
-
maxWidth: breakpoint
|
|
9644
|
+
maxWidth: breakpoint
|
|
9730
9645
|
};
|
|
9731
9646
|
};
|
|
9732
9647
|
return handleBreakpoints(props, props.maxWidth, styleFromPropValue);
|
|
@@ -20189,45 +20104,6 @@ var TimeSliderConnect = function TimeSliderConnect(_ref) {
|
|
|
20189
20104
|
});
|
|
20190
20105
|
};
|
|
20191
20106
|
|
|
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
20107
|
/* global Reflect, Promise */
|
|
20232
20108
|
|
|
20233
20109
|
var extendStatics = function(d, b) {
|
|
@@ -20546,1063 +20422,6 @@ var isDOMElement = function (element) {
|
|
|
20546
20422
|
return __assign$2({ ref: onRefChange }, size);
|
|
20547
20423
|
}
|
|
20548
20424
|
|
|
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
20425
|
/* *
|
|
21607
20426
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21608
20427
|
* you may not use this file except in compliance with the License.
|
|
@@ -22027,9 +20846,6 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
22027
20846
|
var displayMapPin = useSelector(function (store) {
|
|
22028
20847
|
return mapSelectors.getDisplayMapPin(store, mapId);
|
|
22029
20848
|
});
|
|
22030
|
-
var services = useSelector(function (store) {
|
|
22031
|
-
return serviceSelectors.getServices(store);
|
|
22032
|
-
});
|
|
22033
20849
|
var dispatch = useDispatch();
|
|
22034
20850
|
var mapChangeDimension = React.useCallback(function (mapDimensionPayload) {
|
|
22035
20851
|
if (mapDimensionPayload.dimension) {
|
|
@@ -22119,7 +20935,6 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
22119
20935
|
animationDelay: animationDelay,
|
|
22120
20936
|
displayMapPin: displayMapPin,
|
|
22121
20937
|
disableMapPin: disableMapPin,
|
|
22122
|
-
services: services,
|
|
22123
20938
|
onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
|
|
22124
20939
|
if (mapDimensionPayload && mapDimensionPayload.dimension && mapDimensionPayload.dimension.name && mapDimensionPayload.dimension.name === 'time') {
|
|
22125
20940
|
setTime({
|
|
@@ -30966,4 +29781,4 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
30966
29781
|
}, "Identifier: ", selectedFeatureProperties.identifier)));
|
|
30967
29782
|
};
|
|
30968
29783
|
|
|
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,
|
|
29784
|
+
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, 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, ZoomControls, componentsLookUp, defaultBbox, defaultBox, defaultConfigurations, defaultDelete, defaultIntersectionStyleProperties, defaultPoint, defaultPolygon, drawOptions, filterMapPresets, filterServices, publicLayers, publicServices, store, testLayers, timeSliderUtils, useFetchServices, useMapDrawContext, useMapDrawTool, useSetupDialog };
|