@opengeoweb/store 9.25.3 → 9.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +1110 -993
- package/package.json +1 -1
- package/src/store/index.d.ts +1 -1
- package/src/store/mapStore/index.d.ts +1 -1
- package/src/store/mapStore/layers/types.d.ts +1 -1
- package/src/store/mapStore/map/index.d.ts +2 -0
- package/src/store/mapStore/map/listener.d.ts +1 -0
- package/src/store/mapStore/map/selectors.d.ts +2 -2
- package/src/store/mapStore/map/types.d.ts +5 -0
- package/src/store/mapStore/map/utils.d.ts +14 -1
- package/src/store/mapStore/service/listener.d.ts +5 -0
- package/src/store/mapStore/service/reducer.d.ts +1 -1
- package/src/store/testUtils/Providers.d.ts +1 -1
- package/src/store/mapStore/map/sagas.d.ts +0 -12
- package/src/store/mapStore/service/sagas.d.ts +0 -7
- package/src/store/mapStore/service/sagas.spec.d.ts +0 -1
- /package/src/store/mapStore/{map/sagas.spec.d.ts → service/listener.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { webmapUtils, LayerType, getWMJSMapById, WMLayer, webmapTestSettings,
|
|
1
|
+
import { webmapUtils, parseISO8601IntervalToDateInterval, LayerType, getWMJSMapById, WMLayer, webmapTestSettings, getWMSRequests, handleDateUtilsISOString, isProjectionSupported, getCapabilities } from '@opengeoweb/webmap';
|
|
2
2
|
import { createAction, createSlice, createSelector, createEntityAdapter, createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit';
|
|
3
3
|
import { getGeoJson, moveFeature, createInterSections, getLastEmptyFeatureIndex, defaultLayers, emptyGeoJSON, addSelectionTypeToGeoJSON, getFeatureCollection, defaultIntersectionStyleProperties } from '@opengeoweb/webmap-react';
|
|
4
4
|
export { defaultLayers } from '@opengeoweb/webmap-react';
|
|
5
|
-
import { dateUtils, defaultDelay, withEggs } from '@opengeoweb/shared';
|
|
5
|
+
import { dateUtils, PROJECTION, defaultDelay, withEggs } from '@opengeoweb/shared';
|
|
6
6
|
import { defaultTimeSpan, defaultTimeStep, defaultAnimationDelayAtStart, defaultSecondsPerPx, roundWithTimeStep, getSpeedDelay } from '@opengeoweb/timeslider';
|
|
7
7
|
import { produce } from 'immer';
|
|
8
|
-
import { isEqual, compact } from 'lodash';
|
|
8
|
+
import { isEqual, isEmpty, compact } from 'lodash';
|
|
9
9
|
import { useSelector, useDispatch, Provider } from 'react-redux';
|
|
10
10
|
import { useCallback, useEffect } from 'react';
|
|
11
|
-
import { createStore
|
|
11
|
+
import { createStore } from '@redux-eggs/redux-toolkit';
|
|
12
12
|
import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
13
|
-
import { takeEvery, call as call$e, put, select, delay, all, takeLatest } from 'redux-saga/effects';
|
|
14
13
|
import { metronome } from '@opengeoweb/metronome';
|
|
14
|
+
import { takeLatest, select, put } from 'redux-saga/effects';
|
|
15
15
|
import { jsx } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
17
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -21,7 +21,7 @@ var check = function (it) {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
24
|
-
var global$
|
|
24
|
+
var global$g =
|
|
25
25
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
26
26
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
27
27
|
check(typeof window == 'object' && window) ||
|
|
@@ -104,21 +104,21 @@ var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
|
|
|
104
104
|
};
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
var uncurryThis$
|
|
107
|
+
var uncurryThis$k = functionUncurryThis;
|
|
108
108
|
|
|
109
|
-
var toString$
|
|
110
|
-
var stringSlice$4 = uncurryThis$
|
|
109
|
+
var toString$a = uncurryThis$k({}.toString);
|
|
110
|
+
var stringSlice$4 = uncurryThis$k(''.slice);
|
|
111
111
|
|
|
112
112
|
var classofRaw$1 = function (it) {
|
|
113
|
-
return stringSlice$4(toString$
|
|
113
|
+
return stringSlice$4(toString$a(it), 8, -1);
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
var uncurryThis$
|
|
116
|
+
var uncurryThis$j = functionUncurryThis;
|
|
117
117
|
var fails$k = fails$n;
|
|
118
118
|
var classof$8 = classofRaw$1;
|
|
119
119
|
|
|
120
120
|
var $Object$4 = Object;
|
|
121
|
-
var split = uncurryThis$
|
|
121
|
+
var split = uncurryThis$j(''.split);
|
|
122
122
|
|
|
123
123
|
// fallback for non-array-like ES3 and non-enumerable old V8 strings
|
|
124
124
|
var indexedObject = fails$k(function () {
|
|
@@ -172,7 +172,7 @@ var isObject$b = function (it) {
|
|
|
172
172
|
return typeof it == 'object' ? it !== null : isCallable$j(it);
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
var global$
|
|
175
|
+
var global$f = global$g;
|
|
176
176
|
var isCallable$i = isCallable$k;
|
|
177
177
|
|
|
178
178
|
var aFunction = function (argument) {
|
|
@@ -180,20 +180,20 @@ var aFunction = function (argument) {
|
|
|
180
180
|
};
|
|
181
181
|
|
|
182
182
|
var getBuiltIn$6 = function (namespace, method) {
|
|
183
|
-
return arguments.length < 2 ? aFunction(global$
|
|
183
|
+
return arguments.length < 2 ? aFunction(global$f[namespace]) : global$f[namespace] && global$f[namespace][method];
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
-
var uncurryThis$
|
|
186
|
+
var uncurryThis$i = functionUncurryThis;
|
|
187
187
|
|
|
188
|
-
var objectIsPrototypeOf = uncurryThis$
|
|
188
|
+
var objectIsPrototypeOf = uncurryThis$i({}.isPrototypeOf);
|
|
189
189
|
|
|
190
190
|
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
|
191
191
|
|
|
192
|
-
var global$
|
|
192
|
+
var global$e = global$g;
|
|
193
193
|
var userAgent = engineUserAgent;
|
|
194
194
|
|
|
195
|
-
var process = global$
|
|
196
|
-
var Deno = global$
|
|
195
|
+
var process = global$e.process;
|
|
196
|
+
var Deno = global$e.Deno;
|
|
197
197
|
var versions = process && process.versions || Deno && Deno.version;
|
|
198
198
|
var v8 = versions && versions.v8;
|
|
199
199
|
var match, version;
|
|
@@ -220,9 +220,9 @@ var engineV8Version = version;
|
|
|
220
220
|
/* eslint-disable es/no-symbol -- required for testing */
|
|
221
221
|
var V8_VERSION = engineV8Version;
|
|
222
222
|
var fails$j = fails$n;
|
|
223
|
-
var global$
|
|
223
|
+
var global$d = global$g;
|
|
224
224
|
|
|
225
|
-
var $String$6 = global$
|
|
225
|
+
var $String$6 = global$d.String;
|
|
226
226
|
|
|
227
227
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
228
228
|
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$j(function () {
|
|
@@ -306,20 +306,20 @@ var ordinaryToPrimitive$1 = function (input, pref) {
|
|
|
306
306
|
|
|
307
307
|
var sharedStore = {exports: {}};
|
|
308
308
|
|
|
309
|
-
var global$
|
|
309
|
+
var global$c = global$g;
|
|
310
310
|
|
|
311
311
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
312
312
|
var defineProperty$6 = Object.defineProperty;
|
|
313
313
|
|
|
314
314
|
var defineGlobalProperty$3 = function (key, value) {
|
|
315
315
|
try {
|
|
316
|
-
defineProperty$6(global$
|
|
316
|
+
defineProperty$6(global$c, key, { value: value, configurable: true, writable: true });
|
|
317
317
|
} catch (error) {
|
|
318
|
-
global$
|
|
318
|
+
global$c[key] = value;
|
|
319
319
|
} return value;
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
-
var globalThis$1 = global$
|
|
322
|
+
var globalThis$1 = global$g;
|
|
323
323
|
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
324
324
|
|
|
325
325
|
var SHARED = '__core-js_shared__';
|
|
@@ -351,10 +351,10 @@ var toObject$6 = function (argument) {
|
|
|
351
351
|
return $Object$2(requireObjectCoercible$5(argument));
|
|
352
352
|
};
|
|
353
353
|
|
|
354
|
-
var uncurryThis$
|
|
354
|
+
var uncurryThis$h = functionUncurryThis;
|
|
355
355
|
var toObject$5 = toObject$6;
|
|
356
356
|
|
|
357
|
-
var hasOwnProperty = uncurryThis$
|
|
357
|
+
var hasOwnProperty = uncurryThis$h({}.hasOwnProperty);
|
|
358
358
|
|
|
359
359
|
// `HasOwnProperty` abstract operation
|
|
360
360
|
// https://tc39.es/ecma262/#sec-hasownproperty
|
|
@@ -363,31 +363,31 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
|
|
363
363
|
return hasOwnProperty(toObject$5(it), key);
|
|
364
364
|
};
|
|
365
365
|
|
|
366
|
-
var uncurryThis$
|
|
366
|
+
var uncurryThis$g = functionUncurryThis;
|
|
367
367
|
|
|
368
368
|
var id = 0;
|
|
369
369
|
var postfix = Math.random();
|
|
370
|
-
var toString$
|
|
370
|
+
var toString$9 = uncurryThis$g(1.0.toString);
|
|
371
371
|
|
|
372
372
|
var uid$2 = function (key) {
|
|
373
|
-
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$
|
|
373
|
+
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$9(++id + postfix, 36);
|
|
374
374
|
};
|
|
375
375
|
|
|
376
|
-
var global$
|
|
376
|
+
var global$b = global$g;
|
|
377
377
|
var shared$3 = shared$4;
|
|
378
378
|
var hasOwn$9 = hasOwnProperty_1;
|
|
379
379
|
var uid$1 = uid$2;
|
|
380
380
|
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
381
381
|
var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
|
382
382
|
|
|
383
|
-
var Symbol$
|
|
383
|
+
var Symbol$1 = global$b.Symbol;
|
|
384
384
|
var WellKnownSymbolsStore = shared$3('wks');
|
|
385
|
-
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$
|
|
385
|
+
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
|
|
386
386
|
|
|
387
387
|
var wellKnownSymbol$c = function (name) {
|
|
388
388
|
if (!hasOwn$9(WellKnownSymbolsStore, name)) {
|
|
389
|
-
WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$9(Symbol$
|
|
390
|
-
? Symbol$
|
|
389
|
+
WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)
|
|
390
|
+
? Symbol$1[name]
|
|
391
391
|
: createWellKnownSymbol('Symbol.' + name);
|
|
392
392
|
} return WellKnownSymbolsStore[name];
|
|
393
393
|
};
|
|
@@ -428,10 +428,10 @@ var toPropertyKey$2 = function (argument) {
|
|
|
428
428
|
return isSymbol$1(key) ? key : key + '';
|
|
429
429
|
};
|
|
430
430
|
|
|
431
|
-
var global$
|
|
431
|
+
var global$a = global$g;
|
|
432
432
|
var isObject$8 = isObject$b;
|
|
433
433
|
|
|
434
|
-
var document$1 = global$
|
|
434
|
+
var document$1 = global$a.document;
|
|
435
435
|
// typeof document.createElement is 'object' in old IE
|
|
436
436
|
var EXISTS$1 = isObject$8(document$1) && isObject$8(document$1.createElement);
|
|
437
437
|
|
|
@@ -575,11 +575,11 @@ var functionName = {
|
|
|
575
575
|
CONFIGURABLE: CONFIGURABLE
|
|
576
576
|
};
|
|
577
577
|
|
|
578
|
-
var uncurryThis$
|
|
578
|
+
var uncurryThis$f = functionUncurryThis;
|
|
579
579
|
var isCallable$e = isCallable$k;
|
|
580
580
|
var store$1 = sharedStoreExports;
|
|
581
581
|
|
|
582
|
-
var functionToString = uncurryThis$
|
|
582
|
+
var functionToString = uncurryThis$f(Function.toString);
|
|
583
583
|
|
|
584
584
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
|
585
585
|
if (!isCallable$e(store$1.inspectSource)) {
|
|
@@ -590,10 +590,10 @@ if (!isCallable$e(store$1.inspectSource)) {
|
|
|
590
590
|
|
|
591
591
|
var inspectSource$2 = store$1.inspectSource;
|
|
592
592
|
|
|
593
|
-
var global$
|
|
593
|
+
var global$9 = global$g;
|
|
594
594
|
var isCallable$d = isCallable$k;
|
|
595
595
|
|
|
596
|
-
var WeakMap$1 = global$
|
|
596
|
+
var WeakMap$1 = global$9.WeakMap;
|
|
597
597
|
|
|
598
598
|
var weakMapBasicDetection = isCallable$d(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
|
599
599
|
|
|
@@ -609,7 +609,7 @@ var sharedKey$3 = function (key) {
|
|
|
609
609
|
var hiddenKeys$4 = {};
|
|
610
610
|
|
|
611
611
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
612
|
-
var global$
|
|
612
|
+
var global$8 = global$g;
|
|
613
613
|
var isObject$6 = isObject$b;
|
|
614
614
|
var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
|
|
615
615
|
var hasOwn$6 = hasOwnProperty_1;
|
|
@@ -618,8 +618,8 @@ var sharedKey$2 = sharedKey$3;
|
|
|
618
618
|
var hiddenKeys$3 = hiddenKeys$4;
|
|
619
619
|
|
|
620
620
|
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
|
621
|
-
var TypeError$1 = global$
|
|
622
|
-
var WeakMap = global$
|
|
621
|
+
var TypeError$1 = global$8.TypeError;
|
|
622
|
+
var WeakMap = global$8.WeakMap;
|
|
623
623
|
var set, get, has;
|
|
624
624
|
|
|
625
625
|
var enforce = function (it) {
|
|
@@ -679,7 +679,7 @@ var internalState = {
|
|
|
679
679
|
getterFor: getterFor
|
|
680
680
|
};
|
|
681
681
|
|
|
682
|
-
var uncurryThis$
|
|
682
|
+
var uncurryThis$e = functionUncurryThis;
|
|
683
683
|
var fails$g = fails$n;
|
|
684
684
|
var isCallable$c = isCallable$k;
|
|
685
685
|
var hasOwn$5 = hasOwnProperty_1;
|
|
@@ -693,9 +693,9 @@ var getInternalState$2 = InternalStateModule$1.get;
|
|
|
693
693
|
var $String$3 = String;
|
|
694
694
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
695
695
|
var defineProperty$5 = Object.defineProperty;
|
|
696
|
-
var stringSlice$3 = uncurryThis$
|
|
697
|
-
var replace$4 = uncurryThis$
|
|
698
|
-
var join = uncurryThis$
|
|
696
|
+
var stringSlice$3 = uncurryThis$e(''.slice);
|
|
697
|
+
var replace$4 = uncurryThis$e(''.replace);
|
|
698
|
+
var join = uncurryThis$e([].join);
|
|
699
699
|
|
|
700
700
|
var CONFIGURABLE_LENGTH = DESCRIPTORS$5 && !fails$g(function () {
|
|
701
701
|
return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
|
|
@@ -853,13 +853,13 @@ var arrayIncludes = {
|
|
|
853
853
|
indexOf: createMethod$3(false)
|
|
854
854
|
};
|
|
855
855
|
|
|
856
|
-
var uncurryThis$
|
|
856
|
+
var uncurryThis$d = functionUncurryThis;
|
|
857
857
|
var hasOwn$4 = hasOwnProperty_1;
|
|
858
858
|
var toIndexedObject$2 = toIndexedObject$5;
|
|
859
859
|
var indexOf$1 = arrayIncludes.indexOf;
|
|
860
860
|
var hiddenKeys$2 = hiddenKeys$4;
|
|
861
861
|
|
|
862
|
-
var push$2 = uncurryThis$
|
|
862
|
+
var push$2 = uncurryThis$d([].push);
|
|
863
863
|
|
|
864
864
|
var objectKeysInternal = function (object, names) {
|
|
865
865
|
var O = toIndexedObject$2(object);
|
|
@@ -903,12 +903,12 @@ var objectGetOwnPropertySymbols = {};
|
|
|
903
903
|
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
|
904
904
|
|
|
905
905
|
var getBuiltIn$4 = getBuiltIn$6;
|
|
906
|
-
var uncurryThis$
|
|
906
|
+
var uncurryThis$c = functionUncurryThis;
|
|
907
907
|
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
|
908
908
|
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
|
909
909
|
var anObject$7 = anObject$9;
|
|
910
910
|
|
|
911
|
-
var concat$1 = uncurryThis$
|
|
911
|
+
var concat$1 = uncurryThis$c([].concat);
|
|
912
912
|
|
|
913
913
|
// all object keys, includes non-enumerable and symbols
|
|
914
914
|
var ownKeys$1 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
|
|
@@ -957,7 +957,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
|
|
|
957
957
|
|
|
958
958
|
var isForced_1 = isForced$1;
|
|
959
959
|
|
|
960
|
-
var global$
|
|
960
|
+
var global$7 = global$g;
|
|
961
961
|
var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
|
|
962
962
|
var createNonEnumerableProperty$6 = createNonEnumerableProperty$8;
|
|
963
963
|
var defineBuiltIn$3 = defineBuiltIn$4;
|
|
@@ -986,11 +986,11 @@ var _export = function (options, source) {
|
|
|
986
986
|
var STATIC = options.stat;
|
|
987
987
|
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
|
988
988
|
if (GLOBAL) {
|
|
989
|
-
target = global$
|
|
989
|
+
target = global$7;
|
|
990
990
|
} else if (STATIC) {
|
|
991
|
-
target = global$
|
|
991
|
+
target = global$7[TARGET] || defineGlobalProperty(TARGET, {});
|
|
992
992
|
} else {
|
|
993
|
-
target = global$
|
|
993
|
+
target = global$7[TARGET] && global$7[TARGET].prototype;
|
|
994
994
|
}
|
|
995
995
|
if (target) for (key in source) {
|
|
996
996
|
sourceProperty = source[key];
|
|
@@ -1023,7 +1023,7 @@ var objectKeys$2 = Object.keys || function keys(O) {
|
|
|
1023
1023
|
};
|
|
1024
1024
|
|
|
1025
1025
|
var DESCRIPTORS$4 = descriptors;
|
|
1026
|
-
var uncurryThis$
|
|
1026
|
+
var uncurryThis$b = functionUncurryThis;
|
|
1027
1027
|
var call$8 = functionCall;
|
|
1028
1028
|
var fails$e = fails$n;
|
|
1029
1029
|
var objectKeys$1 = objectKeys$2;
|
|
@@ -1036,7 +1036,7 @@ var IndexedObject$1 = indexedObject;
|
|
|
1036
1036
|
var $assign = Object.assign;
|
|
1037
1037
|
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
|
|
1038
1038
|
var defineProperty$4 = Object.defineProperty;
|
|
1039
|
-
var concat = uncurryThis$
|
|
1039
|
+
var concat = uncurryThis$b([].concat);
|
|
1040
1040
|
|
|
1041
1041
|
// `Object.assign` method
|
|
1042
1042
|
// https://tc39.es/ecma262/#sec-object.assign
|
|
@@ -1283,7 +1283,7 @@ var getPrototypeOf$1 = objectGetPrototypeOf;
|
|
|
1283
1283
|
var defineBuiltIn$2 = defineBuiltIn$4;
|
|
1284
1284
|
var wellKnownSymbol$9 = wellKnownSymbol$c;
|
|
1285
1285
|
|
|
1286
|
-
var ITERATOR$
|
|
1286
|
+
var ITERATOR$2 = wellKnownSymbol$9('iterator');
|
|
1287
1287
|
var BUGGY_SAFARI_ITERATORS$1 = false;
|
|
1288
1288
|
|
|
1289
1289
|
// `%IteratorPrototype%` object
|
|
@@ -1304,15 +1304,15 @@ if ([].keys) {
|
|
|
1304
1304
|
var NEW_ITERATOR_PROTOTYPE = !isObject$5(IteratorPrototype$2) || fails$b(function () {
|
|
1305
1305
|
var test = {};
|
|
1306
1306
|
// FF44- legacy iterators case
|
|
1307
|
-
return IteratorPrototype$2[ITERATOR$
|
|
1307
|
+
return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
|
|
1308
1308
|
});
|
|
1309
1309
|
|
|
1310
1310
|
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
|
|
1311
1311
|
|
|
1312
1312
|
// `%IteratorPrototype%[@@iterator]()` method
|
|
1313
1313
|
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
|
1314
|
-
if (!isCallable$8(IteratorPrototype$2[ITERATOR$
|
|
1315
|
-
defineBuiltIn$2(IteratorPrototype$2, ITERATOR$
|
|
1314
|
+
if (!isCallable$8(IteratorPrototype$2[ITERATOR$2])) {
|
|
1315
|
+
defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
|
|
1316
1316
|
return this;
|
|
1317
1317
|
});
|
|
1318
1318
|
}
|
|
@@ -1351,13 +1351,13 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
|
|
|
1351
1351
|
return IteratorConstructor;
|
|
1352
1352
|
};
|
|
1353
1353
|
|
|
1354
|
-
var uncurryThis$
|
|
1354
|
+
var uncurryThis$a = functionUncurryThis;
|
|
1355
1355
|
var aCallable$1 = aCallable$3;
|
|
1356
1356
|
|
|
1357
1357
|
var functionUncurryThisAccessor = function (object, key, method) {
|
|
1358
1358
|
try {
|
|
1359
1359
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
1360
|
-
return uncurryThis$
|
|
1360
|
+
return uncurryThis$a(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
|
|
1361
1361
|
} catch (error) { /* empty */ }
|
|
1362
1362
|
};
|
|
1363
1363
|
|
|
@@ -1420,11 +1420,11 @@ var wellKnownSymbol$7 = wellKnownSymbol$c;
|
|
|
1420
1420
|
var Iterators$1 = iterators;
|
|
1421
1421
|
var IteratorsCore = iteratorsCore;
|
|
1422
1422
|
|
|
1423
|
-
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
|
1423
|
+
var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
|
|
1424
1424
|
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
|
1425
1425
|
var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
|
1426
1426
|
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
|
1427
|
-
var ITERATOR$
|
|
1427
|
+
var ITERATOR$1 = wellKnownSymbol$7('iterator');
|
|
1428
1428
|
var KEYS = 'keys';
|
|
1429
1429
|
var VALUES = 'values';
|
|
1430
1430
|
var ENTRIES = 'entries';
|
|
@@ -1450,7 +1450,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1450
1450
|
var TO_STRING_TAG = NAME + ' Iterator';
|
|
1451
1451
|
var INCORRECT_VALUES_NAME = false;
|
|
1452
1452
|
var IterablePrototype = Iterable.prototype;
|
|
1453
|
-
var nativeIterator = IterablePrototype[ITERATOR$
|
|
1453
|
+
var nativeIterator = IterablePrototype[ITERATOR$1]
|
|
1454
1454
|
|| IterablePrototype['@@iterator']
|
|
1455
1455
|
|| DEFAULT && IterablePrototype[DEFAULT];
|
|
1456
1456
|
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
|
@@ -1464,8 +1464,8 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1464
1464
|
if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
|
1465
1465
|
if (setPrototypeOf$2) {
|
|
1466
1466
|
setPrototypeOf$2(CurrentIteratorPrototype, IteratorPrototype);
|
|
1467
|
-
} else if (!isCallable$7(CurrentIteratorPrototype[ITERATOR$
|
|
1468
|
-
defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$
|
|
1467
|
+
} else if (!isCallable$7(CurrentIteratorPrototype[ITERATOR$1])) {
|
|
1468
|
+
defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
1471
|
// Set @@toStringTag to native iterators
|
|
@@ -1474,7 +1474,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1474
1474
|
}
|
|
1475
1475
|
|
|
1476
1476
|
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
|
1477
|
-
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1477
|
+
if (PROPER_FUNCTION_NAME$1 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
|
1478
1478
|
if (CONFIGURABLE_FUNCTION_NAME) {
|
|
1479
1479
|
createNonEnumerableProperty$5(IterablePrototype, 'name', VALUES);
|
|
1480
1480
|
} else {
|
|
@@ -1498,8 +1498,8 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
|
|
|
1498
1498
|
}
|
|
1499
1499
|
|
|
1500
1500
|
// define iterator
|
|
1501
|
-
if (IterablePrototype[ITERATOR$
|
|
1502
|
-
defineBuiltIn$1(IterablePrototype, ITERATOR$
|
|
1501
|
+
if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
|
|
1502
|
+
defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
|
|
1503
1503
|
}
|
|
1504
1504
|
Iterators$1[NAME] = defaultIterator;
|
|
1505
1505
|
|
|
@@ -1639,11 +1639,11 @@ var properErrorOnNonWritableLength$1 = function () {
|
|
|
1639
1639
|
}
|
|
1640
1640
|
};
|
|
1641
1641
|
|
|
1642
|
-
var FORCED$
|
|
1642
|
+
var FORCED$3 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength$1();
|
|
1643
1643
|
|
|
1644
1644
|
// `Array.prototype.push` method
|
|
1645
1645
|
// https://tc39.es/ecma262/#sec-array.prototype.push
|
|
1646
|
-
$$8({ target: 'Array', proto: true, arity: 1, forced: FORCED$
|
|
1646
|
+
$$8({ target: 'Array', proto: true, arity: 1, forced: FORCED$3 }, {
|
|
1647
1647
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
1648
1648
|
push: function push(item) {
|
|
1649
1649
|
var O = toObject$2(this);
|
|
@@ -1715,10 +1715,10 @@ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
|
|
|
1715
1715
|
});
|
|
1716
1716
|
};
|
|
1717
1717
|
|
|
1718
|
-
var global$
|
|
1718
|
+
var global$6 = global$g;
|
|
1719
1719
|
var classof$6 = classofRaw$1;
|
|
1720
1720
|
|
|
1721
|
-
var engineIsNode = classof$6(global$
|
|
1721
|
+
var engineIsNode = classof$6(global$6.process) === 'process';
|
|
1722
1722
|
|
|
1723
1723
|
var $$7 = _export;
|
|
1724
1724
|
var $reduce = arrayReduce.left;
|
|
@@ -1729,11 +1729,11 @@ var IS_NODE = engineIsNode;
|
|
|
1729
1729
|
// Chrome 80-82 has a critical bug
|
|
1730
1730
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
|
1731
1731
|
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
|
1732
|
-
var FORCED$
|
|
1732
|
+
var FORCED$2 = CHROME_BUG || !arrayMethodIsStrict('reduce');
|
|
1733
1733
|
|
|
1734
1734
|
// `Array.prototype.reduce` method
|
|
1735
1735
|
// https://tc39.es/ecma262/#sec-array.prototype.reduce
|
|
1736
|
-
$$7({ target: 'Array', proto: true, forced: FORCED$
|
|
1736
|
+
$$7({ target: 'Array', proto: true, forced: FORCED$2 }, {
|
|
1737
1737
|
reduce: function reduce(callbackfn /* , initialValue */) {
|
|
1738
1738
|
var length = arguments.length;
|
|
1739
1739
|
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
|
@@ -1806,7 +1806,7 @@ var classof$3 = classof$4;
|
|
|
1806
1806
|
|
|
1807
1807
|
var $String$1 = String;
|
|
1808
1808
|
|
|
1809
|
-
var toString$
|
|
1809
|
+
var toString$8 = function (argument) {
|
|
1810
1810
|
if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
|
1811
1811
|
return $String$1(argument);
|
|
1812
1812
|
};
|
|
@@ -1828,21 +1828,21 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
|
|
|
1828
1828
|
};
|
|
1829
1829
|
|
|
1830
1830
|
var $$6 = _export;
|
|
1831
|
-
var uncurryThis$
|
|
1831
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
1832
1832
|
var notARegExp = notARegexp;
|
|
1833
1833
|
var requireObjectCoercible$3 = requireObjectCoercible$7;
|
|
1834
|
-
var toString$
|
|
1834
|
+
var toString$7 = toString$8;
|
|
1835
1835
|
var correctIsRegExpLogic = correctIsRegexpLogic;
|
|
1836
1836
|
|
|
1837
|
-
var stringIndexOf = uncurryThis$
|
|
1837
|
+
var stringIndexOf = uncurryThis$9(''.indexOf);
|
|
1838
1838
|
|
|
1839
1839
|
// `String.prototype.includes` method
|
|
1840
1840
|
// https://tc39.es/ecma262/#sec-string.prototype.includes
|
|
1841
1841
|
$$6({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
|
1842
1842
|
includes: function includes(searchString /* , position = 0 */) {
|
|
1843
1843
|
return !!~stringIndexOf(
|
|
1844
|
-
toString$
|
|
1845
|
-
toString$
|
|
1844
|
+
toString$7(requireObjectCoercible$3(this)),
|
|
1845
|
+
toString$7(notARegExp(searchString)),
|
|
1846
1846
|
arguments.length > 1 ? arguments[1] : undefined
|
|
1847
1847
|
);
|
|
1848
1848
|
}
|
|
@@ -1892,7 +1892,7 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
|
|
|
1892
1892
|
|
|
1893
1893
|
var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
|
|
1894
1894
|
|
|
1895
|
-
var global$
|
|
1895
|
+
var global$5 = global$g;
|
|
1896
1896
|
var DOMIterables = domIterables;
|
|
1897
1897
|
var DOMTokenListPrototype = domTokenListPrototype;
|
|
1898
1898
|
var ArrayIteratorMethods = es_array_iterator;
|
|
@@ -1900,16 +1900,16 @@ var createNonEnumerableProperty$4 = createNonEnumerableProperty$8;
|
|
|
1900
1900
|
var setToStringTag = setToStringTag$3;
|
|
1901
1901
|
var wellKnownSymbol$2 = wellKnownSymbol$c;
|
|
1902
1902
|
|
|
1903
|
-
var ITERATOR
|
|
1903
|
+
var ITERATOR = wellKnownSymbol$2('iterator');
|
|
1904
1904
|
var ArrayValues = ArrayIteratorMethods.values;
|
|
1905
1905
|
|
|
1906
1906
|
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
1907
1907
|
if (CollectionPrototype) {
|
|
1908
1908
|
// some Chrome versions have non-configurable methods on DOMTokenList
|
|
1909
|
-
if (CollectionPrototype[ITERATOR
|
|
1910
|
-
createNonEnumerableProperty$4(CollectionPrototype, ITERATOR
|
|
1909
|
+
if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
|
1910
|
+
createNonEnumerableProperty$4(CollectionPrototype, ITERATOR, ArrayValues);
|
|
1911
1911
|
} catch (error) {
|
|
1912
|
-
CollectionPrototype[ITERATOR
|
|
1912
|
+
CollectionPrototype[ITERATOR] = ArrayValues;
|
|
1913
1913
|
}
|
|
1914
1914
|
setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
|
|
1915
1915
|
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
|
@@ -1924,7 +1924,7 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
|
|
1924
1924
|
};
|
|
1925
1925
|
|
|
1926
1926
|
for (var COLLECTION_NAME in DOMIterables) {
|
|
1927
|
-
handlePrototype(global$
|
|
1927
|
+
handlePrototype(global$5[COLLECTION_NAME] && global$5[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
|
1928
1928
|
}
|
|
1929
1929
|
|
|
1930
1930
|
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
|
@@ -2002,7 +2002,7 @@ var LayerActionOrigin;
|
|
|
2002
2002
|
LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
|
|
2003
2003
|
LayerActionOrigin["updateLayerInformationListener"] = "updateLayerInformationListener";
|
|
2004
2004
|
LayerActionOrigin["toggleAutoUpdateListener"] = "toggleAutoUpdateListener";
|
|
2005
|
-
LayerActionOrigin["
|
|
2005
|
+
LayerActionOrigin["unregisterMapListener"] = "unregisterMapListener";
|
|
2006
2006
|
})(LayerActionOrigin || (LayerActionOrigin = {}));
|
|
2007
2007
|
|
|
2008
2008
|
var types$5 = /*#__PURE__*/Object.freeze({
|
|
@@ -2011,6 +2011,69 @@ var types$5 = /*#__PURE__*/Object.freeze({
|
|
|
2011
2011
|
get LayerStatus () { return LayerStatus; }
|
|
2012
2012
|
});
|
|
2013
2013
|
|
|
2014
|
+
// a string of all valid unicode whitespaces
|
|
2015
|
+
var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
2016
|
+
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
2017
|
+
|
|
2018
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
2019
|
+
var requireObjectCoercible$2 = requireObjectCoercible$7;
|
|
2020
|
+
var toString$6 = toString$8;
|
|
2021
|
+
var whitespaces$1 = whitespaces$2;
|
|
2022
|
+
|
|
2023
|
+
var replace$3 = uncurryThis$8(''.replace);
|
|
2024
|
+
var ltrim = RegExp('^[' + whitespaces$1 + ']+');
|
|
2025
|
+
var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
|
|
2026
|
+
|
|
2027
|
+
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
2028
|
+
var createMethod$1 = function (TYPE) {
|
|
2029
|
+
return function ($this) {
|
|
2030
|
+
var string = toString$6(requireObjectCoercible$2($this));
|
|
2031
|
+
if (TYPE & 1) string = replace$3(string, ltrim, '');
|
|
2032
|
+
if (TYPE & 2) string = replace$3(string, rtrim, '$1');
|
|
2033
|
+
return string;
|
|
2034
|
+
};
|
|
2035
|
+
};
|
|
2036
|
+
|
|
2037
|
+
var stringTrim = {
|
|
2038
|
+
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
2039
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
2040
|
+
start: createMethod$1(1),
|
|
2041
|
+
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
2042
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
2043
|
+
end: createMethod$1(2),
|
|
2044
|
+
// `String.prototype.trim` method
|
|
2045
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
2046
|
+
trim: createMethod$1(3)
|
|
2047
|
+
};
|
|
2048
|
+
|
|
2049
|
+
var PROPER_FUNCTION_NAME = functionName.PROPER;
|
|
2050
|
+
var fails$8 = fails$n;
|
|
2051
|
+
var whitespaces = whitespaces$2;
|
|
2052
|
+
|
|
2053
|
+
var non = '\u200B\u0085\u180E';
|
|
2054
|
+
|
|
2055
|
+
// check that a method works with the correct list
|
|
2056
|
+
// of whitespaces and has a correct name
|
|
2057
|
+
var stringTrimForced = function (METHOD_NAME) {
|
|
2058
|
+
return fails$8(function () {
|
|
2059
|
+
return !!whitespaces[METHOD_NAME]()
|
|
2060
|
+
|| non[METHOD_NAME]() !== non
|
|
2061
|
+
|| (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
|
|
2062
|
+
});
|
|
2063
|
+
};
|
|
2064
|
+
|
|
2065
|
+
var $$5 = _export;
|
|
2066
|
+
var $trim = stringTrim.trim;
|
|
2067
|
+
var forcedStringTrimMethod = stringTrimForced;
|
|
2068
|
+
|
|
2069
|
+
// `String.prototype.trim` method
|
|
2070
|
+
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
2071
|
+
$$5({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
|
2072
|
+
trim: function trim() {
|
|
2073
|
+
return $trim(this);
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
|
|
2014
2077
|
const dateFormat = dateUtils.DATE_FORMAT_UTC;
|
|
2015
2078
|
const createMap = ({
|
|
2016
2079
|
id,
|
|
@@ -2029,7 +2092,7 @@ const createMap = ({
|
|
|
2029
2092
|
right: 19000000,
|
|
2030
2093
|
top: 19000000
|
|
2031
2094
|
},
|
|
2032
|
-
srs: _srs =
|
|
2095
|
+
srs: _srs = PROJECTION.EPSG_3857.value,
|
|
2033
2096
|
baseLayers: _baseLayers = [],
|
|
2034
2097
|
overLayers: _overLayers = [],
|
|
2035
2098
|
mapLayers: _mapLayers = [],
|
|
@@ -2205,16 +2268,16 @@ const getTimeStepFromDataInterval = timeInterval => {
|
|
|
2205
2268
|
return timeInterval.year * 365 * 24 * 60;
|
|
2206
2269
|
}
|
|
2207
2270
|
case true:
|
|
2208
|
-
if (timeInterval.day !== 0) {
|
|
2271
|
+
if (timeInterval.day !== 0 && !isNaN(timeInterval.day)) {
|
|
2209
2272
|
return timeInterval.day * 24 * 60;
|
|
2210
2273
|
}
|
|
2211
|
-
if (timeInterval.hour !== 0) {
|
|
2274
|
+
if (timeInterval.hour !== 0 && !isNaN(timeInterval.hour)) {
|
|
2212
2275
|
return timeInterval.hour * 60;
|
|
2213
2276
|
}
|
|
2214
|
-
if (timeInterval.minute !== 0) {
|
|
2277
|
+
if (timeInterval.minute !== 0 && !isNaN(timeInterval.minute)) {
|
|
2215
2278
|
return timeInterval.minute;
|
|
2216
2279
|
}
|
|
2217
|
-
if (timeInterval.second !== 0) {
|
|
2280
|
+
if (timeInterval.second !== 0 && !isNaN(timeInterval.second)) {
|
|
2218
2281
|
return timeInterval.second / 60.0;
|
|
2219
2282
|
}
|
|
2220
2283
|
return defaultTimeStep;
|
|
@@ -2226,6 +2289,81 @@ const getSpeedFactor = speedDelay => {
|
|
|
2226
2289
|
return defaultDelay / speedDelay;
|
|
2227
2290
|
};
|
|
2228
2291
|
const getAnimationDuration = (animationEndTime, animationStartTime) => animationEndTime && animationStartTime ? dateUtils.differenceInMinutes(new Date(animationEndTime), new Date(animationStartTime)) : 0;
|
|
2292
|
+
/**
|
|
2293
|
+
* @param animationStart
|
|
2294
|
+
* @param animationEnd
|
|
2295
|
+
* @param iso8601Intervals
|
|
2296
|
+
* @returns WebMapAnimationList with time points
|
|
2297
|
+
*/
|
|
2298
|
+
const generateAnimationList = (unixAnimationStart, unixAnimationEnd, timeValues) => {
|
|
2299
|
+
if (!unixAnimationStart || !unixAnimationEnd || !timeValues) {
|
|
2300
|
+
return [];
|
|
2301
|
+
}
|
|
2302
|
+
const iso8601Intervals = parseTimeDimToISO8601Interval(timeValues);
|
|
2303
|
+
const animationList = [];
|
|
2304
|
+
// If there are no ISO8601 intervals in the time dimension we treat it as a list of time values
|
|
2305
|
+
if (!iso8601Intervals.length) {
|
|
2306
|
+
timeValues.split(',').forEach(timeValue => {
|
|
2307
|
+
if (unixAnimationStart <= dateUtils.unix(dateUtils.utc(timeValue)) && dateUtils.unix(dateUtils.utc(timeValue)) <= unixAnimationEnd) {
|
|
2308
|
+
animationList.push({
|
|
2309
|
+
name: 'time',
|
|
2310
|
+
value: timeValue
|
|
2311
|
+
});
|
|
2312
|
+
}
|
|
2313
|
+
});
|
|
2314
|
+
return animationList;
|
|
2315
|
+
}
|
|
2316
|
+
// Initialize aggregate start time for animation points in case of multiple intervals
|
|
2317
|
+
let currentAnimationTime = unixAnimationStart;
|
|
2318
|
+
// Iterate over each iso8601 interval and generate animation points
|
|
2319
|
+
iso8601Intervals.forEach(timeInterval => {
|
|
2320
|
+
if (!timeInterval.duration) {
|
|
2321
|
+
return;
|
|
2322
|
+
}
|
|
2323
|
+
// Convert interval start and end times to Unix time
|
|
2324
|
+
const unixIntervalStart = dateUtils.unix(dateUtils.utc(timeInterval.startTime));
|
|
2325
|
+
const unixIntervalEnd = dateUtils.unix(dateUtils.utc(timeInterval.endTime));
|
|
2326
|
+
// Parse the duration and calculate interval step in seconds
|
|
2327
|
+
const interval = parseISO8601IntervalToDateInterval(timeInterval.duration);
|
|
2328
|
+
const intervalSeconds = getTimeStepFromDataInterval(interval) * 60;
|
|
2329
|
+
// Generate animation points for the current interval
|
|
2330
|
+
for (let i = currentAnimationTime; i <= unixAnimationEnd; i += intervalSeconds) {
|
|
2331
|
+
if (i >= unixIntervalStart && i <= unixIntervalEnd) {
|
|
2332
|
+
animationList.push({
|
|
2333
|
+
name: 'time',
|
|
2334
|
+
value: dateUtils.fromUnix(i).toISOString()
|
|
2335
|
+
});
|
|
2336
|
+
}
|
|
2337
|
+
// If the next step exceeds the current interval, break to switch to next interval
|
|
2338
|
+
if (i + intervalSeconds > unixIntervalEnd) {
|
|
2339
|
+
break;
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
// Update the start time for the next interval
|
|
2343
|
+
currentAnimationTime = unixIntervalStart + intervalSeconds;
|
|
2344
|
+
});
|
|
2345
|
+
return animationList;
|
|
2346
|
+
};
|
|
2347
|
+
/**
|
|
2348
|
+
* Parses the time dimension values string to an array of ISO8601 intervals
|
|
2349
|
+
* @param timeInterval
|
|
2350
|
+
* @returns An array of ISO8601 intervals
|
|
2351
|
+
*/
|
|
2352
|
+
const parseTimeDimToISO8601Interval = timeInterval => {
|
|
2353
|
+
if (!timeInterval || !timeInterval.includes('/')) {
|
|
2354
|
+
return [];
|
|
2355
|
+
}
|
|
2356
|
+
const intervalList = timeInterval.split(',').map(interval => {
|
|
2357
|
+
const [startTime, endTime, duration] = interval.split('/');
|
|
2358
|
+
return {
|
|
2359
|
+
startTime: startTime === null || startTime === void 0 ? void 0 : startTime.trim(),
|
|
2360
|
+
endTime: endTime === null || endTime === void 0 ? void 0 : endTime.trim(),
|
|
2361
|
+
duration: duration === null || duration === void 0 ? void 0 : duration.trim()
|
|
2362
|
+
};
|
|
2363
|
+
});
|
|
2364
|
+
// Filter out intervals with missing start, end or duration
|
|
2365
|
+
return intervalList.filter(interval => interval.startTime && interval.endTime && interval.duration);
|
|
2366
|
+
};
|
|
2229
2367
|
|
|
2230
2368
|
var utils$3 = /*#__PURE__*/Object.freeze({
|
|
2231
2369
|
__proto__: null,
|
|
@@ -2233,11 +2371,13 @@ var utils$3 = /*#__PURE__*/Object.freeze({
|
|
|
2233
2371
|
createMap: createMap,
|
|
2234
2372
|
dateFormat: dateFormat,
|
|
2235
2373
|
findMapIdFromLayerId: findMapIdFromLayerId,
|
|
2374
|
+
generateAnimationList: generateAnimationList,
|
|
2236
2375
|
getAnimationDuration: getAnimationDuration,
|
|
2237
2376
|
getDraftMapById: getDraftMapById,
|
|
2238
2377
|
getSpeedFactor: getSpeedFactor,
|
|
2239
2378
|
getTimeStepFromDataInterval: getTimeStepFromDataInterval,
|
|
2240
2379
|
moveArrayElements: moveArrayElements,
|
|
2380
|
+
parseTimeDimToISO8601Interval: parseTimeDimToISO8601Interval,
|
|
2241
2381
|
produceDraftStateSetMapDimensionFromLayerChangeDimension: produceDraftStateSetMapDimensionFromLayerChangeDimension,
|
|
2242
2382
|
produceDraftStateSetWebMapDimension: produceDraftStateSetWebMapDimension
|
|
2243
2383
|
});
|
|
@@ -3424,7 +3564,32 @@ const getUseLatestReferenceTime = createSelector(getLayerById, layer => Boolean(
|
|
|
3424
3564
|
* Returns the timestep for this layerId in seconds, or undefined if it has no time dimension or timeinterval.
|
|
3425
3565
|
*/
|
|
3426
3566
|
const getTimeStepForLayerId = createSelector(getLayerTimeDimension, timeDimension => {
|
|
3427
|
-
|
|
3567
|
+
if (!timeDimension) {
|
|
3568
|
+
return undefined;
|
|
3569
|
+
}
|
|
3570
|
+
const {
|
|
3571
|
+
values,
|
|
3572
|
+
currentValue,
|
|
3573
|
+
timeInterval = {}
|
|
3574
|
+
} = timeDimension;
|
|
3575
|
+
if (!values || !currentValue) {
|
|
3576
|
+
return isEmpty(timeInterval) ? undefined : getTimeStepFromDataInterval(timeInterval);
|
|
3577
|
+
}
|
|
3578
|
+
const iso8601Intervals = parseTimeDimToISO8601Interval(values);
|
|
3579
|
+
for (const {
|
|
3580
|
+
startTime,
|
|
3581
|
+
endTime,
|
|
3582
|
+
duration
|
|
3583
|
+
} of iso8601Intervals) {
|
|
3584
|
+
if (dateUtils.isWithinInterval(currentValue, {
|
|
3585
|
+
start: startTime,
|
|
3586
|
+
end: endTime
|
|
3587
|
+
})) {
|
|
3588
|
+
const parsedInterval = parseISO8601IntervalToDateInterval(duration);
|
|
3589
|
+
return getTimeStepFromDataInterval(parsedInterval);
|
|
3590
|
+
}
|
|
3591
|
+
}
|
|
3592
|
+
return getTimeStepFromDataInterval(timeInterval);
|
|
3428
3593
|
}, selectorMemoizationOptions);
|
|
3429
3594
|
const getActiveLayerInfo = createSelector(layerStore, store => store === null || store === void 0 ? void 0 : store.activeLayerInfo);
|
|
3430
3595
|
|
|
@@ -3588,7 +3753,7 @@ var deletePropertyOrThrow$1 = function (O, P) {
|
|
|
3588
3753
|
if (!delete O[P]) throw new $TypeError$2('Cannot delete property ' + tryToString$1(P) + ' of ' + tryToString$1(O));
|
|
3589
3754
|
};
|
|
3590
3755
|
|
|
3591
|
-
var $$
|
|
3756
|
+
var $$4 = _export;
|
|
3592
3757
|
var toObject = toObject$6;
|
|
3593
3758
|
var lengthOfArrayLike = lengthOfArrayLike$4;
|
|
3594
3759
|
var setArrayLength = arraySetLength;
|
|
@@ -3608,11 +3773,11 @@ var properErrorOnNonWritableLength = function () {
|
|
|
3608
3773
|
}
|
|
3609
3774
|
};
|
|
3610
3775
|
|
|
3611
|
-
var FORCED$
|
|
3776
|
+
var FORCED$1 = INCORRECT_RESULT || !properErrorOnNonWritableLength();
|
|
3612
3777
|
|
|
3613
3778
|
// `Array.prototype.unshift` method
|
|
3614
3779
|
// https://tc39.es/ecma262/#sec-array.prototype.unshift
|
|
3615
|
-
$$
|
|
3780
|
+
$$4({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
|
|
3616
3781
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
3617
3782
|
unshift: function unshift(item) {
|
|
3618
3783
|
var O = toObject(this);
|
|
@@ -6092,36 +6257,45 @@ const getDockedLayerManagerSize = createSelector(getMapById, store => store ? st
|
|
|
6092
6257
|
* @param {string} mapId mapId: string - Id of the map
|
|
6093
6258
|
* @returns {animationList} returnType: WebMapAnimationList, list of timesteps to animate for this map.
|
|
6094
6259
|
*/
|
|
6095
|
-
const getAnimationList = createSelector(getMapById, getAnimationStartTime, getAnimationEndTime, getMapTimeStep, (mapStore, animationStart, animationEnd, animationInterval) => {
|
|
6260
|
+
const getAnimationList = createSelector(getLayersById, getMapById, getAnimationStartTime, getAnimationEndTime, getMapTimeStep, (layers, mapStore, animationStart, animationEnd, animationInterval) => {
|
|
6096
6261
|
// Animation is defined by one of the following:
|
|
6097
|
-
// - start, end and interval for a continuous animation loop
|
|
6262
|
+
// - start, end and interval for a continuous animation loop
|
|
6098
6263
|
// - timeList, for a custom timeList
|
|
6264
|
+
var _a, _b, _c;
|
|
6099
6265
|
// Here the animation is defined by a timeList
|
|
6100
|
-
if (
|
|
6266
|
+
if ((_a = mapStore === null || mapStore === void 0 ? void 0 : mapStore.timeList) === null || _a === void 0 ? void 0 : _a.length) {
|
|
6101
6267
|
return mapStore.timeList;
|
|
6102
6268
|
}
|
|
6103
|
-
|
|
6104
|
-
const
|
|
6105
|
-
const
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
const
|
|
6109
|
-
const
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6269
|
+
const autoTimeStepLayerId = mapStore === null || mapStore === void 0 ? void 0 : mapStore.autoTimeStepLayerId;
|
|
6270
|
+
const timeDimension = autoTimeStepLayerId && ((_c = (_b = layers === null || layers === void 0 ? void 0 : layers[autoTimeStepLayerId]) === null || _b === void 0 ? void 0 : _b.dimensions) === null || _c === void 0 ? void 0 : _c.find(dimension => dimension.name === 'time'));
|
|
6271
|
+
const {
|
|
6272
|
+
values
|
|
6273
|
+
} = timeDimension || {};
|
|
6274
|
+
const unixAnimationStart = roundWithTimeStep(Number(animationStart && dateUtils.unix(dateUtils.utc(animationStart))), animationInterval, 'ceil');
|
|
6275
|
+
const unixAnimationEnd = roundWithTimeStep(Number(animationEnd && dateUtils.unix(dateUtils.utc(animationEnd))), animationInterval, 'floor');
|
|
6276
|
+
const animationList = generateAnimationList(unixAnimationStart, unixAnimationEnd, values);
|
|
6277
|
+
// If no animationList is generated, generate a default list using the interval from map
|
|
6278
|
+
if (!animationList.length) {
|
|
6279
|
+
const timeList = [];
|
|
6280
|
+
const intervalSeconds = animationInterval * 60;
|
|
6281
|
+
for (let j = unixAnimationStart; j <= unixAnimationEnd; j += intervalSeconds) {
|
|
6282
|
+
timeList.push({
|
|
6283
|
+
name: 'time',
|
|
6284
|
+
value: dateUtils.fromUnix(j).toISOString()
|
|
6285
|
+
});
|
|
6286
|
+
}
|
|
6287
|
+
return timeList;
|
|
6115
6288
|
}
|
|
6116
|
-
return
|
|
6289
|
+
return animationList;
|
|
6117
6290
|
}, selectorMemoizationOptions);
|
|
6118
6291
|
/**
|
|
6119
6292
|
* @param {object} store store: object - store object
|
|
6120
6293
|
* @param {string} mapId mapId: string - Id of the map
|
|
6121
6294
|
* @returns {object} Returns min and max value of time dimension of autoTimeStep-layer. If no autoTimeStep-layer it returns default start/end time from store.
|
|
6122
6295
|
*/
|
|
6123
|
-
const getAnimationRange = createSelector(
|
|
6124
|
-
|
|
6296
|
+
const getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime, isAnimationLengthAuto, (layers, autoTimeStepLayerId, startTime, endTime, isAnimationLengthAuto) => {
|
|
6297
|
+
var _a, _b;
|
|
6298
|
+
const layerTimeDimension = autoTimeStepLayerId && ((_b = (_a = layers === null || layers === void 0 ? void 0 : layers[autoTimeStepLayerId]) === null || _a === void 0 ? void 0 : _a.dimensions) === null || _b === void 0 ? void 0 : _b.find(dimension => dimension.name === 'time'));
|
|
6125
6299
|
const {
|
|
6126
6300
|
minValue,
|
|
6127
6301
|
maxValue
|
|
@@ -6133,7 +6307,7 @@ const getAnimationRange = createSelector(store => store, getAutoTimeStepLayerId,
|
|
|
6133
6307
|
animationStartTime,
|
|
6134
6308
|
animationEndTime
|
|
6135
6309
|
};
|
|
6136
|
-
});
|
|
6310
|
+
}, selectorMemoizationOptions);
|
|
6137
6311
|
|
|
6138
6312
|
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
6139
6313
|
__proto__: null,
|
|
@@ -6328,7 +6502,9 @@ const slice$2 = createSlice({
|
|
|
6328
6502
|
// eslint-disable-next-line no-unused-vars
|
|
6329
6503
|
draft,
|
|
6330
6504
|
// eslint-disable-next-line no-unused-vars
|
|
6331
|
-
action) => {
|
|
6505
|
+
action) => {
|
|
6506
|
+
// This block is intentionally left empty so no code should be put in here
|
|
6507
|
+
}
|
|
6332
6508
|
}
|
|
6333
6509
|
});
|
|
6334
6510
|
const {
|
|
@@ -6474,17 +6650,17 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND
|
|
|
6474
6650
|
return call$6.apply(apply$2, arguments);
|
|
6475
6651
|
});
|
|
6476
6652
|
|
|
6477
|
-
var uncurryThis$
|
|
6653
|
+
var uncurryThis$7 = functionUncurryThis;
|
|
6478
6654
|
|
|
6479
|
-
var arraySlice$1 = uncurryThis$
|
|
6655
|
+
var arraySlice$1 = uncurryThis$7([].slice);
|
|
6480
6656
|
|
|
6481
|
-
var uncurryThis$
|
|
6657
|
+
var uncurryThis$6 = functionUncurryThis;
|
|
6482
6658
|
var isArray = isArray$2;
|
|
6483
6659
|
var isCallable$5 = isCallable$k;
|
|
6484
6660
|
var classof$2 = classofRaw$1;
|
|
6485
|
-
var toString$
|
|
6661
|
+
var toString$5 = toString$8;
|
|
6486
6662
|
|
|
6487
|
-
var push$1 = uncurryThis$
|
|
6663
|
+
var push$1 = uncurryThis$6([].push);
|
|
6488
6664
|
|
|
6489
6665
|
var getJsonReplacerFunction = function (replacer) {
|
|
6490
6666
|
if (isCallable$5(replacer)) return replacer;
|
|
@@ -6494,7 +6670,7 @@ var getJsonReplacerFunction = function (replacer) {
|
|
|
6494
6670
|
for (var i = 0; i < rawLength; i++) {
|
|
6495
6671
|
var element = replacer[i];
|
|
6496
6672
|
if (typeof element == 'string') push$1(keys, element);
|
|
6497
|
-
else if (typeof element == 'number' || classof$2(element) === 'Number' || classof$2(element) === 'String') push$1(keys, toString$
|
|
6673
|
+
else if (typeof element == 'number' || classof$2(element) === 'Number' || classof$2(element) === 'String') push$1(keys, toString$5(element));
|
|
6498
6674
|
}
|
|
6499
6675
|
var keysLength = keys.length;
|
|
6500
6676
|
var root = true;
|
|
@@ -6508,12 +6684,12 @@ var getJsonReplacerFunction = function (replacer) {
|
|
|
6508
6684
|
};
|
|
6509
6685
|
};
|
|
6510
6686
|
|
|
6511
|
-
var $$
|
|
6687
|
+
var $$3 = _export;
|
|
6512
6688
|
var getBuiltIn$2 = getBuiltIn$6;
|
|
6513
6689
|
var apply$1 = functionApply;
|
|
6514
6690
|
var call$5 = functionCall;
|
|
6515
|
-
var uncurryThis$
|
|
6516
|
-
var fails$
|
|
6691
|
+
var uncurryThis$5 = functionUncurryThis;
|
|
6692
|
+
var fails$7 = fails$n;
|
|
6517
6693
|
var isCallable$4 = isCallable$k;
|
|
6518
6694
|
var isSymbol = isSymbol$3;
|
|
6519
6695
|
var arraySlice = arraySlice$1;
|
|
@@ -6522,17 +6698,17 @@ var NATIVE_SYMBOL = symbolConstructorDetection;
|
|
|
6522
6698
|
|
|
6523
6699
|
var $String = String;
|
|
6524
6700
|
var $stringify = getBuiltIn$2('JSON', 'stringify');
|
|
6525
|
-
var exec$
|
|
6526
|
-
var charAt$3 = uncurryThis$
|
|
6527
|
-
var charCodeAt$1 = uncurryThis$
|
|
6528
|
-
var replace$
|
|
6529
|
-
var numberToString = uncurryThis$
|
|
6701
|
+
var exec$2 = uncurryThis$5(/./.exec);
|
|
6702
|
+
var charAt$3 = uncurryThis$5(''.charAt);
|
|
6703
|
+
var charCodeAt$1 = uncurryThis$5(''.charCodeAt);
|
|
6704
|
+
var replace$2 = uncurryThis$5(''.replace);
|
|
6705
|
+
var numberToString = uncurryThis$5(1.0.toString);
|
|
6530
6706
|
|
|
6531
6707
|
var tester = /[\uD800-\uDFFF]/g;
|
|
6532
6708
|
var low = /^[\uD800-\uDBFF]$/;
|
|
6533
6709
|
var hi = /^[\uDC00-\uDFFF]$/;
|
|
6534
6710
|
|
|
6535
|
-
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$
|
|
6711
|
+
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$7(function () {
|
|
6536
6712
|
var symbol = getBuiltIn$2('Symbol')('stringify detection');
|
|
6537
6713
|
// MS Edge converts symbol values to JSON as {}
|
|
6538
6714
|
return $stringify([symbol]) !== '[null]'
|
|
@@ -6543,7 +6719,7 @@ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$8(function () {
|
|
|
6543
6719
|
});
|
|
6544
6720
|
|
|
6545
6721
|
// https://github.com/tc39/proposal-well-formed-stringify
|
|
6546
|
-
var ILL_FORMED_UNICODE = fails$
|
|
6722
|
+
var ILL_FORMED_UNICODE = fails$7(function () {
|
|
6547
6723
|
return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
|
6548
6724
|
|| $stringify('\uDEAD') !== '"\\udead"';
|
|
6549
6725
|
});
|
|
@@ -6563,7 +6739,7 @@ var stringifyWithSymbolsFix = function (it, replacer) {
|
|
|
6563
6739
|
var fixIllFormed = function (match, offset, string) {
|
|
6564
6740
|
var prev = charAt$3(string, offset - 1);
|
|
6565
6741
|
var next = charAt$3(string, offset + 1);
|
|
6566
|
-
if ((exec$
|
|
6742
|
+
if ((exec$2(low, match) && !exec$2(hi, next)) || (exec$2(hi, match) && !exec$2(low, prev))) {
|
|
6567
6743
|
return '\\u' + numberToString(charCodeAt$1(match, 0), 16);
|
|
6568
6744
|
} return match;
|
|
6569
6745
|
};
|
|
@@ -6571,12 +6747,12 @@ var fixIllFormed = function (match, offset, string) {
|
|
|
6571
6747
|
if ($stringify) {
|
|
6572
6748
|
// `JSON.stringify` method
|
|
6573
6749
|
// https://tc39.es/ecma262/#sec-json.stringify
|
|
6574
|
-
$$
|
|
6750
|
+
$$3({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
|
6575
6751
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
6576
6752
|
stringify: function stringify(it, replacer, space) {
|
|
6577
6753
|
var args = arraySlice(arguments);
|
|
6578
6754
|
var result = apply$1(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
|
|
6579
|
-
return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$
|
|
6755
|
+
return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$2(result, tester, fixIllFormed) : result;
|
|
6580
6756
|
}
|
|
6581
6757
|
});
|
|
6582
6758
|
}
|
|
@@ -6803,73 +6979,344 @@ var storeTestSettings = /*#__PURE__*/Object.freeze({
|
|
|
6803
6979
|
styleListForRADNLOPERR25PCPRRL3KNMILayer: styleListForRADNLOPERR25PCPRRL3KNMILayer
|
|
6804
6980
|
});
|
|
6805
6981
|
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6982
|
+
/* A map with all the timerIds and their current step */
|
|
6983
|
+
const stepMap = new Map();
|
|
6984
|
+
/* A map with a list of timers and their dwell */
|
|
6985
|
+
const timerDwellMap = new Map();
|
|
6986
|
+
/**
|
|
6987
|
+
* Returns the next step for given timerId.
|
|
6988
|
+
* @param timerId The timer id
|
|
6989
|
+
* @param numberOfStepsInAnimation Animation length in steps
|
|
6990
|
+
* @param numStepsToGoForward Amount of steps to go forwards, defaults to 1. Can be positive and negative
|
|
6991
|
+
* @returns
|
|
6992
|
+
*/
|
|
6993
|
+
const getNextStep = (timerId, numberOfStepsInAnimation, numStepsToGoForward = 1) => {
|
|
6994
|
+
const currentStep = getCurrentStep(timerId);
|
|
6995
|
+
const nextStep = currentStep + numStepsToGoForward;
|
|
6996
|
+
const nextStepClipped = (nextStep % numberOfStepsInAnimation + numberOfStepsInAnimation) % numberOfStepsInAnimation;
|
|
6997
|
+
return nextStepClipped;
|
|
6814
6998
|
};
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
if (
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6999
|
+
/**
|
|
7000
|
+
* Handles dwell at the end of the animation loop sequence. The number of steps to wait till proceed can be set by the dwell parameter.
|
|
7001
|
+
* @param timerId The timer id
|
|
7002
|
+
* @param numberOfStepsInAnimation Number of steps in the animation
|
|
7003
|
+
* @param dwell The number of steps to wait at the end of the animation sequence before to continue
|
|
7004
|
+
* @returns
|
|
7005
|
+
*/
|
|
7006
|
+
const handleTimerDwell = (timerId, numberOfStepsInAnimation, dwell = 8) => {
|
|
7007
|
+
if (dwell > 0) {
|
|
7008
|
+
const currentStep = getCurrentStep(timerId);
|
|
7009
|
+
// Reset the dwell if we are not at the last animation step
|
|
7010
|
+
if (currentStep < numberOfStepsInAnimation - 1) {
|
|
7011
|
+
timerDwellMap.set(timerId, dwell);
|
|
7012
|
+
return false;
|
|
7013
|
+
}
|
|
7014
|
+
// We are at the last animation step, check the dwell
|
|
7015
|
+
const timerDwell = timerDwellMap.has(timerId) && timerDwellMap.get(timerId) || 0;
|
|
7016
|
+
if (currentStep === numberOfStepsInAnimation - 1 && timerDwell > 0) {
|
|
7017
|
+
timerDwellMap.set(timerId, timerDwell - 1);
|
|
7018
|
+
return true;
|
|
7019
|
+
}
|
|
7020
|
+
}
|
|
7021
|
+
return false;
|
|
6833
7022
|
};
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
7023
|
+
/**
|
|
7024
|
+
* Set step for the timerId
|
|
7025
|
+
* @param timerId
|
|
7026
|
+
* @param timerStep
|
|
7027
|
+
*/
|
|
7028
|
+
const setStep = (timerId, timerStep) => {
|
|
7029
|
+
stepMap.set(timerId, timerStep);
|
|
6839
7030
|
};
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
if (isObject(options) && 'cause' in options) {
|
|
6848
|
-
createNonEnumerableProperty$3(O, 'cause', options.cause);
|
|
6849
|
-
}
|
|
7031
|
+
/**
|
|
7032
|
+
* Gets the current step for the timer
|
|
7033
|
+
* @param timerId
|
|
7034
|
+
* @returns
|
|
7035
|
+
*/
|
|
7036
|
+
const getCurrentStep = timerId => {
|
|
7037
|
+
return stepMap.get(timerId) || 0;
|
|
6850
7038
|
};
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
7039
|
+
const MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH = 2;
|
|
7040
|
+
const MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES = 8;
|
|
7041
|
+
/**
|
|
7042
|
+
* This prefetches all images connected to the same sync group as provided timerId
|
|
7043
|
+
* @param timerId The timerId
|
|
7044
|
+
* @param animationListValues List of animation steps in isostring to animate
|
|
7045
|
+
* @param targets List of targets to check
|
|
7046
|
+
* @returns True if all maps are ready to go forward, false if the map has no data to display yet.
|
|
7047
|
+
*/
|
|
7048
|
+
const prefetchAnimationTargetsForMetronome = (timerId, animationListValues, targets) => {
|
|
7049
|
+
let timerShouldStepForward = true;
|
|
7050
|
+
// The following code prefetches/buffers for all maps in the group
|
|
7051
|
+
for (let numPrefetch = 0; numPrefetch < MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH; numPrefetch += 1) {
|
|
7052
|
+
const nextStep = getNextStep(timerId, animationListValues.length, numPrefetch + 1);
|
|
7053
|
+
const nextTimeValueStepToCheck = animationListValues[nextStep];
|
|
7054
|
+
for (const target of targets) {
|
|
7055
|
+
const targetMapId = target.targetId;
|
|
7056
|
+
const wmMap = getWMJSMapById(targetMapId);
|
|
7057
|
+
if (!wmMap) {
|
|
7058
|
+
return true; // Map was not registered so there is nothing to prefetch, do not block going forward
|
|
7059
|
+
}
|
|
7060
|
+
const layersImageUrls = getWMSRequests(wmMap, [{
|
|
7061
|
+
name: 'time',
|
|
7062
|
+
currentValue: nextTimeValueStepToCheck
|
|
7063
|
+
}]);
|
|
7064
|
+
for (const layersImageUrl of layersImageUrls) {
|
|
7065
|
+
const image = wmMap.getMapImageStore.getImage(layersImageUrl.url);
|
|
7066
|
+
if (!image.isLoaded()) {
|
|
7067
|
+
if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
|
|
7068
|
+
image.load();
|
|
7069
|
+
}
|
|
7070
|
+
if (numPrefetch === 0) {
|
|
7071
|
+
const altImage = wmMap.getAlternativeImage(layersImageUrl.url, wmMap.getBBOX(), true);
|
|
7072
|
+
// No alternative image available yet, so skipping animation.
|
|
7073
|
+
if (altImage.length === 0) {
|
|
7074
|
+
// This is useful to indicate that the map is loading and has nothing yet to display.
|
|
7075
|
+
// console.warn('No data available: Not stepping forward');
|
|
7076
|
+
timerShouldStepForward = false;
|
|
7077
|
+
}
|
|
7078
|
+
}
|
|
7079
|
+
} else if (image.isStale()) {
|
|
7080
|
+
if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
|
|
7081
|
+
image.forceReload(true);
|
|
7082
|
+
}
|
|
7083
|
+
}
|
|
7084
|
+
}
|
|
7085
|
+
}
|
|
7086
|
+
}
|
|
7087
|
+
return timerShouldStepForward;
|
|
6866
7088
|
};
|
|
6867
7089
|
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
7090
|
+
/**
|
|
7091
|
+
* This handler is triggered by the metronome. An array of timerIds is given as argument.
|
|
7092
|
+
* It will update the animation loop of multiple maps and sliders
|
|
7093
|
+
* It will prefetch images for maps
|
|
7094
|
+
* @param timerIds string[] array of timerIds
|
|
7095
|
+
* @param listenerApi ListenerEffectAPI<CoreAppStore, Dispatch, unknown> listenerApi as received from listener
|
|
7096
|
+
*/
|
|
7097
|
+
const metronomeHandler = (timerIds, listenerApi) => {
|
|
7098
|
+
const targetsWithUpdateValue = [];
|
|
7099
|
+
for (const timerId of timerIds) {
|
|
7100
|
+
const animationListValuesNameAndValue = getAnimationList(listenerApi.getState(), timerId);
|
|
7101
|
+
const animationListValues = animationListValuesNameAndValue.map(nameAndValue => nameAndValue.value);
|
|
7102
|
+
const targets = getTargets(listenerApi.getState(), {
|
|
7103
|
+
sourceId: timerId,
|
|
7104
|
+
origin: timerId
|
|
7105
|
+
}, SYNCGROUPS_TYPE_SETTIME);
|
|
7106
|
+
if (targets.length === 0) {
|
|
7107
|
+
// When there are no targets, default to one
|
|
7108
|
+
targets.push({
|
|
7109
|
+
targetId: timerId,
|
|
7110
|
+
value: ''
|
|
7111
|
+
});
|
|
7112
|
+
}
|
|
7113
|
+
const timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
|
|
7114
|
+
const timerShouldStepForward = prefetchAnimationTargetsForMetronome(timerId, animationListValues, targets) && !timerIsInDwell;
|
|
7115
|
+
// Determine the next step
|
|
7116
|
+
const timerStep = timerShouldStepForward ? getNextStep(timerId, animationListValues.length) : getCurrentStep(timerId);
|
|
7117
|
+
setStep(timerId, timerStep);
|
|
7118
|
+
const updatedValue = animationListValues[timerStep];
|
|
7119
|
+
targetsWithUpdateValue.push(...targets.map(target => {
|
|
7120
|
+
return Object.assign(Object.assign({}, target), {
|
|
7121
|
+
value: updatedValue
|
|
7122
|
+
});
|
|
7123
|
+
}));
|
|
7124
|
+
const speedDelay = getMapAnimationDelay(listenerApi.getState(), timerId);
|
|
7125
|
+
const speed = 1000 / (speedDelay || 1);
|
|
7126
|
+
metronome.setSpeed(timerId, speed);
|
|
7127
|
+
}
|
|
7128
|
+
// Update all targets of all sync groups in one action.
|
|
7129
|
+
if (targetsWithUpdateValue.length > 0) {
|
|
7130
|
+
listenerApi.dispatch(setTimeSync(null, targetsWithUpdateValue, ['metronomesaga']));
|
|
7131
|
+
}
|
|
7132
|
+
};
|
|
7133
|
+
const metronomeListener = createListenerMiddleware();
|
|
7134
|
+
metronomeListener.startListening({
|
|
7135
|
+
actionCreator: mapActions.mapStartAnimation,
|
|
7136
|
+
effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7137
|
+
// register handler with access to listenerApi
|
|
7138
|
+
metronome.handleTimerTicks = timerIds => {
|
|
7139
|
+
metronomeHandler(timerIds, listenerApi);
|
|
7140
|
+
};
|
|
7141
|
+
})
|
|
7142
|
+
});
|
|
7143
|
+
|
|
7144
|
+
/* *
|
|
7145
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7146
|
+
* you may not use this file except in compliance with the License.
|
|
7147
|
+
* You may obtain a copy of the License at
|
|
7148
|
+
*
|
|
7149
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7150
|
+
*
|
|
7151
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7152
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7153
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7154
|
+
* See the License for the specific language governing permissions and
|
|
7155
|
+
* limitations under the License.
|
|
7156
|
+
*
|
|
7157
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
7158
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
7159
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
7160
|
+
* */
|
|
7161
|
+
const layersListener = createListenerMiddleware();
|
|
7162
|
+
layersListener.startListening({
|
|
7163
|
+
actionCreator: layerActions.showLayerInfo,
|
|
7164
|
+
effect: ({
|
|
7165
|
+
payload
|
|
7166
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7167
|
+
const {
|
|
7168
|
+
mapId,
|
|
7169
|
+
source
|
|
7170
|
+
} = payload;
|
|
7171
|
+
const currentActiveMapId = getDialogMapId(listenerApi.getState(), DialogTypes.LayerInfo);
|
|
7172
|
+
const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
|
|
7173
|
+
if (currentActiveMapId !== mapId ? true : !isOpenInStore) {
|
|
7174
|
+
listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
|
|
7175
|
+
type: DialogTypes.LayerInfo,
|
|
7176
|
+
mapId,
|
|
7177
|
+
setOpen: true,
|
|
7178
|
+
source
|
|
7179
|
+
}));
|
|
7180
|
+
}
|
|
7181
|
+
})
|
|
7182
|
+
});
|
|
7183
|
+
layersListener.startListening({
|
|
7184
|
+
actionCreator: uiActions.setToggleOpenDialog,
|
|
7185
|
+
effect: ({
|
|
7186
|
+
payload
|
|
7187
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7188
|
+
const {
|
|
7189
|
+
setOpen,
|
|
7190
|
+
type
|
|
7191
|
+
} = payload;
|
|
7192
|
+
// close LayerInfo if open and LayerManager is closed
|
|
7193
|
+
if (type === DialogTypes.LayerManager && !setOpen) {
|
|
7194
|
+
const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
|
|
7195
|
+
if (isOpenInStore) {
|
|
7196
|
+
listenerApi.dispatch(layerActions.hideLayerInfo());
|
|
7197
|
+
}
|
|
7198
|
+
}
|
|
7199
|
+
})
|
|
7200
|
+
});
|
|
7201
|
+
|
|
7202
|
+
const mapUiListener = createListenerMiddleware();
|
|
7203
|
+
mapUiListener.startListening({
|
|
7204
|
+
actionCreator: mapActions.registerMap,
|
|
7205
|
+
effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7206
|
+
const fields = getAllMapIds(listenerApi.getState());
|
|
7207
|
+
if (fields.length === 1) {
|
|
7208
|
+
const source = getDialogSource(listenerApi.getState(), 'legend');
|
|
7209
|
+
listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
|
|
7210
|
+
type: 'legend',
|
|
7211
|
+
mapId: fields[0],
|
|
7212
|
+
setOpen: true,
|
|
7213
|
+
source
|
|
7214
|
+
}));
|
|
7215
|
+
}
|
|
7216
|
+
})
|
|
7217
|
+
});
|
|
7218
|
+
mapUiListener.startListening({
|
|
7219
|
+
actionCreator: mapActions.unregisterMap,
|
|
7220
|
+
effect: ({
|
|
7221
|
+
payload
|
|
7222
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
7223
|
+
const fields = getAllMapIds(listenerApi.getState());
|
|
7224
|
+
const activeLegendUI = getDialogDetailsByType(listenerApi.getState(), 'legend');
|
|
7225
|
+
if (fields.length && activeLegendUI && !fields.includes(activeLegendUI.activeMapId)) {
|
|
7226
|
+
listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
|
|
7227
|
+
type: 'legend',
|
|
7228
|
+
mapId: fields[0],
|
|
7229
|
+
setOpen: activeLegendUI.isOpen
|
|
7230
|
+
}));
|
|
7231
|
+
} else if (!fields.length) {
|
|
7232
|
+
// if no more maps, we hide the legend
|
|
7233
|
+
listenerApi.dispatch(uiActions.setToggleOpenDialog({
|
|
7234
|
+
type: 'legend',
|
|
7235
|
+
setOpen: false
|
|
7236
|
+
}));
|
|
7237
|
+
}
|
|
7238
|
+
// close any remaining windows with map assigned to it
|
|
7239
|
+
const remainingDialogsConnectedToMap = getUiDialogsByActiveMapId(listenerApi.getState(), payload.mapId);
|
|
7240
|
+
if (remainingDialogsConnectedToMap.length) {
|
|
7241
|
+
remainingDialogsConnectedToMap.forEach(dialog => {
|
|
7242
|
+
if (dialog.isOpen) {
|
|
7243
|
+
listenerApi.dispatch(uiActions.setToggleOpenDialog({
|
|
7244
|
+
type: dialog.type,
|
|
7245
|
+
setOpen: false
|
|
7246
|
+
}));
|
|
7247
|
+
}
|
|
7248
|
+
});
|
|
7249
|
+
}
|
|
7250
|
+
})
|
|
7251
|
+
});
|
|
7252
|
+
|
|
7253
|
+
var defineProperty = objectDefineProperty.f;
|
|
7254
|
+
|
|
7255
|
+
var proxyAccessor$1 = function (Target, Source, key) {
|
|
7256
|
+
key in Target || defineProperty(Target, key, {
|
|
7257
|
+
configurable: true,
|
|
7258
|
+
get: function () { return Source[key]; },
|
|
7259
|
+
set: function (it) { Source[key] = it; }
|
|
7260
|
+
});
|
|
7261
|
+
};
|
|
7262
|
+
|
|
7263
|
+
var isCallable$3 = isCallable$k;
|
|
7264
|
+
var isObject$1 = isObject$b;
|
|
7265
|
+
var setPrototypeOf$1 = objectSetPrototypeOf;
|
|
7266
|
+
|
|
7267
|
+
// makes subclassing work correct for wrapped built-ins
|
|
7268
|
+
var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
|
|
7269
|
+
var NewTarget, NewTargetPrototype;
|
|
7270
|
+
if (
|
|
7271
|
+
// it can work only with native `setPrototypeOf`
|
|
7272
|
+
setPrototypeOf$1 &&
|
|
7273
|
+
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
|
|
7274
|
+
isCallable$3(NewTarget = dummy.constructor) &&
|
|
7275
|
+
NewTarget !== Wrapper &&
|
|
7276
|
+
isObject$1(NewTargetPrototype = NewTarget.prototype) &&
|
|
7277
|
+
NewTargetPrototype !== Wrapper.prototype
|
|
7278
|
+
) setPrototypeOf$1($this, NewTargetPrototype);
|
|
7279
|
+
return $this;
|
|
7280
|
+
};
|
|
7281
|
+
|
|
7282
|
+
var toString$4 = toString$8;
|
|
7283
|
+
|
|
7284
|
+
var normalizeStringArgument$1 = function (argument, $default) {
|
|
7285
|
+
return argument === undefined ? arguments.length < 2 ? '' : $default : toString$4(argument);
|
|
7286
|
+
};
|
|
7287
|
+
|
|
7288
|
+
var isObject = isObject$b;
|
|
7289
|
+
var createNonEnumerableProperty$3 = createNonEnumerableProperty$8;
|
|
7290
|
+
|
|
7291
|
+
// `InstallErrorCause` abstract operation
|
|
7292
|
+
// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
|
|
7293
|
+
var installErrorCause$1 = function (O, options) {
|
|
7294
|
+
if (isObject(options) && 'cause' in options) {
|
|
7295
|
+
createNonEnumerableProperty$3(O, 'cause', options.cause);
|
|
7296
|
+
}
|
|
7297
|
+
};
|
|
7298
|
+
|
|
7299
|
+
var uncurryThis$4 = functionUncurryThis;
|
|
7300
|
+
|
|
7301
|
+
var $Error = Error;
|
|
7302
|
+
var replace$1 = uncurryThis$4(''.replace);
|
|
7303
|
+
|
|
7304
|
+
var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
|
|
7305
|
+
// eslint-disable-next-line redos/no-vulnerable -- safe
|
|
7306
|
+
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
|
7307
|
+
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
|
7308
|
+
|
|
7309
|
+
var errorStackClear = function (stack, dropEntries) {
|
|
7310
|
+
if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
|
|
7311
|
+
while (dropEntries--) stack = replace$1(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
|
7312
|
+
} return stack;
|
|
7313
|
+
};
|
|
7314
|
+
|
|
7315
|
+
var fails$6 = fails$n;
|
|
7316
|
+
var createPropertyDescriptor = createPropertyDescriptor$4;
|
|
7317
|
+
|
|
7318
|
+
var errorStackInstallable = !fails$6(function () {
|
|
7319
|
+
var error = new Error('a');
|
|
6873
7320
|
if (!('stack' in error)) return true;
|
|
6874
7321
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
6875
7322
|
Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
|
|
@@ -6955,28 +7402,28 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
|
|
|
6955
7402
|
};
|
|
6956
7403
|
|
|
6957
7404
|
/* eslint-disable no-unused-vars -- required for functions `.length` */
|
|
6958
|
-
var $$
|
|
6959
|
-
var global$
|
|
7405
|
+
var $$2 = _export;
|
|
7406
|
+
var global$4 = global$g;
|
|
6960
7407
|
var apply = functionApply;
|
|
6961
7408
|
var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
|
|
6962
7409
|
|
|
6963
7410
|
var WEB_ASSEMBLY = 'WebAssembly';
|
|
6964
|
-
var WebAssembly = global$
|
|
7411
|
+
var WebAssembly = global$4[WEB_ASSEMBLY];
|
|
6965
7412
|
|
|
6966
7413
|
// eslint-disable-next-line es/no-error-cause -- feature detection
|
|
6967
|
-
var FORCED
|
|
7414
|
+
var FORCED = new Error('e', { cause: 7 }).cause !== 7;
|
|
6968
7415
|
|
|
6969
7416
|
var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
|
|
6970
7417
|
var O = {};
|
|
6971
|
-
O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED
|
|
6972
|
-
$$
|
|
7418
|
+
O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
|
|
7419
|
+
$$2({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
|
|
6973
7420
|
};
|
|
6974
7421
|
|
|
6975
7422
|
var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
|
|
6976
7423
|
if (WebAssembly && WebAssembly[ERROR_NAME]) {
|
|
6977
7424
|
var O = {};
|
|
6978
|
-
O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED
|
|
6979
|
-
$$
|
|
7425
|
+
O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
|
|
7426
|
+
$$2({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
|
|
6980
7427
|
}
|
|
6981
7428
|
};
|
|
6982
7429
|
|
|
@@ -7012,93 +7459,26 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
|
|
|
7012
7459
|
return function RuntimeError(message) { return apply(init, this, arguments); };
|
|
7013
7460
|
});
|
|
7014
7461
|
|
|
7015
|
-
|
|
7016
|
-
var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
|
7017
|
-
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
|
7462
|
+
var anObject$4 = anObject$9;
|
|
7018
7463
|
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
var
|
|
7022
|
-
var
|
|
7464
|
+
// `RegExp.prototype.flags` getter implementation
|
|
7465
|
+
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
7466
|
+
var regexpFlags$1 = function () {
|
|
7467
|
+
var that = anObject$4(this);
|
|
7468
|
+
var result = '';
|
|
7469
|
+
if (that.hasIndices) result += 'd';
|
|
7470
|
+
if (that.global) result += 'g';
|
|
7471
|
+
if (that.ignoreCase) result += 'i';
|
|
7472
|
+
if (that.multiline) result += 'm';
|
|
7473
|
+
if (that.dotAll) result += 's';
|
|
7474
|
+
if (that.unicode) result += 'u';
|
|
7475
|
+
if (that.unicodeSets) result += 'v';
|
|
7476
|
+
if (that.sticky) result += 'y';
|
|
7477
|
+
return result;
|
|
7478
|
+
};
|
|
7023
7479
|
|
|
7024
|
-
var
|
|
7025
|
-
var
|
|
7026
|
-
var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
|
|
7027
|
-
|
|
7028
|
-
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
|
|
7029
|
-
var createMethod$1 = function (TYPE) {
|
|
7030
|
-
return function ($this) {
|
|
7031
|
-
var string = toString$5(requireObjectCoercible$2($this));
|
|
7032
|
-
if (TYPE & 1) string = replace$1(string, ltrim, '');
|
|
7033
|
-
if (TYPE & 2) string = replace$1(string, rtrim, '$1');
|
|
7034
|
-
return string;
|
|
7035
|
-
};
|
|
7036
|
-
};
|
|
7037
|
-
|
|
7038
|
-
var stringTrim = {
|
|
7039
|
-
// `String.prototype.{ trimLeft, trimStart }` methods
|
|
7040
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
|
|
7041
|
-
start: createMethod$1(1),
|
|
7042
|
-
// `String.prototype.{ trimRight, trimEnd }` methods
|
|
7043
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trimend
|
|
7044
|
-
end: createMethod$1(2),
|
|
7045
|
-
// `String.prototype.trim` method
|
|
7046
|
-
// https://tc39.es/ecma262/#sec-string.prototype.trim
|
|
7047
|
-
trim: createMethod$1(3)
|
|
7048
|
-
};
|
|
7049
|
-
|
|
7050
|
-
var global$4 = global$h;
|
|
7051
|
-
var fails$6 = fails$n;
|
|
7052
|
-
var uncurryThis$4 = functionUncurryThis;
|
|
7053
|
-
var toString$4 = toString$9;
|
|
7054
|
-
var trim = stringTrim.trim;
|
|
7055
|
-
var whitespaces = whitespaces$2;
|
|
7056
|
-
|
|
7057
|
-
var $parseInt$1 = global$4.parseInt;
|
|
7058
|
-
var Symbol$1 = global$4.Symbol;
|
|
7059
|
-
var ITERATOR = Symbol$1 && Symbol$1.iterator;
|
|
7060
|
-
var hex = /^[+-]?0x/i;
|
|
7061
|
-
var exec$2 = uncurryThis$4(hex.exec);
|
|
7062
|
-
var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
|
|
7063
|
-
// MS Edge 18- broken with boxed symbols
|
|
7064
|
-
|| (ITERATOR && !fails$6(function () { $parseInt$1(Object(ITERATOR)); }));
|
|
7065
|
-
|
|
7066
|
-
// `parseInt` method
|
|
7067
|
-
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
7068
|
-
var numberParseInt = FORCED ? function parseInt(string, radix) {
|
|
7069
|
-
var S = trim(toString$4(string));
|
|
7070
|
-
return $parseInt$1(S, (radix >>> 0) || (exec$2(hex, S) ? 16 : 10));
|
|
7071
|
-
} : $parseInt$1;
|
|
7072
|
-
|
|
7073
|
-
var $$2 = _export;
|
|
7074
|
-
var $parseInt = numberParseInt;
|
|
7075
|
-
|
|
7076
|
-
// `parseInt` method
|
|
7077
|
-
// https://tc39.es/ecma262/#sec-parseint-string-radix
|
|
7078
|
-
$$2({ global: true, forced: parseInt !== $parseInt }, {
|
|
7079
|
-
parseInt: $parseInt
|
|
7080
|
-
});
|
|
7081
|
-
|
|
7082
|
-
var anObject$4 = anObject$9;
|
|
7083
|
-
|
|
7084
|
-
// `RegExp.prototype.flags` getter implementation
|
|
7085
|
-
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
|
|
7086
|
-
var regexpFlags$1 = function () {
|
|
7087
|
-
var that = anObject$4(this);
|
|
7088
|
-
var result = '';
|
|
7089
|
-
if (that.hasIndices) result += 'd';
|
|
7090
|
-
if (that.global) result += 'g';
|
|
7091
|
-
if (that.ignoreCase) result += 'i';
|
|
7092
|
-
if (that.multiline) result += 'm';
|
|
7093
|
-
if (that.dotAll) result += 's';
|
|
7094
|
-
if (that.unicode) result += 'u';
|
|
7095
|
-
if (that.unicodeSets) result += 'v';
|
|
7096
|
-
if (that.sticky) result += 'y';
|
|
7097
|
-
return result;
|
|
7098
|
-
};
|
|
7099
|
-
|
|
7100
|
-
var fails$5 = fails$n;
|
|
7101
|
-
var global$3 = global$h;
|
|
7480
|
+
var fails$5 = fails$n;
|
|
7481
|
+
var global$3 = global$g;
|
|
7102
7482
|
|
|
7103
7483
|
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
|
|
7104
7484
|
var $RegExp$2 = global$3.RegExp;
|
|
@@ -7129,7 +7509,7 @@ var regexpStickyHelpers = {
|
|
|
7129
7509
|
};
|
|
7130
7510
|
|
|
7131
7511
|
var fails$4 = fails$n;
|
|
7132
|
-
var global$2 = global$
|
|
7512
|
+
var global$2 = global$g;
|
|
7133
7513
|
|
|
7134
7514
|
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
|
|
7135
7515
|
var $RegExp$1 = global$2.RegExp;
|
|
@@ -7140,7 +7520,7 @@ var regexpUnsupportedDotAll = fails$4(function () {
|
|
|
7140
7520
|
});
|
|
7141
7521
|
|
|
7142
7522
|
var fails$3 = fails$n;
|
|
7143
|
-
var global$1 = global$
|
|
7523
|
+
var global$1 = global$g;
|
|
7144
7524
|
|
|
7145
7525
|
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
|
|
7146
7526
|
var $RegExp = global$1.RegExp;
|
|
@@ -7155,7 +7535,7 @@ var regexpUnsupportedNcg = fails$3(function () {
|
|
|
7155
7535
|
/* eslint-disable regexp/no-useless-quantifier -- testing */
|
|
7156
7536
|
var call$4 = functionCall;
|
|
7157
7537
|
var uncurryThis$3 = functionUncurryThis;
|
|
7158
|
-
var toString$3 = toString$
|
|
7538
|
+
var toString$3 = toString$8;
|
|
7159
7539
|
var regexpFlags = regexpFlags$1;
|
|
7160
7540
|
var stickyHelpers$1 = regexpStickyHelpers;
|
|
7161
7541
|
var shared = shared$4;
|
|
@@ -7283,7 +7663,7 @@ var $ = _export;
|
|
|
7283
7663
|
var call$3 = functionCall;
|
|
7284
7664
|
var isCallable$2 = isCallable$k;
|
|
7285
7665
|
var anObject$3 = anObject$9;
|
|
7286
|
-
var toString$2 = toString$
|
|
7666
|
+
var toString$2 = toString$8;
|
|
7287
7667
|
|
|
7288
7668
|
var DELEGATES_TO_EXEC = function () {
|
|
7289
7669
|
var execCalled = false;
|
|
@@ -7468,7 +7848,7 @@ var speciesConstructor$1 = function (O, defaultConstructor) {
|
|
|
7468
7848
|
|
|
7469
7849
|
var uncurryThis$1 = functionUncurryThis;
|
|
7470
7850
|
var toIntegerOrInfinity = toIntegerOrInfinity$3;
|
|
7471
|
-
var toString$1 = toString$
|
|
7851
|
+
var toString$1 = toString$8;
|
|
7472
7852
|
var requireObjectCoercible$1 = requireObjectCoercible$7;
|
|
7473
7853
|
|
|
7474
7854
|
var charAt$1 = uncurryThis$1(''.charAt);
|
|
@@ -7541,7 +7921,7 @@ var requireObjectCoercible = requireObjectCoercible$7;
|
|
|
7541
7921
|
var speciesConstructor = speciesConstructor$1;
|
|
7542
7922
|
var advanceStringIndex = advanceStringIndex$1;
|
|
7543
7923
|
var toLength = toLength$2;
|
|
7544
|
-
var toString = toString$
|
|
7924
|
+
var toString = toString$8;
|
|
7545
7925
|
var getMethod = getMethod$2;
|
|
7546
7926
|
var regExpExec = regexpExecAbstract;
|
|
7547
7927
|
var stickyHelpers = regexpStickyHelpers;
|
|
@@ -7598,697 +7978,61 @@ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNa
|
|
|
7598
7978
|
var rx = anObject(this);
|
|
7599
7979
|
var S = toString(string);
|
|
7600
7980
|
|
|
7601
|
-
if (!BUGGY) {
|
|
7602
|
-
var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
|
|
7603
|
-
if (res.done) return res.value;
|
|
7604
|
-
}
|
|
7605
|
-
|
|
7606
|
-
var C = speciesConstructor(rx, RegExp);
|
|
7607
|
-
var unicodeMatching = rx.unicode;
|
|
7608
|
-
var flags = (rx.ignoreCase ? 'i' : '') +
|
|
7609
|
-
(rx.multiline ? 'm' : '') +
|
|
7610
|
-
(rx.unicode ? 'u' : '') +
|
|
7611
|
-
(UNSUPPORTED_Y ? 'g' : 'y');
|
|
7612
|
-
// ^(? + rx + ) is needed, in combination with some S slicing, to
|
|
7613
|
-
// simulate the 'y' flag.
|
|
7614
|
-
var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
|
|
7615
|
-
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
|
7616
|
-
if (lim === 0) return [];
|
|
7617
|
-
if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
|
|
7618
|
-
var p = 0;
|
|
7619
|
-
var q = 0;
|
|
7620
|
-
var A = [];
|
|
7621
|
-
while (q < S.length) {
|
|
7622
|
-
splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
|
|
7623
|
-
var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
|
|
7624
|
-
var e;
|
|
7625
|
-
if (
|
|
7626
|
-
z === null ||
|
|
7627
|
-
(e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
|
|
7628
|
-
) {
|
|
7629
|
-
q = advanceStringIndex(S, q, unicodeMatching);
|
|
7630
|
-
} else {
|
|
7631
|
-
push(A, stringSlice(S, p, q));
|
|
7632
|
-
if (A.length === lim) return A;
|
|
7633
|
-
for (var i = 1; i <= z.length - 1; i++) {
|
|
7634
|
-
push(A, z[i]);
|
|
7635
|
-
if (A.length === lim) return A;
|
|
7636
|
-
}
|
|
7637
|
-
q = p = e;
|
|
7638
|
-
}
|
|
7639
|
-
}
|
|
7640
|
-
push(A, stringSlice(S, p));
|
|
7641
|
-
return A;
|
|
7642
|
-
}
|
|
7643
|
-
];
|
|
7644
|
-
}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
|
|
7645
|
-
|
|
7646
|
-
const isAnimationEndTimeValid = animationEndTime => {
|
|
7647
|
-
const hasValidPrefix = animationEndTime.split(/[-+]/)[0] === 'NOW' || animationEndTime.split(/[-+]/)[0] === 'TODAY';
|
|
7648
|
-
const durationString = animationEndTime.substring(animationEndTime.indexOf('PT') + 2);
|
|
7649
|
-
const hasValidDate = /^(\d+H)?(\d+M)?$/.test(durationString);
|
|
7650
|
-
if (hasValidPrefix && hasValidDate) {
|
|
7651
|
-
return true;
|
|
7652
|
-
}
|
|
7653
|
-
const parsedDate = dateUtils.parseISO(animationEndTime);
|
|
7654
|
-
return dateUtils.isValid(parsedDate);
|
|
7655
|
-
};
|
|
7656
|
-
function* handleBaseLayersSaga(mapId, baseLayers) {
|
|
7657
|
-
const baseLayer = baseLayers.find(layer => layer.layerType === 'baseLayer');
|
|
7658
|
-
const currentAvailableBaseLayers = yield select(getAvailableBaseLayersForMap, mapId);
|
|
7659
|
-
// find a availableBaseLayer with the same name, and use that id for the active baselayer
|
|
7660
|
-
const activeAvailableBaseLayer = currentAvailableBaseLayers.find(availableBaseLayer => availableBaseLayer.name === baseLayer.name);
|
|
7661
|
-
const activeBaseLayerId = activeAvailableBaseLayer ? activeAvailableBaseLayer.id : webmapUtils.generateLayerId();
|
|
7662
|
-
// if the baseLayer can't be found in a visible available baseLayer list, add it
|
|
7663
|
-
if (!activeAvailableBaseLayer && currentAvailableBaseLayers.length) {
|
|
7664
|
-
yield put(layerActions.addAvailableBaseLayers({
|
|
7665
|
-
// TODO: remove type casting in https://gitlab.com/opengeoweb/opengeoweb/-/issues/1884
|
|
7666
|
-
layers: [Object.assign(Object.assign({}, baseLayer), {
|
|
7667
|
-
mapId,
|
|
7668
|
-
id: activeBaseLayerId
|
|
7669
|
-
})]
|
|
7670
|
-
}));
|
|
7671
|
-
}
|
|
7672
|
-
const baseLayersWithActiveId = baseLayers.map((layer, index) => index === 0 ? Object.assign(Object.assign({}, layer), {
|
|
7673
|
-
id: activeBaseLayerId || layer.id
|
|
7674
|
-
}) : layer);
|
|
7675
|
-
yield put(layerActions.setBaseLayers({
|
|
7676
|
-
mapId,
|
|
7677
|
-
// TODO: remove type casting in https://gitlab.com/opengeoweb/opengeoweb/-/issues/1884
|
|
7678
|
-
layers: baseLayersWithActiveId
|
|
7679
|
-
}));
|
|
7680
|
-
}
|
|
7681
|
-
function* setMapPresetSaga({
|
|
7682
|
-
payload
|
|
7683
|
-
}) {
|
|
7684
|
-
var _a, _b, _c;
|
|
7685
|
-
try {
|
|
7686
|
-
const {
|
|
7687
|
-
mapId,
|
|
7688
|
-
initialProps
|
|
7689
|
-
} = payload;
|
|
7690
|
-
const {
|
|
7691
|
-
mapPreset
|
|
7692
|
-
} = initialProps;
|
|
7693
|
-
if (mapPreset) {
|
|
7694
|
-
const {
|
|
7695
|
-
layers,
|
|
7696
|
-
activeLayerId,
|
|
7697
|
-
autoTimeStepLayerId,
|
|
7698
|
-
autoUpdateLayerId,
|
|
7699
|
-
proj,
|
|
7700
|
-
shouldAutoUpdate,
|
|
7701
|
-
shouldAnimate,
|
|
7702
|
-
animationPayload,
|
|
7703
|
-
toggleTimestepAuto,
|
|
7704
|
-
showTimeSlider,
|
|
7705
|
-
displayMapPin,
|
|
7706
|
-
shouldShowZoomControls,
|
|
7707
|
-
shouldShowLegend,
|
|
7708
|
-
dockedLayerManagerSize
|
|
7709
|
-
} = mapPreset;
|
|
7710
|
-
const {
|
|
7711
|
-
mapLayers,
|
|
7712
|
-
baseLayers,
|
|
7713
|
-
overLayers
|
|
7714
|
-
} = filterLayers(layers);
|
|
7715
|
-
if (layers) {
|
|
7716
|
-
// make sure all layers have a unique id before going forward
|
|
7717
|
-
let autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
7718
|
-
let autoUpdateLayerIdNew = autoUpdateLayerId;
|
|
7719
|
-
const onlyActiveLayerIdIsSet = !autoTimeStepLayerId && !autoUpdateLayerId && activeLayerId;
|
|
7720
|
-
if (onlyActiveLayerIdIsSet) {
|
|
7721
|
-
autoTimeStepLayerIdNew = activeLayerId;
|
|
7722
|
-
autoUpdateLayerIdNew = activeLayerId;
|
|
7723
|
-
}
|
|
7724
|
-
const newLayerIds = yield call$e(replaceLayerIdsToEnsureUniqueLayerIdsInStore, {
|
|
7725
|
-
layers: mapLayers,
|
|
7726
|
-
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
7727
|
-
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
7728
|
-
});
|
|
7729
|
-
// set layers
|
|
7730
|
-
yield put(layerActions.setLayers({
|
|
7731
|
-
mapId,
|
|
7732
|
-
layers: newLayerIds.layers
|
|
7733
|
-
}));
|
|
7734
|
-
// set active layer if given otherwise to first layer
|
|
7735
|
-
const firstLayerId = (_a = newLayerIds.layers[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
7736
|
-
yield put(mapActions.setAutoLayerId({
|
|
7737
|
-
mapId,
|
|
7738
|
-
autoTimeStepLayerId: (_b = newLayerIds.autoTimeStepLayerId) !== null && _b !== void 0 ? _b : firstLayerId,
|
|
7739
|
-
autoUpdateLayerId: (_c = newLayerIds.autoUpdateLayerId) !== null && _c !== void 0 ? _c : firstLayerId
|
|
7740
|
-
}));
|
|
7741
|
-
}
|
|
7742
|
-
// sets (default) baseLayers
|
|
7743
|
-
const baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [defaultLayers.baseLayerGrey];
|
|
7744
|
-
// sets (default) overLayers
|
|
7745
|
-
const overLayersWithDefaultLayer = overLayers.length ? overLayers : [defaultLayers.overLayer];
|
|
7746
|
-
const allBaseLayers = [...baseLayersWithDefaultLayer, ...overLayersWithDefaultLayer].map(layer => Object.assign(Object.assign({}, layer), {
|
|
7747
|
-
id: webmapUtils.generateLayerId()
|
|
7748
|
-
}));
|
|
7749
|
-
yield call$e(handleBaseLayersSaga, mapId, allBaseLayers);
|
|
7750
|
-
if (proj) {
|
|
7751
|
-
const checkIsprojectionSupported = isProjectionSupported(proj.srs);
|
|
7752
|
-
if (!checkIsprojectionSupported) {
|
|
7753
|
-
throw new Error(`Projection ${proj.srs} is not supported`);
|
|
7754
|
-
}
|
|
7755
|
-
// set bbox
|
|
7756
|
-
yield put(mapActions.setBbox({
|
|
7757
|
-
mapId,
|
|
7758
|
-
bbox: proj.bbox,
|
|
7759
|
-
srs: proj.srs
|
|
7760
|
-
}));
|
|
7761
|
-
}
|
|
7762
|
-
const animationLength = animationPayload && animationPayload.duration;
|
|
7763
|
-
const animationEndTime = animationPayload && animationPayload.endTime && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
7764
|
-
const shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
7765
|
-
if (shouldEndtimeOverride) {
|
|
7766
|
-
// auto update
|
|
7767
|
-
yield put(mapActions.setEndTimeOverriding({
|
|
7768
|
-
mapId,
|
|
7769
|
-
shouldEndtimeOverride
|
|
7770
|
-
}));
|
|
7771
|
-
}
|
|
7772
|
-
if (shouldAutoUpdate !== undefined && !animationEndTime) {
|
|
7773
|
-
// auto update
|
|
7774
|
-
yield put(mapActions.toggleAutoUpdate({
|
|
7775
|
-
mapId,
|
|
7776
|
-
shouldAutoUpdate
|
|
7777
|
-
}));
|
|
7778
|
-
}
|
|
7779
|
-
if (showTimeSlider !== undefined) {
|
|
7780
|
-
// toggle timeslider
|
|
7781
|
-
yield put(mapActions.toggleTimeSliderIsVisible({
|
|
7782
|
-
mapId,
|
|
7783
|
-
isTimeSliderVisible: showTimeSlider
|
|
7784
|
-
}));
|
|
7785
|
-
}
|
|
7786
|
-
if (shouldShowZoomControls !== undefined) {
|
|
7787
|
-
// toggle zoom controls
|
|
7788
|
-
yield put(mapActions.toggleZoomControls({
|
|
7789
|
-
mapId,
|
|
7790
|
-
shouldShowZoomControls
|
|
7791
|
-
}));
|
|
7792
|
-
}
|
|
7793
|
-
if (displayMapPin !== undefined) {
|
|
7794
|
-
// display map pin
|
|
7795
|
-
yield put(mapActions.toggleMapPinIsVisible({
|
|
7796
|
-
mapId,
|
|
7797
|
-
displayMapPin
|
|
7798
|
-
}));
|
|
7799
|
-
}
|
|
7800
|
-
// sets timestep by interval of animationPayload
|
|
7801
|
-
const interval = animationPayload && animationPayload.interval;
|
|
7802
|
-
if (interval) {
|
|
7803
|
-
yield put(mapActions.setTimeStep({
|
|
7804
|
-
mapId,
|
|
7805
|
-
timeStep: interval
|
|
7806
|
-
}));
|
|
7807
|
-
}
|
|
7808
|
-
// sets animationEndTime by endTime of animationPayload
|
|
7809
|
-
if (animationEndTime) {
|
|
7810
|
-
const endTime = animationEndTime.includes('NOW') || animationEndTime.includes('TODAY') ? dateUtils.convertNOWandTODAYFormatsToUTC(animationEndTime) : animationEndTime;
|
|
7811
|
-
yield put(mapActions.setAnimationEndTime({
|
|
7812
|
-
mapId,
|
|
7813
|
-
animationEndTime: handleDateUtilsISOString(endTime)
|
|
7814
|
-
}));
|
|
7815
|
-
const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(endTime), {
|
|
7816
|
-
minutes: 5 * 60 // set to default of 5 hours
|
|
7817
|
-
}).toISOString());
|
|
7818
|
-
yield put(mapActions.setAnimationStartTime({
|
|
7819
|
-
mapId,
|
|
7820
|
-
animationStartTime: startTime
|
|
7821
|
-
}));
|
|
7822
|
-
yield put(genericActions.setTime({
|
|
7823
|
-
origin: '',
|
|
7824
|
-
sourceId: mapId,
|
|
7825
|
-
value: startTime
|
|
7826
|
-
}));
|
|
7827
|
-
const centerTimeInSeconds = new Date(handleDateUtilsISOString(endTime)).getTime();
|
|
7828
|
-
yield put(mapActions.setTimeSliderCenterTime({
|
|
7829
|
-
mapId,
|
|
7830
|
-
timeSliderCenterTime: centerTimeInSeconds
|
|
7831
|
-
}));
|
|
7832
|
-
}
|
|
7833
|
-
// sets animationStartTime by duration of animationPayload
|
|
7834
|
-
if (animationLength) {
|
|
7835
|
-
const animationEnd = yield select(getAnimationEndTime, mapId);
|
|
7836
|
-
const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(animationEnd), {
|
|
7837
|
-
minutes: animationLength
|
|
7838
|
-
}).toISOString());
|
|
7839
|
-
yield put(mapActions.setAnimationStartTime({
|
|
7840
|
-
mapId,
|
|
7841
|
-
animationStartTime: startTime
|
|
7842
|
-
}));
|
|
7843
|
-
yield put(genericActions.setTime({
|
|
7844
|
-
origin: '',
|
|
7845
|
-
sourceId: mapId,
|
|
7846
|
-
value: startTime
|
|
7847
|
-
}));
|
|
7848
|
-
}
|
|
7849
|
-
// sets animationDelay by speed of animationPayload
|
|
7850
|
-
if (animationPayload && animationPayload.speed) {
|
|
7851
|
-
yield put(mapActions.setAnimationDelay({
|
|
7852
|
-
mapId,
|
|
7853
|
-
animationDelay: getSpeedDelay(animationPayload.speed)
|
|
7854
|
-
}));
|
|
7855
|
-
}
|
|
7856
|
-
// turn animation on
|
|
7857
|
-
if (shouldAnimate === true) {
|
|
7858
|
-
const duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
|
|
7859
|
-
const animationEnd = shouldEndtimeOverride && animationEndTime ? yield select(getAnimationEndTime, mapId) : dateUtils.dateToString(dateUtils.utc(), dateFormat);
|
|
7860
|
-
const animationStart = shouldEndtimeOverride && animationLength ? yield select(getAnimationStartTime, mapId) : dateUtils.dateToString(dateUtils.sub(dateUtils.utc(animationEnd), {
|
|
7861
|
-
minutes: duration
|
|
7862
|
-
}), dateFormat);
|
|
7863
|
-
yield put(mapActions.mapStartAnimation({
|
|
7864
|
-
mapId,
|
|
7865
|
-
start: animationStart,
|
|
7866
|
-
end: animationEnd,
|
|
7867
|
-
interval: interval || defaultTimeStep
|
|
7868
|
-
}));
|
|
7869
|
-
// If animation interval set, set the timestep auto property to false
|
|
7870
|
-
if (interval) {
|
|
7871
|
-
yield put(mapActions.toggleTimestepAuto({
|
|
7872
|
-
mapId,
|
|
7873
|
-
timestepAuto: false
|
|
7874
|
-
}));
|
|
7875
|
-
}
|
|
7876
|
-
} else if (toggleTimestepAuto !== undefined) {
|
|
7877
|
-
// Set timestep auto based on preset if animation is off
|
|
7878
|
-
yield put(mapActions.toggleTimestepAuto({
|
|
7879
|
-
mapId,
|
|
7880
|
-
timestepAuto: toggleTimestepAuto
|
|
7881
|
-
}));
|
|
7882
|
-
}
|
|
7883
|
-
// show legend
|
|
7884
|
-
const shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
|
|
7885
|
-
const legendId = yield select(getLegendId, mapId);
|
|
7886
|
-
if (legendId) {
|
|
7887
|
-
yield put(uiActions.setToggleOpenDialog({
|
|
7888
|
-
type: legendId,
|
|
7889
|
-
setOpen: shouldOpenLegend
|
|
7890
|
-
}));
|
|
7891
|
-
}
|
|
7892
|
-
if (dockedLayerManagerSize) {
|
|
7893
|
-
yield put(mapActions.setDockedLayerManagerSize({
|
|
7894
|
-
mapId,
|
|
7895
|
-
dockedLayerManagerSize
|
|
7896
|
-
}));
|
|
7897
|
-
}
|
|
7898
|
-
while (animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate))) {
|
|
7899
|
-
const fiveMinuteDelayForAnimation = 1000 * 60 * 5;
|
|
7900
|
-
yield delay(fiveMinuteDelayForAnimation);
|
|
7901
|
-
const animationEnd = yield select(getAnimationEndTime, mapId);
|
|
7902
|
-
yield put(mapActions.setAnimationEndTime({
|
|
7903
|
-
mapId,
|
|
7904
|
-
animationEndTime: dateUtils.add(dateUtils.utc(animationEnd), {
|
|
7905
|
-
minutes: 5
|
|
7906
|
-
}).toISOString()
|
|
7907
|
-
}));
|
|
7908
|
-
const animationStart = yield select(getAnimationStartTime, mapId);
|
|
7909
|
-
yield put(mapActions.setAnimationStartTime({
|
|
7910
|
-
mapId,
|
|
7911
|
-
animationStartTime: dateUtils.add(dateUtils.utc(animationStart), {
|
|
7912
|
-
minutes: 5
|
|
7913
|
-
}).toISOString()
|
|
7914
|
-
}));
|
|
7915
|
-
}
|
|
7916
|
-
}
|
|
7917
|
-
} catch (error) {
|
|
7918
|
-
yield put(mapActions.setMapPresetError({
|
|
7919
|
-
mapId: payload.mapId,
|
|
7920
|
-
error: error.message
|
|
7921
|
-
}));
|
|
7922
|
-
}
|
|
7923
|
-
}
|
|
7924
|
-
function* unregisterMapSaga({
|
|
7925
|
-
payload
|
|
7926
|
-
}) {
|
|
7927
|
-
const {
|
|
7928
|
-
mapId
|
|
7929
|
-
} = payload;
|
|
7930
|
-
const layerList = yield select(getLayersByMapId, mapId);
|
|
7931
|
-
metronome.unregister(mapId);
|
|
7932
|
-
yield all(layerList.map(layer => put(layerActions.layerDelete({
|
|
7933
|
-
mapId,
|
|
7934
|
-
layerId: layer.id,
|
|
7935
|
-
origin: LayerActionOrigin.unregisterMapSaga
|
|
7936
|
-
}))));
|
|
7937
|
-
}
|
|
7938
|
-
function* setStepBackwardOrForwardSaga({
|
|
7939
|
-
payload
|
|
7940
|
-
}) {
|
|
7941
|
-
const {
|
|
7942
|
-
mapId,
|
|
7943
|
-
isForwardStep
|
|
7944
|
-
} = payload;
|
|
7945
|
-
const timeStep = yield select(getMapTimeStep, mapId);
|
|
7946
|
-
const currentTime = yield select(getSelectedTime, mapId);
|
|
7947
|
-
const [dataStartTime, dataEndTime] = yield select(getDataLimitsFromLayers, mapId);
|
|
7948
|
-
if (dateUtils.isValid(currentTime)) {
|
|
7949
|
-
const makeForwardStep = () => {
|
|
7950
|
-
const nextTime = currentTime + timeStep;
|
|
7951
|
-
const roundedTime = roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
7952
|
-
const newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
7953
|
-
return dateUtils.fromUnix(newTime).toISOString();
|
|
7954
|
-
};
|
|
7955
|
-
const makeBackwardStep = () => {
|
|
7956
|
-
const nextTime = currentTime - timeStep;
|
|
7957
|
-
const roundedTime = roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
7958
|
-
const newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
7959
|
-
return dateUtils.fromUnix(newTime).toISOString();
|
|
7960
|
-
};
|
|
7961
|
-
const selectedTimeString = isForwardStep ? makeForwardStep() : makeBackwardStep();
|
|
7962
|
-
const isMapAnimating = yield select(isAnimating, mapId);
|
|
7963
|
-
if (isMapAnimating) {
|
|
7964
|
-
yield put(mapActions.mapStopAnimation({
|
|
7965
|
-
mapId,
|
|
7966
|
-
origin: MapActionOrigin.map
|
|
7967
|
-
}));
|
|
7968
|
-
}
|
|
7969
|
-
const isAutoUpdateOn = yield select(isAutoUpdating, mapId);
|
|
7970
|
-
if (isAutoUpdateOn) {
|
|
7971
|
-
yield put(mapActions.toggleAutoUpdate({
|
|
7972
|
-
mapId,
|
|
7973
|
-
shouldAutoUpdate: false
|
|
7974
|
-
}));
|
|
7975
|
-
}
|
|
7976
|
-
yield put(genericActions.setTime({
|
|
7977
|
-
origin: '',
|
|
7978
|
-
sourceId: mapId,
|
|
7979
|
-
value: handleDateUtilsISOString(selectedTimeString)
|
|
7980
|
-
}));
|
|
7981
|
-
}
|
|
7982
|
-
}
|
|
7983
|
-
function* rootSaga$2() {
|
|
7984
|
-
// resets IWMJSMap state
|
|
7985
|
-
yield takeEvery(mapActions.setMapPreset.type, setMapPresetSaga);
|
|
7986
|
-
yield takeEvery(mapActions.unregisterMap.type, unregisterMapSaga);
|
|
7987
|
-
yield takeEvery(mapActions.setStepBackwardOrForward.type, setStepBackwardOrForwardSaga);
|
|
7988
|
-
}
|
|
7989
|
-
|
|
7990
|
-
function* fetchServiceSaga(service) {
|
|
7991
|
-
try {
|
|
7992
|
-
const layers = yield call$e(getCapabilities.getLayersFlattenedFromService, service.serviceUrl);
|
|
7993
|
-
yield put(serviceActions.serviceSetLayers(Object.assign(Object.assign({}, service), {
|
|
7994
|
-
layers
|
|
7995
|
-
})));
|
|
7996
|
-
} catch (error) {
|
|
7997
|
-
// not implemented yet
|
|
7998
|
-
}
|
|
7999
|
-
}
|
|
8000
|
-
function* fetchInitialServicesSaga({
|
|
8001
|
-
payload
|
|
8002
|
-
}) {
|
|
8003
|
-
const {
|
|
8004
|
-
services
|
|
8005
|
-
} = payload;
|
|
8006
|
-
yield all(services.map(_a => {
|
|
8007
|
-
var {
|
|
8008
|
-
url
|
|
8009
|
-
} = _a,
|
|
8010
|
-
service = __rest(_a, ["url"]);
|
|
8011
|
-
return call$e(fetchServiceSaga, Object.assign(Object.assign({}, service), {
|
|
8012
|
-
serviceUrl: url
|
|
8013
|
-
}));
|
|
8014
|
-
}));
|
|
8015
|
-
}
|
|
8016
|
-
function* rootSaga$1() {
|
|
8017
|
-
yield takeEvery(serviceActions.fetchInitialServices, fetchInitialServicesSaga);
|
|
8018
|
-
}
|
|
8019
|
-
|
|
8020
|
-
/* A map with all the timerIds and their current step */
|
|
8021
|
-
const stepMap = new Map();
|
|
8022
|
-
/* A map with a list of timers and their dwell */
|
|
8023
|
-
const timerDwellMap = new Map();
|
|
8024
|
-
/**
|
|
8025
|
-
* Returns the next step for given timerId.
|
|
8026
|
-
* @param timerId The timer id
|
|
8027
|
-
* @param numberOfStepsInAnimation Animation length in steps
|
|
8028
|
-
* @param numStepsToGoForward Amount of steps to go forwards, defaults to 1. Can be positive and negative
|
|
8029
|
-
* @returns
|
|
8030
|
-
*/
|
|
8031
|
-
const getNextStep = (timerId, numberOfStepsInAnimation, numStepsToGoForward = 1) => {
|
|
8032
|
-
const currentStep = getCurrentStep(timerId);
|
|
8033
|
-
const nextStep = currentStep + numStepsToGoForward;
|
|
8034
|
-
const nextStepClipped = (nextStep % numberOfStepsInAnimation + numberOfStepsInAnimation) % numberOfStepsInAnimation;
|
|
8035
|
-
return nextStepClipped;
|
|
8036
|
-
};
|
|
8037
|
-
/**
|
|
8038
|
-
* Handles dwell at the end of the animation loop sequence. The number of steps to wait till proceed can be set by the dwell parameter.
|
|
8039
|
-
* @param timerId The timer id
|
|
8040
|
-
* @param numberOfStepsInAnimation Number of steps in the animation
|
|
8041
|
-
* @param dwell The number of steps to wait at the end of the animation sequence before to continue
|
|
8042
|
-
* @returns
|
|
8043
|
-
*/
|
|
8044
|
-
const handleTimerDwell = (timerId, numberOfStepsInAnimation, dwell = 8) => {
|
|
8045
|
-
if (dwell > 0) {
|
|
8046
|
-
const currentStep = getCurrentStep(timerId);
|
|
8047
|
-
// Reset the dwell if we are not at the last animation step
|
|
8048
|
-
if (currentStep < numberOfStepsInAnimation - 1) {
|
|
8049
|
-
timerDwellMap.set(timerId, dwell);
|
|
8050
|
-
return false;
|
|
8051
|
-
}
|
|
8052
|
-
// We are at the last animation step, check the dwell
|
|
8053
|
-
const timerDwell = timerDwellMap.has(timerId) && timerDwellMap.get(timerId) || 0;
|
|
8054
|
-
if (currentStep === numberOfStepsInAnimation - 1 && timerDwell > 0) {
|
|
8055
|
-
timerDwellMap.set(timerId, timerDwell - 1);
|
|
8056
|
-
return true;
|
|
8057
|
-
}
|
|
8058
|
-
}
|
|
8059
|
-
return false;
|
|
8060
|
-
};
|
|
8061
|
-
/**
|
|
8062
|
-
* Set step for the timerId
|
|
8063
|
-
* @param timerId
|
|
8064
|
-
* @param timerStep
|
|
8065
|
-
*/
|
|
8066
|
-
const setStep = (timerId, timerStep) => {
|
|
8067
|
-
stepMap.set(timerId, timerStep);
|
|
8068
|
-
};
|
|
8069
|
-
/**
|
|
8070
|
-
* Gets the current step for the timer
|
|
8071
|
-
* @param timerId
|
|
8072
|
-
* @returns
|
|
8073
|
-
*/
|
|
8074
|
-
const getCurrentStep = timerId => {
|
|
8075
|
-
return stepMap.get(timerId) || 0;
|
|
8076
|
-
};
|
|
8077
|
-
const MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH = 2;
|
|
8078
|
-
const MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES = 8;
|
|
8079
|
-
/**
|
|
8080
|
-
* This prefetches all images connected to the same sync group as provided timerId
|
|
8081
|
-
* @param timerId The timerId
|
|
8082
|
-
* @param animationListValues List of animation steps in isostring to animate
|
|
8083
|
-
* @param targets List of targets to check
|
|
8084
|
-
* @returns True if all maps are ready to go forward, false if the map has no data to display yet.
|
|
8085
|
-
*/
|
|
8086
|
-
const prefetchAnimationTargetsForMetronome = (timerId, animationListValues, targets) => {
|
|
8087
|
-
let timerShouldStepForward = true;
|
|
8088
|
-
// The following code prefetches/buffers for all maps in the group
|
|
8089
|
-
for (let numPrefetch = 0; numPrefetch < MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH; numPrefetch += 1) {
|
|
8090
|
-
const nextStep = getNextStep(timerId, animationListValues.length, numPrefetch + 1);
|
|
8091
|
-
const nextTimeValueStepToCheck = animationListValues[nextStep];
|
|
8092
|
-
for (const target of targets) {
|
|
8093
|
-
const targetMapId = target.targetId;
|
|
8094
|
-
const wmMap = getWMJSMapById(targetMapId);
|
|
8095
|
-
if (wmMap) {
|
|
8096
|
-
const layersImageUrls = getWMSRequests(wmMap, [{
|
|
8097
|
-
name: 'time',
|
|
8098
|
-
currentValue: nextTimeValueStepToCheck
|
|
8099
|
-
}]);
|
|
8100
|
-
for (const layersImageUrl of layersImageUrls) {
|
|
8101
|
-
const image = wmMap.getMapImageStore.getImage(layersImageUrl.url);
|
|
8102
|
-
if (!image.isLoaded()) {
|
|
8103
|
-
if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
|
|
8104
|
-
image.load();
|
|
8105
|
-
}
|
|
8106
|
-
if (numPrefetch === 0) {
|
|
8107
|
-
const altImage = wmMap.getAlternativeImage(layersImageUrl.url, wmMap.getBBOX(), true);
|
|
8108
|
-
// No alternative image available yet, so skipping animation.
|
|
8109
|
-
if (altImage.length === 0) {
|
|
8110
|
-
// This is useful to indicate that the map is loading and has nothing yet to display.
|
|
8111
|
-
// console.warn('No data available: Not stepping forward');
|
|
8112
|
-
timerShouldStepForward = false;
|
|
8113
|
-
}
|
|
8114
|
-
}
|
|
8115
|
-
} else if (image.isStale()) {
|
|
8116
|
-
if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
|
|
8117
|
-
image.forceReload(true);
|
|
8118
|
-
}
|
|
8119
|
-
}
|
|
8120
|
-
}
|
|
8121
|
-
} else {
|
|
8122
|
-
return false; // Map was not registered so there is nothing to prefetch
|
|
8123
|
-
}
|
|
8124
|
-
}
|
|
8125
|
-
}
|
|
8126
|
-
return timerShouldStepForward;
|
|
8127
|
-
};
|
|
8128
|
-
|
|
8129
|
-
/**
|
|
8130
|
-
* This handler is triggered by the metronome. An array of timerIds is given as argument.
|
|
8131
|
-
* It will update the animation loop of multiple maps and sliders
|
|
8132
|
-
* It will prefetch images for maps
|
|
8133
|
-
* @param timerIds string[] array of timerIds
|
|
8134
|
-
* @param listenerApi ListenerEffectAPI<CoreAppStore, Dispatch, unknown> listenerApi as received from listener
|
|
8135
|
-
*/
|
|
8136
|
-
const metronomeHandler = (timerIds, listenerApi) => {
|
|
8137
|
-
const targetsWithUpdateValue = [];
|
|
8138
|
-
for (const timerId of timerIds) {
|
|
8139
|
-
const animationListValuesNameAndValue = getAnimationList(listenerApi.getState(), timerId);
|
|
8140
|
-
const animationListValues = animationListValuesNameAndValue.map(nameAndValue => nameAndValue.value);
|
|
8141
|
-
const targets = getTargets(listenerApi.getState(), {
|
|
8142
|
-
sourceId: timerId,
|
|
8143
|
-
origin: timerId
|
|
8144
|
-
}, SYNCGROUPS_TYPE_SETTIME);
|
|
8145
|
-
if (targets.length === 0) {
|
|
8146
|
-
// When there are no targets, default to one
|
|
8147
|
-
targets.push({
|
|
8148
|
-
targetId: timerId,
|
|
8149
|
-
value: ''
|
|
8150
|
-
});
|
|
8151
|
-
}
|
|
8152
|
-
const timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
|
|
8153
|
-
const timerShouldStepForward = prefetchAnimationTargetsForMetronome(timerId, animationListValues, targets) && !timerIsInDwell;
|
|
8154
|
-
// Determine the next step
|
|
8155
|
-
const timerStep = timerShouldStepForward ? getNextStep(timerId, animationListValues.length) : getCurrentStep(timerId);
|
|
8156
|
-
setStep(timerId, timerStep);
|
|
8157
|
-
const updatedValue = animationListValues[timerStep];
|
|
8158
|
-
targetsWithUpdateValue.push(...targets.map(target => {
|
|
8159
|
-
return Object.assign(Object.assign({}, target), {
|
|
8160
|
-
value: updatedValue
|
|
8161
|
-
});
|
|
8162
|
-
}));
|
|
8163
|
-
const speedDelay = getMapAnimationDelay(listenerApi.getState(), timerId);
|
|
8164
|
-
const speed = 1000 / (speedDelay || 1);
|
|
8165
|
-
metronome.setSpeed(timerId, speed);
|
|
8166
|
-
}
|
|
8167
|
-
// Update all targets of all sync groups in one action.
|
|
8168
|
-
if (targetsWithUpdateValue.length > 0) {
|
|
8169
|
-
listenerApi.dispatch(setTimeSync(null, targetsWithUpdateValue, ['metronomesaga']));
|
|
8170
|
-
}
|
|
8171
|
-
};
|
|
8172
|
-
const metronomeListener = createListenerMiddleware();
|
|
8173
|
-
metronomeListener.startListening({
|
|
8174
|
-
actionCreator: mapActions.mapStartAnimation,
|
|
8175
|
-
effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8176
|
-
// register handler with access to listenerApi
|
|
8177
|
-
metronome.handleTimerTicks = timerIds => {
|
|
8178
|
-
metronomeHandler(timerIds, listenerApi);
|
|
8179
|
-
};
|
|
8180
|
-
})
|
|
8181
|
-
});
|
|
8182
|
-
|
|
8183
|
-
/* *
|
|
8184
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8185
|
-
* you may not use this file except in compliance with the License.
|
|
8186
|
-
* You may obtain a copy of the License at
|
|
8187
|
-
*
|
|
8188
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8189
|
-
*
|
|
8190
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
8191
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
8192
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
8193
|
-
* See the License for the specific language governing permissions and
|
|
8194
|
-
* limitations under the License.
|
|
8195
|
-
*
|
|
8196
|
-
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
8197
|
-
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8198
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8199
|
-
* */
|
|
8200
|
-
const layersListener = createListenerMiddleware();
|
|
8201
|
-
layersListener.startListening({
|
|
8202
|
-
actionCreator: layerActions.showLayerInfo,
|
|
8203
|
-
effect: ({
|
|
8204
|
-
payload
|
|
8205
|
-
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8206
|
-
const {
|
|
8207
|
-
mapId,
|
|
8208
|
-
source
|
|
8209
|
-
} = payload;
|
|
8210
|
-
const currentActiveMapId = getDialogMapId(listenerApi.getState(), DialogTypes.LayerInfo);
|
|
8211
|
-
const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
|
|
8212
|
-
if (currentActiveMapId !== mapId ? true : !isOpenInStore) {
|
|
8213
|
-
listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
|
|
8214
|
-
type: DialogTypes.LayerInfo,
|
|
8215
|
-
mapId,
|
|
8216
|
-
setOpen: true,
|
|
8217
|
-
source
|
|
8218
|
-
}));
|
|
8219
|
-
}
|
|
8220
|
-
})
|
|
8221
|
-
});
|
|
8222
|
-
layersListener.startListening({
|
|
8223
|
-
actionCreator: uiActions.setToggleOpenDialog,
|
|
8224
|
-
effect: ({
|
|
8225
|
-
payload
|
|
8226
|
-
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8227
|
-
const {
|
|
8228
|
-
setOpen,
|
|
8229
|
-
type
|
|
8230
|
-
} = payload;
|
|
8231
|
-
// close LayerInfo if open and LayerManager is closed
|
|
8232
|
-
if (type === DialogTypes.LayerManager && !setOpen) {
|
|
8233
|
-
const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
|
|
8234
|
-
if (isOpenInStore) {
|
|
8235
|
-
listenerApi.dispatch(layerActions.hideLayerInfo());
|
|
7981
|
+
if (!BUGGY) {
|
|
7982
|
+
var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
|
|
7983
|
+
if (res.done) return res.value;
|
|
8236
7984
|
}
|
|
8237
|
-
}
|
|
8238
|
-
})
|
|
8239
|
-
});
|
|
8240
7985
|
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
|
|
8251
|
-
|
|
8252
|
-
|
|
8253
|
-
|
|
8254
|
-
|
|
8255
|
-
|
|
8256
|
-
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
|
|
8265
|
-
|
|
8266
|
-
|
|
8267
|
-
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
type: 'legend',
|
|
8274
|
-
setOpen: false
|
|
8275
|
-
}));
|
|
8276
|
-
}
|
|
8277
|
-
// close any remaining windows with map assigned to it
|
|
8278
|
-
const remainingDialogsConnectedToMap = getUiDialogsByActiveMapId(listenerApi.getState(), payload.mapId);
|
|
8279
|
-
if (remainingDialogsConnectedToMap.length) {
|
|
8280
|
-
remainingDialogsConnectedToMap.forEach(dialog => {
|
|
8281
|
-
if (dialog.isOpen) {
|
|
8282
|
-
listenerApi.dispatch(uiActions.setToggleOpenDialog({
|
|
8283
|
-
type: dialog.type,
|
|
8284
|
-
setOpen: false
|
|
8285
|
-
}));
|
|
7986
|
+
var C = speciesConstructor(rx, RegExp);
|
|
7987
|
+
var unicodeMatching = rx.unicode;
|
|
7988
|
+
var flags = (rx.ignoreCase ? 'i' : '') +
|
|
7989
|
+
(rx.multiline ? 'm' : '') +
|
|
7990
|
+
(rx.unicode ? 'u' : '') +
|
|
7991
|
+
(UNSUPPORTED_Y ? 'g' : 'y');
|
|
7992
|
+
// ^(? + rx + ) is needed, in combination with some S slicing, to
|
|
7993
|
+
// simulate the 'y' flag.
|
|
7994
|
+
var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
|
|
7995
|
+
var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
|
7996
|
+
if (lim === 0) return [];
|
|
7997
|
+
if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
|
|
7998
|
+
var p = 0;
|
|
7999
|
+
var q = 0;
|
|
8000
|
+
var A = [];
|
|
8001
|
+
while (q < S.length) {
|
|
8002
|
+
splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
|
|
8003
|
+
var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
|
|
8004
|
+
var e;
|
|
8005
|
+
if (
|
|
8006
|
+
z === null ||
|
|
8007
|
+
(e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
|
|
8008
|
+
) {
|
|
8009
|
+
q = advanceStringIndex(S, q, unicodeMatching);
|
|
8010
|
+
} else {
|
|
8011
|
+
push(A, stringSlice(S, p, q));
|
|
8012
|
+
if (A.length === lim) return A;
|
|
8013
|
+
for (var i = 1; i <= z.length - 1; i++) {
|
|
8014
|
+
push(A, z[i]);
|
|
8015
|
+
if (A.length === lim) return A;
|
|
8016
|
+
}
|
|
8017
|
+
q = p = e;
|
|
8286
8018
|
}
|
|
8287
|
-
}
|
|
8019
|
+
}
|
|
8020
|
+
push(A, stringSlice(S, p));
|
|
8021
|
+
return A;
|
|
8288
8022
|
}
|
|
8289
|
-
|
|
8290
|
-
});
|
|
8023
|
+
];
|
|
8024
|
+
}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
|
|
8291
8025
|
|
|
8026
|
+
const isAnimationEndTimeValid = animationEndTime => {
|
|
8027
|
+
const hasValidPrefix = animationEndTime.split(/[-+]/)[0] === 'NOW' || animationEndTime.split(/[-+]/)[0] === 'TODAY';
|
|
8028
|
+
const durationString = animationEndTime.substring(animationEndTime.indexOf('PT') + 2);
|
|
8029
|
+
const hasValidDate = /^(\d+H)?(\d+M)?$/.test(durationString);
|
|
8030
|
+
if (hasValidPrefix && hasValidDate) {
|
|
8031
|
+
return true;
|
|
8032
|
+
}
|
|
8033
|
+
const parsedDate = dateUtils.parseISO(animationEndTime);
|
|
8034
|
+
return dateUtils.isValid(parsedDate);
|
|
8035
|
+
};
|
|
8292
8036
|
const mapListener = createListenerMiddleware();
|
|
8293
8037
|
mapListener.startListening({
|
|
8294
8038
|
actionCreator: layerActions.layerDelete,
|
|
@@ -8487,9 +8231,385 @@ mapListener.startListening({
|
|
|
8487
8231
|
metronome.unregister(mapId);
|
|
8488
8232
|
}
|
|
8489
8233
|
});
|
|
8234
|
+
const handleBaseLayers = (mapId, baseLayers, listenerApi) => {
|
|
8235
|
+
const baseLayer = baseLayers.find(layer => layer.layerType === 'baseLayer');
|
|
8236
|
+
const currentAvailableBaseLayers = getAvailableBaseLayersForMap(listenerApi.getState(), mapId);
|
|
8237
|
+
// find a availableBaseLayer with the same name, and use that id for the active baselayer
|
|
8238
|
+
const activeAvailableBaseLayer = currentAvailableBaseLayers.find(availableBaseLayer => availableBaseLayer.name === baseLayer.name);
|
|
8239
|
+
const activeBaseLayerId = activeAvailableBaseLayer ? activeAvailableBaseLayer.id : webmapUtils.generateLayerId();
|
|
8240
|
+
// if the baseLayer can't be found in a visible available baseLayer list, add it
|
|
8241
|
+
// This happens when switching to a preset that has non-default baselayers
|
|
8242
|
+
if (!activeAvailableBaseLayer && currentAvailableBaseLayers.length) {
|
|
8243
|
+
listenerApi.dispatch(layerActions.addAvailableBaseLayers({
|
|
8244
|
+
layers: [Object.assign(Object.assign({}, baseLayer), {
|
|
8245
|
+
mapId,
|
|
8246
|
+
id: activeBaseLayerId
|
|
8247
|
+
})]
|
|
8248
|
+
}));
|
|
8249
|
+
}
|
|
8250
|
+
const baseLayersWithActiveId = baseLayers.map((layer, index) => index === 0 ? Object.assign(Object.assign({}, layer), {
|
|
8251
|
+
id: activeBaseLayerId || layer.id
|
|
8252
|
+
}) : layer);
|
|
8253
|
+
listenerApi.dispatch(layerActions.setBaseLayers({
|
|
8254
|
+
mapId,
|
|
8255
|
+
layers: baseLayersWithActiveId
|
|
8256
|
+
}));
|
|
8257
|
+
};
|
|
8258
|
+
mapListener.startListening({
|
|
8259
|
+
actionCreator: mapActions.setMapPreset,
|
|
8260
|
+
effect: ({
|
|
8261
|
+
payload
|
|
8262
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8263
|
+
var _a, _b, _c;
|
|
8264
|
+
try {
|
|
8265
|
+
const {
|
|
8266
|
+
mapId,
|
|
8267
|
+
initialProps
|
|
8268
|
+
} = payload;
|
|
8269
|
+
const {
|
|
8270
|
+
mapPreset
|
|
8271
|
+
} = initialProps;
|
|
8272
|
+
if (mapPreset) {
|
|
8273
|
+
const {
|
|
8274
|
+
layers,
|
|
8275
|
+
activeLayerId,
|
|
8276
|
+
autoTimeStepLayerId,
|
|
8277
|
+
autoUpdateLayerId,
|
|
8278
|
+
proj,
|
|
8279
|
+
shouldAutoUpdate,
|
|
8280
|
+
shouldAnimate,
|
|
8281
|
+
animationPayload,
|
|
8282
|
+
toggleTimestepAuto,
|
|
8283
|
+
showTimeSlider,
|
|
8284
|
+
displayMapPin,
|
|
8285
|
+
shouldShowZoomControls,
|
|
8286
|
+
shouldShowLegend,
|
|
8287
|
+
dockedLayerManagerSize
|
|
8288
|
+
} = mapPreset;
|
|
8289
|
+
const {
|
|
8290
|
+
mapLayers,
|
|
8291
|
+
baseLayers,
|
|
8292
|
+
overLayers
|
|
8293
|
+
} = filterLayers(layers);
|
|
8294
|
+
if (layers) {
|
|
8295
|
+
// make sure all layers have a unique id before going forward
|
|
8296
|
+
let autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
8297
|
+
let autoUpdateLayerIdNew = autoUpdateLayerId;
|
|
8298
|
+
const onlyActiveLayerIdIsSet = !autoTimeStepLayerId && !autoUpdateLayerId && activeLayerId;
|
|
8299
|
+
if (onlyActiveLayerIdIsSet) {
|
|
8300
|
+
autoTimeStepLayerIdNew = activeLayerId;
|
|
8301
|
+
autoUpdateLayerIdNew = activeLayerId;
|
|
8302
|
+
}
|
|
8303
|
+
const newLayerIds = replaceLayerIdsToEnsureUniqueLayerIdsInStore({
|
|
8304
|
+
layers: mapLayers,
|
|
8305
|
+
autoTimeStepLayerId: autoTimeStepLayerIdNew,
|
|
8306
|
+
autoUpdateLayerId: autoUpdateLayerIdNew
|
|
8307
|
+
});
|
|
8308
|
+
// set layers
|
|
8309
|
+
listenerApi.dispatch(layerActions.setLayers({
|
|
8310
|
+
mapId,
|
|
8311
|
+
layers: newLayerIds.layers
|
|
8312
|
+
}));
|
|
8313
|
+
// set active layer if given otherwise to first layer
|
|
8314
|
+
const firstLayerId = (_a = newLayerIds.layers[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
8315
|
+
listenerApi.dispatch(mapActions.setAutoLayerId({
|
|
8316
|
+
mapId,
|
|
8317
|
+
autoTimeStepLayerId: (_b = newLayerIds.autoTimeStepLayerId) !== null && _b !== void 0 ? _b : firstLayerId,
|
|
8318
|
+
autoUpdateLayerId: (_c = newLayerIds.autoUpdateLayerId) !== null && _c !== void 0 ? _c : firstLayerId
|
|
8319
|
+
}));
|
|
8320
|
+
}
|
|
8321
|
+
// sets (default) baseLayers
|
|
8322
|
+
const baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [defaultLayers.baseLayerGrey];
|
|
8323
|
+
// sets (default) overLayers
|
|
8324
|
+
const overLayersWithDefaultLayer = overLayers.length ? overLayers : [defaultLayers.overLayer];
|
|
8325
|
+
const allBaseLayers = [...baseLayersWithDefaultLayer, ...overLayersWithDefaultLayer].map(layer => Object.assign(Object.assign({}, layer), {
|
|
8326
|
+
id: webmapUtils.generateLayerId()
|
|
8327
|
+
}));
|
|
8328
|
+
handleBaseLayers(mapId, allBaseLayers, listenerApi);
|
|
8329
|
+
if (proj) {
|
|
8330
|
+
const checkIsprojectionSupported = isProjectionSupported(proj.srs);
|
|
8331
|
+
if (!checkIsprojectionSupported) {
|
|
8332
|
+
throw new Error(`Projection ${proj.srs} is not supported`);
|
|
8333
|
+
}
|
|
8334
|
+
// set bbox
|
|
8335
|
+
listenerApi.dispatch(mapActions.setBbox({
|
|
8336
|
+
mapId,
|
|
8337
|
+
bbox: proj.bbox,
|
|
8338
|
+
srs: proj.srs
|
|
8339
|
+
}));
|
|
8340
|
+
}
|
|
8341
|
+
const animationLength = animationPayload && animationPayload.duration;
|
|
8342
|
+
const animationEndTime = animationPayload && animationPayload.endTime && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
8343
|
+
const shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
8344
|
+
if (shouldEndtimeOverride) {
|
|
8345
|
+
// auto update
|
|
8346
|
+
listenerApi.dispatch(mapActions.setEndTimeOverriding({
|
|
8347
|
+
mapId,
|
|
8348
|
+
shouldEndtimeOverride
|
|
8349
|
+
}));
|
|
8350
|
+
}
|
|
8351
|
+
if (shouldAutoUpdate !== undefined && !animationEndTime) {
|
|
8352
|
+
// auto update
|
|
8353
|
+
listenerApi.dispatch(mapActions.toggleAutoUpdate({
|
|
8354
|
+
mapId,
|
|
8355
|
+
shouldAutoUpdate
|
|
8356
|
+
}));
|
|
8357
|
+
}
|
|
8358
|
+
if (showTimeSlider !== undefined) {
|
|
8359
|
+
// toggle timeslider
|
|
8360
|
+
listenerApi.dispatch(mapActions.toggleTimeSliderIsVisible({
|
|
8361
|
+
mapId,
|
|
8362
|
+
isTimeSliderVisible: showTimeSlider
|
|
8363
|
+
}));
|
|
8364
|
+
}
|
|
8365
|
+
if (shouldShowZoomControls !== undefined) {
|
|
8366
|
+
// toggle zoom controls
|
|
8367
|
+
listenerApi.dispatch(mapActions.toggleZoomControls({
|
|
8368
|
+
mapId,
|
|
8369
|
+
shouldShowZoomControls
|
|
8370
|
+
}));
|
|
8371
|
+
}
|
|
8372
|
+
if (displayMapPin !== undefined) {
|
|
8373
|
+
// display map pin
|
|
8374
|
+
listenerApi.dispatch(mapActions.toggleMapPinIsVisible({
|
|
8375
|
+
mapId,
|
|
8376
|
+
displayMapPin
|
|
8377
|
+
}));
|
|
8378
|
+
}
|
|
8379
|
+
// sets timestep by interval of animationPayload
|
|
8380
|
+
const interval = animationPayload && animationPayload.interval;
|
|
8381
|
+
if (interval) {
|
|
8382
|
+
listenerApi.dispatch(mapActions.setTimeStep({
|
|
8383
|
+
mapId,
|
|
8384
|
+
timeStep: interval
|
|
8385
|
+
}));
|
|
8386
|
+
}
|
|
8387
|
+
// sets animationEndTime by endTime of animationPayload
|
|
8388
|
+
if (animationEndTime) {
|
|
8389
|
+
const endTime = animationEndTime.includes('NOW') || animationEndTime.includes('TODAY') ? dateUtils.convertNOWandTODAYFormatsToUTC(animationEndTime) : animationEndTime;
|
|
8390
|
+
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
8391
|
+
mapId,
|
|
8392
|
+
animationEndTime: handleDateUtilsISOString(endTime)
|
|
8393
|
+
}));
|
|
8394
|
+
const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(endTime), {
|
|
8395
|
+
minutes: 5 * 60 // set to default of 5 hours
|
|
8396
|
+
}).toISOString());
|
|
8397
|
+
listenerApi.dispatch(mapActions.setAnimationStartTime({
|
|
8398
|
+
mapId,
|
|
8399
|
+
animationStartTime: startTime
|
|
8400
|
+
}));
|
|
8401
|
+
listenerApi.dispatch(genericActions.setTime({
|
|
8402
|
+
origin: '',
|
|
8403
|
+
sourceId: mapId,
|
|
8404
|
+
value: startTime
|
|
8405
|
+
}));
|
|
8406
|
+
const centerTimeInSeconds = new Date(handleDateUtilsISOString(endTime)).getTime();
|
|
8407
|
+
listenerApi.dispatch(mapActions.setTimeSliderCenterTime({
|
|
8408
|
+
mapId,
|
|
8409
|
+
timeSliderCenterTime: centerTimeInSeconds
|
|
8410
|
+
}));
|
|
8411
|
+
}
|
|
8412
|
+
// sets animationStartTime by duration of animationPayload
|
|
8413
|
+
if (animationLength) {
|
|
8414
|
+
const animationEnd = getAnimationEndTime(listenerApi.getState(), mapId);
|
|
8415
|
+
const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(animationEnd), {
|
|
8416
|
+
minutes: animationLength
|
|
8417
|
+
}).toISOString());
|
|
8418
|
+
listenerApi.dispatch(mapActions.setAnimationStartTime({
|
|
8419
|
+
mapId,
|
|
8420
|
+
animationStartTime: startTime
|
|
8421
|
+
}));
|
|
8422
|
+
listenerApi.dispatch(genericActions.setTime({
|
|
8423
|
+
origin: '',
|
|
8424
|
+
sourceId: mapId,
|
|
8425
|
+
value: startTime
|
|
8426
|
+
}));
|
|
8427
|
+
}
|
|
8428
|
+
// sets animationDelay by speed of animationPayload
|
|
8429
|
+
if (animationPayload && animationPayload.speed) {
|
|
8430
|
+
listenerApi.dispatch(mapActions.setAnimationDelay({
|
|
8431
|
+
mapId,
|
|
8432
|
+
animationDelay: getSpeedDelay(animationPayload.speed)
|
|
8433
|
+
}));
|
|
8434
|
+
}
|
|
8435
|
+
// turn animation on
|
|
8436
|
+
if (shouldAnimate === true) {
|
|
8437
|
+
const duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
|
|
8438
|
+
const animationEnd = shouldEndtimeOverride && animationEndTime ? getAnimationEndTime(listenerApi.getState(), mapId) : dateUtils.dateToString(dateUtils.utc(), dateFormat);
|
|
8439
|
+
const animationStart = shouldEndtimeOverride && animationLength ? getAnimationStartTime(listenerApi.getState(), mapId) : dateUtils.dateToString(dateUtils.sub(dateUtils.utc(animationEnd), {
|
|
8440
|
+
minutes: duration
|
|
8441
|
+
}), dateFormat);
|
|
8442
|
+
listenerApi.dispatch(mapActions.mapStartAnimation({
|
|
8443
|
+
mapId,
|
|
8444
|
+
start: animationStart,
|
|
8445
|
+
end: animationEnd,
|
|
8446
|
+
interval: interval || defaultTimeStep
|
|
8447
|
+
}));
|
|
8448
|
+
// If animation interval set, set the timestep auto property to false
|
|
8449
|
+
if (interval) {
|
|
8450
|
+
listenerApi.dispatch(mapActions.toggleTimestepAuto({
|
|
8451
|
+
mapId,
|
|
8452
|
+
timestepAuto: false
|
|
8453
|
+
}));
|
|
8454
|
+
}
|
|
8455
|
+
} else if (toggleTimestepAuto !== undefined) {
|
|
8456
|
+
// Set timestep auto based on preset if animation is off
|
|
8457
|
+
listenerApi.dispatch(mapActions.toggleTimestepAuto({
|
|
8458
|
+
mapId,
|
|
8459
|
+
timestepAuto: toggleTimestepAuto
|
|
8460
|
+
}));
|
|
8461
|
+
}
|
|
8462
|
+
// show legend
|
|
8463
|
+
const shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
|
|
8464
|
+
const legendId = getLegendId(listenerApi.getState(), mapId);
|
|
8465
|
+
if (legendId) {
|
|
8466
|
+
listenerApi.dispatch(uiActions.setToggleOpenDialog({
|
|
8467
|
+
type: legendId,
|
|
8468
|
+
setOpen: shouldOpenLegend
|
|
8469
|
+
}));
|
|
8470
|
+
}
|
|
8471
|
+
if (dockedLayerManagerSize) {
|
|
8472
|
+
listenerApi.dispatch(mapActions.setDockedLayerManagerSize({
|
|
8473
|
+
mapId,
|
|
8474
|
+
dockedLayerManagerSize
|
|
8475
|
+
}));
|
|
8476
|
+
}
|
|
8477
|
+
while (animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate))) {
|
|
8478
|
+
const fiveMinuteDelayForAnimation = 1000 * 60 * 5;
|
|
8479
|
+
// eslint-disable-next-line no-await-in-loop
|
|
8480
|
+
yield listenerApi.delay(fiveMinuteDelayForAnimation);
|
|
8481
|
+
const animationEnd = getAnimationEndTime(listenerApi.getState(), mapId);
|
|
8482
|
+
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
8483
|
+
mapId,
|
|
8484
|
+
animationEndTime: dateUtils.add(dateUtils.utc(animationEnd), {
|
|
8485
|
+
minutes: 5
|
|
8486
|
+
}).toISOString()
|
|
8487
|
+
}));
|
|
8488
|
+
const animationStart = getAnimationStartTime(listenerApi.getState(), mapId);
|
|
8489
|
+
listenerApi.dispatch(mapActions.setAnimationStartTime({
|
|
8490
|
+
mapId,
|
|
8491
|
+
animationStartTime: dateUtils.add(dateUtils.utc(animationStart), {
|
|
8492
|
+
minutes: 5
|
|
8493
|
+
}).toISOString()
|
|
8494
|
+
}));
|
|
8495
|
+
}
|
|
8496
|
+
}
|
|
8497
|
+
} catch (error) {
|
|
8498
|
+
listenerApi.dispatch(mapActions.setMapPresetError({
|
|
8499
|
+
mapId: payload.mapId,
|
|
8500
|
+
error: error.message
|
|
8501
|
+
}));
|
|
8502
|
+
}
|
|
8503
|
+
})
|
|
8504
|
+
});
|
|
8505
|
+
mapListener.startListening({
|
|
8506
|
+
actionCreator: mapActions.unregisterMap,
|
|
8507
|
+
effect: ({
|
|
8508
|
+
payload
|
|
8509
|
+
}, listenerApi) => {
|
|
8510
|
+
const {
|
|
8511
|
+
mapId
|
|
8512
|
+
} = payload;
|
|
8513
|
+
const layerList = getLayersByMapId(listenerApi.getState(), mapId);
|
|
8514
|
+
metronome.unregister(mapId);
|
|
8515
|
+
layerList.map(layer => listenerApi.dispatch(layerActions.layerDelete({
|
|
8516
|
+
mapId,
|
|
8517
|
+
layerId: layer.id,
|
|
8518
|
+
origin: LayerActionOrigin.unregisterMapListener
|
|
8519
|
+
})));
|
|
8520
|
+
}
|
|
8521
|
+
});
|
|
8522
|
+
mapListener.startListening({
|
|
8523
|
+
actionCreator: mapActions.setStepBackwardOrForward,
|
|
8524
|
+
effect: ({
|
|
8525
|
+
payload
|
|
8526
|
+
}, listenerApi) => {
|
|
8527
|
+
const {
|
|
8528
|
+
mapId,
|
|
8529
|
+
isForwardStep
|
|
8530
|
+
} = payload;
|
|
8531
|
+
const timeStep = getMapTimeStep(listenerApi.getState(), mapId);
|
|
8532
|
+
const currentTime = getSelectedTime(listenerApi.getState(), mapId);
|
|
8533
|
+
const [dataStartTime, dataEndTime] = getDataLimitsFromLayers(listenerApi.getState(), mapId);
|
|
8534
|
+
if (dateUtils.isValid(currentTime)) {
|
|
8535
|
+
const makeForwardStep = () => {
|
|
8536
|
+
const nextTime = currentTime + timeStep;
|
|
8537
|
+
const roundedTime = roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
8538
|
+
const newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
8539
|
+
return dateUtils.fromUnix(newTime).toISOString();
|
|
8540
|
+
};
|
|
8541
|
+
const makeBackwardStep = () => {
|
|
8542
|
+
const nextTime = currentTime - timeStep;
|
|
8543
|
+
const roundedTime = roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
8544
|
+
const newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
8545
|
+
return dateUtils.fromUnix(newTime).toISOString();
|
|
8546
|
+
};
|
|
8547
|
+
const selectedTimeString = isForwardStep ? makeForwardStep() : makeBackwardStep();
|
|
8548
|
+
const isMapAnimating = isAnimating(listenerApi.getState(), mapId);
|
|
8549
|
+
if (isMapAnimating) {
|
|
8550
|
+
listenerApi.dispatch(mapActions.mapStopAnimation({
|
|
8551
|
+
mapId,
|
|
8552
|
+
origin: MapActionOrigin.map
|
|
8553
|
+
}));
|
|
8554
|
+
}
|
|
8555
|
+
const isAutoUpdateOn = isAutoUpdating(listenerApi.getState(), mapId);
|
|
8556
|
+
if (isAutoUpdateOn) {
|
|
8557
|
+
listenerApi.dispatch(mapActions.toggleAutoUpdate({
|
|
8558
|
+
mapId,
|
|
8559
|
+
shouldAutoUpdate: false
|
|
8560
|
+
}));
|
|
8561
|
+
}
|
|
8562
|
+
listenerApi.dispatch(genericActions.setTime({
|
|
8563
|
+
origin: '',
|
|
8564
|
+
sourceId: mapId,
|
|
8565
|
+
value: handleDateUtilsISOString(selectedTimeString)
|
|
8566
|
+
}));
|
|
8567
|
+
}
|
|
8568
|
+
}
|
|
8569
|
+
});
|
|
8570
|
+
|
|
8571
|
+
const serviceListener = createListenerMiddleware();
|
|
8572
|
+
const fetchService = (service, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8573
|
+
try {
|
|
8574
|
+
const layers = yield getCapabilities.getLayersFlattenedFromService(service.serviceUrl);
|
|
8575
|
+
listenerApi.dispatch(serviceActions.serviceSetLayers(Object.assign(Object.assign({}, service), {
|
|
8576
|
+
layers
|
|
8577
|
+
})));
|
|
8578
|
+
} catch (error) {
|
|
8579
|
+
console.warn(error.message);
|
|
8580
|
+
}
|
|
8581
|
+
});
|
|
8582
|
+
const fetchInitialServices = (payload, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8583
|
+
if (!payload || !payload.services) {
|
|
8584
|
+
return;
|
|
8585
|
+
}
|
|
8586
|
+
try {
|
|
8587
|
+
payload.services.map(_a => {
|
|
8588
|
+
var {
|
|
8589
|
+
url
|
|
8590
|
+
} = _a,
|
|
8591
|
+
service = __rest(_a, ["url"]);
|
|
8592
|
+
return fetchService(Object.assign(Object.assign({}, service), {
|
|
8593
|
+
serviceUrl: url
|
|
8594
|
+
}), listenerApi);
|
|
8595
|
+
});
|
|
8596
|
+
} catch (error) {
|
|
8597
|
+
// eslint-disable-next-line no-console
|
|
8598
|
+
console.warn(error);
|
|
8599
|
+
}
|
|
8600
|
+
});
|
|
8601
|
+
serviceListener.startListening({
|
|
8602
|
+
actionCreator: serviceActions.fetchInitialServices,
|
|
8603
|
+
effect: ({
|
|
8604
|
+
payload
|
|
8605
|
+
}, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8606
|
+
listenerApi.cancelActiveListeners();
|
|
8607
|
+
fetchInitialServices(payload, listenerApi);
|
|
8608
|
+
})
|
|
8609
|
+
});
|
|
8490
8610
|
|
|
8491
8611
|
// TODO: This fixes typecheck errors but maybe there is a better way to do that
|
|
8492
|
-
createStore
|
|
8612
|
+
createStore({
|
|
8493
8613
|
extensions: [getSagaExtension()]
|
|
8494
8614
|
});
|
|
8495
8615
|
const mapStoreReducers = {
|
|
@@ -8500,8 +8620,7 @@ const mapStoreReducers = {
|
|
|
8500
8620
|
const mapStoreModuleConfig = {
|
|
8501
8621
|
id: 'webmap-module',
|
|
8502
8622
|
reducersMap: mapStoreReducers,
|
|
8503
|
-
|
|
8504
|
-
middlewares: [metronomeListener.middleware, layersListener.middleware, mapUiListener.middleware, mapListener.middleware]
|
|
8623
|
+
middlewares: [metronomeListener.middleware, layersListener.middleware, mapUiListener.middleware, mapListener.middleware, serviceListener.middleware]
|
|
8505
8624
|
};
|
|
8506
8625
|
|
|
8507
8626
|
const mapStoreActions = Object.assign(Object.assign(Object.assign({}, layerActions), mapActions), serviceActions);
|
|
@@ -9827,10 +9946,8 @@ const uiModuleConfig = {
|
|
|
9827
9946
|
* */
|
|
9828
9947
|
const coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig, drawtoolModuleConfig];
|
|
9829
9948
|
|
|
9830
|
-
const
|
|
9831
|
-
extensions: [getSagaExtension({})
|
|
9832
|
-
middlewares: [metronomeListener.middleware, mapListener.middleware]
|
|
9833
|
-
}]
|
|
9949
|
+
const createCustomStore = () => createStore({
|
|
9950
|
+
extensions: [getSagaExtension({})]
|
|
9834
9951
|
});
|
|
9835
9952
|
const WrapperWithModules = withEggs(coreModuleConfig)(({
|
|
9836
9953
|
children
|
|
@@ -9852,4 +9969,4 @@ const StoreProvider = ({
|
|
|
9852
9969
|
})
|
|
9853
9970
|
}));
|
|
9854
9971
|
|
|
9855
|
-
export { IS_LEGEND_OPEN_BY_DEFAULT, StoreProvider, coreModuleConfig,
|
|
9972
|
+
export { IS_LEGEND_OPEN_BY_DEFAULT, StoreProvider, coreModuleConfig, createCustomStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$4 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, initialState$3 as initialState, layerActions, reducer$6 as layerReducer, selectors$7 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, loadingIndicatorActions, constants as loadingIndicatorConstants, loadingIndicatorReducer, selectors$3 as loadingIndicatorSelectors, mapActions, enums as mapEnums, mapListener, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, setUserAddedServices, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants$1 as syncConstants, actions as syncGroupsActions, reducer$3 as syncGroupsReducer, selector as syncGroupsSelector, selectors$5 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$5 as uiReducer, selectors$6 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$4 as webmapReducer };
|