@opengeoweb/store 19.6.0 → 19.6.1-nightly-20260912
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 +444 -205
- 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/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 +21 -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, roundWithTimeStep, isValidAnimationLength, resolveNowAnimationRange, 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;
|
|
2152
|
+
var currentLayer = draft.byId[layerId];
|
|
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;
|
|
2135
2196
|
var currentLayer = draft.byId[layerId];
|
|
2136
|
-
if (!(currentLayer !== null && currentLayer !== void 0 && (_currentLayer$
|
|
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 = {
|
|
@@ -2468,7 +2529,9 @@ var slice$6 = createSlice({
|
|
|
2468
2529
|
return;
|
|
2469
2530
|
}
|
|
2470
2531
|
draft.byId[mapId].animationStartTime = animationStartTime;
|
|
2471
|
-
draft.byId[mapId].
|
|
2532
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2533
|
+
mode: AnimationLengthMode.Exact
|
|
2534
|
+
});
|
|
2472
2535
|
},
|
|
2473
2536
|
setAnimationEndTime: function setAnimationEndTime(draft, action) {
|
|
2474
2537
|
var _action$payload7 = action.payload,
|
|
@@ -2478,23 +2541,53 @@ var slice$6 = createSlice({
|
|
|
2478
2541
|
return;
|
|
2479
2542
|
}
|
|
2480
2543
|
draft.byId[mapId].animationEndTime = animationEndTime;
|
|
2481
|
-
draft.byId[mapId].
|
|
2544
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2545
|
+
mode: AnimationLengthMode.Exact
|
|
2546
|
+
});
|
|
2482
2547
|
},
|
|
2483
|
-
|
|
2548
|
+
setAnimationLength: function setAnimationLength(draft, action) {
|
|
2484
2549
|
var _action$payload8 = action.payload,
|
|
2485
2550
|
mapId = _action$payload8.mapId,
|
|
2486
|
-
|
|
2551
|
+
animationLength = _action$payload8.animationLength,
|
|
2552
|
+
animationStartTime = _action$payload8.animationStartTime,
|
|
2553
|
+
animationEndTime = _action$payload8.animationEndTime;
|
|
2487
2554
|
if (!draft.byId[mapId]) {
|
|
2488
2555
|
return;
|
|
2489
2556
|
}
|
|
2490
|
-
draft.byId[mapId].
|
|
2557
|
+
draft.byId[mapId].animationLength = animationLength;
|
|
2558
|
+
if (animationStartTime) {
|
|
2559
|
+
draft.byId[mapId].animationStartTime = animationStartTime;
|
|
2560
|
+
}
|
|
2561
|
+
if (animationEndTime) {
|
|
2562
|
+
draft.byId[mapId].animationEndTime = animationEndTime;
|
|
2563
|
+
}
|
|
2491
2564
|
},
|
|
2492
|
-
|
|
2565
|
+
refreshNowAnimationRange: function refreshNowAnimationRange(draft, action) {
|
|
2493
2566
|
var _action$payload9 = action.payload,
|
|
2494
|
-
oldIndex = _action$payload9.oldIndex,
|
|
2495
|
-
newIndex = _action$payload9.newIndex,
|
|
2496
2567
|
mapId = _action$payload9.mapId,
|
|
2497
|
-
|
|
2568
|
+
animationStartTime = _action$payload9.animationStartTime,
|
|
2569
|
+
animationEndTime = _action$payload9.animationEndTime;
|
|
2570
|
+
if (!draft.byId[mapId]) {
|
|
2571
|
+
return;
|
|
2572
|
+
}
|
|
2573
|
+
draft.byId[mapId].animationStartTime = animationStartTime;
|
|
2574
|
+
draft.byId[mapId].animationEndTime = animationEndTime;
|
|
2575
|
+
},
|
|
2576
|
+
setAnimationDelay: function setAnimationDelay(draft, action) {
|
|
2577
|
+
var _action$payload0 = action.payload,
|
|
2578
|
+
mapId = _action$payload0.mapId,
|
|
2579
|
+
animationDelay = _action$payload0.animationDelay;
|
|
2580
|
+
if (!draft.byId[mapId]) {
|
|
2581
|
+
return;
|
|
2582
|
+
}
|
|
2583
|
+
draft.byId[mapId].animationDelay = animationDelay;
|
|
2584
|
+
},
|
|
2585
|
+
layerMoveLayer: function layerMoveLayer(draft, action) {
|
|
2586
|
+
var _action$payload1 = action.payload,
|
|
2587
|
+
oldIndex = _action$payload1.oldIndex,
|
|
2588
|
+
newIndex = _action$payload1.newIndex,
|
|
2589
|
+
mapId = _action$payload1.mapId,
|
|
2590
|
+
layerType = _action$payload1.layerType;
|
|
2498
2591
|
if (!draft.byId[mapId]) {
|
|
2499
2592
|
return;
|
|
2500
2593
|
}
|
|
@@ -2505,11 +2598,11 @@ var slice$6 = createSlice({
|
|
|
2505
2598
|
}
|
|
2506
2599
|
},
|
|
2507
2600
|
setAutoLayerId: function setAutoLayerId(draft, action) {
|
|
2508
|
-
var _action$
|
|
2509
|
-
mapId = _action$
|
|
2510
|
-
layerId = _action$
|
|
2511
|
-
autoTimeStepLayerId = _action$
|
|
2512
|
-
autoUpdateLayerId = _action$
|
|
2601
|
+
var _action$payload10 = action.payload,
|
|
2602
|
+
mapId = _action$payload10.mapId,
|
|
2603
|
+
layerId = _action$payload10.layerId,
|
|
2604
|
+
autoTimeStepLayerId = _action$payload10.autoTimeStepLayerId,
|
|
2605
|
+
autoUpdateLayerId = _action$payload10.autoUpdateLayerId;
|
|
2513
2606
|
var map = draft.byId[mapId];
|
|
2514
2607
|
if (!map) {
|
|
2515
2608
|
return;
|
|
@@ -2526,9 +2619,9 @@ var slice$6 = createSlice({
|
|
|
2526
2619
|
}
|
|
2527
2620
|
},
|
|
2528
2621
|
setAutoTimestepLayerId: function setAutoTimestepLayerId(draft, action) {
|
|
2529
|
-
var _action$
|
|
2530
|
-
mapId = _action$
|
|
2531
|
-
autoTimestepLayerId = _action$
|
|
2622
|
+
var _action$payload11 = action.payload,
|
|
2623
|
+
mapId = _action$payload11.mapId,
|
|
2624
|
+
autoTimestepLayerId = _action$payload11.autoTimestepLayerId;
|
|
2532
2625
|
var map = draft.byId[mapId];
|
|
2533
2626
|
if (!map) {
|
|
2534
2627
|
return;
|
|
@@ -2536,9 +2629,9 @@ var slice$6 = createSlice({
|
|
|
2536
2629
|
map.autoTimeStepLayerId = autoTimestepLayerId;
|
|
2537
2630
|
},
|
|
2538
2631
|
setAutoUpdateLayerId: function setAutoUpdateLayerId(draft, action) {
|
|
2539
|
-
var _action$
|
|
2540
|
-
mapId = _action$
|
|
2541
|
-
autoUpdateLayerId = _action$
|
|
2632
|
+
var _action$payload12 = action.payload,
|
|
2633
|
+
mapId = _action$payload12.mapId,
|
|
2634
|
+
autoUpdateLayerId = _action$payload12.autoUpdateLayerId;
|
|
2542
2635
|
var map = draft.byId[mapId];
|
|
2543
2636
|
if (!map) {
|
|
2544
2637
|
return;
|
|
@@ -2546,9 +2639,9 @@ var slice$6 = createSlice({
|
|
|
2546
2639
|
map.autoUpdateLayerId = autoUpdateLayerId;
|
|
2547
2640
|
},
|
|
2548
2641
|
setTimeSliderWidth: function setTimeSliderWidth(draft, action) {
|
|
2549
|
-
var _action$
|
|
2550
|
-
mapId = _action$
|
|
2551
|
-
timeSliderWidth = _action$
|
|
2642
|
+
var _action$payload13 = action.payload,
|
|
2643
|
+
mapId = _action$payload13.mapId,
|
|
2644
|
+
timeSliderWidth = _action$payload13.timeSliderWidth;
|
|
2552
2645
|
if (!draft.byId[mapId]) {
|
|
2553
2646
|
return;
|
|
2554
2647
|
}
|
|
@@ -2556,157 +2649,169 @@ var slice$6 = createSlice({
|
|
|
2556
2649
|
draft.byId[mapId].timeSliderSecondsPerPx = secondsPerPxFromCanvasWidth(timeSliderWidth, draft.byId[mapId].timeSliderSpan || defaultTimeSpan);
|
|
2557
2650
|
},
|
|
2558
2651
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2559
|
-
var _action$
|
|
2560
|
-
mapId = _action$
|
|
2561
|
-
timeSliderCenterTime = _action$
|
|
2652
|
+
var _action$payload14 = action.payload,
|
|
2653
|
+
mapId = _action$payload14.mapId,
|
|
2654
|
+
timeSliderCenterTime = _action$payload14.timeSliderCenterTime;
|
|
2562
2655
|
if (!draft.byId[mapId]) {
|
|
2563
2656
|
return;
|
|
2564
2657
|
}
|
|
2565
2658
|
draft.byId[mapId].timeSliderCenterTime = timeSliderCenterTime;
|
|
2566
2659
|
},
|
|
2567
2660
|
toggleAutoUpdate: function toggleAutoUpdate(draft, action) {
|
|
2568
|
-
var _action$
|
|
2569
|
-
mapId = _action$
|
|
2570
|
-
shouldAutoUpdate = _action$
|
|
2661
|
+
var _action$payload15 = action.payload,
|
|
2662
|
+
mapId = _action$payload15.mapId,
|
|
2663
|
+
shouldAutoUpdate = _action$payload15.shouldAutoUpdate;
|
|
2571
2664
|
if (!draft.byId[mapId]) {
|
|
2572
2665
|
return;
|
|
2573
2666
|
}
|
|
2574
2667
|
draft.byId[mapId].isAutoUpdating = shouldAutoUpdate;
|
|
2575
2668
|
},
|
|
2576
2669
|
setEndTimeOverriding: function setEndTimeOverriding(draft, action) {
|
|
2577
|
-
var _action$
|
|
2578
|
-
mapId = _action$
|
|
2579
|
-
shouldEndtimeOverride = _action$
|
|
2670
|
+
var _action$payload16 = action.payload,
|
|
2671
|
+
mapId = _action$payload16.mapId,
|
|
2672
|
+
shouldEndtimeOverride = _action$payload16.shouldEndtimeOverride;
|
|
2580
2673
|
if (!draft.byId[mapId]) {
|
|
2581
2674
|
return;
|
|
2582
2675
|
}
|
|
2583
2676
|
draft.byId[mapId].shouldEndtimeOverride = shouldEndtimeOverride;
|
|
2584
2677
|
},
|
|
2585
2678
|
toggleTimestepAuto: function toggleTimestepAuto(draft, action) {
|
|
2586
|
-
var _action$
|
|
2587
|
-
mapId = _action$
|
|
2588
|
-
timestepAuto = _action$
|
|
2679
|
+
var _action$payload17 = action.payload,
|
|
2680
|
+
mapId = _action$payload17.mapId,
|
|
2681
|
+
timestepAuto = _action$payload17.timestepAuto;
|
|
2589
2682
|
if (!draft.byId[mapId]) {
|
|
2590
2683
|
return;
|
|
2591
2684
|
}
|
|
2592
2685
|
draft.byId[mapId].isTimestepAuto = timestepAuto;
|
|
2593
2686
|
},
|
|
2594
2687
|
toggleTimeSpanAuto: function toggleTimeSpanAuto(draft, action) {
|
|
2595
|
-
var _action$
|
|
2596
|
-
mapId = _action$
|
|
2597
|
-
timeSpanAuto = _action$
|
|
2688
|
+
var _action$payload18 = action.payload,
|
|
2689
|
+
mapId = _action$payload18.mapId,
|
|
2690
|
+
timeSpanAuto = _action$payload18.timeSpanAuto;
|
|
2598
2691
|
if (!draft.byId[mapId]) {
|
|
2599
2692
|
return;
|
|
2600
2693
|
}
|
|
2601
2694
|
draft.byId[mapId].isTimeSpanAuto = timeSpanAuto;
|
|
2602
2695
|
},
|
|
2696
|
+
/** Superseded by setAnimationLength; removed together with the old animation length button. */
|
|
2603
2697
|
toggleAnimationLengthAuto: function toggleAnimationLengthAuto(draft, action) {
|
|
2604
|
-
var _action$
|
|
2605
|
-
mapId = _action$
|
|
2606
|
-
autoAnimationLength = _action$
|
|
2698
|
+
var _action$payload19 = action.payload,
|
|
2699
|
+
mapId = _action$payload19.mapId,
|
|
2700
|
+
autoAnimationLength = _action$payload19.autoAnimationLength;
|
|
2607
2701
|
if (!draft.byId[mapId]) {
|
|
2608
2702
|
return;
|
|
2609
2703
|
}
|
|
2610
|
-
draft.byId[mapId].
|
|
2704
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2705
|
+
mode: autoAnimationLength ? AnimationLengthMode.Auto : AnimationLengthMode.Exact
|
|
2706
|
+
});
|
|
2611
2707
|
},
|
|
2612
2708
|
toggleTimeSliderHover: function toggleTimeSliderHover(draft, action) {
|
|
2613
|
-
var _action$
|
|
2614
|
-
mapId = _action$
|
|
2615
|
-
isTimeSliderHoverOn = _action$
|
|
2709
|
+
var _action$payload20 = action.payload,
|
|
2710
|
+
mapId = _action$payload20.mapId,
|
|
2711
|
+
isTimeSliderHoverOn = _action$payload20.isTimeSliderHoverOn;
|
|
2616
2712
|
if (!draft.byId[mapId]) {
|
|
2617
2713
|
return;
|
|
2618
2714
|
}
|
|
2619
2715
|
draft.byId[mapId].isTimeSliderHoverOn = isTimeSliderHoverOn;
|
|
2620
2716
|
},
|
|
2621
2717
|
toggleTimeSliderIsVisible: function toggleTimeSliderIsVisible(draft, action) {
|
|
2622
|
-
var _action$
|
|
2623
|
-
mapId = _action$
|
|
2624
|
-
isTimeSliderVisible = _action$
|
|
2718
|
+
var _action$payload21 = action.payload,
|
|
2719
|
+
mapId = _action$payload21.mapId,
|
|
2720
|
+
isTimeSliderVisible = _action$payload21.isTimeSliderVisible;
|
|
2625
2721
|
if (!draft.byId[mapId]) {
|
|
2626
2722
|
return;
|
|
2627
2723
|
}
|
|
2628
2724
|
draft.byId[mapId].isTimeSliderVisible = isTimeSliderVisible;
|
|
2629
2725
|
},
|
|
2630
2726
|
toggleZoomControls: function toggleZoomControls(draft, action) {
|
|
2631
|
-
var _action$
|
|
2632
|
-
mapId = _action$
|
|
2633
|
-
shouldShowZoomControls = _action$
|
|
2727
|
+
var _action$payload22 = action.payload,
|
|
2728
|
+
mapId = _action$payload22.mapId,
|
|
2729
|
+
shouldShowZoomControls = _action$payload22.shouldShowZoomControls;
|
|
2634
2730
|
if (!draft.byId[mapId]) {
|
|
2635
2731
|
return;
|
|
2636
2732
|
}
|
|
2637
2733
|
draft.byId[mapId].shouldShowZoomControls = shouldShowZoomControls;
|
|
2638
2734
|
},
|
|
2639
2735
|
setMapPinLocation: function setMapPinLocation(draft, action) {
|
|
2640
|
-
var _action$
|
|
2641
|
-
mapId = _action$
|
|
2642
|
-
mapPinLocation = _action$
|
|
2736
|
+
var _action$payload23 = action.payload,
|
|
2737
|
+
mapId = _action$payload23.mapId,
|
|
2738
|
+
mapPinLocation = _action$payload23.mapPinLocation;
|
|
2643
2739
|
if (!draft.byId[mapId]) {
|
|
2644
2740
|
return;
|
|
2645
2741
|
}
|
|
2646
2742
|
draft.byId[mapId].mapPinLocation = mapPinLocation;
|
|
2647
2743
|
},
|
|
2648
2744
|
setDisableMapPin: function setDisableMapPin(draft, action) {
|
|
2649
|
-
var _action$
|
|
2650
|
-
mapId = _action$
|
|
2651
|
-
disableMapPin = _action$
|
|
2745
|
+
var _action$payload24 = action.payload,
|
|
2746
|
+
mapId = _action$payload24.mapId,
|
|
2747
|
+
disableMapPin = _action$payload24.disableMapPin;
|
|
2652
2748
|
if (!draft.byId[mapId]) {
|
|
2653
2749
|
return;
|
|
2654
2750
|
}
|
|
2655
2751
|
draft.byId[mapId].disableMapPin = disableMapPin;
|
|
2656
2752
|
},
|
|
2657
2753
|
toggleMapPinIsVisible: function toggleMapPinIsVisible(draft, action) {
|
|
2658
|
-
var _action$
|
|
2659
|
-
mapId = _action$
|
|
2660
|
-
displayMapPin = _action$
|
|
2754
|
+
var _action$payload25 = action.payload,
|
|
2755
|
+
mapId = _action$payload25.mapId,
|
|
2756
|
+
displayMapPin = _action$payload25.displayMapPin;
|
|
2661
2757
|
if (!draft.byId[mapId]) {
|
|
2662
2758
|
return;
|
|
2663
2759
|
}
|
|
2664
2760
|
draft.byId[mapId].displayMapPin = displayMapPin;
|
|
2665
2761
|
},
|
|
2666
2762
|
setDockedLayerManagerSize: function setDockedLayerManagerSize(draft, action) {
|
|
2667
|
-
var _action$
|
|
2668
|
-
mapId = _action$
|
|
2669
|
-
dockedLayerManagerSize = _action$
|
|
2763
|
+
var _action$payload26 = action.payload,
|
|
2764
|
+
mapId = _action$payload26.mapId,
|
|
2765
|
+
dockedLayerManagerSize = _action$payload26.dockedLayerManagerSize;
|
|
2670
2766
|
if (!draft.byId[mapId]) {
|
|
2671
2767
|
return;
|
|
2672
2768
|
}
|
|
2673
2769
|
draft.byId[mapId].dockedLayerManagerSize = dockedLayerManagerSize;
|
|
2674
2770
|
},
|
|
2675
2771
|
setDockedLayerManagerPosition: function setDockedLayerManagerPosition(draft, action) {
|
|
2676
|
-
var _action$
|
|
2677
|
-
mapId = _action$
|
|
2678
|
-
dockedLayerManagerPosition = _action$
|
|
2772
|
+
var _action$payload27 = action.payload,
|
|
2773
|
+
mapId = _action$payload27.mapId,
|
|
2774
|
+
dockedLayerManagerPosition = _action$payload27.dockedLayerManagerPosition;
|
|
2679
2775
|
if (!draft.byId[mapId]) {
|
|
2680
2776
|
return;
|
|
2681
2777
|
}
|
|
2682
2778
|
draft.byId[mapId].dockedLayerManagerPosition = dockedLayerManagerPosition;
|
|
2683
2779
|
},
|
|
2684
2780
|
setDockedLayerManagerDimensions: function setDockedLayerManagerDimensions(draft, action) {
|
|
2685
|
-
var _action$
|
|
2686
|
-
mapId = _action$
|
|
2687
|
-
dockedLayerManagerDimensions = _action$
|
|
2781
|
+
var _action$payload28 = action.payload,
|
|
2782
|
+
mapId = _action$payload28.mapId,
|
|
2783
|
+
dockedLayerManagerDimensions = _action$payload28.dockedLayerManagerDimensions;
|
|
2688
2784
|
if (!draft.byId[mapId]) {
|
|
2689
2785
|
return;
|
|
2690
2786
|
}
|
|
2691
2787
|
draft.byId[mapId].dockedLayerManagerDimensions = dockedLayerManagerDimensions;
|
|
2692
2788
|
},
|
|
2789
|
+
setPendingInitialZoomToLayer: function setPendingInitialZoomToLayer(draft, action) {
|
|
2790
|
+
var _action$payload29 = action.payload,
|
|
2791
|
+
mapId = _action$payload29.mapId,
|
|
2792
|
+
layerId = _action$payload29.layerId;
|
|
2793
|
+
if (!draft.byId[mapId]) {
|
|
2794
|
+
return;
|
|
2795
|
+
}
|
|
2796
|
+
draft.byId[mapId].initialZoomToLayerId = layerId;
|
|
2797
|
+
},
|
|
2693
2798
|
setMapPresetError: function setMapPresetError(_draft, _action) {},
|
|
2694
2799
|
setDefaultMapSettings: function setDefaultMapSettings(draft, action) {
|
|
2695
2800
|
draft.defaultMapSettings = action.payload.preset;
|
|
2696
2801
|
},
|
|
2697
2802
|
changeOverlayer: function changeOverlayer(draft, action) {
|
|
2698
|
-
var _action$
|
|
2699
|
-
mapId = _action$
|
|
2700
|
-
selectedOverlayer = _action$
|
|
2803
|
+
var _action$payload30 = action.payload,
|
|
2804
|
+
mapId = _action$payload30.mapId,
|
|
2805
|
+
selectedOverlayer = _action$payload30.selectedOverlayer;
|
|
2701
2806
|
if (!draft.byId[mapId]) {
|
|
2702
2807
|
return;
|
|
2703
2808
|
}
|
|
2704
2809
|
draft.byId[mapId].overLayers = [selectedOverlayer];
|
|
2705
2810
|
},
|
|
2706
2811
|
toggleClock: function toggleClock(draft, action) {
|
|
2707
|
-
var _action$
|
|
2708
|
-
mapId = _action$
|
|
2709
|
-
isClockVisible = _action$
|
|
2812
|
+
var _action$payload31 = action.payload,
|
|
2813
|
+
mapId = _action$payload31.mapId,
|
|
2814
|
+
isClockVisible = _action$payload31.isClockVisible;
|
|
2710
2815
|
if (!draft.byId[mapId]) {
|
|
2711
2816
|
return;
|
|
2712
2817
|
}
|
|
@@ -2717,19 +2822,19 @@ var slice$6 = createSlice({
|
|
|
2717
2822
|
}
|
|
2718
2823
|
},
|
|
2719
2824
|
toggleClockOptions: function toggleClockOptions(draft, action) {
|
|
2720
|
-
var _action$
|
|
2721
|
-
mapId = _action$
|
|
2722
|
-
isClockOptionsMenuVisible = _action$
|
|
2825
|
+
var _action$payload32 = action.payload,
|
|
2826
|
+
mapId = _action$payload32.mapId,
|
|
2827
|
+
isClockOptionsMenuVisible = _action$payload32.isClockOptionsMenuVisible;
|
|
2723
2828
|
if (!draft.byId[mapId]) {
|
|
2724
2829
|
return;
|
|
2725
2830
|
}
|
|
2726
2831
|
draft.byId[mapId].isClockOptionsMenuVisible = isClockOptionsMenuVisible;
|
|
2727
2832
|
},
|
|
2728
2833
|
setClockPositionSize: function setClockPositionSize(draft, action) {
|
|
2729
|
-
var _action$
|
|
2730
|
-
mapId = _action$
|
|
2731
|
-
position = _action$
|
|
2732
|
-
size = _action$
|
|
2834
|
+
var _action$payload33 = action.payload,
|
|
2835
|
+
mapId = _action$payload33.mapId,
|
|
2836
|
+
position = _action$payload33.position,
|
|
2837
|
+
size = _action$payload33.size;
|
|
2733
2838
|
if (!draft.byId[mapId]) {
|
|
2734
2839
|
return;
|
|
2735
2840
|
}
|
|
@@ -2741,10 +2846,10 @@ var slice$6 = createSlice({
|
|
|
2741
2846
|
}
|
|
2742
2847
|
},
|
|
2743
2848
|
setLegendPositionSize: function setLegendPositionSize(draft, action) {
|
|
2744
|
-
var _action$
|
|
2745
|
-
mapId = _action$
|
|
2746
|
-
position = _action$
|
|
2747
|
-
size = _action$
|
|
2849
|
+
var _action$payload34 = action.payload,
|
|
2850
|
+
mapId = _action$payload34.mapId,
|
|
2851
|
+
position = _action$payload34.position,
|
|
2852
|
+
size = _action$payload34.size;
|
|
2748
2853
|
if (!draft.byId[mapId]) {
|
|
2749
2854
|
return;
|
|
2750
2855
|
}
|
|
@@ -2758,10 +2863,10 @@ var slice$6 = createSlice({
|
|
|
2758
2863
|
},
|
|
2759
2864
|
extraReducers: function extraReducers(builder) {
|
|
2760
2865
|
builder.addCase(layerActions.addLayer, function (draft, action) {
|
|
2761
|
-
var _action$
|
|
2762
|
-
layerId = _action$
|
|
2763
|
-
mapId = _action$
|
|
2764
|
-
layer = _action$
|
|
2866
|
+
var _action$payload35 = action.payload,
|
|
2867
|
+
layerId = _action$payload35.layerId,
|
|
2868
|
+
mapId = _action$payload35.mapId,
|
|
2869
|
+
layer = _action$payload35.layer;
|
|
2765
2870
|
if (!draft.byId[mapId]) {
|
|
2766
2871
|
return;
|
|
2767
2872
|
}
|
|
@@ -2780,10 +2885,10 @@ var slice$6 = createSlice({
|
|
|
2780
2885
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
2781
2886
|
}
|
|
2782
2887
|
}).addCase(layerActions.duplicateMapLayer, function (draft, action) {
|
|
2783
|
-
var _action$
|
|
2784
|
-
newLayerId = _action$
|
|
2785
|
-
oldLayerId = _action$
|
|
2786
|
-
mapId = _action$
|
|
2888
|
+
var _action$payload36 = action.payload,
|
|
2889
|
+
newLayerId = _action$payload36.newLayerId,
|
|
2890
|
+
oldLayerId = _action$payload36.oldLayerId,
|
|
2891
|
+
mapId = _action$payload36.mapId;
|
|
2787
2892
|
if (!draft.byId[mapId]) {
|
|
2788
2893
|
return;
|
|
2789
2894
|
}
|
|
@@ -2800,10 +2905,10 @@ var slice$6 = createSlice({
|
|
|
2800
2905
|
draft.byId[mapId].featureLayers.unshift(newLayerId);
|
|
2801
2906
|
}
|
|
2802
2907
|
}).addCase(layerActions.addBaseLayer, function (draft, action) {
|
|
2803
|
-
var _action$
|
|
2804
|
-
layer = _action$
|
|
2805
|
-
layerId = _action$
|
|
2806
|
-
mapId = _action$
|
|
2908
|
+
var _action$payload37 = action.payload,
|
|
2909
|
+
layer = _action$payload37.layer,
|
|
2910
|
+
layerId = _action$payload37.layerId,
|
|
2911
|
+
mapId = _action$payload37.mapId;
|
|
2807
2912
|
if (!draft.byId[mapId]) {
|
|
2808
2913
|
return;
|
|
2809
2914
|
}
|
|
@@ -2833,9 +2938,9 @@ var slice$6 = createSlice({
|
|
|
2833
2938
|
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2834
2939
|
}
|
|
2835
2940
|
}).addCase(layerActions.setBaseLayers, function (draft, action) {
|
|
2836
|
-
var _action$
|
|
2837
|
-
layers = _action$
|
|
2838
|
-
mapId = _action$
|
|
2941
|
+
var _action$payload38 = action.payload,
|
|
2942
|
+
layers = _action$payload38.layers,
|
|
2943
|
+
mapId = _action$payload38.mapId;
|
|
2839
2944
|
// Split into base and overlayers
|
|
2840
2945
|
var baseLayers = [];
|
|
2841
2946
|
var overLayers = [];
|
|
@@ -2865,9 +2970,9 @@ var slice$6 = createSlice({
|
|
|
2865
2970
|
}
|
|
2866
2971
|
}
|
|
2867
2972
|
}).addCase(layerActions.layerDelete, function (draft, action) {
|
|
2868
|
-
var _action$
|
|
2869
|
-
mapId = _action$
|
|
2870
|
-
layerId = _action$
|
|
2973
|
+
var _action$payload39 = action.payload,
|
|
2974
|
+
mapId = _action$payload39.mapId,
|
|
2975
|
+
layerId = _action$payload39.layerId;
|
|
2871
2976
|
var map = draft.byId[mapId];
|
|
2872
2977
|
if (!map) {
|
|
2873
2978
|
return;
|
|
@@ -2893,9 +2998,9 @@ var slice$6 = createSlice({
|
|
|
2893
2998
|
map.autoTimeStepLayerId = activeLayerId;
|
|
2894
2999
|
}
|
|
2895
3000
|
}).addCase(layerActions.baseLayerDelete, function (draft, action) {
|
|
2896
|
-
var _action$
|
|
2897
|
-
mapId = _action$
|
|
2898
|
-
layerId = _action$
|
|
3001
|
+
var _action$payload40 = action.payload,
|
|
3002
|
+
mapId = _action$payload40.mapId,
|
|
3003
|
+
layerId = _action$payload40.layerId;
|
|
2899
3004
|
if (!draft.byId[mapId]) {
|
|
2900
3005
|
return;
|
|
2901
3006
|
}
|
|
@@ -2906,14 +3011,14 @@ var slice$6 = createSlice({
|
|
|
2906
3011
|
return id !== layerId;
|
|
2907
3012
|
});
|
|
2908
3013
|
}).addCase(layerActions.layerChangeDimension, function (draft, action) {
|
|
2909
|
-
var _action$
|
|
2910
|
-
layerId = _action$
|
|
2911
|
-
dimension = _action$
|
|
3014
|
+
var _action$payload41 = action.payload,
|
|
3015
|
+
layerId = _action$payload41.layerId,
|
|
3016
|
+
dimension = _action$payload41.dimension;
|
|
2912
3017
|
produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension);
|
|
2913
3018
|
}).addCase(setTimeSync, function (draft, action) {
|
|
2914
|
-
var _action$
|
|
2915
|
-
targetsFromAction = _action$
|
|
2916
|
-
source = _action$
|
|
3019
|
+
var _action$payload42 = action.payload,
|
|
3020
|
+
targetsFromAction = _action$payload42.targets,
|
|
3021
|
+
source = _action$payload42.source;
|
|
2917
3022
|
var sourceMapId = source === null || source === void 0 ? void 0 : source.payload.sourceId;
|
|
2918
3023
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2919
3024
|
var targets = [];
|
|
@@ -2971,9 +3076,9 @@ var slice$6 = createSlice({
|
|
|
2971
3076
|
}
|
|
2972
3077
|
});
|
|
2973
3078
|
}).addCase(setBboxSync, function (draft, action) {
|
|
2974
|
-
var _action$
|
|
2975
|
-
targetsFromAction = _action$
|
|
2976
|
-
source = _action$
|
|
3079
|
+
var _action$payload43 = action.payload,
|
|
3080
|
+
targetsFromAction = _action$payload43.targets,
|
|
3081
|
+
source = _action$payload43.source;
|
|
2977
3082
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2978
3083
|
var targets = [];
|
|
2979
3084
|
if (source) {
|
|
@@ -3005,9 +3110,9 @@ var slice$6 = createSlice({
|
|
|
3005
3110
|
* These targets can be used as payloads in new Layer actions.
|
|
3006
3111
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
3007
3112
|
*/
|
|
3008
|
-
var _action$
|
|
3009
|
-
targets = _action$
|
|
3010
|
-
source = _action$
|
|
3113
|
+
var _action$payload44 = action.payload,
|
|
3114
|
+
targets = _action$payload44.targets,
|
|
3115
|
+
source = _action$payload44.source;
|
|
3011
3116
|
return targets.reduce(function (prevState, target) {
|
|
3012
3117
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
3013
3118
|
var action = {
|
|
@@ -3029,9 +3134,9 @@ var slice$6 = createSlice({
|
|
|
3029
3134
|
});
|
|
3030
3135
|
return draft;
|
|
3031
3136
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
3032
|
-
var _action$
|
|
3033
|
-
mapId = _action$
|
|
3034
|
-
dimensionFromAction = _action$
|
|
3137
|
+
var _action$payload45 = action.payload,
|
|
3138
|
+
mapId = _action$payload45.mapId,
|
|
3139
|
+
dimensionFromAction = _action$payload45.dimension;
|
|
3035
3140
|
produceDraftStateSetWebMapDimension(draft, mapId, dimensionFromAction, true);
|
|
3036
3141
|
}).addCase(setMapPreset, function (draft, action) {
|
|
3037
3142
|
var mapId = action.payload.mapId;
|
|
@@ -6796,13 +6901,24 @@ var isTimestepAuto = createSelector(getMapById, function (store) {
|
|
|
6796
6901
|
return store ? store.isTimestepAuto : false;
|
|
6797
6902
|
}, selectorMemoizationOptions);
|
|
6798
6903
|
/**
|
|
6799
|
-
* Returns
|
|
6904
|
+
* Returns how the animation length is determined for the map
|
|
6905
|
+
* @param {object} store store: object - store object
|
|
6906
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
6907
|
+
* @returns {AnimationLengthSetting | undefined} returnType: AnimationLengthSetting
|
|
6908
|
+
*/
|
|
6909
|
+
var getAnimationLength = createSelector(getMapById, function (store) {
|
|
6910
|
+
return store === null || store === void 0 ? void 0 : store.animationLength;
|
|
6911
|
+
}, selectorMemoizationOptions);
|
|
6912
|
+
/**
|
|
6913
|
+
* Returns map is animation auto. Superseded by getAnimationLength; removed
|
|
6914
|
+
* together with the old animation length button.
|
|
6800
6915
|
* @param {object} store store: object - store object
|
|
6801
6916
|
* @param {string} mapId mapId: string - Id of the map
|
|
6802
6917
|
* @returns {boolean} returnType: boolean
|
|
6803
6918
|
*/
|
|
6804
6919
|
var isAnimationLengthAuto = createSelector(getMapById, function (store) {
|
|
6805
|
-
|
|
6920
|
+
var _store$animationLengt;
|
|
6921
|
+
return (store === null || store === void 0 || (_store$animationLengt = store.animationLength) === null || _store$animationLengt === void 0 ? void 0 : _store$animationLengt.mode) === AnimationLengthMode.Auto;
|
|
6806
6922
|
}, selectorMemoizationOptions);
|
|
6807
6923
|
/**
|
|
6808
6924
|
* Returns map is timespan auto
|
|
@@ -7033,7 +7149,7 @@ var getLegendSize = createSelector(getMapById, function (store) {
|
|
|
7033
7149
|
* @param {boolean} keepAllDims? keepAllDims: boolean - default false: whether or not to leave the time and reference_time dimentions
|
|
7034
7150
|
* @returns {MapPreset} returnType: MapPreset
|
|
7035
7151
|
*/
|
|
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) {
|
|
7152
|
+
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
7153
|
var _getMapById$dockedLay, _getMapById;
|
|
7038
7154
|
return (_getMapById$dockedLay = (_getMapById = getMapById(store, mapId)) === null || _getMapById === void 0 ? void 0 : _getMapById.dockedLayerManagerSize) !== null && _getMapById$dockedLay !== void 0 ? _getMapById$dockedLay : 'sizeSmall';
|
|
7039
7155
|
}, function (store, mapId) {
|
|
@@ -7050,9 +7166,9 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
7050
7166
|
}, function (_store, _mapId) {
|
|
7051
7167
|
var keepAllDims = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7052
7168
|
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) {
|
|
7169
|
+
}, 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
7170
|
var _overLayers$, _uiStore$dialogs$isOp, _uiStore$dialogs;
|
|
7055
|
-
var defaultOverlayer = arguments.length >
|
|
7171
|
+
var defaultOverlayer = arguments.length > 34 && arguments[34] !== undefined ? arguments[34] : ((_overLayers$ = overLayers[0]) === null || _overLayers$ === void 0 ? void 0 : _overLayers$.name) || 'none';
|
|
7056
7172
|
var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_ref3) {
|
|
7057
7173
|
_ref3.mapId;
|
|
7058
7174
|
var layer = _objectWithoutProperties(_ref3, _excluded$2);
|
|
@@ -7072,11 +7188,13 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
7072
7188
|
}
|
|
7073
7189
|
return layer;
|
|
7074
7190
|
});
|
|
7075
|
-
var animationPayload = {
|
|
7191
|
+
var animationPayload = _objectSpread2({
|
|
7076
7192
|
interval: mapTimeStep,
|
|
7077
7193
|
speed: mapAnimationDelay ? getSpeedFactor(mapAnimationDelay) : 1,
|
|
7078
7194
|
duration: getAnimationDuration(animationEndTime, animationStartTime)
|
|
7079
|
-
}
|
|
7195
|
+
}, animationLength && {
|
|
7196
|
+
animationLength: animationLength
|
|
7197
|
+
});
|
|
7080
7198
|
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
7199
|
var legendPreset = shouldShowLegend ? _objectSpread2(_objectSpread2({}, legendPosition !== undefined && {
|
|
7082
7200
|
legendPosition: legendPosition
|
|
@@ -7311,7 +7429,7 @@ var getAnimationListAsEpochTimes = createSelector(getAnimationList, function (li
|
|
|
7311
7429
|
* @param {string} mapId mapId: string - Id of the map
|
|
7312
7430
|
* @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
7431
|
*/
|
|
7314
|
-
var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime,
|
|
7432
|
+
var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime, getAnimationLength, function (layers, autoTimeStepLayerId, startTime, endTime, animationLength) {
|
|
7315
7433
|
var _layers$autoTimeStepL2;
|
|
7316
7434
|
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
7435
|
return dimension.name === 'time';
|
|
@@ -7320,8 +7438,9 @@ var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, ge
|
|
|
7320
7438
|
minValue = _ref5.minValue,
|
|
7321
7439
|
maxValue = _ref5.maxValue;
|
|
7322
7440
|
var hasTimeDimension = minValue && maxValue;
|
|
7323
|
-
var
|
|
7324
|
-
var
|
|
7441
|
+
var shouldFollowAutoTimeStepLayer = (animationLength === null || animationLength === void 0 ? void 0 : animationLength.mode) === AnimationLengthMode.Auto && !!autoTimeStepLayerId && !!hasTimeDimension;
|
|
7442
|
+
var animationStartTime = shouldFollowAutoTimeStepLayer ? minValue : startTime;
|
|
7443
|
+
var animationEndTime = shouldFollowAutoTimeStepLayer ? maxValue : endTime;
|
|
7325
7444
|
return {
|
|
7326
7445
|
animationStartTime: animationStartTime,
|
|
7327
7446
|
animationEndTime: animationEndTime
|
|
@@ -7363,6 +7482,12 @@ var getSelectedOverlayerByMapId = createSelector(getMapById, function (store) {
|
|
|
7363
7482
|
var getRefTimeDimensionModes = createSelector(getdefaultMapSettings, function (state) {
|
|
7364
7483
|
return state === null || state === void 0 ? void 0 : state.refTimeDimensionModes;
|
|
7365
7484
|
}, selectorMemoizationOptions);
|
|
7485
|
+
/**
|
|
7486
|
+
* Gets the initialZoomToLayerId flag from map state
|
|
7487
|
+
*/
|
|
7488
|
+
var getInitialZoomToLayerId = createSelector(getMapById, function (map) {
|
|
7489
|
+
return map === null || map === void 0 ? void 0 : map.initialZoomToLayerId;
|
|
7490
|
+
}, selectorMemoizationOptions);
|
|
7366
7491
|
|
|
7367
7492
|
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
7368
7493
|
__proto__: null,
|
|
@@ -7371,6 +7496,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
7371
7496
|
getAllMapsByIds: getAllMapsByIds,
|
|
7372
7497
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
7373
7498
|
getAnimationEndTime: getAnimationEndTime,
|
|
7499
|
+
getAnimationLength: getAnimationLength,
|
|
7374
7500
|
getAnimationList: getAnimationList,
|
|
7375
7501
|
getAnimationListAsEpochTimes: getAnimationListAsEpochTimes,
|
|
7376
7502
|
getAnimationRange: getAnimationRange,
|
|
@@ -7389,6 +7515,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
7389
7515
|
getFirstMap: getFirstMap,
|
|
7390
7516
|
getFirstMapId: getFirstMapId,
|
|
7391
7517
|
getHarmonieInitialProps: getHarmonieInitialProps,
|
|
7518
|
+
getInitialZoomToLayerId: getInitialZoomToLayerId,
|
|
7392
7519
|
getIsClockOptionsMenuVisible: getIsClockOptionsMenuVisible,
|
|
7393
7520
|
getIsClockVisible: getIsClockVisible,
|
|
7394
7521
|
getIsEnabledLayersForMapDimension: getIsEnabledLayersForMapDimension,
|
|
@@ -8559,9 +8686,16 @@ mapListener.startListening({
|
|
|
8559
8686
|
}
|
|
8560
8687
|
}
|
|
8561
8688
|
});
|
|
8689
|
+
/** Auto follows the leading layer and Now follows the clock, so neither may be shifted by layer updates. */
|
|
8690
|
+
var derivesOwnAnimationRange = function derivesOwnAnimationRange(animationLength) {
|
|
8691
|
+
return !!animationLength && animationLength.mode !== AnimationLengthMode.Exact;
|
|
8692
|
+
};
|
|
8562
8693
|
var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
|
|
8563
8694
|
var shouldEndtimeOverride$1 = shouldEndtimeOverride(listenerApi.getState(), mapId);
|
|
8564
|
-
|
|
8695
|
+
var shiftsWithLayerUpdates = function shiftsWithLayerUpdates(id) {
|
|
8696
|
+
return !derivesOwnAnimationRange(getAnimationLength(listenerApi.getState(), id));
|
|
8697
|
+
};
|
|
8698
|
+
if (shouldEndtimeOverride$1 || !shiftsWithLayerUpdates(mapId)) {
|
|
8565
8699
|
return;
|
|
8566
8700
|
}
|
|
8567
8701
|
var animationStart = getAnimationStartTime(listenerApi.getState(), mapId);
|
|
@@ -8581,7 +8715,7 @@ var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
|
|
|
8581
8715
|
var isSyncedMap = syncedMapIds.includes(mapId);
|
|
8582
8716
|
var mapIdsToUpdate = isSyncedMap ? syncedMapIds : [mapId];
|
|
8583
8717
|
// Update new animation times for the map or in case of syncgroup, all maps in the syncgroup
|
|
8584
|
-
mapIdsToUpdate.forEach(function (id) {
|
|
8718
|
+
mapIdsToUpdate.filter(shiftsWithLayerUpdates).forEach(function (id) {
|
|
8585
8719
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
8586
8720
|
mapId: id,
|
|
8587
8721
|
animationEndTime: newAnimationEndTime
|
|
@@ -8742,7 +8876,7 @@ mapListener.startListening({
|
|
|
8742
8876
|
actionCreator: mapActions.setMapPreset,
|
|
8743
8877
|
effect: function () {
|
|
8744
8878
|
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, animationLength, animationEndTime, shouldEndtimeOverride, interval, timeAlreadySet, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, duration, _animationEnd, animationStart, shouldOpenLegend, dockedLayerManagerType, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart, _t;
|
|
8879
|
+
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, animationLength, animationLengthSetting, animationEndTime, shouldEndtimeOverride, interval, timeAlreadySet, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, animationStartTime, _animationEndTime, resolvedRange, duration, _animationEnd, animationStart, shouldOpenLegend, dockedLayerManagerType, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart, _t;
|
|
8746
8880
|
return _regenerator().w(function (_context2) {
|
|
8747
8881
|
while (1) switch (_context2.p = _context2.n) {
|
|
8748
8882
|
case 0:
|
|
@@ -8751,11 +8885,12 @@ mapListener.startListening({
|
|
|
8751
8885
|
mapId = payload.mapId, initialProps = payload.initialProps;
|
|
8752
8886
|
mapPreset = initialProps.mapPreset;
|
|
8753
8887
|
if (!mapPreset) {
|
|
8754
|
-
_context2.n =
|
|
8888
|
+
_context2.n = 7;
|
|
8755
8889
|
break;
|
|
8756
8890
|
}
|
|
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;
|
|
8891
|
+
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
8892
|
_filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
|
|
8893
|
+
pendingInitialZoomToLayerId = null;
|
|
8759
8894
|
if (layers) {
|
|
8760
8895
|
// make sure all layers have a unique id before going forward
|
|
8761
8896
|
autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
@@ -8780,6 +8915,12 @@ mapListener.startListening({
|
|
|
8780
8915
|
newAutoUpdateLayerId = ((_newLayerIds$layers$f2 = newLayerIds.layers.find(function (layer) {
|
|
8781
8916
|
return layer.id === newLayerIds.autoUpdateLayerId;
|
|
8782
8917
|
})) === null || _newLayerIds$layers$f2 === void 0 ? void 0 : _newLayerIds$layers$f2.id) || undefined;
|
|
8918
|
+
if (initialZoomToLayerId) {
|
|
8919
|
+
initialZoomLayerIndex = mapLayers.findIndex(function (layer) {
|
|
8920
|
+
return layer.id === initialZoomToLayerId;
|
|
8921
|
+
});
|
|
8922
|
+
pendingInitialZoomToLayerId = initialZoomLayerIndex >= 0 ? (_newLayerIds$layers$i = newLayerIds.layers[initialZoomLayerIndex]) === null || _newLayerIds$layers$i === void 0 ? void 0 : _newLayerIds$layers$i.id : undefined;
|
|
8923
|
+
}
|
|
8783
8924
|
listenerApi.dispatch(mapActions.setAutoLayerId({
|
|
8784
8925
|
mapId: mapId,
|
|
8785
8926
|
autoTimeStepLayerId: newAutoTimeStepLayerId,
|
|
@@ -8823,14 +8964,29 @@ mapListener.startListening({
|
|
|
8823
8964
|
}
|
|
8824
8965
|
throw new Error("Projection ".concat(proj.srs, " is not supported"));
|
|
8825
8966
|
case 2:
|
|
8967
|
+
listenerApi.dispatch(mapActions.setPendingInitialZoomToLayer({
|
|
8968
|
+
mapId: mapId,
|
|
8969
|
+
layerId: undefined
|
|
8970
|
+
}));
|
|
8826
8971
|
// set bbox
|
|
8827
8972
|
listenerApi.dispatch(mapActions.setBbox({
|
|
8828
8973
|
mapId: mapId,
|
|
8829
8974
|
bbox: proj.bbox,
|
|
8830
8975
|
srs: proj.srs
|
|
8831
8976
|
}));
|
|
8977
|
+
_context2.n = 4;
|
|
8978
|
+
break;
|
|
8832
8979
|
case 3:
|
|
8980
|
+
layerId = pendingInitialZoomToLayerId ||
|
|
8981
|
+
// if not set in preset use first layer to determine initial bbox
|
|
8982
|
+
getLayerIds(listenerApi.getState(), mapId).at(0);
|
|
8983
|
+
listenerApi.dispatch(mapActions.setPendingInitialZoomToLayer({
|
|
8984
|
+
mapId: mapId,
|
|
8985
|
+
layerId: layerId
|
|
8986
|
+
}));
|
|
8987
|
+
case 4:
|
|
8833
8988
|
animationLength = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.duration;
|
|
8989
|
+
animationLengthSetting = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.animationLength;
|
|
8834
8990
|
animationEndTime = (animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.endTime) && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
8835
8991
|
shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
8836
8992
|
if (shouldEndtimeOverride) {
|
|
@@ -8981,6 +9137,34 @@ mapListener.startListening({
|
|
|
8981
9137
|
}));
|
|
8982
9138
|
}
|
|
8983
9139
|
}
|
|
9140
|
+
// restores how the animation length is determined, overriding duration and endTime
|
|
9141
|
+
if (animationLengthSetting) {
|
|
9142
|
+
if (animationLengthSetting.mode === AnimationLengthMode.Exact) {
|
|
9143
|
+
animationStartTime = animationLengthSetting.animationStartTime, _animationEndTime = animationLengthSetting.animationEndTime;
|
|
9144
|
+
listenerApi.dispatch(mapActions.setAnimationLength({
|
|
9145
|
+
mapId: mapId,
|
|
9146
|
+
animationLength: animationLengthSetting,
|
|
9147
|
+
animationStartTime: animationStartTime,
|
|
9148
|
+
animationEndTime: _animationEndTime
|
|
9149
|
+
}));
|
|
9150
|
+
}
|
|
9151
|
+
if (animationLengthSetting.mode === AnimationLengthMode.Now) {
|
|
9152
|
+
resolvedRange = isValidAnimationLength(animationLengthSetting) ? resolveNowAnimationRange(animationLengthSetting) : undefined;
|
|
9153
|
+
listenerApi.dispatch(mapActions.setAnimationLength(_objectSpread2({
|
|
9154
|
+
mapId: mapId,
|
|
9155
|
+
animationLength: animationLengthSetting
|
|
9156
|
+
}, resolvedRange)));
|
|
9157
|
+
if (resolvedRange && timeAlreadySet === undefined) {
|
|
9158
|
+
listenerApi.dispatch(genericActions.setTime({
|
|
9159
|
+
origin: 'map/listener.ts, setAnimationLength',
|
|
9160
|
+
sourceId: mapId,
|
|
9161
|
+
value: {
|
|
9162
|
+
currentTime: resolvedRange.animationStartTime
|
|
9163
|
+
}
|
|
9164
|
+
}));
|
|
9165
|
+
}
|
|
9166
|
+
}
|
|
9167
|
+
}
|
|
8984
9168
|
// sets animationDelay by speed of animationPayload
|
|
8985
9169
|
if (animationPayload !== null && animationPayload !== void 0 && animationPayload.speed) {
|
|
8986
9170
|
listenerApi.dispatch(mapActions.setAnimationDelay({
|
|
@@ -9062,15 +9246,15 @@ mapListener.startListening({
|
|
|
9062
9246
|
dockedLayerManagerDimensions: dockedLayerManagerDimensions
|
|
9063
9247
|
}));
|
|
9064
9248
|
}
|
|
9065
|
-
case
|
|
9066
|
-
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
9067
|
-
_context2.n =
|
|
9249
|
+
case 5:
|
|
9250
|
+
if (!(animationEndTime && !derivesOwnAnimationRange(animationLengthSetting) && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
9251
|
+
_context2.n = 7;
|
|
9068
9252
|
break;
|
|
9069
9253
|
}
|
|
9070
9254
|
fiveMinuteDelayForAnimation = 1000 * 60 * 5; // eslint-disable-next-line no-await-in-loop
|
|
9071
|
-
_context2.n =
|
|
9255
|
+
_context2.n = 6;
|
|
9072
9256
|
return listenerApi.delay(fiveMinuteDelayForAnimation);
|
|
9073
|
-
case
|
|
9257
|
+
case 6:
|
|
9074
9258
|
_animationEnd2 = getAnimationEndTime(listenerApi.getState(), mapId);
|
|
9075
9259
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
9076
9260
|
mapId: mapId,
|
|
@@ -9085,13 +9269,13 @@ mapListener.startListening({
|
|
|
9085
9269
|
minutes: 5
|
|
9086
9270
|
}).toISOString()
|
|
9087
9271
|
}));
|
|
9088
|
-
_context2.n =
|
|
9089
|
-
break;
|
|
9090
|
-
case 6:
|
|
9091
|
-
_context2.n = 8;
|
|
9272
|
+
_context2.n = 5;
|
|
9092
9273
|
break;
|
|
9093
9274
|
case 7:
|
|
9094
|
-
_context2.
|
|
9275
|
+
_context2.n = 9;
|
|
9276
|
+
break;
|
|
9277
|
+
case 8:
|
|
9278
|
+
_context2.p = 8;
|
|
9095
9279
|
_t = _context2.v;
|
|
9096
9280
|
if (_t instanceof Error) {
|
|
9097
9281
|
listenerApi.dispatch(mapActions.setMapPresetError({
|
|
@@ -9099,10 +9283,10 @@ mapListener.startListening({
|
|
|
9099
9283
|
error: _t.message
|
|
9100
9284
|
}));
|
|
9101
9285
|
}
|
|
9102
|
-
case
|
|
9286
|
+
case 9:
|
|
9103
9287
|
return _context2.a(2);
|
|
9104
9288
|
}
|
|
9105
|
-
}, _callee2, null, [[1,
|
|
9289
|
+
}, _callee2, null, [[1, 8]]);
|
|
9106
9290
|
}));
|
|
9107
9291
|
function effect(_x3, _x4) {
|
|
9108
9292
|
return _effect2.apply(this, arguments);
|
|
@@ -9110,11 +9294,66 @@ mapListener.startListening({
|
|
|
9110
9294
|
return effect;
|
|
9111
9295
|
}()
|
|
9112
9296
|
});
|
|
9297
|
+
var NOW_ANIMATION_REFRESH_INTERVAL = 1000 * 60 * 5;
|
|
9298
|
+
/* Newest loop per map wins; older loops see a stale token and exit. */
|
|
9299
|
+
var nowAnimationRefreshTokens = new Map();
|
|
9300
|
+
mapListener.startListening({
|
|
9301
|
+
actionCreator: mapActions.setAnimationLength,
|
|
9302
|
+
effect: function () {
|
|
9303
|
+
var _effect3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref7, listenerApi) {
|
|
9304
|
+
var payload, mapId, refreshToken, isNewestRefreshLoop, getClockFollowingLength, animationLength;
|
|
9305
|
+
return _regenerator().w(function (_context3) {
|
|
9306
|
+
while (1) switch (_context3.n) {
|
|
9307
|
+
case 0:
|
|
9308
|
+
payload = _ref7.payload;
|
|
9309
|
+
mapId = payload.mapId;
|
|
9310
|
+
refreshToken = Symbol(mapId);
|
|
9311
|
+
nowAnimationRefreshTokens.set(mapId, refreshToken);
|
|
9312
|
+
isNewestRefreshLoop = function isNewestRefreshLoop() {
|
|
9313
|
+
return nowAnimationRefreshTokens.get(mapId) === refreshToken;
|
|
9314
|
+
};
|
|
9315
|
+
getClockFollowingLength = function getClockFollowingLength() {
|
|
9316
|
+
var animationLength = getAnimationLength(listenerApi.getState(), mapId);
|
|
9317
|
+
var timeStep = getMapTimeStep(listenerApi.getState(), mapId);
|
|
9318
|
+
return (animationLength === null || animationLength === void 0 ? void 0 : animationLength.mode) === AnimationLengthMode.Now && isValidAnimationLength(animationLength) && isWithinAnimationStepLimit(animationLength, timeStep) ? animationLength : undefined;
|
|
9319
|
+
};
|
|
9320
|
+
case 1:
|
|
9321
|
+
if (!(isNewestRefreshLoop() && getClockFollowingLength())) {
|
|
9322
|
+
_context3.n = 4;
|
|
9323
|
+
break;
|
|
9324
|
+
}
|
|
9325
|
+
_context3.n = 2;
|
|
9326
|
+
return listenerApi.delay(NOW_ANIMATION_REFRESH_INTERVAL);
|
|
9327
|
+
case 2:
|
|
9328
|
+
animationLength = getClockFollowingLength();
|
|
9329
|
+
if (!(!isNewestRefreshLoop() || !animationLength)) {
|
|
9330
|
+
_context3.n = 3;
|
|
9331
|
+
break;
|
|
9332
|
+
}
|
|
9333
|
+
return _context3.a(2);
|
|
9334
|
+
case 3:
|
|
9335
|
+
listenerApi.dispatch(mapActions.refreshNowAnimationRange(_objectSpread2({
|
|
9336
|
+
mapId: mapId
|
|
9337
|
+
}, resolveNowAnimationRange(animationLength))));
|
|
9338
|
+
_context3.n = 1;
|
|
9339
|
+
break;
|
|
9340
|
+
case 4:
|
|
9341
|
+
return _context3.a(2);
|
|
9342
|
+
}
|
|
9343
|
+
}, _callee3);
|
|
9344
|
+
}));
|
|
9345
|
+
function effect(_x5, _x6) {
|
|
9346
|
+
return _effect3.apply(this, arguments);
|
|
9347
|
+
}
|
|
9348
|
+
return effect;
|
|
9349
|
+
}()
|
|
9350
|
+
});
|
|
9113
9351
|
mapListener.startListening({
|
|
9114
9352
|
actionCreator: mapActions.unregisterMap,
|
|
9115
|
-
effect: function effect(
|
|
9116
|
-
var payload =
|
|
9353
|
+
effect: function effect(_ref8, listenerApi) {
|
|
9354
|
+
var payload = _ref8.payload;
|
|
9117
9355
|
var mapId = payload.mapId;
|
|
9356
|
+
nowAnimationRefreshTokens["delete"](mapId);
|
|
9118
9357
|
var layerList = getLayersByMapId(listenerApi.getState(), mapId);
|
|
9119
9358
|
metronome.unregister(mapId);
|
|
9120
9359
|
layerList.map(function (layer) {
|
|
@@ -9131,8 +9370,8 @@ mapListener.startListening({
|
|
|
9131
9370
|
});
|
|
9132
9371
|
mapListener.startListening({
|
|
9133
9372
|
actionCreator: mapActions.setStepBackwardOrForward,
|
|
9134
|
-
effect: function effect(
|
|
9135
|
-
var payload =
|
|
9373
|
+
effect: function effect(_ref9, listenerApi) {
|
|
9374
|
+
var payload = _ref9.payload;
|
|
9136
9375
|
var mapId = payload.mapId,
|
|
9137
9376
|
isForwardStep = payload.isForwardStep;
|
|
9138
9377
|
// timeStep is stored in minutes
|