@opengeoweb/store 19.6.1 → 20.0.0-nightly-20260919
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +766 -326
- package/dist/src/store/drawingTool/selectors.d.ts +30 -30
- package/dist/src/store/map/layer/reducer.d.ts +3 -1
- package/dist/src/store/map/layer/types.d.ts +6 -1
- package/dist/src/store/map/map/index.d.ts +2 -2
- package/dist/src/store/map/map/olMapListenerAnimationUtils.d.ts +9 -0
- package/dist/src/store/map/map/reducer.d.ts +8 -1
- package/dist/src/store/map/map/selectors.d.ts +86 -13
- package/dist/src/store/map/map/types.d.ts +24 -2
- package/dist/src/store/ui/selectors.d.ts +4 -4
- package/package.json +46 -46
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { isEqual, mergeWith, merge, isEmpty, compact } from 'lodash';
|
|
|
3
3
|
import { webmapUtils, parseISO8601IntervalToDateInterval, LayerType, handleDateUtilsISOString, webmapTestSettings, WMLayer, getWMLayerById, WMInvalidDateValues, isProjectionSupported, queryWMSLayers } from '@opengeoweb/webmap';
|
|
4
4
|
export { LayerType } from '@opengeoweb/webmap';
|
|
5
5
|
import { dateUtils, PROJECTION, defaultDelay, useDebounce } from '@opengeoweb/shared';
|
|
6
|
-
import { secondsPerPxFromCanvasWidth, defaultTimeSpan, defaultSecondsPerPx, defaultAnimationDelayAtStart, defaultTimeStep, roundWithTimeStep, getSpeedDelay } from '@opengeoweb/time-slider';
|
|
6
|
+
import { secondsPerPxFromCanvasWidth, defaultTimeSpan, defaultSecondsPerPx, defaultAnimationDelayAtStart, defaultTimeStep, AnimationLengthMode, defaultExactSelections, roundWithTimeStep, resolveAnimationRange, isValidAnimationLength, defaultOffsetSelections, isAnchoredMode, getAnimationLengthFromRange, withModeSelections, getSpeedDelay, isWithinAnimationStepLimit } from '@opengeoweb/time-slider';
|
|
7
7
|
import { produce } from 'immer';
|
|
8
8
|
import { getLastEmptyFeatureIndex, getGeoJson, moveFeature, createInterSections, defaultLayers, fetchStacCatalogRoot, stacCatalogCollectionToLayerProps, fetchStacCatalogCollections, emptyGeoJSON, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, getFeatureCollection } from '@opengeoweb/webmap-react';
|
|
9
9
|
export { defaultLayers } from '@opengeoweb/webmap-react';
|
|
@@ -1556,21 +1556,40 @@ var utils$1 = /*#__PURE__*/Object.freeze({
|
|
|
1556
1556
|
});
|
|
1557
1557
|
|
|
1558
1558
|
var _excluded$3 = ["id", "opacity", "acceptanceTimeInMinutes", "enabled", "layerType", "status", "useLatestReferenceTime"];
|
|
1559
|
-
var
|
|
1560
|
-
var
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1559
|
+
var updateIntersectionLayers = function updateIntersectionLayers(_ref) {
|
|
1560
|
+
var _currentLayer$geojson;
|
|
1561
|
+
var draft = _ref.draft,
|
|
1562
|
+
currentLayer = _ref.currentLayer,
|
|
1563
|
+
geojson = _ref.geojson,
|
|
1564
|
+
geoJSONIntersectionLayerId = _ref.geoJSONIntersectionLayerId,
|
|
1565
|
+
geoJSONIntersectionBoundsLayerId = _ref.geoJSONIntersectionBoundsLayerId;
|
|
1566
|
+
if (!geoJSONIntersectionBoundsLayerId || !geoJSONIntersectionLayerId) {
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
var intersectionLayer = draft.byId[geoJSONIntersectionLayerId];
|
|
1570
|
+
var intersectionBoundsLayer = draft.byId[geoJSONIntersectionBoundsLayerId];
|
|
1571
|
+
if (!intersectionLayer || !intersectionBoundsLayer) {
|
|
1572
|
+
return;
|
|
1573
|
+
}
|
|
1574
|
+
var bounds = intersectionBoundsLayer.geojson;
|
|
1575
|
+
var geoJSONProperties = intersectionLayer.defaultGeoJSONProperties || ((_currentLayer$geojson = currentLayer.geojson) === null || _currentLayer$geojson === void 0 || (_currentLayer$geojson = _currentLayer$geojson.features[0]) === null || _currentLayer$geojson === void 0 ? void 0 : _currentLayer$geojson.properties);
|
|
1576
|
+
intersectionLayer.geojson = createInterSections(geojson, bounds, geoJSONProperties);
|
|
1577
|
+
};
|
|
1578
|
+
var createLayer = function createLayer(_ref2) {
|
|
1579
|
+
var id = _ref2.id,
|
|
1580
|
+
_ref2$opacity = _ref2.opacity,
|
|
1581
|
+
opacity = _ref2$opacity === void 0 ? 1 : _ref2$opacity,
|
|
1582
|
+
_ref2$acceptanceTimeI = _ref2.acceptanceTimeInMinutes,
|
|
1583
|
+
acceptanceTimeInMinutes = _ref2$acceptanceTimeI === void 0 ? 60 : _ref2$acceptanceTimeI,
|
|
1584
|
+
_ref2$enabled = _ref2.enabled,
|
|
1585
|
+
enabled = _ref2$enabled === void 0 ? true : _ref2$enabled,
|
|
1586
|
+
_ref2$layerType = _ref2.layerType,
|
|
1587
|
+
layerType = _ref2$layerType === void 0 ? 'mapLayer' : _ref2$layerType,
|
|
1588
|
+
_ref2$status = _ref2.status,
|
|
1589
|
+
status = _ref2$status === void 0 ? 'default' : _ref2$status,
|
|
1590
|
+
_ref2$useLatestRefere = _ref2.useLatestReferenceTime,
|
|
1591
|
+
useLatestReferenceTime = _ref2$useLatestRefere === void 0 ? true : _ref2$useLatestRefere,
|
|
1592
|
+
props = _objectWithoutProperties(_ref2, _excluded$3);
|
|
1574
1593
|
var wmjsLayer = webmapUtils.getWMLayerById(id);
|
|
1575
1594
|
var dimensions = props.dimensions || (wmjsLayer ? wmjsLayer.getDimensions() : []).map(function (dim) {
|
|
1576
1595
|
return {
|
|
@@ -2095,17 +2114,13 @@ var slice$7 = createSlice({
|
|
|
2095
2114
|
var selectedFeatureKey = getFeatureSelectionKey(selectedFeature);
|
|
2096
2115
|
currentLayer.selectedFeatureIds = selectedFeatureKey ? [selectedFeatureKey] : [];
|
|
2097
2116
|
}
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
var bounds = intersectionBoundsLayer.geojson;
|
|
2106
|
-
var geoJSONProperties = intersectionLayer.defaultGeoJSONProperties || ((_currentLayer$geojson = currentLayer.geojson) === null || _currentLayer$geojson === void 0 || (_currentLayer$geojson = _currentLayer$geojson.features[0]) === null || _currentLayer$geojson === void 0 ? void 0 : _currentLayer$geojson.properties);
|
|
2107
|
-
intersectionLayer.geojson = createInterSections(updatedGeoJSONWithIds, bounds, geoJSONProperties);
|
|
2108
|
-
}
|
|
2117
|
+
updateIntersectionLayers({
|
|
2118
|
+
draft: draft,
|
|
2119
|
+
currentLayer: currentLayer,
|
|
2120
|
+
geojson: updatedGeoJSONWithIds,
|
|
2121
|
+
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId,
|
|
2122
|
+
geoJSONIntersectionBoundsLayerId: geoJSONIntersectionBoundsLayerId
|
|
2123
|
+
});
|
|
2109
2124
|
},
|
|
2110
2125
|
updateFeatureProperties: function updateFeatureProperties(draft, action) {
|
|
2111
2126
|
var _currentLayer$geojson2;
|
|
@@ -2127,13 +2142,59 @@ var slice$7 = createSlice({
|
|
|
2127
2142
|
});
|
|
2128
2143
|
}
|
|
2129
2144
|
},
|
|
2130
|
-
|
|
2131
|
-
var _currentLayer$geojson3
|
|
2145
|
+
moveFeatures: function moveFeatures(draft, action) {
|
|
2146
|
+
var _currentLayer$geojson3;
|
|
2132
2147
|
var _action$payload21 = action.payload,
|
|
2133
2148
|
layerId = _action$payload21.layerId,
|
|
2134
|
-
|
|
2149
|
+
movedFeatures = _action$payload21.movedFeatures,
|
|
2150
|
+
geoJSONIntersectionLayerId = _action$payload21.geoJSONIntersectionLayerId,
|
|
2151
|
+
geoJSONIntersectionBoundsLayerId = _action$payload21.geoJSONIntersectionBoundsLayerId;
|
|
2135
2152
|
var currentLayer = draft.byId[layerId];
|
|
2136
|
-
if (!(currentLayer !== null && currentLayer !== void 0 && (_currentLayer$geojson3 = currentLayer.geojson) !== null && _currentLayer$geojson3 !== void 0 && _currentLayer$geojson3.features.length)) {
|
|
2153
|
+
if (!(currentLayer !== null && currentLayer !== void 0 && (_currentLayer$geojson3 = currentLayer.geojson) !== null && _currentLayer$geojson3 !== void 0 && _currentLayer$geojson3.features.length) || !(movedFeatures !== null && movedFeatures !== void 0 && movedFeatures.length)) {
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2156
|
+
var geometryByFeatureId = new Map(movedFeatures.map(function (_ref3) {
|
|
2157
|
+
var featureId = _ref3.featureId,
|
|
2158
|
+
geometry = _ref3.geometry;
|
|
2159
|
+
return [featureId, geometry];
|
|
2160
|
+
}));
|
|
2161
|
+
var hasChanges = false;
|
|
2162
|
+
var features = currentLayer.geojson.features.map(function (feature) {
|
|
2163
|
+
var _feature$properties;
|
|
2164
|
+
if (((_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.isReadonly) === true) {
|
|
2165
|
+
return feature;
|
|
2166
|
+
}
|
|
2167
|
+
var featureKey = getFeatureSelectionKey(feature);
|
|
2168
|
+
var geometry = featureKey ? geometryByFeatureId.get(featureKey) : undefined;
|
|
2169
|
+
if (!geometry) {
|
|
2170
|
+
return feature;
|
|
2171
|
+
}
|
|
2172
|
+
hasChanges = true;
|
|
2173
|
+
return _objectSpread2(_objectSpread2({}, feature), {}, {
|
|
2174
|
+
geometry: geometry
|
|
2175
|
+
});
|
|
2176
|
+
});
|
|
2177
|
+
if (!hasChanges) {
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
currentLayer.geojson = _objectSpread2(_objectSpread2({}, currentLayer.geojson), {}, {
|
|
2181
|
+
features: features
|
|
2182
|
+
});
|
|
2183
|
+
updateIntersectionLayers({
|
|
2184
|
+
draft: draft,
|
|
2185
|
+
currentLayer: currentLayer,
|
|
2186
|
+
geojson: currentLayer.geojson,
|
|
2187
|
+
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId,
|
|
2188
|
+
geoJSONIntersectionBoundsLayerId: geoJSONIntersectionBoundsLayerId
|
|
2189
|
+
});
|
|
2190
|
+
},
|
|
2191
|
+
deleteFeature: function deleteFeature(draft, action) {
|
|
2192
|
+
var _currentLayer$geojson4, _currentLayer$selecte, _currentLayer$hovered;
|
|
2193
|
+
var _action$payload22 = action.payload,
|
|
2194
|
+
layerId = _action$payload22.layerId,
|
|
2195
|
+
featureId = _action$payload22.featureId;
|
|
2196
|
+
var currentLayer = draft.byId[layerId];
|
|
2197
|
+
if (!(currentLayer !== null && currentLayer !== void 0 && (_currentLayer$geojson4 = currentLayer.geojson) !== null && _currentLayer$geojson4 !== void 0 && _currentLayer$geojson4.features.length)) {
|
|
2137
2198
|
return;
|
|
2138
2199
|
}
|
|
2139
2200
|
var features = currentLayer.geojson.features;
|
|
@@ -2164,10 +2225,10 @@ var slice$7 = createSlice({
|
|
|
2164
2225
|
});
|
|
2165
2226
|
},
|
|
2166
2227
|
toggleFeatureMode: function toggleFeatureMode(draft, action) {
|
|
2167
|
-
var _action$
|
|
2168
|
-
layerId = _action$
|
|
2169
|
-
isInEditMode = _action$
|
|
2170
|
-
drawMode = _action$
|
|
2228
|
+
var _action$payload23 = action.payload,
|
|
2229
|
+
layerId = _action$payload23.layerId,
|
|
2230
|
+
isInEditMode = _action$payload23.isInEditMode,
|
|
2231
|
+
drawMode = _action$payload23.drawMode;
|
|
2171
2232
|
if (!draft.byId[layerId]) {
|
|
2172
2233
|
return;
|
|
2173
2234
|
}
|
|
@@ -2179,10 +2240,10 @@ var slice$7 = createSlice({
|
|
|
2179
2240
|
}
|
|
2180
2241
|
},
|
|
2181
2242
|
exitFeatureDrawMode: function exitFeatureDrawMode(draft, action) {
|
|
2182
|
-
var _action$
|
|
2183
|
-
layerId = _action$
|
|
2184
|
-
shouldAllowMultipleShapes = _action$
|
|
2185
|
-
reason = _action$
|
|
2243
|
+
var _action$payload24 = action.payload,
|
|
2244
|
+
layerId = _action$payload24.layerId,
|
|
2245
|
+
shouldAllowMultipleShapes = _action$payload24.shouldAllowMultipleShapes,
|
|
2246
|
+
reason = _action$payload24.reason;
|
|
2186
2247
|
if (!draft.byId[layerId]) {
|
|
2187
2248
|
return;
|
|
2188
2249
|
}
|
|
@@ -2218,10 +2279,10 @@ var slice$7 = createSlice({
|
|
|
2218
2279
|
},
|
|
2219
2280
|
// layer info actions
|
|
2220
2281
|
showLayerInfo: function showLayerInfo(draft, action) {
|
|
2221
|
-
var _action$
|
|
2222
|
-
serviceUrl = _action$
|
|
2223
|
-
layerName = _action$
|
|
2224
|
-
style = _action$
|
|
2282
|
+
var _action$payload25 = action.payload,
|
|
2283
|
+
serviceUrl = _action$payload25.serviceUrl,
|
|
2284
|
+
layerName = _action$payload25.layerName,
|
|
2285
|
+
style = _action$payload25.style;
|
|
2225
2286
|
draft.activeLayerInfo = {
|
|
2226
2287
|
serviceUrl: serviceUrl,
|
|
2227
2288
|
layerName: layerName,
|
|
@@ -2232,9 +2293,9 @@ var slice$7 = createSlice({
|
|
|
2232
2293
|
delete draft.activeLayerInfo;
|
|
2233
2294
|
},
|
|
2234
2295
|
SetLayerLegendVisibilityPayload: function SetLayerLegendVisibilityPayload(draft, action) {
|
|
2235
|
-
var _action$
|
|
2236
|
-
layerId = _action$
|
|
2237
|
-
showLayerLegend = _action$
|
|
2296
|
+
var _action$payload26 = action.payload,
|
|
2297
|
+
layerId = _action$payload26.layerId,
|
|
2298
|
+
showLayerLegend = _action$payload26.showLayerLegend;
|
|
2238
2299
|
var layer = draft.byId[layerId];
|
|
2239
2300
|
if (!layer) {
|
|
2240
2301
|
return;
|
|
@@ -2247,9 +2308,9 @@ var slice$7 = createSlice({
|
|
|
2247
2308
|
},
|
|
2248
2309
|
extraReducers: function extraReducers(builder) {
|
|
2249
2310
|
builder.addCase(setTimeSync, function (draft, action) {
|
|
2250
|
-
var _action$
|
|
2251
|
-
targetsFromAction = _action$
|
|
2252
|
-
source = _action$
|
|
2311
|
+
var _action$payload27 = action.payload,
|
|
2312
|
+
targetsFromAction = _action$payload27.targets,
|
|
2313
|
+
source = _action$payload27.source;
|
|
2253
2314
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2254
2315
|
var targets = [];
|
|
2255
2316
|
if (source) {
|
|
@@ -2279,9 +2340,9 @@ var slice$7 = createSlice({
|
|
|
2279
2340
|
* These targets can be used as payloads in new Layer actions.
|
|
2280
2341
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
2281
2342
|
*/
|
|
2282
|
-
var _action$
|
|
2283
|
-
targets = _action$
|
|
2284
|
-
source = _action$
|
|
2343
|
+
var _action$payload28 = action.payload,
|
|
2344
|
+
targets = _action$payload28.targets,
|
|
2345
|
+
source = _action$payload28.source;
|
|
2285
2346
|
return targets.reduce(function (prevState, target) {
|
|
2286
2347
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
2287
2348
|
var action = {
|
|
@@ -2364,6 +2425,15 @@ var initialState$5 = {
|
|
|
2364
2425
|
byId: {},
|
|
2365
2426
|
allIds: []
|
|
2366
2427
|
};
|
|
2428
|
+
/** Dragging the slider selects an exact window, so the mode needs its own range stored with it. */
|
|
2429
|
+
var exactSelectionsFrom = function exactSelectionsFrom(animationLength, animationStartTime, animationEndTime) {
|
|
2430
|
+
var _animationLength$exac;
|
|
2431
|
+
var current = (_animationLength$exac = animationLength === null || animationLength === void 0 ? void 0 : animationLength.exact) !== null && _animationLength$exac !== void 0 ? _animationLength$exac : defaultExactSelections();
|
|
2432
|
+
return {
|
|
2433
|
+
animationStartTime: animationStartTime !== null && animationStartTime !== void 0 ? animationStartTime : current.animationStartTime,
|
|
2434
|
+
animationEndTime: animationEndTime !== null && animationEndTime !== void 0 ? animationEndTime : current.animationEndTime
|
|
2435
|
+
};
|
|
2436
|
+
};
|
|
2367
2437
|
var slice$6 = createSlice({
|
|
2368
2438
|
initialState: initialState$5,
|
|
2369
2439
|
name: 'mapReducer',
|
|
@@ -2468,7 +2538,10 @@ var slice$6 = createSlice({
|
|
|
2468
2538
|
return;
|
|
2469
2539
|
}
|
|
2470
2540
|
draft.byId[mapId].animationStartTime = animationStartTime;
|
|
2471
|
-
draft.byId[mapId].
|
|
2541
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2542
|
+
mode: AnimationLengthMode.Exact,
|
|
2543
|
+
exact: exactSelectionsFrom(draft.byId[mapId].animationLength, animationStartTime, draft.byId[mapId].animationEndTime)
|
|
2544
|
+
});
|
|
2472
2545
|
},
|
|
2473
2546
|
setAnimationEndTime: function setAnimationEndTime(draft, action) {
|
|
2474
2547
|
var _action$payload7 = action.payload,
|
|
@@ -2478,23 +2551,54 @@ var slice$6 = createSlice({
|
|
|
2478
2551
|
return;
|
|
2479
2552
|
}
|
|
2480
2553
|
draft.byId[mapId].animationEndTime = animationEndTime;
|
|
2481
|
-
draft.byId[mapId].
|
|
2554
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2555
|
+
mode: AnimationLengthMode.Exact,
|
|
2556
|
+
exact: exactSelectionsFrom(draft.byId[mapId].animationLength, draft.byId[mapId].animationStartTime, animationEndTime)
|
|
2557
|
+
});
|
|
2482
2558
|
},
|
|
2483
|
-
|
|
2559
|
+
setAnimationLength: function setAnimationLength(draft, action) {
|
|
2484
2560
|
var _action$payload8 = action.payload,
|
|
2485
2561
|
mapId = _action$payload8.mapId,
|
|
2486
|
-
|
|
2562
|
+
animationLength = _action$payload8.animationLength,
|
|
2563
|
+
animationStartTime = _action$payload8.animationStartTime,
|
|
2564
|
+
animationEndTime = _action$payload8.animationEndTime;
|
|
2487
2565
|
if (!draft.byId[mapId]) {
|
|
2488
2566
|
return;
|
|
2489
2567
|
}
|
|
2490
|
-
draft.byId[mapId].
|
|
2568
|
+
draft.byId[mapId].animationLength = animationLength;
|
|
2569
|
+
if (animationStartTime) {
|
|
2570
|
+
draft.byId[mapId].animationStartTime = animationStartTime;
|
|
2571
|
+
}
|
|
2572
|
+
if (animationEndTime) {
|
|
2573
|
+
draft.byId[mapId].animationEndTime = animationEndTime;
|
|
2574
|
+
}
|
|
2491
2575
|
},
|
|
2492
|
-
|
|
2576
|
+
refreshAnimationRange: function refreshAnimationRange(draft, action) {
|
|
2493
2577
|
var _action$payload9 = action.payload,
|
|
2494
|
-
oldIndex = _action$payload9.oldIndex,
|
|
2495
|
-
newIndex = _action$payload9.newIndex,
|
|
2496
2578
|
mapId = _action$payload9.mapId,
|
|
2497
|
-
|
|
2579
|
+
animationStartTime = _action$payload9.animationStartTime,
|
|
2580
|
+
animationEndTime = _action$payload9.animationEndTime;
|
|
2581
|
+
if (!draft.byId[mapId]) {
|
|
2582
|
+
return;
|
|
2583
|
+
}
|
|
2584
|
+
draft.byId[mapId].animationStartTime = animationStartTime;
|
|
2585
|
+
draft.byId[mapId].animationEndTime = animationEndTime;
|
|
2586
|
+
},
|
|
2587
|
+
setAnimationDelay: function setAnimationDelay(draft, action) {
|
|
2588
|
+
var _action$payload0 = action.payload,
|
|
2589
|
+
mapId = _action$payload0.mapId,
|
|
2590
|
+
animationDelay = _action$payload0.animationDelay;
|
|
2591
|
+
if (!draft.byId[mapId]) {
|
|
2592
|
+
return;
|
|
2593
|
+
}
|
|
2594
|
+
draft.byId[mapId].animationDelay = animationDelay;
|
|
2595
|
+
},
|
|
2596
|
+
layerMoveLayer: function layerMoveLayer(draft, action) {
|
|
2597
|
+
var _action$payload1 = action.payload,
|
|
2598
|
+
oldIndex = _action$payload1.oldIndex,
|
|
2599
|
+
newIndex = _action$payload1.newIndex,
|
|
2600
|
+
mapId = _action$payload1.mapId,
|
|
2601
|
+
layerType = _action$payload1.layerType;
|
|
2498
2602
|
if (!draft.byId[mapId]) {
|
|
2499
2603
|
return;
|
|
2500
2604
|
}
|
|
@@ -2505,11 +2609,11 @@ var slice$6 = createSlice({
|
|
|
2505
2609
|
}
|
|
2506
2610
|
},
|
|
2507
2611
|
setAutoLayerId: function setAutoLayerId(draft, action) {
|
|
2508
|
-
var _action$
|
|
2509
|
-
mapId = _action$
|
|
2510
|
-
layerId = _action$
|
|
2511
|
-
autoTimeStepLayerId = _action$
|
|
2512
|
-
autoUpdateLayerId = _action$
|
|
2612
|
+
var _action$payload10 = action.payload,
|
|
2613
|
+
mapId = _action$payload10.mapId,
|
|
2614
|
+
layerId = _action$payload10.layerId,
|
|
2615
|
+
autoTimeStepLayerId = _action$payload10.autoTimeStepLayerId,
|
|
2616
|
+
autoUpdateLayerId = _action$payload10.autoUpdateLayerId;
|
|
2513
2617
|
var map = draft.byId[mapId];
|
|
2514
2618
|
if (!map) {
|
|
2515
2619
|
return;
|
|
@@ -2526,9 +2630,9 @@ var slice$6 = createSlice({
|
|
|
2526
2630
|
}
|
|
2527
2631
|
},
|
|
2528
2632
|
setAutoTimestepLayerId: function setAutoTimestepLayerId(draft, action) {
|
|
2529
|
-
var _action$
|
|
2530
|
-
mapId = _action$
|
|
2531
|
-
autoTimestepLayerId = _action$
|
|
2633
|
+
var _action$payload11 = action.payload,
|
|
2634
|
+
mapId = _action$payload11.mapId,
|
|
2635
|
+
autoTimestepLayerId = _action$payload11.autoTimestepLayerId;
|
|
2532
2636
|
var map = draft.byId[mapId];
|
|
2533
2637
|
if (!map) {
|
|
2534
2638
|
return;
|
|
@@ -2536,9 +2640,9 @@ var slice$6 = createSlice({
|
|
|
2536
2640
|
map.autoTimeStepLayerId = autoTimestepLayerId;
|
|
2537
2641
|
},
|
|
2538
2642
|
setAutoUpdateLayerId: function setAutoUpdateLayerId(draft, action) {
|
|
2539
|
-
var _action$
|
|
2540
|
-
mapId = _action$
|
|
2541
|
-
autoUpdateLayerId = _action$
|
|
2643
|
+
var _action$payload12 = action.payload,
|
|
2644
|
+
mapId = _action$payload12.mapId,
|
|
2645
|
+
autoUpdateLayerId = _action$payload12.autoUpdateLayerId;
|
|
2542
2646
|
var map = draft.byId[mapId];
|
|
2543
2647
|
if (!map) {
|
|
2544
2648
|
return;
|
|
@@ -2546,9 +2650,9 @@ var slice$6 = createSlice({
|
|
|
2546
2650
|
map.autoUpdateLayerId = autoUpdateLayerId;
|
|
2547
2651
|
},
|
|
2548
2652
|
setTimeSliderWidth: function setTimeSliderWidth(draft, action) {
|
|
2549
|
-
var _action$
|
|
2550
|
-
mapId = _action$
|
|
2551
|
-
timeSliderWidth = _action$
|
|
2653
|
+
var _action$payload13 = action.payload,
|
|
2654
|
+
mapId = _action$payload13.mapId,
|
|
2655
|
+
timeSliderWidth = _action$payload13.timeSliderWidth;
|
|
2552
2656
|
if (!draft.byId[mapId]) {
|
|
2553
2657
|
return;
|
|
2554
2658
|
}
|
|
@@ -2556,157 +2660,172 @@ var slice$6 = createSlice({
|
|
|
2556
2660
|
draft.byId[mapId].timeSliderSecondsPerPx = secondsPerPxFromCanvasWidth(timeSliderWidth, draft.byId[mapId].timeSliderSpan || defaultTimeSpan);
|
|
2557
2661
|
},
|
|
2558
2662
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2559
|
-
var _action$
|
|
2560
|
-
mapId = _action$
|
|
2561
|
-
timeSliderCenterTime = _action$
|
|
2663
|
+
var _action$payload14 = action.payload,
|
|
2664
|
+
mapId = _action$payload14.mapId,
|
|
2665
|
+
timeSliderCenterTime = _action$payload14.timeSliderCenterTime;
|
|
2562
2666
|
if (!draft.byId[mapId]) {
|
|
2563
2667
|
return;
|
|
2564
2668
|
}
|
|
2565
2669
|
draft.byId[mapId].timeSliderCenterTime = timeSliderCenterTime;
|
|
2566
2670
|
},
|
|
2567
2671
|
toggleAutoUpdate: function toggleAutoUpdate(draft, action) {
|
|
2568
|
-
var _action$
|
|
2569
|
-
mapId = _action$
|
|
2570
|
-
shouldAutoUpdate = _action$
|
|
2672
|
+
var _action$payload15 = action.payload,
|
|
2673
|
+
mapId = _action$payload15.mapId,
|
|
2674
|
+
shouldAutoUpdate = _action$payload15.shouldAutoUpdate;
|
|
2571
2675
|
if (!draft.byId[mapId]) {
|
|
2572
2676
|
return;
|
|
2573
2677
|
}
|
|
2574
2678
|
draft.byId[mapId].isAutoUpdating = shouldAutoUpdate;
|
|
2575
2679
|
},
|
|
2576
2680
|
setEndTimeOverriding: function setEndTimeOverriding(draft, action) {
|
|
2577
|
-
var _action$
|
|
2578
|
-
mapId = _action$
|
|
2579
|
-
shouldEndtimeOverride = _action$
|
|
2681
|
+
var _action$payload16 = action.payload,
|
|
2682
|
+
mapId = _action$payload16.mapId,
|
|
2683
|
+
shouldEndtimeOverride = _action$payload16.shouldEndtimeOverride;
|
|
2580
2684
|
if (!draft.byId[mapId]) {
|
|
2581
2685
|
return;
|
|
2582
2686
|
}
|
|
2583
2687
|
draft.byId[mapId].shouldEndtimeOverride = shouldEndtimeOverride;
|
|
2584
2688
|
},
|
|
2585
2689
|
toggleTimestepAuto: function toggleTimestepAuto(draft, action) {
|
|
2586
|
-
var _action$
|
|
2587
|
-
mapId = _action$
|
|
2588
|
-
timestepAuto = _action$
|
|
2690
|
+
var _action$payload17 = action.payload,
|
|
2691
|
+
mapId = _action$payload17.mapId,
|
|
2692
|
+
timestepAuto = _action$payload17.timestepAuto;
|
|
2589
2693
|
if (!draft.byId[mapId]) {
|
|
2590
2694
|
return;
|
|
2591
2695
|
}
|
|
2592
2696
|
draft.byId[mapId].isTimestepAuto = timestepAuto;
|
|
2593
2697
|
},
|
|
2594
2698
|
toggleTimeSpanAuto: function toggleTimeSpanAuto(draft, action) {
|
|
2595
|
-
var _action$
|
|
2596
|
-
mapId = _action$
|
|
2597
|
-
timeSpanAuto = _action$
|
|
2699
|
+
var _action$payload18 = action.payload,
|
|
2700
|
+
mapId = _action$payload18.mapId,
|
|
2701
|
+
timeSpanAuto = _action$payload18.timeSpanAuto;
|
|
2598
2702
|
if (!draft.byId[mapId]) {
|
|
2599
2703
|
return;
|
|
2600
2704
|
}
|
|
2601
2705
|
draft.byId[mapId].isTimeSpanAuto = timeSpanAuto;
|
|
2602
2706
|
},
|
|
2707
|
+
/** Superseded by setAnimationLength; removed together with the old animation length button. */
|
|
2603
2708
|
toggleAnimationLengthAuto: function toggleAnimationLengthAuto(draft, action) {
|
|
2604
|
-
var _action$
|
|
2605
|
-
mapId = _action$
|
|
2606
|
-
autoAnimationLength = _action$
|
|
2709
|
+
var _action$payload19 = action.payload,
|
|
2710
|
+
mapId = _action$payload19.mapId,
|
|
2711
|
+
autoAnimationLength = _action$payload19.autoAnimationLength;
|
|
2607
2712
|
if (!draft.byId[mapId]) {
|
|
2608
2713
|
return;
|
|
2609
2714
|
}
|
|
2610
|
-
draft.byId[mapId].
|
|
2715
|
+
draft.byId[mapId].animationLength = autoAnimationLength ? _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2716
|
+
mode: AnimationLengthMode.Auto
|
|
2717
|
+
}) : _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2718
|
+
mode: AnimationLengthMode.Exact,
|
|
2719
|
+
exact: exactSelectionsFrom(draft.byId[mapId].animationLength, draft.byId[mapId].animationStartTime, draft.byId[mapId].animationEndTime)
|
|
2720
|
+
});
|
|
2611
2721
|
},
|
|
2612
2722
|
toggleTimeSliderHover: function toggleTimeSliderHover(draft, action) {
|
|
2613
|
-
var _action$
|
|
2614
|
-
mapId = _action$
|
|
2615
|
-
isTimeSliderHoverOn = _action$
|
|
2723
|
+
var _action$payload20 = action.payload,
|
|
2724
|
+
mapId = _action$payload20.mapId,
|
|
2725
|
+
isTimeSliderHoverOn = _action$payload20.isTimeSliderHoverOn;
|
|
2616
2726
|
if (!draft.byId[mapId]) {
|
|
2617
2727
|
return;
|
|
2618
2728
|
}
|
|
2619
2729
|
draft.byId[mapId].isTimeSliderHoverOn = isTimeSliderHoverOn;
|
|
2620
2730
|
},
|
|
2621
2731
|
toggleTimeSliderIsVisible: function toggleTimeSliderIsVisible(draft, action) {
|
|
2622
|
-
var _action$
|
|
2623
|
-
mapId = _action$
|
|
2624
|
-
isTimeSliderVisible = _action$
|
|
2732
|
+
var _action$payload21 = action.payload,
|
|
2733
|
+
mapId = _action$payload21.mapId,
|
|
2734
|
+
isTimeSliderVisible = _action$payload21.isTimeSliderVisible;
|
|
2625
2735
|
if (!draft.byId[mapId]) {
|
|
2626
2736
|
return;
|
|
2627
2737
|
}
|
|
2628
2738
|
draft.byId[mapId].isTimeSliderVisible = isTimeSliderVisible;
|
|
2629
2739
|
},
|
|
2630
2740
|
toggleZoomControls: function toggleZoomControls(draft, action) {
|
|
2631
|
-
var _action$
|
|
2632
|
-
mapId = _action$
|
|
2633
|
-
shouldShowZoomControls = _action$
|
|
2741
|
+
var _action$payload22 = action.payload,
|
|
2742
|
+
mapId = _action$payload22.mapId,
|
|
2743
|
+
shouldShowZoomControls = _action$payload22.shouldShowZoomControls;
|
|
2634
2744
|
if (!draft.byId[mapId]) {
|
|
2635
2745
|
return;
|
|
2636
2746
|
}
|
|
2637
2747
|
draft.byId[mapId].shouldShowZoomControls = shouldShowZoomControls;
|
|
2638
2748
|
},
|
|
2639
2749
|
setMapPinLocation: function setMapPinLocation(draft, action) {
|
|
2640
|
-
var _action$
|
|
2641
|
-
mapId = _action$
|
|
2642
|
-
mapPinLocation = _action$
|
|
2750
|
+
var _action$payload23 = action.payload,
|
|
2751
|
+
mapId = _action$payload23.mapId,
|
|
2752
|
+
mapPinLocation = _action$payload23.mapPinLocation;
|
|
2643
2753
|
if (!draft.byId[mapId]) {
|
|
2644
2754
|
return;
|
|
2645
2755
|
}
|
|
2646
2756
|
draft.byId[mapId].mapPinLocation = mapPinLocation;
|
|
2647
2757
|
},
|
|
2648
2758
|
setDisableMapPin: function setDisableMapPin(draft, action) {
|
|
2649
|
-
var _action$
|
|
2650
|
-
mapId = _action$
|
|
2651
|
-
disableMapPin = _action$
|
|
2759
|
+
var _action$payload24 = action.payload,
|
|
2760
|
+
mapId = _action$payload24.mapId,
|
|
2761
|
+
disableMapPin = _action$payload24.disableMapPin;
|
|
2652
2762
|
if (!draft.byId[mapId]) {
|
|
2653
2763
|
return;
|
|
2654
2764
|
}
|
|
2655
2765
|
draft.byId[mapId].disableMapPin = disableMapPin;
|
|
2656
2766
|
},
|
|
2657
2767
|
toggleMapPinIsVisible: function toggleMapPinIsVisible(draft, action) {
|
|
2658
|
-
var _action$
|
|
2659
|
-
mapId = _action$
|
|
2660
|
-
displayMapPin = _action$
|
|
2768
|
+
var _action$payload25 = action.payload,
|
|
2769
|
+
mapId = _action$payload25.mapId,
|
|
2770
|
+
displayMapPin = _action$payload25.displayMapPin;
|
|
2661
2771
|
if (!draft.byId[mapId]) {
|
|
2662
2772
|
return;
|
|
2663
2773
|
}
|
|
2664
2774
|
draft.byId[mapId].displayMapPin = displayMapPin;
|
|
2665
2775
|
},
|
|
2666
2776
|
setDockedLayerManagerSize: function setDockedLayerManagerSize(draft, action) {
|
|
2667
|
-
var _action$
|
|
2668
|
-
mapId = _action$
|
|
2669
|
-
dockedLayerManagerSize = _action$
|
|
2777
|
+
var _action$payload26 = action.payload,
|
|
2778
|
+
mapId = _action$payload26.mapId,
|
|
2779
|
+
dockedLayerManagerSize = _action$payload26.dockedLayerManagerSize;
|
|
2670
2780
|
if (!draft.byId[mapId]) {
|
|
2671
2781
|
return;
|
|
2672
2782
|
}
|
|
2673
2783
|
draft.byId[mapId].dockedLayerManagerSize = dockedLayerManagerSize;
|
|
2674
2784
|
},
|
|
2675
2785
|
setDockedLayerManagerPosition: function setDockedLayerManagerPosition(draft, action) {
|
|
2676
|
-
var _action$
|
|
2677
|
-
mapId = _action$
|
|
2678
|
-
dockedLayerManagerPosition = _action$
|
|
2786
|
+
var _action$payload27 = action.payload,
|
|
2787
|
+
mapId = _action$payload27.mapId,
|
|
2788
|
+
dockedLayerManagerPosition = _action$payload27.dockedLayerManagerPosition;
|
|
2679
2789
|
if (!draft.byId[mapId]) {
|
|
2680
2790
|
return;
|
|
2681
2791
|
}
|
|
2682
2792
|
draft.byId[mapId].dockedLayerManagerPosition = dockedLayerManagerPosition;
|
|
2683
2793
|
},
|
|
2684
2794
|
setDockedLayerManagerDimensions: function setDockedLayerManagerDimensions(draft, action) {
|
|
2685
|
-
var _action$
|
|
2686
|
-
mapId = _action$
|
|
2687
|
-
dockedLayerManagerDimensions = _action$
|
|
2795
|
+
var _action$payload28 = action.payload,
|
|
2796
|
+
mapId = _action$payload28.mapId,
|
|
2797
|
+
dockedLayerManagerDimensions = _action$payload28.dockedLayerManagerDimensions;
|
|
2688
2798
|
if (!draft.byId[mapId]) {
|
|
2689
2799
|
return;
|
|
2690
2800
|
}
|
|
2691
2801
|
draft.byId[mapId].dockedLayerManagerDimensions = dockedLayerManagerDimensions;
|
|
2692
2802
|
},
|
|
2803
|
+
setPendingInitialZoomToLayer: function setPendingInitialZoomToLayer(draft, action) {
|
|
2804
|
+
var _action$payload29 = action.payload,
|
|
2805
|
+
mapId = _action$payload29.mapId,
|
|
2806
|
+
layerId = _action$payload29.layerId;
|
|
2807
|
+
if (!draft.byId[mapId]) {
|
|
2808
|
+
return;
|
|
2809
|
+
}
|
|
2810
|
+
draft.byId[mapId].initialZoomToLayerId = layerId;
|
|
2811
|
+
},
|
|
2693
2812
|
setMapPresetError: function setMapPresetError(_draft, _action) {},
|
|
2694
2813
|
setDefaultMapSettings: function setDefaultMapSettings(draft, action) {
|
|
2695
2814
|
draft.defaultMapSettings = action.payload.preset;
|
|
2696
2815
|
},
|
|
2697
2816
|
changeOverlayer: function changeOverlayer(draft, action) {
|
|
2698
|
-
var _action$
|
|
2699
|
-
mapId = _action$
|
|
2700
|
-
selectedOverlayer = _action$
|
|
2817
|
+
var _action$payload30 = action.payload,
|
|
2818
|
+
mapId = _action$payload30.mapId,
|
|
2819
|
+
selectedOverlayer = _action$payload30.selectedOverlayer;
|
|
2701
2820
|
if (!draft.byId[mapId]) {
|
|
2702
2821
|
return;
|
|
2703
2822
|
}
|
|
2704
2823
|
draft.byId[mapId].overLayers = [selectedOverlayer];
|
|
2705
2824
|
},
|
|
2706
2825
|
toggleClock: function toggleClock(draft, action) {
|
|
2707
|
-
var _action$
|
|
2708
|
-
mapId = _action$
|
|
2709
|
-
isClockVisible = _action$
|
|
2826
|
+
var _action$payload31 = action.payload,
|
|
2827
|
+
mapId = _action$payload31.mapId,
|
|
2828
|
+
isClockVisible = _action$payload31.isClockVisible;
|
|
2710
2829
|
if (!draft.byId[mapId]) {
|
|
2711
2830
|
return;
|
|
2712
2831
|
}
|
|
@@ -2717,19 +2836,19 @@ var slice$6 = createSlice({
|
|
|
2717
2836
|
}
|
|
2718
2837
|
},
|
|
2719
2838
|
toggleClockOptions: function toggleClockOptions(draft, action) {
|
|
2720
|
-
var _action$
|
|
2721
|
-
mapId = _action$
|
|
2722
|
-
isClockOptionsMenuVisible = _action$
|
|
2839
|
+
var _action$payload32 = action.payload,
|
|
2840
|
+
mapId = _action$payload32.mapId,
|
|
2841
|
+
isClockOptionsMenuVisible = _action$payload32.isClockOptionsMenuVisible;
|
|
2723
2842
|
if (!draft.byId[mapId]) {
|
|
2724
2843
|
return;
|
|
2725
2844
|
}
|
|
2726
2845
|
draft.byId[mapId].isClockOptionsMenuVisible = isClockOptionsMenuVisible;
|
|
2727
2846
|
},
|
|
2728
2847
|
setClockPositionSize: function setClockPositionSize(draft, action) {
|
|
2729
|
-
var _action$
|
|
2730
|
-
mapId = _action$
|
|
2731
|
-
position = _action$
|
|
2732
|
-
size = _action$
|
|
2848
|
+
var _action$payload33 = action.payload,
|
|
2849
|
+
mapId = _action$payload33.mapId,
|
|
2850
|
+
position = _action$payload33.position,
|
|
2851
|
+
size = _action$payload33.size;
|
|
2733
2852
|
if (!draft.byId[mapId]) {
|
|
2734
2853
|
return;
|
|
2735
2854
|
}
|
|
@@ -2741,10 +2860,10 @@ var slice$6 = createSlice({
|
|
|
2741
2860
|
}
|
|
2742
2861
|
},
|
|
2743
2862
|
setLegendPositionSize: function setLegendPositionSize(draft, action) {
|
|
2744
|
-
var _action$
|
|
2745
|
-
mapId = _action$
|
|
2746
|
-
position = _action$
|
|
2747
|
-
size = _action$
|
|
2863
|
+
var _action$payload34 = action.payload,
|
|
2864
|
+
mapId = _action$payload34.mapId,
|
|
2865
|
+
position = _action$payload34.position,
|
|
2866
|
+
size = _action$payload34.size;
|
|
2748
2867
|
if (!draft.byId[mapId]) {
|
|
2749
2868
|
return;
|
|
2750
2869
|
}
|
|
@@ -2758,10 +2877,10 @@ var slice$6 = createSlice({
|
|
|
2758
2877
|
},
|
|
2759
2878
|
extraReducers: function extraReducers(builder) {
|
|
2760
2879
|
builder.addCase(layerActions.addLayer, function (draft, action) {
|
|
2761
|
-
var _action$
|
|
2762
|
-
layerId = _action$
|
|
2763
|
-
mapId = _action$
|
|
2764
|
-
layer = _action$
|
|
2880
|
+
var _action$payload35 = action.payload,
|
|
2881
|
+
layerId = _action$payload35.layerId,
|
|
2882
|
+
mapId = _action$payload35.mapId,
|
|
2883
|
+
layer = _action$payload35.layer;
|
|
2765
2884
|
if (!draft.byId[mapId]) {
|
|
2766
2885
|
return;
|
|
2767
2886
|
}
|
|
@@ -2780,10 +2899,10 @@ var slice$6 = createSlice({
|
|
|
2780
2899
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
2781
2900
|
}
|
|
2782
2901
|
}).addCase(layerActions.duplicateMapLayer, function (draft, action) {
|
|
2783
|
-
var _action$
|
|
2784
|
-
newLayerId = _action$
|
|
2785
|
-
oldLayerId = _action$
|
|
2786
|
-
mapId = _action$
|
|
2902
|
+
var _action$payload36 = action.payload,
|
|
2903
|
+
newLayerId = _action$payload36.newLayerId,
|
|
2904
|
+
oldLayerId = _action$payload36.oldLayerId,
|
|
2905
|
+
mapId = _action$payload36.mapId;
|
|
2787
2906
|
if (!draft.byId[mapId]) {
|
|
2788
2907
|
return;
|
|
2789
2908
|
}
|
|
@@ -2800,10 +2919,10 @@ var slice$6 = createSlice({
|
|
|
2800
2919
|
draft.byId[mapId].featureLayers.unshift(newLayerId);
|
|
2801
2920
|
}
|
|
2802
2921
|
}).addCase(layerActions.addBaseLayer, function (draft, action) {
|
|
2803
|
-
var _action$
|
|
2804
|
-
layer = _action$
|
|
2805
|
-
layerId = _action$
|
|
2806
|
-
mapId = _action$
|
|
2922
|
+
var _action$payload37 = action.payload,
|
|
2923
|
+
layer = _action$payload37.layer,
|
|
2924
|
+
layerId = _action$payload37.layerId,
|
|
2925
|
+
mapId = _action$payload37.mapId;
|
|
2807
2926
|
if (!draft.byId[mapId]) {
|
|
2808
2927
|
return;
|
|
2809
2928
|
}
|
|
@@ -2833,9 +2952,9 @@ var slice$6 = createSlice({
|
|
|
2833
2952
|
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2834
2953
|
}
|
|
2835
2954
|
}).addCase(layerActions.setBaseLayers, function (draft, action) {
|
|
2836
|
-
var _action$
|
|
2837
|
-
layers = _action$
|
|
2838
|
-
mapId = _action$
|
|
2955
|
+
var _action$payload38 = action.payload,
|
|
2956
|
+
layers = _action$payload38.layers,
|
|
2957
|
+
mapId = _action$payload38.mapId;
|
|
2839
2958
|
// Split into base and overlayers
|
|
2840
2959
|
var baseLayers = [];
|
|
2841
2960
|
var overLayers = [];
|
|
@@ -2865,9 +2984,9 @@ var slice$6 = createSlice({
|
|
|
2865
2984
|
}
|
|
2866
2985
|
}
|
|
2867
2986
|
}).addCase(layerActions.layerDelete, function (draft, action) {
|
|
2868
|
-
var _action$
|
|
2869
|
-
mapId = _action$
|
|
2870
|
-
layerId = _action$
|
|
2987
|
+
var _action$payload39 = action.payload,
|
|
2988
|
+
mapId = _action$payload39.mapId,
|
|
2989
|
+
layerId = _action$payload39.layerId;
|
|
2871
2990
|
var map = draft.byId[mapId];
|
|
2872
2991
|
if (!map) {
|
|
2873
2992
|
return;
|
|
@@ -2893,9 +3012,9 @@ var slice$6 = createSlice({
|
|
|
2893
3012
|
map.autoTimeStepLayerId = activeLayerId;
|
|
2894
3013
|
}
|
|
2895
3014
|
}).addCase(layerActions.baseLayerDelete, function (draft, action) {
|
|
2896
|
-
var _action$
|
|
2897
|
-
mapId = _action$
|
|
2898
|
-
layerId = _action$
|
|
3015
|
+
var _action$payload40 = action.payload,
|
|
3016
|
+
mapId = _action$payload40.mapId,
|
|
3017
|
+
layerId = _action$payload40.layerId;
|
|
2899
3018
|
if (!draft.byId[mapId]) {
|
|
2900
3019
|
return;
|
|
2901
3020
|
}
|
|
@@ -2906,14 +3025,14 @@ var slice$6 = createSlice({
|
|
|
2906
3025
|
return id !== layerId;
|
|
2907
3026
|
});
|
|
2908
3027
|
}).addCase(layerActions.layerChangeDimension, function (draft, action) {
|
|
2909
|
-
var _action$
|
|
2910
|
-
layerId = _action$
|
|
2911
|
-
dimension = _action$
|
|
3028
|
+
var _action$payload41 = action.payload,
|
|
3029
|
+
layerId = _action$payload41.layerId,
|
|
3030
|
+
dimension = _action$payload41.dimension;
|
|
2912
3031
|
produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension);
|
|
2913
3032
|
}).addCase(setTimeSync, function (draft, action) {
|
|
2914
|
-
var _action$
|
|
2915
|
-
targetsFromAction = _action$
|
|
2916
|
-
source = _action$
|
|
3033
|
+
var _action$payload42 = action.payload,
|
|
3034
|
+
targetsFromAction = _action$payload42.targets,
|
|
3035
|
+
source = _action$payload42.source;
|
|
2917
3036
|
var sourceMapId = source === null || source === void 0 ? void 0 : source.payload.sourceId;
|
|
2918
3037
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2919
3038
|
var targets = [];
|
|
@@ -2929,6 +3048,7 @@ var slice$6 = createSlice({
|
|
|
2929
3048
|
var targetId = target.targetId,
|
|
2930
3049
|
value = target.value;
|
|
2931
3050
|
if (draft.byId[targetId]) {
|
|
3051
|
+
var _draft$byId$targetId$;
|
|
2932
3052
|
// SetTimeSliderSpan
|
|
2933
3053
|
if (value !== null && value !== void 0 && value.timeSliderSpan) {
|
|
2934
3054
|
produceTimeSliderTimeSpan(draft, targetId, value.timeSliderSpan);
|
|
@@ -2955,6 +3075,13 @@ var slice$6 = createSlice({
|
|
|
2955
3075
|
if (value !== null && value !== void 0 && value.timeSliderAnimationEndTime) {
|
|
2956
3076
|
draft.byId[targetId].animationEndTime = value.timeSliderAnimationEndTime;
|
|
2957
3077
|
}
|
|
3078
|
+
/* An exact window is the stored range, so a synced range has to move it too. */
|
|
3079
|
+
if ((value !== null && value !== void 0 && value.timeSliderAnimationStartTime || value !== null && value !== void 0 && value.timeSliderAnimationEndTime) && (targetId !== sourceMapId || ((_draft$byId$targetId$ = draft.byId[targetId].animationLength) === null || _draft$byId$targetId$ === void 0 ? void 0 : _draft$byId$targetId$.mode) === AnimationLengthMode.Exact)) {
|
|
3080
|
+
draft.byId[targetId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[targetId].animationLength), {}, {
|
|
3081
|
+
mode: AnimationLengthMode.Exact,
|
|
3082
|
+
exact: exactSelectionsFrom(draft.byId[targetId].animationLength, draft.byId[targetId].animationStartTime, draft.byId[targetId].animationEndTime)
|
|
3083
|
+
});
|
|
3084
|
+
}
|
|
2958
3085
|
// SetAnimationDelay
|
|
2959
3086
|
if (value !== null && value !== void 0 && value.timeSliderAnimationDelay) {
|
|
2960
3087
|
draft.byId[targetId].animationDelay = value.timeSliderAnimationDelay;
|
|
@@ -2971,9 +3098,9 @@ var slice$6 = createSlice({
|
|
|
2971
3098
|
}
|
|
2972
3099
|
});
|
|
2973
3100
|
}).addCase(setBboxSync, function (draft, action) {
|
|
2974
|
-
var _action$
|
|
2975
|
-
targetsFromAction = _action$
|
|
2976
|
-
source = _action$
|
|
3101
|
+
var _action$payload43 = action.payload,
|
|
3102
|
+
targetsFromAction = _action$payload43.targets,
|
|
3103
|
+
source = _action$payload43.source;
|
|
2977
3104
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2978
3105
|
var targets = [];
|
|
2979
3106
|
if (source) {
|
|
@@ -3005,9 +3132,9 @@ var slice$6 = createSlice({
|
|
|
3005
3132
|
* These targets can be used as payloads in new Layer actions.
|
|
3006
3133
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
3007
3134
|
*/
|
|
3008
|
-
var _action$
|
|
3009
|
-
targets = _action$
|
|
3010
|
-
source = _action$
|
|
3135
|
+
var _action$payload44 = action.payload,
|
|
3136
|
+
targets = _action$payload44.targets,
|
|
3137
|
+
source = _action$payload44.source;
|
|
3011
3138
|
return targets.reduce(function (prevState, target) {
|
|
3012
3139
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
3013
3140
|
var action = {
|
|
@@ -3029,9 +3156,9 @@ var slice$6 = createSlice({
|
|
|
3029
3156
|
});
|
|
3030
3157
|
return draft;
|
|
3031
3158
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
3032
|
-
var _action$
|
|
3033
|
-
mapId = _action$
|
|
3034
|
-
dimensionFromAction = _action$
|
|
3159
|
+
var _action$payload45 = action.payload,
|
|
3160
|
+
mapId = _action$payload45.mapId,
|
|
3161
|
+
dimensionFromAction = _action$payload45.dimension;
|
|
3035
3162
|
produceDraftStateSetWebMapDimension(draft, mapId, dimensionFromAction, true);
|
|
3036
3163
|
}).addCase(setMapPreset, function (draft, action) {
|
|
3037
3164
|
var mapId = action.payload.mapId;
|
|
@@ -6796,13 +6923,24 @@ var isTimestepAuto = createSelector(getMapById, function (store) {
|
|
|
6796
6923
|
return store ? store.isTimestepAuto : false;
|
|
6797
6924
|
}, selectorMemoizationOptions);
|
|
6798
6925
|
/**
|
|
6799
|
-
* Returns
|
|
6926
|
+
* Returns how the animation length is determined for the map
|
|
6927
|
+
* @param {object} store store: object - store object
|
|
6928
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
6929
|
+
* @returns {AnimationLengthSetting | undefined} returnType: AnimationLengthSetting
|
|
6930
|
+
*/
|
|
6931
|
+
var getAnimationLength = createSelector(getMapById, function (store) {
|
|
6932
|
+
return store === null || store === void 0 ? void 0 : store.animationLength;
|
|
6933
|
+
}, selectorMemoizationOptions);
|
|
6934
|
+
/**
|
|
6935
|
+
* Returns map is animation auto. Superseded by getAnimationLength; removed
|
|
6936
|
+
* together with the old animation length button.
|
|
6800
6937
|
* @param {object} store store: object - store object
|
|
6801
6938
|
* @param {string} mapId mapId: string - Id of the map
|
|
6802
6939
|
* @returns {boolean} returnType: boolean
|
|
6803
6940
|
*/
|
|
6804
6941
|
var isAnimationLengthAuto = createSelector(getMapById, function (store) {
|
|
6805
|
-
|
|
6942
|
+
var _store$animationLengt;
|
|
6943
|
+
return (store === null || store === void 0 || (_store$animationLengt = store.animationLength) === null || _store$animationLengt === void 0 ? void 0 : _store$animationLengt.mode) === AnimationLengthMode.Auto;
|
|
6806
6944
|
}, selectorMemoizationOptions);
|
|
6807
6945
|
/**
|
|
6808
6946
|
* Returns map is timespan auto
|
|
@@ -7033,7 +7171,7 @@ var getLegendSize = createSelector(getMapById, function (store) {
|
|
|
7033
7171
|
* @param {boolean} keepAllDims? keepAllDims: boolean - default false: whether or not to leave the time and reference_time dimentions
|
|
7034
7172
|
* @returns {MapPreset} returnType: MapPreset
|
|
7035
7173
|
*/
|
|
7036
|
-
var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, getMapTimeSliderSpan, getMapDimensions, isTimestepAuto, isTimeSpanAuto, function (store, mapId) {
|
|
7174
|
+
var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, getMapTimeSliderSpan, getMapDimensions, isTimestepAuto, isTimeSpanAuto, getAnimationLength, function (store, mapId) {
|
|
7037
7175
|
var _getMapById$dockedLay, _getMapById;
|
|
7038
7176
|
return (_getMapById$dockedLay = (_getMapById = getMapById(store, mapId)) === null || _getMapById === void 0 ? void 0 : _getMapById.dockedLayerManagerSize) !== null && _getMapById$dockedLay !== void 0 ? _getMapById$dockedLay : 'sizeSmall';
|
|
7039
7177
|
}, function (store, mapId) {
|
|
@@ -7050,9 +7188,9 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
7050
7188
|
}, function (_store, _mapId) {
|
|
7051
7189
|
var keepAllDims = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7052
7190
|
return keepAllDims;
|
|
7053
|
-
}, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, animationStartTime, animationEndTime, timeSliderSpan, mapDimensions, isTimestepAuto, isTimeSpanAuto, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, isClockVisible, isClockOptionsMenuVisible, clockPosition, clockSize, legendPosition, legendSize, uiStore, mapId, keepAllDims) {
|
|
7191
|
+
}, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, animationStartTime, animationEndTime, timeSliderSpan, mapDimensions, isTimestepAuto, isTimeSpanAuto, animationLength, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, isClockVisible, isClockOptionsMenuVisible, clockPosition, clockSize, legendPosition, legendSize, uiStore, mapId, keepAllDims) {
|
|
7054
7192
|
var _overLayers$, _uiStore$dialogs$isOp, _uiStore$dialogs;
|
|
7055
|
-
var defaultOverlayer = arguments.length >
|
|
7193
|
+
var defaultOverlayer = arguments.length > 34 && arguments[34] !== undefined ? arguments[34] : ((_overLayers$ = overLayers[0]) === null || _overLayers$ === void 0 ? void 0 : _overLayers$.name) || 'none';
|
|
7056
7194
|
var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_ref3) {
|
|
7057
7195
|
_ref3.mapId;
|
|
7058
7196
|
var layer = _objectWithoutProperties(_ref3, _excluded$2);
|
|
@@ -7072,11 +7210,13 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
7072
7210
|
}
|
|
7073
7211
|
return layer;
|
|
7074
7212
|
});
|
|
7075
|
-
var animationPayload = {
|
|
7213
|
+
var animationPayload = _objectSpread2({
|
|
7076
7214
|
interval: mapTimeStep,
|
|
7077
7215
|
speed: mapAnimationDelay ? getSpeedFactor(mapAnimationDelay) : 1,
|
|
7078
7216
|
duration: getAnimationDuration(animationEndTime, animationStartTime)
|
|
7079
|
-
}
|
|
7217
|
+
}, animationLength && {
|
|
7218
|
+
animationLength: animationLength
|
|
7219
|
+
});
|
|
7080
7220
|
var shouldShowLegend = (_uiStore$dialogs$isOp = uiStore === null || uiStore === void 0 || (_uiStore$dialogs = uiStore.dialogs["".concat(DialogTypes.Legend, "-").concat(mapId)]) === null || _uiStore$dialogs === void 0 ? void 0 : _uiStore$dialogs.isOpen) !== null && _uiStore$dialogs$isOp !== void 0 ? _uiStore$dialogs$isOp : false;
|
|
7081
7221
|
var legendPreset = shouldShowLegend ? _objectSpread2(_objectSpread2({}, legendPosition !== undefined && {
|
|
7082
7222
|
legendPosition: legendPosition
|
|
@@ -7311,7 +7451,7 @@ var getAnimationListAsEpochTimes = createSelector(getAnimationList, function (li
|
|
|
7311
7451
|
* @param {string} mapId mapId: string - Id of the map
|
|
7312
7452
|
* @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.
|
|
7313
7453
|
*/
|
|
7314
|
-
var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime,
|
|
7454
|
+
var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime, getAnimationLength, function (layers, autoTimeStepLayerId, startTime, endTime, animationLength) {
|
|
7315
7455
|
var _layers$autoTimeStepL2;
|
|
7316
7456
|
var layerTimeDimension = autoTimeStepLayerId && (layers === null || layers === void 0 || (_layers$autoTimeStepL2 = layers[autoTimeStepLayerId]) === null || _layers$autoTimeStepL2 === void 0 || (_layers$autoTimeStepL2 = _layers$autoTimeStepL2.dimensions) === null || _layers$autoTimeStepL2 === void 0 ? void 0 : _layers$autoTimeStepL2.find(function (dimension) {
|
|
7317
7457
|
return dimension.name === 'time';
|
|
@@ -7320,8 +7460,9 @@ var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, ge
|
|
|
7320
7460
|
minValue = _ref5.minValue,
|
|
7321
7461
|
maxValue = _ref5.maxValue;
|
|
7322
7462
|
var hasTimeDimension = minValue && maxValue;
|
|
7323
|
-
var
|
|
7324
|
-
var
|
|
7463
|
+
var shouldFollowAutoTimeStepLayer = (animationLength === null || animationLength === void 0 ? void 0 : animationLength.mode) === AnimationLengthMode.Auto && !!autoTimeStepLayerId && !!hasTimeDimension;
|
|
7464
|
+
var animationStartTime = shouldFollowAutoTimeStepLayer ? minValue : startTime;
|
|
7465
|
+
var animationEndTime = shouldFollowAutoTimeStepLayer ? maxValue : endTime;
|
|
7325
7466
|
return {
|
|
7326
7467
|
animationStartTime: animationStartTime,
|
|
7327
7468
|
animationEndTime: animationEndTime
|
|
@@ -7363,6 +7504,12 @@ var getSelectedOverlayerByMapId = createSelector(getMapById, function (store) {
|
|
|
7363
7504
|
var getRefTimeDimensionModes = createSelector(getdefaultMapSettings, function (state) {
|
|
7364
7505
|
return state === null || state === void 0 ? void 0 : state.refTimeDimensionModes;
|
|
7365
7506
|
}, selectorMemoizationOptions);
|
|
7507
|
+
/**
|
|
7508
|
+
* Gets the initialZoomToLayerId flag from map state
|
|
7509
|
+
*/
|
|
7510
|
+
var getInitialZoomToLayerId = createSelector(getMapById, function (map) {
|
|
7511
|
+
return map === null || map === void 0 ? void 0 : map.initialZoomToLayerId;
|
|
7512
|
+
}, selectorMemoizationOptions);
|
|
7366
7513
|
|
|
7367
7514
|
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
7368
7515
|
__proto__: null,
|
|
@@ -7371,6 +7518,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
7371
7518
|
getAllMapsByIds: getAllMapsByIds,
|
|
7372
7519
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
7373
7520
|
getAnimationEndTime: getAnimationEndTime,
|
|
7521
|
+
getAnimationLength: getAnimationLength,
|
|
7374
7522
|
getAnimationList: getAnimationList,
|
|
7375
7523
|
getAnimationListAsEpochTimes: getAnimationListAsEpochTimes,
|
|
7376
7524
|
getAnimationRange: getAnimationRange,
|
|
@@ -7389,6 +7537,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
7389
7537
|
getFirstMap: getFirstMap,
|
|
7390
7538
|
getFirstMapId: getFirstMapId,
|
|
7391
7539
|
getHarmonieInitialProps: getHarmonieInitialProps,
|
|
7540
|
+
getInitialZoomToLayerId: getInitialZoomToLayerId,
|
|
7392
7541
|
getIsClockOptionsMenuVisible: getIsClockOptionsMenuVisible,
|
|
7393
7542
|
getIsClockVisible: getIsClockVisible,
|
|
7394
7543
|
getIsEnabledLayersForMapDimension: getIsEnabledLayersForMapDimension,
|
|
@@ -7941,16 +8090,22 @@ genericListener.startListening({
|
|
|
7941
8090
|
});
|
|
7942
8091
|
// Synchronize timeslider settings for actions 'centertime', 'span' and 'timestep'.
|
|
7943
8092
|
genericListener.startListening({
|
|
7944
|
-
matcher: isAnyOf(mapActions.setTimeSliderCenterTime, mapActions.setTimeSliderSpan, mapActions.setTimeStep, mapActions.setAnimationStartTime, mapActions.setAnimationEndTime, mapActions.setAnimationDelay, mapActions.mapStartAnimation),
|
|
8093
|
+
matcher: isAnyOf(mapActions.setTimeSliderCenterTime, mapActions.setTimeSliderSpan, mapActions.setTimeStep, mapActions.setAnimationStartTime, mapActions.setAnimationEndTime, mapActions.setAnimationLength, mapActions.refreshAnimationRange, mapActions.setAnimationDelay, mapActions.mapStartAnimation),
|
|
7945
8094
|
effect: function () {
|
|
7946
8095
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref2, listenerApi) {
|
|
7947
|
-
var payload, type, sourceId, newPayload, animationStartPayload, targets, groups;
|
|
8096
|
+
var payload, type, sourceId, newPayload, _mapSelectors$getAnim, animationStartTime, animationEndTime, animationStartPayload, targets, groups;
|
|
7948
8097
|
return _regenerator().w(function (_context2) {
|
|
7949
8098
|
while (1) switch (_context2.n) {
|
|
7950
8099
|
case 0:
|
|
7951
8100
|
payload = _ref2.payload, type = _ref2.type;
|
|
7952
8101
|
listenerApi.cancelActiveListeners();
|
|
7953
8102
|
sourceId = payload.mapId;
|
|
8103
|
+
if (!((type === mapActions.setAnimationLength.type || type === mapActions.setAnimationStartTime.type || type === mapActions.setAnimationEndTime.type) && payload.skipSync)) {
|
|
8104
|
+
_context2.n = 1;
|
|
8105
|
+
break;
|
|
8106
|
+
}
|
|
8107
|
+
return _context2.a(2);
|
|
8108
|
+
case 1:
|
|
7954
8109
|
newPayload = {
|
|
7955
8110
|
sourceId: sourceId,
|
|
7956
8111
|
origin: 'timeslidersynclistener',
|
|
@@ -7963,6 +8118,11 @@ genericListener.startListening({
|
|
|
7963
8118
|
timeSliderAnimationDelay: type === mapActions.setAnimationDelay.type ? payload.animationDelay : undefined
|
|
7964
8119
|
}
|
|
7965
8120
|
};
|
|
8121
|
+
if (type === mapActions.setAnimationLength.type || type === mapActions.refreshAnimationRange.type) {
|
|
8122
|
+
_mapSelectors$getAnim = getAnimationRange(listenerApi.getState(), sourceId), animationStartTime = _mapSelectors$getAnim.animationStartTime, animationEndTime = _mapSelectors$getAnim.animationEndTime;
|
|
8123
|
+
newPayload.value.timeSliderAnimationStartTime = animationStartTime;
|
|
8124
|
+
newPayload.value.timeSliderAnimationEndTime = animationEndTime;
|
|
8125
|
+
}
|
|
7966
8126
|
if (type === mapActions.mapStartAnimation.type) {
|
|
7967
8127
|
animationStartPayload = payload;
|
|
7968
8128
|
if (animationStartPayload.start) {
|
|
@@ -7975,7 +8135,7 @@ genericListener.startListening({
|
|
|
7975
8135
|
targets = getTargets(listenerApi.getState(), newPayload, SYNCGROUPS_TYPE_SETTIME);
|
|
7976
8136
|
groups = getTargetGroups(listenerApi.getState(), newPayload, SYNCGROUPS_TYPE_SETTIME);
|
|
7977
8137
|
listenerApi.dispatch(setTimeSync(newPayload, targets, groups));
|
|
7978
|
-
case
|
|
8138
|
+
case 2:
|
|
7979
8139
|
return _context2.a(2);
|
|
7980
8140
|
}
|
|
7981
8141
|
}, _callee2);
|
|
@@ -8286,6 +8446,41 @@ var setStep = function setStep(timerId, timerStep) {
|
|
|
8286
8446
|
var getCurrentStep = function getCurrentStep(timerId) {
|
|
8287
8447
|
return stepMap.get(timerId) || 0;
|
|
8288
8448
|
};
|
|
8449
|
+
/**
|
|
8450
|
+
* Re-anchors the step index to the frame closest to what's already showing.
|
|
8451
|
+
* Without this, a range change while animating leaves the index pointing at
|
|
8452
|
+
* the same position in the (now different) frame list, so playback silently
|
|
8453
|
+
* jumps by however far the range moved instead of continuing smoothly.
|
|
8454
|
+
* @param timerId
|
|
8455
|
+
* @param listenerApi
|
|
8456
|
+
*/
|
|
8457
|
+
var preserveAnimationStep = function preserveAnimationStep(timerId, listenerApi) {
|
|
8458
|
+
var _mapSelectors$getMapD;
|
|
8459
|
+
var state = listenerApi.getState();
|
|
8460
|
+
if (!isAnimating(state, timerId)) {
|
|
8461
|
+
return;
|
|
8462
|
+
}
|
|
8463
|
+
var currentTime = (_mapSelectors$getMapD = getMapDimension(state, timerId, 'time')) === null || _mapSelectors$getMapD === void 0 ? void 0 : _mapSelectors$getMapD.currentValue;
|
|
8464
|
+
var currentInstant = currentTime && dateUtils.parseISO(currentTime);
|
|
8465
|
+
if (!currentInstant || !dateUtils.isValid(currentInstant)) {
|
|
8466
|
+
return;
|
|
8467
|
+
}
|
|
8468
|
+
var animationList = getAnimationList(state, timerId).map(function (_ref) {
|
|
8469
|
+
var value = _ref.value;
|
|
8470
|
+
return value;
|
|
8471
|
+
});
|
|
8472
|
+
if (animationList.length === 0) {
|
|
8473
|
+
return;
|
|
8474
|
+
}
|
|
8475
|
+
var currentUnix = dateUtils.unix(currentInstant);
|
|
8476
|
+
var distances = animationList.map(function (value) {
|
|
8477
|
+
return Math.abs(dateUtils.unix(dateUtils.parseISO(value)) - currentUnix);
|
|
8478
|
+
});
|
|
8479
|
+
var nearestStep = distances.reduce(function (closest, distance, index) {
|
|
8480
|
+
return distance < distances[closest] ? index : closest;
|
|
8481
|
+
}, 0);
|
|
8482
|
+
setStep(timerId, nearestStep);
|
|
8483
|
+
};
|
|
8289
8484
|
/**
|
|
8290
8485
|
* Checks if the next step is available for all provided layers
|
|
8291
8486
|
* @param reduxLayers
|
|
@@ -8343,72 +8538,66 @@ var isNextStepAvailable = function isNextStepAvailable(reduxLayers, nextTimeStri
|
|
|
8343
8538
|
*/
|
|
8344
8539
|
var olMetronomeHandler = function olMetronomeHandler(timerIds, listenerApi) {
|
|
8345
8540
|
var targetsWithUpdateValue = [];
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8541
|
+
timerIds.forEach(function (timerId) {
|
|
8542
|
+
var animationListValuesNameAndValue = getAnimationList(listenerApi.getState(), timerId);
|
|
8543
|
+
var animationListValues = animationListValuesNameAndValue.map(function (nameAndValue) {
|
|
8544
|
+
return nameAndValue.value;
|
|
8545
|
+
});
|
|
8546
|
+
if (animationListValues.length === 0) {
|
|
8547
|
+
return;
|
|
8548
|
+
}
|
|
8549
|
+
var targets = getTargets(listenerApi.getState(), {
|
|
8550
|
+
sourceId: timerId,
|
|
8551
|
+
origin: timerId
|
|
8552
|
+
}, SYNCGROUPS_TYPE_SETTIME);
|
|
8553
|
+
if (targets.length === 0) {
|
|
8554
|
+
// When there are no targets, default to one
|
|
8555
|
+
targets.push({
|
|
8556
|
+
targetId: timerId,
|
|
8557
|
+
value: {
|
|
8558
|
+
currentTime: ''
|
|
8559
|
+
}
|
|
8354
8560
|
});
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
currentTime: ''
|
|
8365
|
-
}
|
|
8366
|
-
});
|
|
8367
|
-
}
|
|
8368
|
-
if (!targets.some(function (target) {
|
|
8369
|
-
return target.targetId === timerId;
|
|
8370
|
-
})) {
|
|
8371
|
-
targets.push({
|
|
8372
|
-
targetId: timerId,
|
|
8373
|
-
value: {
|
|
8374
|
-
currentTime: ''
|
|
8375
|
-
}
|
|
8376
|
-
});
|
|
8377
|
-
}
|
|
8378
|
-
var timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
|
|
8379
|
-
// Collect all layers for this syncgroups target
|
|
8380
|
-
var reduxLayers = [];
|
|
8381
|
-
targets.forEach(function (target) {
|
|
8382
|
-
reduxLayers.push.apply(reduxLayers, _toConsumableArray(getLayersByMapId(listenerApi.getState(), target.targetId).filter(function (layer) {
|
|
8383
|
-
return layer.layerType === LayerType.mapLayer;
|
|
8384
|
-
})));
|
|
8561
|
+
}
|
|
8562
|
+
if (!targets.some(function (target) {
|
|
8563
|
+
return target.targetId === timerId;
|
|
8564
|
+
})) {
|
|
8565
|
+
targets.push({
|
|
8566
|
+
targetId: timerId,
|
|
8567
|
+
value: {
|
|
8568
|
+
currentTime: ''
|
|
8569
|
+
}
|
|
8385
8570
|
});
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
return _objectSpread2(_objectSpread2({}, target), {}, {
|
|
8394
|
-
value: {
|
|
8395
|
-
currentTime: updatedValue
|
|
8396
|
-
}
|
|
8397
|
-
});
|
|
8571
|
+
}
|
|
8572
|
+
var timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
|
|
8573
|
+
// Collect all layers for this syncgroups target
|
|
8574
|
+
var reduxLayers = [];
|
|
8575
|
+
targets.forEach(function (target) {
|
|
8576
|
+
reduxLayers.push.apply(reduxLayers, _toConsumableArray(getLayersByMapId(listenerApi.getState(), target.targetId).filter(function (layer) {
|
|
8577
|
+
return layer.layerType === LayerType.mapLayer;
|
|
8398
8578
|
})));
|
|
8399
|
-
|
|
8400
|
-
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8579
|
+
});
|
|
8580
|
+
var nextStep = getNextStep(timerId, animationListValues.length, 1);
|
|
8581
|
+
var timerShouldStepForward = isNextStepAvailable(reduxLayers, animationListValues[nextStep]) && !timerIsInDwell;
|
|
8582
|
+
// Determine the next step
|
|
8583
|
+
var timerStep = timerShouldStepForward ? getNextStep(timerId, animationListValues.length) : getCurrentStep(timerId);
|
|
8584
|
+
if (timerStep < 0 || timerStep >= animationListValues.length) {
|
|
8585
|
+
return;
|
|
8405
8586
|
}
|
|
8406
|
-
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8587
|
+
setStep(timerId, timerStep);
|
|
8588
|
+
var updatedValue = animationListValues[timerStep];
|
|
8589
|
+
targetsWithUpdateValue.push.apply(targetsWithUpdateValue, _toConsumableArray(targets.map(function (target) {
|
|
8590
|
+
return _objectSpread2(_objectSpread2({}, target), {}, {
|
|
8591
|
+
value: {
|
|
8592
|
+
currentTime: updatedValue
|
|
8593
|
+
}
|
|
8594
|
+
});
|
|
8595
|
+
})));
|
|
8596
|
+
var speedDelay = getMapAnimationDelay(listenerApi.getState(), timerId);
|
|
8597
|
+
var speed = 1000 / (speedDelay || 1);
|
|
8598
|
+
metronome.setSpeed(timerId, speed);
|
|
8599
|
+
});
|
|
8600
|
+
// Update all targets of all sync groups in one action.
|
|
8412
8601
|
if (targetsWithUpdateValue.length > 0) {
|
|
8413
8602
|
// This ensures the source value is stored in the syncgroup
|
|
8414
8603
|
var metronomelistenersource = {
|
|
@@ -8471,6 +8660,7 @@ mapListener.startListening({
|
|
|
8471
8660
|
mapId: mapId
|
|
8472
8661
|
}));
|
|
8473
8662
|
}
|
|
8663
|
+
updateAnimationMode(mapId, listenerApi);
|
|
8474
8664
|
}
|
|
8475
8665
|
});
|
|
8476
8666
|
// update layer, synced maps and animation on latest max time if autoupdating
|
|
@@ -8492,10 +8682,21 @@ mapListener.startListening({
|
|
|
8492
8682
|
var newTimeDimension = dimensions.find(function (dimension) {
|
|
8493
8683
|
return dimension.name === 'time';
|
|
8494
8684
|
});
|
|
8685
|
+
var hasReferenceTimeDimension = dimensions.some(function (dimension) {
|
|
8686
|
+
return dimension.name === 'reference_time';
|
|
8687
|
+
});
|
|
8495
8688
|
var mapId = layer.mapId;
|
|
8496
8689
|
if (!mapId) {
|
|
8497
8690
|
return;
|
|
8498
8691
|
}
|
|
8692
|
+
if (hasReferenceTimeDimension) {
|
|
8693
|
+
var _layerSelectors$getLa, _layerSelectors$getLa2;
|
|
8694
|
+
var previousReferenceTime = (_layerSelectors$getLa = getLayerDimension(listenerApi.getOriginalState(), layerId, 'reference_time')) === null || _layerSelectors$getLa === void 0 ? void 0 : _layerSelectors$getLa.currentValue;
|
|
8695
|
+
var referenceTime = (_layerSelectors$getLa2 = getLayerDimension(listenerApi.getState(), layerId, 'reference_time')) === null || _layerSelectors$getLa2 === void 0 ? void 0 : _layerSelectors$getLa2.currentValue;
|
|
8696
|
+
if (referenceTime && referenceTime !== previousReferenceTime) {
|
|
8697
|
+
updateReferenceTimeAnimationRange(mapId, layerId, referenceTime, listenerApi);
|
|
8698
|
+
}
|
|
8699
|
+
}
|
|
8499
8700
|
listenerApi.dispatch(mapActions.mapUpdateAllMapDimensions({
|
|
8500
8701
|
mapId: mapId,
|
|
8501
8702
|
dimensions: getMapDimensionsFromLayers(listenerApi.getState(), mapId),
|
|
@@ -8559,9 +8760,16 @@ mapListener.startListening({
|
|
|
8559
8760
|
}
|
|
8560
8761
|
}
|
|
8561
8762
|
});
|
|
8763
|
+
/** Auto follows the leading layer and the anchored modes follow the clock, so none may be shifted by layer updates. */
|
|
8764
|
+
var derivesOwnAnimationRange = function derivesOwnAnimationRange(animationLength) {
|
|
8765
|
+
return !!animationLength && animationLength.mode !== AnimationLengthMode.Exact;
|
|
8766
|
+
};
|
|
8562
8767
|
var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
|
|
8563
8768
|
var shouldEndtimeOverride$1 = shouldEndtimeOverride(listenerApi.getState(), mapId);
|
|
8564
|
-
|
|
8769
|
+
var shiftsWithLayerUpdates = function shiftsWithLayerUpdates(id) {
|
|
8770
|
+
return !derivesOwnAnimationRange(getAnimationLength(listenerApi.getState(), id));
|
|
8771
|
+
};
|
|
8772
|
+
if (shouldEndtimeOverride$1 || !shiftsWithLayerUpdates(mapId)) {
|
|
8565
8773
|
return;
|
|
8566
8774
|
}
|
|
8567
8775
|
var animationStart = getAnimationStartTime(listenerApi.getState(), mapId);
|
|
@@ -8581,7 +8789,7 @@ var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
|
|
|
8581
8789
|
var isSyncedMap = syncedMapIds.includes(mapId);
|
|
8582
8790
|
var mapIdsToUpdate = isSyncedMap ? syncedMapIds : [mapId];
|
|
8583
8791
|
// Update new animation times for the map or in case of syncgroup, all maps in the syncgroup
|
|
8584
|
-
mapIdsToUpdate.forEach(function (id) {
|
|
8792
|
+
mapIdsToUpdate.filter(shiftsWithLayerUpdates).forEach(function (id) {
|
|
8585
8793
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
8586
8794
|
mapId: id,
|
|
8587
8795
|
animationEndTime: newAnimationEndTime
|
|
@@ -8742,7 +8950,7 @@ mapListener.startListening({
|
|
|
8742
8950
|
actionCreator: mapActions.setMapPreset,
|
|
8743
8951
|
effect: function () {
|
|
8744
8952
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref6, listenerApi) {
|
|
8745
|
-
var payload, mapId, initialProps, mapPreset, _mapPreset$dimensions, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, legendPosition, legendSize, shouldShowDockedLayerManager, shouldShowDataExplorer, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, timeSliderSpan, toggleTimeSpanAuto, defaultOverlayer, isClockVisible, isClockOptionsMenuVisible, clockPosition, clockSize, _filterLayers, mapLayers, baseLayers, overLayers, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, _overlayersFromStore$, overlayersFromStore, foundOverlayerId, checkIsprojectionSupported,
|
|
8953
|
+
var payload, mapId, initialProps, mapPreset, _mapPreset$dimensions, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, legendPosition, legendSize, shouldShowDockedLayerManager, shouldShowDataExplorer, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, timeSliderSpan, toggleTimeSpanAuto, defaultOverlayer, isClockVisible, isClockOptionsMenuVisible, clockPosition, clockSize, initialZoomToLayerId, _filterLayers, mapLayers, baseLayers, overLayers, pendingInitialZoomToLayerId, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, _newLayerIds$layers$i, initialZoomLayerIndex, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, _overlayersFromStore$, overlayersFromStore, foundOverlayerId, checkIsprojectionSupported, layerId, animationDuration, animationLengthSetting, animationEndTime, shouldEndtimeOverride, interval, timeAlreadySet, mode, endTimeFromPreset, endTime, startTime, hasNoAnimationDetails, defaultAnimationLengthSetting, effectiveAnimationLengthSetting, animationLength, animationStartTime, _autoTimeStepLayerId, layerRefTimeDimension, referenceTimeFromLayer, anchorTime, resolvedRange, shouldOpenLegend, dockedLayerManagerType, fiveMinuteDelayForAnimation, animationEnd, animationStart, _t;
|
|
8746
8954
|
return _regenerator().w(function (_context2) {
|
|
8747
8955
|
while (1) switch (_context2.p = _context2.n) {
|
|
8748
8956
|
case 0:
|
|
@@ -8751,11 +8959,12 @@ mapListener.startListening({
|
|
|
8751
8959
|
mapId = payload.mapId, initialProps = payload.initialProps;
|
|
8752
8960
|
mapPreset = initialProps.mapPreset;
|
|
8753
8961
|
if (!mapPreset) {
|
|
8754
|
-
_context2.n =
|
|
8962
|
+
_context2.n = 9;
|
|
8755
8963
|
break;
|
|
8756
8964
|
}
|
|
8757
|
-
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, legendPosition = mapPreset.legendPosition, legendSize = mapPreset.legendSize, shouldShowDockedLayerManager = mapPreset.shouldShowDockedLayerManager, shouldShowDataExplorer = mapPreset.shouldShowDataExplorer, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, dockedLayerManagerPosition = mapPreset.dockedLayerManagerPosition, dockedLayerManagerDimensions = mapPreset.dockedLayerManagerDimensions, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto, defaultOverlayer = mapPreset.defaultOverlayer, isClockVisible = mapPreset.isClockVisible, isClockOptionsMenuVisible = mapPreset.isClockOptionsMenuVisible, clockPosition = mapPreset.clockPosition, clockSize = mapPreset.clockSize;
|
|
8965
|
+
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, legendPosition = mapPreset.legendPosition, legendSize = mapPreset.legendSize, shouldShowDockedLayerManager = mapPreset.shouldShowDockedLayerManager, shouldShowDataExplorer = mapPreset.shouldShowDataExplorer, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, dockedLayerManagerPosition = mapPreset.dockedLayerManagerPosition, dockedLayerManagerDimensions = mapPreset.dockedLayerManagerDimensions, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto, defaultOverlayer = mapPreset.defaultOverlayer, isClockVisible = mapPreset.isClockVisible, isClockOptionsMenuVisible = mapPreset.isClockOptionsMenuVisible, clockPosition = mapPreset.clockPosition, clockSize = mapPreset.clockSize, initialZoomToLayerId = mapPreset.initialZoomToLayerId;
|
|
8758
8966
|
_filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
|
|
8967
|
+
pendingInitialZoomToLayerId = null;
|
|
8759
8968
|
if (layers) {
|
|
8760
8969
|
// make sure all layers have a unique id before going forward
|
|
8761
8970
|
autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
@@ -8780,6 +8989,12 @@ mapListener.startListening({
|
|
|
8780
8989
|
newAutoUpdateLayerId = ((_newLayerIds$layers$f2 = newLayerIds.layers.find(function (layer) {
|
|
8781
8990
|
return layer.id === newLayerIds.autoUpdateLayerId;
|
|
8782
8991
|
})) === null || _newLayerIds$layers$f2 === void 0 ? void 0 : _newLayerIds$layers$f2.id) || undefined;
|
|
8992
|
+
if (initialZoomToLayerId) {
|
|
8993
|
+
initialZoomLayerIndex = mapLayers.findIndex(function (layer) {
|
|
8994
|
+
return layer.id === initialZoomToLayerId;
|
|
8995
|
+
});
|
|
8996
|
+
pendingInitialZoomToLayerId = initialZoomLayerIndex >= 0 ? (_newLayerIds$layers$i = newLayerIds.layers[initialZoomLayerIndex]) === null || _newLayerIds$layers$i === void 0 ? void 0 : _newLayerIds$layers$i.id : undefined;
|
|
8997
|
+
}
|
|
8783
8998
|
listenerApi.dispatch(mapActions.setAutoLayerId({
|
|
8784
8999
|
mapId: mapId,
|
|
8785
9000
|
autoTimeStepLayerId: newAutoTimeStepLayerId,
|
|
@@ -8823,14 +9038,29 @@ mapListener.startListening({
|
|
|
8823
9038
|
}
|
|
8824
9039
|
throw new Error("Projection ".concat(proj.srs, " is not supported"));
|
|
8825
9040
|
case 2:
|
|
9041
|
+
listenerApi.dispatch(mapActions.setPendingInitialZoomToLayer({
|
|
9042
|
+
mapId: mapId,
|
|
9043
|
+
layerId: undefined
|
|
9044
|
+
}));
|
|
8826
9045
|
// set bbox
|
|
8827
9046
|
listenerApi.dispatch(mapActions.setBbox({
|
|
8828
9047
|
mapId: mapId,
|
|
8829
9048
|
bbox: proj.bbox,
|
|
8830
9049
|
srs: proj.srs
|
|
8831
9050
|
}));
|
|
9051
|
+
_context2.n = 4;
|
|
9052
|
+
break;
|
|
8832
9053
|
case 3:
|
|
8833
|
-
|
|
9054
|
+
layerId = pendingInitialZoomToLayerId ||
|
|
9055
|
+
// if not set in preset use first layer to determine initial bbox
|
|
9056
|
+
getLayerIds(listenerApi.getState(), mapId).at(0);
|
|
9057
|
+
listenerApi.dispatch(mapActions.setPendingInitialZoomToLayer({
|
|
9058
|
+
mapId: mapId,
|
|
9059
|
+
layerId: layerId
|
|
9060
|
+
}));
|
|
9061
|
+
case 4:
|
|
9062
|
+
animationDuration = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.duration;
|
|
9063
|
+
animationLengthSetting = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.animationLength;
|
|
8834
9064
|
animationEndTime = (animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.endTime) && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
8835
9065
|
shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
8836
9066
|
if (shouldEndtimeOverride) {
|
|
@@ -8932,53 +9162,115 @@ mapListener.startListening({
|
|
|
8932
9162
|
// If set, don't dispatch setTime action
|
|
8933
9163
|
timeAlreadySet = (_mapPreset$dimensions = mapPreset.dimensions) === null || _mapPreset$dimensions === void 0 ? void 0 : _mapPreset$dimensions.find(function (dimension) {
|
|
8934
9164
|
return dimension.name === 'time';
|
|
8935
|
-
});
|
|
8936
|
-
if (animationEndTime) {
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
origin: 'map/listener.ts, setMapPreset',
|
|
8952
|
-
sourceId: mapId,
|
|
8953
|
-
value: {
|
|
8954
|
-
currentTime: startTime
|
|
8955
|
-
}
|
|
8956
|
-
}));
|
|
9165
|
+
});
|
|
9166
|
+
if (!(animationEndTime || animationDuration)) {
|
|
9167
|
+
_context2.n = 6;
|
|
9168
|
+
break;
|
|
9169
|
+
}
|
|
9170
|
+
// set animationEndTime by endTime of animationPayload
|
|
9171
|
+
// set animationStartTime by endTime minus duration of animationPayload
|
|
9172
|
+
mode = function () {
|
|
9173
|
+
if (animationEndTime) {
|
|
9174
|
+
if (animationEndTime.includes('TODAY')) {
|
|
9175
|
+
return AnimationLengthMode.RecurringPeriod;
|
|
9176
|
+
}
|
|
9177
|
+
if (animationEndTime.includes('NOW')) {
|
|
9178
|
+
return AnimationLengthMode.Now;
|
|
9179
|
+
}
|
|
9180
|
+
return AnimationLengthMode.Exact;
|
|
8957
9181
|
}
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
9182
|
+
return AnimationLengthMode.Now;
|
|
9183
|
+
}();
|
|
9184
|
+
endTimeFromPreset = animationEndTime && (animationEndTime !== null && animationEndTime !== void 0 && animationEndTime.includes('NOW') || animationEndTime !== null && animationEndTime !== void 0 && animationEndTime.includes('TODAY')) ? handleDateUtilsISOString(dateUtils.convertNOWandTODAYFormatsToUTC(animationEndTime)) : animationEndTime;
|
|
9185
|
+
endTime = endTimeFromPreset || getAnimationEndTime(listenerApi.getState(), mapId);
|
|
9186
|
+
if (endTime) {
|
|
9187
|
+
_context2.n = 5;
|
|
9188
|
+
break;
|
|
8963
9189
|
}
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
9190
|
+
return _context2.a(2);
|
|
9191
|
+
case 5:
|
|
9192
|
+
// startTime always relative to endTime
|
|
9193
|
+
startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(endTime), {
|
|
9194
|
+
minutes: animationDuration || 5 * 60 // default 5 hours
|
|
9195
|
+
}).toISOString());
|
|
9196
|
+
listenerApi.dispatch(mapActions.setAnimationLength({
|
|
9197
|
+
mapId: mapId,
|
|
9198
|
+
animationLength: getAnimationLengthFromRange(mode, {
|
|
9199
|
+
animationStartTime: startTime,
|
|
9200
|
+
animationEndTime: endTime
|
|
9201
|
+
}),
|
|
9202
|
+
animationStartTime: startTime,
|
|
9203
|
+
animationEndTime: endTime,
|
|
9204
|
+
skipSync: !!animationLengthSetting
|
|
9205
|
+
}));
|
|
9206
|
+
if (timeAlreadySet === undefined) {
|
|
9207
|
+
listenerApi.dispatch(genericActions.setTime({
|
|
9208
|
+
origin: 'map/listener.ts, setMapPreset',
|
|
9209
|
+
sourceId: mapId,
|
|
9210
|
+
value: {
|
|
9211
|
+
currentTime: startTime
|
|
9212
|
+
}
|
|
8973
9213
|
}));
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
9214
|
+
}
|
|
9215
|
+
case 6:
|
|
9216
|
+
// restores how the animation length is determined, overriding duration and endTime
|
|
9217
|
+
// if preset has no animation details at all: follow the auto-time-step layer if there is one, otherwise Now
|
|
9218
|
+
hasNoAnimationDetails = !animationLengthSetting && !animationDuration && !animationEndTime;
|
|
9219
|
+
defaultAnimationLengthSetting = getAutoTimeStepLayerId(listenerApi.getState(), mapId) ? {
|
|
9220
|
+
mode: AnimationLengthMode.Auto
|
|
9221
|
+
} : {
|
|
9222
|
+
mode: AnimationLengthMode.Now,
|
|
9223
|
+
now: defaultOffsetSelections
|
|
9224
|
+
};
|
|
9225
|
+
effectiveAnimationLengthSetting = function () {
|
|
9226
|
+
if (animationLengthSetting) {
|
|
9227
|
+
return withModeSelections(animationLengthSetting);
|
|
9228
|
+
}
|
|
9229
|
+
if (hasNoAnimationDetails) {
|
|
9230
|
+
return defaultAnimationLengthSetting;
|
|
9231
|
+
}
|
|
9232
|
+
return undefined;
|
|
9233
|
+
}();
|
|
9234
|
+
if (effectiveAnimationLengthSetting) {
|
|
9235
|
+
animationLength = effectiveAnimationLengthSetting;
|
|
9236
|
+
if (animationLength.mode === AnimationLengthMode.Exact) {
|
|
9237
|
+
listenerApi.dispatch(mapActions.setAnimationLength(_objectSpread2(_objectSpread2({
|
|
9238
|
+
mapId: mapId,
|
|
9239
|
+
animationLength: animationLength
|
|
9240
|
+
}, animationLength.exact), {}, {
|
|
9241
|
+
skipSync: true
|
|
9242
|
+
})));
|
|
9243
|
+
animationStartTime = animationLength.exact.animationStartTime;
|
|
9244
|
+
if (timeAlreadySet === undefined) {
|
|
9245
|
+
listenerApi.dispatch(genericActions.setTime({
|
|
9246
|
+
origin: 'map/listener.ts, setAnimationLength',
|
|
9247
|
+
sourceId: mapId,
|
|
9248
|
+
value: {
|
|
9249
|
+
currentTime: animationStartTime
|
|
9250
|
+
}
|
|
9251
|
+
}));
|
|
9252
|
+
}
|
|
9253
|
+
} else {
|
|
9254
|
+
_autoTimeStepLayerId = getAutoTimeStepLayerId(listenerApi.getState(), mapId);
|
|
9255
|
+
layerRefTimeDimension = getLayerDimension(listenerApi.getState(), _autoTimeStepLayerId, 'reference_time');
|
|
9256
|
+
referenceTimeFromLayer = (layerRefTimeDimension === null || layerRefTimeDimension === void 0 ? void 0 : layerRefTimeDimension.currentValue) || undefined;
|
|
9257
|
+
anchorTime = dateUtils.utc(referenceTimeFromLayer);
|
|
9258
|
+
resolvedRange = isAnchoredMode(animationLength.mode) && isValidAnimationLength(animationLength, anchorTime) ? resolveAnimationRange(animationLength, anchorTime) : undefined;
|
|
9259
|
+
listenerApi.dispatch(mapActions.setAnimationLength(_objectSpread2(_objectSpread2({
|
|
9260
|
+
mapId: mapId,
|
|
9261
|
+
animationLength: animationLength
|
|
9262
|
+
}, resolvedRange), {}, {
|
|
9263
|
+
skipSync: true
|
|
9264
|
+
})));
|
|
9265
|
+
if (resolvedRange && timeAlreadySet === undefined) {
|
|
9266
|
+
listenerApi.dispatch(genericActions.setTime({
|
|
9267
|
+
origin: 'map/listener.ts, setAnimationLength',
|
|
9268
|
+
sourceId: mapId,
|
|
9269
|
+
value: {
|
|
9270
|
+
currentTime: resolvedRange.animationStartTime
|
|
9271
|
+
}
|
|
9272
|
+
}));
|
|
9273
|
+
}
|
|
8982
9274
|
}
|
|
8983
9275
|
}
|
|
8984
9276
|
// sets animationDelay by speed of animationPayload
|
|
@@ -8990,15 +9282,8 @@ mapListener.startListening({
|
|
|
8990
9282
|
}
|
|
8991
9283
|
// turn animation on
|
|
8992
9284
|
if (shouldAnimate === true) {
|
|
8993
|
-
duration = animationPayload !== null && animationPayload !== void 0 && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
|
|
8994
|
-
_animationEnd = shouldEndtimeOverride && animationEndTime ? getAnimationEndTime(listenerApi.getState(), mapId) : dateUtils.dateToString(dateUtils.utc(), dateFormat);
|
|
8995
|
-
animationStart = shouldEndtimeOverride && animationLength ? getAnimationStartTime(listenerApi.getState(), mapId) : dateUtils.dateToString(dateUtils.sub(dateUtils.utc(_animationEnd), {
|
|
8996
|
-
minutes: duration
|
|
8997
|
-
}), dateFormat);
|
|
8998
9285
|
listenerApi.dispatch(mapActions.mapStartAnimation({
|
|
8999
9286
|
mapId: mapId,
|
|
9000
|
-
start: animationStart,
|
|
9001
|
-
end: _animationEnd,
|
|
9002
9287
|
interval: interval || defaultTimeStep
|
|
9003
9288
|
}));
|
|
9004
9289
|
// If animation interval set, set the timestep auto property to false
|
|
@@ -9062,36 +9347,36 @@ mapListener.startListening({
|
|
|
9062
9347
|
dockedLayerManagerDimensions: dockedLayerManagerDimensions
|
|
9063
9348
|
}));
|
|
9064
9349
|
}
|
|
9065
|
-
case
|
|
9066
|
-
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
9067
|
-
_context2.n =
|
|
9350
|
+
case 7:
|
|
9351
|
+
if (!(animationEndTime && !derivesOwnAnimationRange(animationLengthSetting) && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
9352
|
+
_context2.n = 9;
|
|
9068
9353
|
break;
|
|
9069
9354
|
}
|
|
9070
9355
|
fiveMinuteDelayForAnimation = 1000 * 60 * 5; // eslint-disable-next-line no-await-in-loop
|
|
9071
|
-
_context2.n =
|
|
9356
|
+
_context2.n = 8;
|
|
9072
9357
|
return listenerApi.delay(fiveMinuteDelayForAnimation);
|
|
9073
|
-
case
|
|
9074
|
-
|
|
9358
|
+
case 8:
|
|
9359
|
+
animationEnd = getAnimationEndTime(listenerApi.getState(), mapId);
|
|
9075
9360
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
9076
9361
|
mapId: mapId,
|
|
9077
|
-
animationEndTime: dateUtils.add(dateUtils.utc(
|
|
9362
|
+
animationEndTime: dateUtils.add(dateUtils.utc(animationEnd), {
|
|
9078
9363
|
minutes: 5
|
|
9079
9364
|
}).toISOString()
|
|
9080
9365
|
}));
|
|
9081
|
-
|
|
9366
|
+
animationStart = getAnimationStartTime(listenerApi.getState(), mapId);
|
|
9082
9367
|
listenerApi.dispatch(mapActions.setAnimationStartTime({
|
|
9083
9368
|
mapId: mapId,
|
|
9084
|
-
animationStartTime: dateUtils.add(dateUtils.utc(
|
|
9369
|
+
animationStartTime: dateUtils.add(dateUtils.utc(animationStart), {
|
|
9085
9370
|
minutes: 5
|
|
9086
9371
|
}).toISOString()
|
|
9087
9372
|
}));
|
|
9088
|
-
_context2.n =
|
|
9373
|
+
_context2.n = 7;
|
|
9089
9374
|
break;
|
|
9090
|
-
case
|
|
9091
|
-
_context2.n =
|
|
9375
|
+
case 9:
|
|
9376
|
+
_context2.n = 11;
|
|
9092
9377
|
break;
|
|
9093
|
-
case
|
|
9094
|
-
_context2.p =
|
|
9378
|
+
case 10:
|
|
9379
|
+
_context2.p = 10;
|
|
9095
9380
|
_t = _context2.v;
|
|
9096
9381
|
if (_t instanceof Error) {
|
|
9097
9382
|
listenerApi.dispatch(mapActions.setMapPresetError({
|
|
@@ -9099,10 +9384,10 @@ mapListener.startListening({
|
|
|
9099
9384
|
error: _t.message
|
|
9100
9385
|
}));
|
|
9101
9386
|
}
|
|
9102
|
-
case
|
|
9387
|
+
case 11:
|
|
9103
9388
|
return _context2.a(2);
|
|
9104
9389
|
}
|
|
9105
|
-
}, _callee2, null, [[1,
|
|
9390
|
+
}, _callee2, null, [[1, 10]]);
|
|
9106
9391
|
}));
|
|
9107
9392
|
function effect(_x3, _x4) {
|
|
9108
9393
|
return _effect2.apply(this, arguments);
|
|
@@ -9110,11 +9395,95 @@ mapListener.startListening({
|
|
|
9110
9395
|
return effect;
|
|
9111
9396
|
}()
|
|
9112
9397
|
});
|
|
9398
|
+
/**
|
|
9399
|
+
* Re-resolving on a short interval keeps a range that follows the clock correct without
|
|
9400
|
+
* tracking what it depends on: Now slides every tick, a recurring period only rolls at
|
|
9401
|
+
* midnight UTC, and a tick that resolves an unchanged range leaves the state untouched.
|
|
9402
|
+
*/
|
|
9403
|
+
var ANIMATION_RANGE_REFRESH_INTERVAL = 1000 * 60 * 5;
|
|
9404
|
+
/* Newest loop per map wins; older loops see a stale token and exit. */
|
|
9405
|
+
var animationRangeRefreshTokens = new Map();
|
|
9406
|
+
mapListener.startListening({
|
|
9407
|
+
actionCreator: mapActions.setAnimationLength,
|
|
9408
|
+
effect: function () {
|
|
9409
|
+
var _effect3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref7, listenerApi) {
|
|
9410
|
+
var payload, mapId, refreshToken, isNewestRefreshLoop, getRefreshableAnimationLength, animationLength;
|
|
9411
|
+
return _regenerator().w(function (_context3) {
|
|
9412
|
+
while (1) switch (_context3.n) {
|
|
9413
|
+
case 0:
|
|
9414
|
+
payload = _ref7.payload;
|
|
9415
|
+
mapId = payload.mapId;
|
|
9416
|
+
if (isAnimating(listenerApi.getState(), mapId)) {
|
|
9417
|
+
setStep(mapId, -1);
|
|
9418
|
+
}
|
|
9419
|
+
refreshToken = Symbol(mapId);
|
|
9420
|
+
animationRangeRefreshTokens.set(mapId, refreshToken);
|
|
9421
|
+
isNewestRefreshLoop = function isNewestRefreshLoop() {
|
|
9422
|
+
return animationRangeRefreshTokens.get(mapId) === refreshToken;
|
|
9423
|
+
};
|
|
9424
|
+
getRefreshableAnimationLength = function getRefreshableAnimationLength() {
|
|
9425
|
+
var animationLength = getAnimationLength(listenerApi.getState(), mapId);
|
|
9426
|
+
var timeStep = getMapTimeStep(listenerApi.getState(), mapId);
|
|
9427
|
+
return isAnchoredMode(animationLength === null || animationLength === void 0 ? void 0 : animationLength.mode) && animationLength && isValidAnimationLength(animationLength) && isWithinAnimationStepLimit(animationLength, timeStep) ? animationLength : undefined;
|
|
9428
|
+
};
|
|
9429
|
+
case 1:
|
|
9430
|
+
if (!(isNewestRefreshLoop() && getRefreshableAnimationLength())) {
|
|
9431
|
+
_context3.n = 4;
|
|
9432
|
+
break;
|
|
9433
|
+
}
|
|
9434
|
+
_context3.n = 2;
|
|
9435
|
+
return listenerApi.delay(ANIMATION_RANGE_REFRESH_INTERVAL);
|
|
9436
|
+
case 2:
|
|
9437
|
+
animationLength = getRefreshableAnimationLength();
|
|
9438
|
+
if (!(!isNewestRefreshLoop() || !animationLength)) {
|
|
9439
|
+
_context3.n = 3;
|
|
9440
|
+
break;
|
|
9441
|
+
}
|
|
9442
|
+
return _context3.a(2);
|
|
9443
|
+
case 3:
|
|
9444
|
+
listenerApi.dispatch(mapActions.refreshAnimationRange(_objectSpread2({
|
|
9445
|
+
mapId: mapId
|
|
9446
|
+
}, resolveAnimationRange(animationLength))));
|
|
9447
|
+
_context3.n = 1;
|
|
9448
|
+
break;
|
|
9449
|
+
case 4:
|
|
9450
|
+
return _context3.a(2);
|
|
9451
|
+
}
|
|
9452
|
+
}, _callee3);
|
|
9453
|
+
}));
|
|
9454
|
+
function effect(_x5, _x6) {
|
|
9455
|
+
return _effect3.apply(this, arguments);
|
|
9456
|
+
}
|
|
9457
|
+
return effect;
|
|
9458
|
+
}()
|
|
9459
|
+
});
|
|
9460
|
+
mapListener.startListening({
|
|
9461
|
+
actionCreator: mapActions.setAnimationStartTime,
|
|
9462
|
+
effect: function effect(_ref8, listenerApi) {
|
|
9463
|
+
var payload = _ref8.payload;
|
|
9464
|
+
preserveAnimationStep(payload.mapId, listenerApi);
|
|
9465
|
+
}
|
|
9466
|
+
});
|
|
9467
|
+
mapListener.startListening({
|
|
9468
|
+
actionCreator: mapActions.setAnimationEndTime,
|
|
9469
|
+
effect: function effect(_ref9, listenerApi) {
|
|
9470
|
+
var payload = _ref9.payload;
|
|
9471
|
+
preserveAnimationStep(payload.mapId, listenerApi);
|
|
9472
|
+
}
|
|
9473
|
+
});
|
|
9474
|
+
mapListener.startListening({
|
|
9475
|
+
actionCreator: mapActions.refreshAnimationRange,
|
|
9476
|
+
effect: function effect(_ref0, listenerApi) {
|
|
9477
|
+
var payload = _ref0.payload;
|
|
9478
|
+
preserveAnimationStep(payload.mapId, listenerApi);
|
|
9479
|
+
}
|
|
9480
|
+
});
|
|
9113
9481
|
mapListener.startListening({
|
|
9114
9482
|
actionCreator: mapActions.unregisterMap,
|
|
9115
|
-
effect: function effect(
|
|
9116
|
-
var payload =
|
|
9483
|
+
effect: function effect(_ref1, listenerApi) {
|
|
9484
|
+
var payload = _ref1.payload;
|
|
9117
9485
|
var mapId = payload.mapId;
|
|
9486
|
+
animationRangeRefreshTokens["delete"](mapId);
|
|
9118
9487
|
var layerList = getLayersByMapId(listenerApi.getState(), mapId);
|
|
9119
9488
|
metronome.unregister(mapId);
|
|
9120
9489
|
layerList.map(function (layer) {
|
|
@@ -9131,8 +9500,8 @@ mapListener.startListening({
|
|
|
9131
9500
|
});
|
|
9132
9501
|
mapListener.startListening({
|
|
9133
9502
|
actionCreator: mapActions.setStepBackwardOrForward,
|
|
9134
|
-
effect: function effect(
|
|
9135
|
-
var payload =
|
|
9503
|
+
effect: function effect(_ref10, listenerApi) {
|
|
9504
|
+
var payload = _ref10.payload;
|
|
9136
9505
|
var mapId = payload.mapId,
|
|
9137
9506
|
isForwardStep = payload.isForwardStep;
|
|
9138
9507
|
// timeStep is stored in minutes
|
|
@@ -9184,6 +9553,77 @@ mapListener.startListening({
|
|
|
9184
9553
|
}
|
|
9185
9554
|
}
|
|
9186
9555
|
});
|
|
9556
|
+
var updateReferenceTimeAnimationRange = function updateReferenceTimeAnimationRange(mapId, layerId, referenceTime, listenerApi) {
|
|
9557
|
+
var animationLength = getAnimationLength(listenerApi.getState(), mapId);
|
|
9558
|
+
var autoTimeStepLayerId = getAutoTimeStepLayerId(listenerApi.getState(), mapId);
|
|
9559
|
+
if (autoTimeStepLayerId !== layerId || (animationLength === null || animationLength === void 0 ? void 0 : animationLength.mode) !== AnimationLengthMode.ReferenceTime) {
|
|
9560
|
+
return;
|
|
9561
|
+
}
|
|
9562
|
+
var anchorTime = dateUtils.utc(referenceTime);
|
|
9563
|
+
var resolvedRange = resolveAnimationRange(animationLength, anchorTime);
|
|
9564
|
+
listenerApi.dispatch(mapActions.setAnimationLength(_objectSpread2({
|
|
9565
|
+
mapId: mapId,
|
|
9566
|
+
animationLength: animationLength
|
|
9567
|
+
}, resolvedRange)));
|
|
9568
|
+
};
|
|
9569
|
+
mapListener.startListening({
|
|
9570
|
+
actionCreator: layerActions.layerChangeDimension,
|
|
9571
|
+
effect: function effect(_ref11, listenerApi) {
|
|
9572
|
+
var payload = _ref11.payload;
|
|
9573
|
+
var mapId = payload.mapId,
|
|
9574
|
+
layerId = payload.layerId,
|
|
9575
|
+
dimension = payload.dimension;
|
|
9576
|
+
if (!mapId || dimension.name !== 'reference_time') {
|
|
9577
|
+
return;
|
|
9578
|
+
}
|
|
9579
|
+
updateReferenceTimeAnimationRange(mapId, layerId, dimension.currentValue, listenerApi);
|
|
9580
|
+
}
|
|
9581
|
+
});
|
|
9582
|
+
var updateAnimationMode = function updateAnimationMode(mapId, listenerApi) {
|
|
9583
|
+
var _autoTimeStepLayer$di;
|
|
9584
|
+
var previousAutoTimeStepLayerId = getAutoTimeStepLayerId(listenerApi.getOriginalState(), mapId);
|
|
9585
|
+
var autoTimeStepLayerId = getAutoTimeStepLayerId(listenerApi.getState(), mapId);
|
|
9586
|
+
var animationLength = getAnimationLength(listenerApi.getState(), mapId);
|
|
9587
|
+
if (previousAutoTimeStepLayerId === autoTimeStepLayerId || (animationLength === null || animationLength === void 0 ? void 0 : animationLength.mode) !== AnimationLengthMode.ReferenceTime && (animationLength === null || animationLength === void 0 ? void 0 : animationLength.mode) !== AnimationLengthMode.Auto) {
|
|
9588
|
+
return;
|
|
9589
|
+
}
|
|
9590
|
+
var autoTimeStepLayer = getLayerById(listenerApi.getState(), autoTimeStepLayerId);
|
|
9591
|
+
var referenceTimeDimension = autoTimeStepLayer === null || autoTimeStepLayer === void 0 || (_autoTimeStepLayer$di = autoTimeStepLayer.dimensions) === null || _autoTimeStepLayer$di === void 0 ? void 0 : _autoTimeStepLayer$di.find(function (dimension) {
|
|
9592
|
+
return dimension.name === 'reference_time';
|
|
9593
|
+
});
|
|
9594
|
+
if (autoTimeStepLayerId && referenceTimeDimension) {
|
|
9595
|
+
listenerApi.dispatch(mapActions.setAnimationLength(_objectSpread2({
|
|
9596
|
+
mapId: mapId,
|
|
9597
|
+
animationLength: animationLength
|
|
9598
|
+
}, resolveAnimationRange(animationLength, dateUtils.utc(referenceTimeDimension.currentValue)))));
|
|
9599
|
+
return;
|
|
9600
|
+
}
|
|
9601
|
+
var nextAnimationLength = autoTimeStepLayerId ? {
|
|
9602
|
+
mode: AnimationLengthMode.Auto
|
|
9603
|
+
} : {
|
|
9604
|
+
mode: AnimationLengthMode.Now,
|
|
9605
|
+
now: defaultOffsetSelections
|
|
9606
|
+
};
|
|
9607
|
+
var resolvedRange = nextAnimationLength.mode === AnimationLengthMode.Now && isValidAnimationLength(nextAnimationLength) ? resolveAnimationRange(nextAnimationLength) : undefined;
|
|
9608
|
+
listenerApi.dispatch(mapActions.setAnimationLength(_objectSpread2({
|
|
9609
|
+
mapId: mapId,
|
|
9610
|
+
animationLength: nextAnimationLength
|
|
9611
|
+
}, resolvedRange)));
|
|
9612
|
+
};
|
|
9613
|
+
mapListener.startListening({
|
|
9614
|
+
actionCreator: mapActions.setAutoLayerId,
|
|
9615
|
+
effect: function effect(_ref12, listenerApi) {
|
|
9616
|
+
var mapId = _ref12.payload.mapId;
|
|
9617
|
+
updateAnimationMode(mapId, listenerApi);
|
|
9618
|
+
}
|
|
9619
|
+
});
|
|
9620
|
+
mapListener.startListening({
|
|
9621
|
+
actionCreator: mapActions.setAutoTimestepLayerId,
|
|
9622
|
+
effect: function effect(_ref13, listenerApi) {
|
|
9623
|
+
var mapId = _ref13.payload.mapId;
|
|
9624
|
+
updateAnimationMode(mapId, listenerApi);
|
|
9625
|
+
}
|
|
9626
|
+
});
|
|
9187
9627
|
|
|
9188
9628
|
var copyView = function copyView(view) {
|
|
9189
9629
|
return new View({
|