@opengeoweb/store 19.5.1 → 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 +526 -215
- 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/selectors.d.ts +49 -0
- 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 +10 -1
- package/dist/src/store/map/map/selectors.d.ts +169 -14
- package/dist/src/store/map/map/types.d.ts +39 -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 {
|
|
@@ -1620,18 +1639,25 @@ var slice$7 = createSlice({
|
|
|
1620
1639
|
}
|
|
1621
1640
|
},
|
|
1622
1641
|
duplicateMapLayer: function duplicateMapLayer(draft, action) {
|
|
1642
|
+
var _oldLayer$dimensions;
|
|
1623
1643
|
var _action$payload2 = action.payload,
|
|
1624
1644
|
oldLayerId = _action$payload2.oldLayerId,
|
|
1625
1645
|
newLayerId = _action$payload2.newLayerId,
|
|
1626
1646
|
mapId = _action$payload2.mapId;
|
|
1627
1647
|
var oldLayer = draft.byId[oldLayerId];
|
|
1628
|
-
if (oldLayer
|
|
1629
|
-
|
|
1630
|
-
id: newLayerId,
|
|
1631
|
-
mapId: mapId
|
|
1632
|
-
}));
|
|
1633
|
-
draft.allIds.push(newLayerId);
|
|
1648
|
+
if (!oldLayer || draft.byId[newLayerId]) {
|
|
1649
|
+
return;
|
|
1634
1650
|
}
|
|
1651
|
+
// Clone dimensions from the Immer draft to avoid sharing references with the original layer.
|
|
1652
|
+
var dimensions = (_oldLayer$dimensions = oldLayer.dimensions) === null || _oldLayer$dimensions === void 0 ? void 0 : _oldLayer$dimensions.map(function (dimension) {
|
|
1653
|
+
return _objectSpread2({}, dimension);
|
|
1654
|
+
});
|
|
1655
|
+
draft.byId[newLayerId] = createLayer(_objectSpread2(_objectSpread2({}, oldLayer), {}, {
|
|
1656
|
+
dimensions: dimensions,
|
|
1657
|
+
id: newLayerId,
|
|
1658
|
+
mapId: mapId
|
|
1659
|
+
}));
|
|
1660
|
+
draft.allIds.push(newLayerId);
|
|
1635
1661
|
},
|
|
1636
1662
|
layerChangeDimension: function layerChangeDimension(draft, action) {
|
|
1637
1663
|
var _action$payload3 = action.payload,
|
|
@@ -1987,8 +2013,12 @@ var slice$7 = createSlice({
|
|
|
1987
2013
|
existingDimension.currentValue = newLayerDimension.currentValue;
|
|
1988
2014
|
}
|
|
1989
2015
|
} else if (layerId === layerDimensions.layerId) {
|
|
2016
|
+
var _newLayerDimension$va2, _newLayerDimension$va3;
|
|
1990
2017
|
/* Otherwise add a new one, but only for this layer. */
|
|
1991
|
-
|
|
2018
|
+
var currentValue = newLayerDimension.name === 'reference_time' && reduxLayer.useLatestReferenceTime ? (_newLayerDimension$va2 = (_newLayerDimension$va3 = newLayerDimension.values) === null || _newLayerDimension$va3 === void 0 ? void 0 : _newLayerDimension$va3.split(',').at(-1)) !== null && _newLayerDimension$va2 !== void 0 ? _newLayerDimension$va2 : newLayerDimension.currentValue : newLayerDimension.currentValue;
|
|
2019
|
+
reduxDimensions.push(_objectSpread2(_objectSpread2({}, newLayerDimension), {}, {
|
|
2020
|
+
currentValue: currentValue
|
|
2021
|
+
}));
|
|
1992
2022
|
}
|
|
1993
2023
|
});
|
|
1994
2024
|
// Ensure that the time range is correctly set based on the current reference time value
|
|
@@ -2084,17 +2114,13 @@ var slice$7 = createSlice({
|
|
|
2084
2114
|
var selectedFeatureKey = getFeatureSelectionKey(selectedFeature);
|
|
2085
2115
|
currentLayer.selectedFeatureIds = selectedFeatureKey ? [selectedFeatureKey] : [];
|
|
2086
2116
|
}
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
var bounds = intersectionBoundsLayer.geojson;
|
|
2095
|
-
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);
|
|
2096
|
-
intersectionLayer.geojson = createInterSections(updatedGeoJSONWithIds, bounds, geoJSONProperties);
|
|
2097
|
-
}
|
|
2117
|
+
updateIntersectionLayers({
|
|
2118
|
+
draft: draft,
|
|
2119
|
+
currentLayer: currentLayer,
|
|
2120
|
+
geojson: updatedGeoJSONWithIds,
|
|
2121
|
+
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId,
|
|
2122
|
+
geoJSONIntersectionBoundsLayerId: geoJSONIntersectionBoundsLayerId
|
|
2123
|
+
});
|
|
2098
2124
|
},
|
|
2099
2125
|
updateFeatureProperties: function updateFeatureProperties(draft, action) {
|
|
2100
2126
|
var _currentLayer$geojson2;
|
|
@@ -2116,13 +2142,59 @@ var slice$7 = createSlice({
|
|
|
2116
2142
|
});
|
|
2117
2143
|
}
|
|
2118
2144
|
},
|
|
2119
|
-
|
|
2120
|
-
var _currentLayer$geojson3
|
|
2145
|
+
moveFeatures: function moveFeatures(draft, action) {
|
|
2146
|
+
var _currentLayer$geojson3;
|
|
2121
2147
|
var _action$payload21 = action.payload,
|
|
2122
2148
|
layerId = _action$payload21.layerId,
|
|
2123
|
-
|
|
2149
|
+
movedFeatures = _action$payload21.movedFeatures,
|
|
2150
|
+
geoJSONIntersectionLayerId = _action$payload21.geoJSONIntersectionLayerId,
|
|
2151
|
+
geoJSONIntersectionBoundsLayerId = _action$payload21.geoJSONIntersectionBoundsLayerId;
|
|
2124
2152
|
var currentLayer = draft.byId[layerId];
|
|
2125
|
-
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)) {
|
|
2126
2198
|
return;
|
|
2127
2199
|
}
|
|
2128
2200
|
var features = currentLayer.geojson.features;
|
|
@@ -2153,10 +2225,10 @@ var slice$7 = createSlice({
|
|
|
2153
2225
|
});
|
|
2154
2226
|
},
|
|
2155
2227
|
toggleFeatureMode: function toggleFeatureMode(draft, action) {
|
|
2156
|
-
var _action$
|
|
2157
|
-
layerId = _action$
|
|
2158
|
-
isInEditMode = _action$
|
|
2159
|
-
drawMode = _action$
|
|
2228
|
+
var _action$payload23 = action.payload,
|
|
2229
|
+
layerId = _action$payload23.layerId,
|
|
2230
|
+
isInEditMode = _action$payload23.isInEditMode,
|
|
2231
|
+
drawMode = _action$payload23.drawMode;
|
|
2160
2232
|
if (!draft.byId[layerId]) {
|
|
2161
2233
|
return;
|
|
2162
2234
|
}
|
|
@@ -2168,10 +2240,10 @@ var slice$7 = createSlice({
|
|
|
2168
2240
|
}
|
|
2169
2241
|
},
|
|
2170
2242
|
exitFeatureDrawMode: function exitFeatureDrawMode(draft, action) {
|
|
2171
|
-
var _action$
|
|
2172
|
-
layerId = _action$
|
|
2173
|
-
shouldAllowMultipleShapes = _action$
|
|
2174
|
-
reason = _action$
|
|
2243
|
+
var _action$payload24 = action.payload,
|
|
2244
|
+
layerId = _action$payload24.layerId,
|
|
2245
|
+
shouldAllowMultipleShapes = _action$payload24.shouldAllowMultipleShapes,
|
|
2246
|
+
reason = _action$payload24.reason;
|
|
2175
2247
|
if (!draft.byId[layerId]) {
|
|
2176
2248
|
return;
|
|
2177
2249
|
}
|
|
@@ -2207,10 +2279,10 @@ var slice$7 = createSlice({
|
|
|
2207
2279
|
},
|
|
2208
2280
|
// layer info actions
|
|
2209
2281
|
showLayerInfo: function showLayerInfo(draft, action) {
|
|
2210
|
-
var _action$
|
|
2211
|
-
serviceUrl = _action$
|
|
2212
|
-
layerName = _action$
|
|
2213
|
-
style = _action$
|
|
2282
|
+
var _action$payload25 = action.payload,
|
|
2283
|
+
serviceUrl = _action$payload25.serviceUrl,
|
|
2284
|
+
layerName = _action$payload25.layerName,
|
|
2285
|
+
style = _action$payload25.style;
|
|
2214
2286
|
draft.activeLayerInfo = {
|
|
2215
2287
|
serviceUrl: serviceUrl,
|
|
2216
2288
|
layerName: layerName,
|
|
@@ -2221,9 +2293,9 @@ var slice$7 = createSlice({
|
|
|
2221
2293
|
delete draft.activeLayerInfo;
|
|
2222
2294
|
},
|
|
2223
2295
|
SetLayerLegendVisibilityPayload: function SetLayerLegendVisibilityPayload(draft, action) {
|
|
2224
|
-
var _action$
|
|
2225
|
-
layerId = _action$
|
|
2226
|
-
showLayerLegend = _action$
|
|
2296
|
+
var _action$payload26 = action.payload,
|
|
2297
|
+
layerId = _action$payload26.layerId,
|
|
2298
|
+
showLayerLegend = _action$payload26.showLayerLegend;
|
|
2227
2299
|
var layer = draft.byId[layerId];
|
|
2228
2300
|
if (!layer) {
|
|
2229
2301
|
return;
|
|
@@ -2236,9 +2308,9 @@ var slice$7 = createSlice({
|
|
|
2236
2308
|
},
|
|
2237
2309
|
extraReducers: function extraReducers(builder) {
|
|
2238
2310
|
builder.addCase(setTimeSync, function (draft, action) {
|
|
2239
|
-
var _action$
|
|
2240
|
-
targetsFromAction = _action$
|
|
2241
|
-
source = _action$
|
|
2311
|
+
var _action$payload27 = action.payload,
|
|
2312
|
+
targetsFromAction = _action$payload27.targets,
|
|
2313
|
+
source = _action$payload27.source;
|
|
2242
2314
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2243
2315
|
var targets = [];
|
|
2244
2316
|
if (source) {
|
|
@@ -2268,9 +2340,9 @@ var slice$7 = createSlice({
|
|
|
2268
2340
|
* These targets can be used as payloads in new Layer actions.
|
|
2269
2341
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
2270
2342
|
*/
|
|
2271
|
-
var _action$
|
|
2272
|
-
targets = _action$
|
|
2273
|
-
source = _action$
|
|
2343
|
+
var _action$payload28 = action.payload,
|
|
2344
|
+
targets = _action$payload28.targets,
|
|
2345
|
+
source = _action$payload28.source;
|
|
2274
2346
|
return targets.reduce(function (prevState, target) {
|
|
2275
2347
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
2276
2348
|
var action = {
|
|
@@ -2457,7 +2529,9 @@ var slice$6 = createSlice({
|
|
|
2457
2529
|
return;
|
|
2458
2530
|
}
|
|
2459
2531
|
draft.byId[mapId].animationStartTime = animationStartTime;
|
|
2460
|
-
draft.byId[mapId].
|
|
2532
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2533
|
+
mode: AnimationLengthMode.Exact
|
|
2534
|
+
});
|
|
2461
2535
|
},
|
|
2462
2536
|
setAnimationEndTime: function setAnimationEndTime(draft, action) {
|
|
2463
2537
|
var _action$payload7 = action.payload,
|
|
@@ -2467,23 +2541,53 @@ var slice$6 = createSlice({
|
|
|
2467
2541
|
return;
|
|
2468
2542
|
}
|
|
2469
2543
|
draft.byId[mapId].animationEndTime = animationEndTime;
|
|
2470
|
-
draft.byId[mapId].
|
|
2544
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2545
|
+
mode: AnimationLengthMode.Exact
|
|
2546
|
+
});
|
|
2471
2547
|
},
|
|
2472
|
-
|
|
2548
|
+
setAnimationLength: function setAnimationLength(draft, action) {
|
|
2473
2549
|
var _action$payload8 = action.payload,
|
|
2474
2550
|
mapId = _action$payload8.mapId,
|
|
2475
|
-
|
|
2551
|
+
animationLength = _action$payload8.animationLength,
|
|
2552
|
+
animationStartTime = _action$payload8.animationStartTime,
|
|
2553
|
+
animationEndTime = _action$payload8.animationEndTime;
|
|
2476
2554
|
if (!draft.byId[mapId]) {
|
|
2477
2555
|
return;
|
|
2478
2556
|
}
|
|
2479
|
-
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
|
+
}
|
|
2480
2564
|
},
|
|
2481
|
-
|
|
2565
|
+
refreshNowAnimationRange: function refreshNowAnimationRange(draft, action) {
|
|
2482
2566
|
var _action$payload9 = action.payload,
|
|
2483
|
-
oldIndex = _action$payload9.oldIndex,
|
|
2484
|
-
newIndex = _action$payload9.newIndex,
|
|
2485
2567
|
mapId = _action$payload9.mapId,
|
|
2486
|
-
|
|
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;
|
|
2487
2591
|
if (!draft.byId[mapId]) {
|
|
2488
2592
|
return;
|
|
2489
2593
|
}
|
|
@@ -2494,11 +2598,11 @@ var slice$6 = createSlice({
|
|
|
2494
2598
|
}
|
|
2495
2599
|
},
|
|
2496
2600
|
setAutoLayerId: function setAutoLayerId(draft, action) {
|
|
2497
|
-
var _action$
|
|
2498
|
-
mapId = _action$
|
|
2499
|
-
layerId = _action$
|
|
2500
|
-
autoTimeStepLayerId = _action$
|
|
2501
|
-
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;
|
|
2502
2606
|
var map = draft.byId[mapId];
|
|
2503
2607
|
if (!map) {
|
|
2504
2608
|
return;
|
|
@@ -2515,9 +2619,9 @@ var slice$6 = createSlice({
|
|
|
2515
2619
|
}
|
|
2516
2620
|
},
|
|
2517
2621
|
setAutoTimestepLayerId: function setAutoTimestepLayerId(draft, action) {
|
|
2518
|
-
var _action$
|
|
2519
|
-
mapId = _action$
|
|
2520
|
-
autoTimestepLayerId = _action$
|
|
2622
|
+
var _action$payload11 = action.payload,
|
|
2623
|
+
mapId = _action$payload11.mapId,
|
|
2624
|
+
autoTimestepLayerId = _action$payload11.autoTimestepLayerId;
|
|
2521
2625
|
var map = draft.byId[mapId];
|
|
2522
2626
|
if (!map) {
|
|
2523
2627
|
return;
|
|
@@ -2525,9 +2629,9 @@ var slice$6 = createSlice({
|
|
|
2525
2629
|
map.autoTimeStepLayerId = autoTimestepLayerId;
|
|
2526
2630
|
},
|
|
2527
2631
|
setAutoUpdateLayerId: function setAutoUpdateLayerId(draft, action) {
|
|
2528
|
-
var _action$
|
|
2529
|
-
mapId = _action$
|
|
2530
|
-
autoUpdateLayerId = _action$
|
|
2632
|
+
var _action$payload12 = action.payload,
|
|
2633
|
+
mapId = _action$payload12.mapId,
|
|
2634
|
+
autoUpdateLayerId = _action$payload12.autoUpdateLayerId;
|
|
2531
2635
|
var map = draft.byId[mapId];
|
|
2532
2636
|
if (!map) {
|
|
2533
2637
|
return;
|
|
@@ -2535,9 +2639,9 @@ var slice$6 = createSlice({
|
|
|
2535
2639
|
map.autoUpdateLayerId = autoUpdateLayerId;
|
|
2536
2640
|
},
|
|
2537
2641
|
setTimeSliderWidth: function setTimeSliderWidth(draft, action) {
|
|
2538
|
-
var _action$
|
|
2539
|
-
mapId = _action$
|
|
2540
|
-
timeSliderWidth = _action$
|
|
2642
|
+
var _action$payload13 = action.payload,
|
|
2643
|
+
mapId = _action$payload13.mapId,
|
|
2644
|
+
timeSliderWidth = _action$payload13.timeSliderWidth;
|
|
2541
2645
|
if (!draft.byId[mapId]) {
|
|
2542
2646
|
return;
|
|
2543
2647
|
}
|
|
@@ -2545,157 +2649,169 @@ var slice$6 = createSlice({
|
|
|
2545
2649
|
draft.byId[mapId].timeSliderSecondsPerPx = secondsPerPxFromCanvasWidth(timeSliderWidth, draft.byId[mapId].timeSliderSpan || defaultTimeSpan);
|
|
2546
2650
|
},
|
|
2547
2651
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2548
|
-
var _action$
|
|
2549
|
-
mapId = _action$
|
|
2550
|
-
timeSliderCenterTime = _action$
|
|
2652
|
+
var _action$payload14 = action.payload,
|
|
2653
|
+
mapId = _action$payload14.mapId,
|
|
2654
|
+
timeSliderCenterTime = _action$payload14.timeSliderCenterTime;
|
|
2551
2655
|
if (!draft.byId[mapId]) {
|
|
2552
2656
|
return;
|
|
2553
2657
|
}
|
|
2554
2658
|
draft.byId[mapId].timeSliderCenterTime = timeSliderCenterTime;
|
|
2555
2659
|
},
|
|
2556
2660
|
toggleAutoUpdate: function toggleAutoUpdate(draft, action) {
|
|
2557
|
-
var _action$
|
|
2558
|
-
mapId = _action$
|
|
2559
|
-
shouldAutoUpdate = _action$
|
|
2661
|
+
var _action$payload15 = action.payload,
|
|
2662
|
+
mapId = _action$payload15.mapId,
|
|
2663
|
+
shouldAutoUpdate = _action$payload15.shouldAutoUpdate;
|
|
2560
2664
|
if (!draft.byId[mapId]) {
|
|
2561
2665
|
return;
|
|
2562
2666
|
}
|
|
2563
2667
|
draft.byId[mapId].isAutoUpdating = shouldAutoUpdate;
|
|
2564
2668
|
},
|
|
2565
2669
|
setEndTimeOverriding: function setEndTimeOverriding(draft, action) {
|
|
2566
|
-
var _action$
|
|
2567
|
-
mapId = _action$
|
|
2568
|
-
shouldEndtimeOverride = _action$
|
|
2670
|
+
var _action$payload16 = action.payload,
|
|
2671
|
+
mapId = _action$payload16.mapId,
|
|
2672
|
+
shouldEndtimeOverride = _action$payload16.shouldEndtimeOverride;
|
|
2569
2673
|
if (!draft.byId[mapId]) {
|
|
2570
2674
|
return;
|
|
2571
2675
|
}
|
|
2572
2676
|
draft.byId[mapId].shouldEndtimeOverride = shouldEndtimeOverride;
|
|
2573
2677
|
},
|
|
2574
2678
|
toggleTimestepAuto: function toggleTimestepAuto(draft, action) {
|
|
2575
|
-
var _action$
|
|
2576
|
-
mapId = _action$
|
|
2577
|
-
timestepAuto = _action$
|
|
2679
|
+
var _action$payload17 = action.payload,
|
|
2680
|
+
mapId = _action$payload17.mapId,
|
|
2681
|
+
timestepAuto = _action$payload17.timestepAuto;
|
|
2578
2682
|
if (!draft.byId[mapId]) {
|
|
2579
2683
|
return;
|
|
2580
2684
|
}
|
|
2581
2685
|
draft.byId[mapId].isTimestepAuto = timestepAuto;
|
|
2582
2686
|
},
|
|
2583
2687
|
toggleTimeSpanAuto: function toggleTimeSpanAuto(draft, action) {
|
|
2584
|
-
var _action$
|
|
2585
|
-
mapId = _action$
|
|
2586
|
-
timeSpanAuto = _action$
|
|
2688
|
+
var _action$payload18 = action.payload,
|
|
2689
|
+
mapId = _action$payload18.mapId,
|
|
2690
|
+
timeSpanAuto = _action$payload18.timeSpanAuto;
|
|
2587
2691
|
if (!draft.byId[mapId]) {
|
|
2588
2692
|
return;
|
|
2589
2693
|
}
|
|
2590
2694
|
draft.byId[mapId].isTimeSpanAuto = timeSpanAuto;
|
|
2591
2695
|
},
|
|
2696
|
+
/** Superseded by setAnimationLength; removed together with the old animation length button. */
|
|
2592
2697
|
toggleAnimationLengthAuto: function toggleAnimationLengthAuto(draft, action) {
|
|
2593
|
-
var _action$
|
|
2594
|
-
mapId = _action$
|
|
2595
|
-
autoAnimationLength = _action$
|
|
2698
|
+
var _action$payload19 = action.payload,
|
|
2699
|
+
mapId = _action$payload19.mapId,
|
|
2700
|
+
autoAnimationLength = _action$payload19.autoAnimationLength;
|
|
2596
2701
|
if (!draft.byId[mapId]) {
|
|
2597
2702
|
return;
|
|
2598
2703
|
}
|
|
2599
|
-
draft.byId[mapId].
|
|
2704
|
+
draft.byId[mapId].animationLength = _objectSpread2(_objectSpread2({}, draft.byId[mapId].animationLength), {}, {
|
|
2705
|
+
mode: autoAnimationLength ? AnimationLengthMode.Auto : AnimationLengthMode.Exact
|
|
2706
|
+
});
|
|
2600
2707
|
},
|
|
2601
2708
|
toggleTimeSliderHover: function toggleTimeSliderHover(draft, action) {
|
|
2602
|
-
var _action$
|
|
2603
|
-
mapId = _action$
|
|
2604
|
-
isTimeSliderHoverOn = _action$
|
|
2709
|
+
var _action$payload20 = action.payload,
|
|
2710
|
+
mapId = _action$payload20.mapId,
|
|
2711
|
+
isTimeSliderHoverOn = _action$payload20.isTimeSliderHoverOn;
|
|
2605
2712
|
if (!draft.byId[mapId]) {
|
|
2606
2713
|
return;
|
|
2607
2714
|
}
|
|
2608
2715
|
draft.byId[mapId].isTimeSliderHoverOn = isTimeSliderHoverOn;
|
|
2609
2716
|
},
|
|
2610
2717
|
toggleTimeSliderIsVisible: function toggleTimeSliderIsVisible(draft, action) {
|
|
2611
|
-
var _action$
|
|
2612
|
-
mapId = _action$
|
|
2613
|
-
isTimeSliderVisible = _action$
|
|
2718
|
+
var _action$payload21 = action.payload,
|
|
2719
|
+
mapId = _action$payload21.mapId,
|
|
2720
|
+
isTimeSliderVisible = _action$payload21.isTimeSliderVisible;
|
|
2614
2721
|
if (!draft.byId[mapId]) {
|
|
2615
2722
|
return;
|
|
2616
2723
|
}
|
|
2617
2724
|
draft.byId[mapId].isTimeSliderVisible = isTimeSliderVisible;
|
|
2618
2725
|
},
|
|
2619
2726
|
toggleZoomControls: function toggleZoomControls(draft, action) {
|
|
2620
|
-
var _action$
|
|
2621
|
-
mapId = _action$
|
|
2622
|
-
shouldShowZoomControls = _action$
|
|
2727
|
+
var _action$payload22 = action.payload,
|
|
2728
|
+
mapId = _action$payload22.mapId,
|
|
2729
|
+
shouldShowZoomControls = _action$payload22.shouldShowZoomControls;
|
|
2623
2730
|
if (!draft.byId[mapId]) {
|
|
2624
2731
|
return;
|
|
2625
2732
|
}
|
|
2626
2733
|
draft.byId[mapId].shouldShowZoomControls = shouldShowZoomControls;
|
|
2627
2734
|
},
|
|
2628
2735
|
setMapPinLocation: function setMapPinLocation(draft, action) {
|
|
2629
|
-
var _action$
|
|
2630
|
-
mapId = _action$
|
|
2631
|
-
mapPinLocation = _action$
|
|
2736
|
+
var _action$payload23 = action.payload,
|
|
2737
|
+
mapId = _action$payload23.mapId,
|
|
2738
|
+
mapPinLocation = _action$payload23.mapPinLocation;
|
|
2632
2739
|
if (!draft.byId[mapId]) {
|
|
2633
2740
|
return;
|
|
2634
2741
|
}
|
|
2635
2742
|
draft.byId[mapId].mapPinLocation = mapPinLocation;
|
|
2636
2743
|
},
|
|
2637
2744
|
setDisableMapPin: function setDisableMapPin(draft, action) {
|
|
2638
|
-
var _action$
|
|
2639
|
-
mapId = _action$
|
|
2640
|
-
disableMapPin = _action$
|
|
2745
|
+
var _action$payload24 = action.payload,
|
|
2746
|
+
mapId = _action$payload24.mapId,
|
|
2747
|
+
disableMapPin = _action$payload24.disableMapPin;
|
|
2641
2748
|
if (!draft.byId[mapId]) {
|
|
2642
2749
|
return;
|
|
2643
2750
|
}
|
|
2644
2751
|
draft.byId[mapId].disableMapPin = disableMapPin;
|
|
2645
2752
|
},
|
|
2646
2753
|
toggleMapPinIsVisible: function toggleMapPinIsVisible(draft, action) {
|
|
2647
|
-
var _action$
|
|
2648
|
-
mapId = _action$
|
|
2649
|
-
displayMapPin = _action$
|
|
2754
|
+
var _action$payload25 = action.payload,
|
|
2755
|
+
mapId = _action$payload25.mapId,
|
|
2756
|
+
displayMapPin = _action$payload25.displayMapPin;
|
|
2650
2757
|
if (!draft.byId[mapId]) {
|
|
2651
2758
|
return;
|
|
2652
2759
|
}
|
|
2653
2760
|
draft.byId[mapId].displayMapPin = displayMapPin;
|
|
2654
2761
|
},
|
|
2655
2762
|
setDockedLayerManagerSize: function setDockedLayerManagerSize(draft, action) {
|
|
2656
|
-
var _action$
|
|
2657
|
-
mapId = _action$
|
|
2658
|
-
dockedLayerManagerSize = _action$
|
|
2763
|
+
var _action$payload26 = action.payload,
|
|
2764
|
+
mapId = _action$payload26.mapId,
|
|
2765
|
+
dockedLayerManagerSize = _action$payload26.dockedLayerManagerSize;
|
|
2659
2766
|
if (!draft.byId[mapId]) {
|
|
2660
2767
|
return;
|
|
2661
2768
|
}
|
|
2662
2769
|
draft.byId[mapId].dockedLayerManagerSize = dockedLayerManagerSize;
|
|
2663
2770
|
},
|
|
2664
2771
|
setDockedLayerManagerPosition: function setDockedLayerManagerPosition(draft, action) {
|
|
2665
|
-
var _action$
|
|
2666
|
-
mapId = _action$
|
|
2667
|
-
dockedLayerManagerPosition = _action$
|
|
2772
|
+
var _action$payload27 = action.payload,
|
|
2773
|
+
mapId = _action$payload27.mapId,
|
|
2774
|
+
dockedLayerManagerPosition = _action$payload27.dockedLayerManagerPosition;
|
|
2668
2775
|
if (!draft.byId[mapId]) {
|
|
2669
2776
|
return;
|
|
2670
2777
|
}
|
|
2671
2778
|
draft.byId[mapId].dockedLayerManagerPosition = dockedLayerManagerPosition;
|
|
2672
2779
|
},
|
|
2673
2780
|
setDockedLayerManagerDimensions: function setDockedLayerManagerDimensions(draft, action) {
|
|
2674
|
-
var _action$
|
|
2675
|
-
mapId = _action$
|
|
2676
|
-
dockedLayerManagerDimensions = _action$
|
|
2781
|
+
var _action$payload28 = action.payload,
|
|
2782
|
+
mapId = _action$payload28.mapId,
|
|
2783
|
+
dockedLayerManagerDimensions = _action$payload28.dockedLayerManagerDimensions;
|
|
2677
2784
|
if (!draft.byId[mapId]) {
|
|
2678
2785
|
return;
|
|
2679
2786
|
}
|
|
2680
2787
|
draft.byId[mapId].dockedLayerManagerDimensions = dockedLayerManagerDimensions;
|
|
2681
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
|
+
},
|
|
2682
2798
|
setMapPresetError: function setMapPresetError(_draft, _action) {},
|
|
2683
2799
|
setDefaultMapSettings: function setDefaultMapSettings(draft, action) {
|
|
2684
2800
|
draft.defaultMapSettings = action.payload.preset;
|
|
2685
2801
|
},
|
|
2686
2802
|
changeOverlayer: function changeOverlayer(draft, action) {
|
|
2687
|
-
var _action$
|
|
2688
|
-
mapId = _action$
|
|
2689
|
-
selectedOverlayer = _action$
|
|
2803
|
+
var _action$payload30 = action.payload,
|
|
2804
|
+
mapId = _action$payload30.mapId,
|
|
2805
|
+
selectedOverlayer = _action$payload30.selectedOverlayer;
|
|
2690
2806
|
if (!draft.byId[mapId]) {
|
|
2691
2807
|
return;
|
|
2692
2808
|
}
|
|
2693
2809
|
draft.byId[mapId].overLayers = [selectedOverlayer];
|
|
2694
2810
|
},
|
|
2695
2811
|
toggleClock: function toggleClock(draft, action) {
|
|
2696
|
-
var _action$
|
|
2697
|
-
mapId = _action$
|
|
2698
|
-
isClockVisible = _action$
|
|
2812
|
+
var _action$payload31 = action.payload,
|
|
2813
|
+
mapId = _action$payload31.mapId,
|
|
2814
|
+
isClockVisible = _action$payload31.isClockVisible;
|
|
2699
2815
|
if (!draft.byId[mapId]) {
|
|
2700
2816
|
return;
|
|
2701
2817
|
}
|
|
@@ -2706,19 +2822,19 @@ var slice$6 = createSlice({
|
|
|
2706
2822
|
}
|
|
2707
2823
|
},
|
|
2708
2824
|
toggleClockOptions: function toggleClockOptions(draft, action) {
|
|
2709
|
-
var _action$
|
|
2710
|
-
mapId = _action$
|
|
2711
|
-
isClockOptionsMenuVisible = _action$
|
|
2825
|
+
var _action$payload32 = action.payload,
|
|
2826
|
+
mapId = _action$payload32.mapId,
|
|
2827
|
+
isClockOptionsMenuVisible = _action$payload32.isClockOptionsMenuVisible;
|
|
2712
2828
|
if (!draft.byId[mapId]) {
|
|
2713
2829
|
return;
|
|
2714
2830
|
}
|
|
2715
2831
|
draft.byId[mapId].isClockOptionsMenuVisible = isClockOptionsMenuVisible;
|
|
2716
2832
|
},
|
|
2717
2833
|
setClockPositionSize: function setClockPositionSize(draft, action) {
|
|
2718
|
-
var _action$
|
|
2719
|
-
mapId = _action$
|
|
2720
|
-
position = _action$
|
|
2721
|
-
size = _action$
|
|
2834
|
+
var _action$payload33 = action.payload,
|
|
2835
|
+
mapId = _action$payload33.mapId,
|
|
2836
|
+
position = _action$payload33.position,
|
|
2837
|
+
size = _action$payload33.size;
|
|
2722
2838
|
if (!draft.byId[mapId]) {
|
|
2723
2839
|
return;
|
|
2724
2840
|
}
|
|
@@ -2728,14 +2844,29 @@ var slice$6 = createSlice({
|
|
|
2728
2844
|
if (size) {
|
|
2729
2845
|
draft.byId[mapId].clockSize = size;
|
|
2730
2846
|
}
|
|
2847
|
+
},
|
|
2848
|
+
setLegendPositionSize: function setLegendPositionSize(draft, action) {
|
|
2849
|
+
var _action$payload34 = action.payload,
|
|
2850
|
+
mapId = _action$payload34.mapId,
|
|
2851
|
+
position = _action$payload34.position,
|
|
2852
|
+
size = _action$payload34.size;
|
|
2853
|
+
if (!draft.byId[mapId]) {
|
|
2854
|
+
return;
|
|
2855
|
+
}
|
|
2856
|
+
if (position) {
|
|
2857
|
+
draft.byId[mapId].legendPosition = position;
|
|
2858
|
+
}
|
|
2859
|
+
if (size) {
|
|
2860
|
+
draft.byId[mapId].legendSize = size;
|
|
2861
|
+
}
|
|
2731
2862
|
}
|
|
2732
2863
|
},
|
|
2733
2864
|
extraReducers: function extraReducers(builder) {
|
|
2734
2865
|
builder.addCase(layerActions.addLayer, function (draft, action) {
|
|
2735
|
-
var _action$
|
|
2736
|
-
layerId = _action$
|
|
2737
|
-
mapId = _action$
|
|
2738
|
-
layer = _action$
|
|
2866
|
+
var _action$payload35 = action.payload,
|
|
2867
|
+
layerId = _action$payload35.layerId,
|
|
2868
|
+
mapId = _action$payload35.mapId,
|
|
2869
|
+
layer = _action$payload35.layer;
|
|
2739
2870
|
if (!draft.byId[mapId]) {
|
|
2740
2871
|
return;
|
|
2741
2872
|
}
|
|
@@ -2754,10 +2885,10 @@ var slice$6 = createSlice({
|
|
|
2754
2885
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
2755
2886
|
}
|
|
2756
2887
|
}).addCase(layerActions.duplicateMapLayer, function (draft, action) {
|
|
2757
|
-
var _action$
|
|
2758
|
-
newLayerId = _action$
|
|
2759
|
-
oldLayerId = _action$
|
|
2760
|
-
mapId = _action$
|
|
2888
|
+
var _action$payload36 = action.payload,
|
|
2889
|
+
newLayerId = _action$payload36.newLayerId,
|
|
2890
|
+
oldLayerId = _action$payload36.oldLayerId,
|
|
2891
|
+
mapId = _action$payload36.mapId;
|
|
2761
2892
|
if (!draft.byId[mapId]) {
|
|
2762
2893
|
return;
|
|
2763
2894
|
}
|
|
@@ -2774,10 +2905,10 @@ var slice$6 = createSlice({
|
|
|
2774
2905
|
draft.byId[mapId].featureLayers.unshift(newLayerId);
|
|
2775
2906
|
}
|
|
2776
2907
|
}).addCase(layerActions.addBaseLayer, function (draft, action) {
|
|
2777
|
-
var _action$
|
|
2778
|
-
layer = _action$
|
|
2779
|
-
layerId = _action$
|
|
2780
|
-
mapId = _action$
|
|
2908
|
+
var _action$payload37 = action.payload,
|
|
2909
|
+
layer = _action$payload37.layer,
|
|
2910
|
+
layerId = _action$payload37.layerId,
|
|
2911
|
+
mapId = _action$payload37.mapId;
|
|
2781
2912
|
if (!draft.byId[mapId]) {
|
|
2782
2913
|
return;
|
|
2783
2914
|
}
|
|
@@ -2807,9 +2938,9 @@ var slice$6 = createSlice({
|
|
|
2807
2938
|
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2808
2939
|
}
|
|
2809
2940
|
}).addCase(layerActions.setBaseLayers, function (draft, action) {
|
|
2810
|
-
var _action$
|
|
2811
|
-
layers = _action$
|
|
2812
|
-
mapId = _action$
|
|
2941
|
+
var _action$payload38 = action.payload,
|
|
2942
|
+
layers = _action$payload38.layers,
|
|
2943
|
+
mapId = _action$payload38.mapId;
|
|
2813
2944
|
// Split into base and overlayers
|
|
2814
2945
|
var baseLayers = [];
|
|
2815
2946
|
var overLayers = [];
|
|
@@ -2839,9 +2970,9 @@ var slice$6 = createSlice({
|
|
|
2839
2970
|
}
|
|
2840
2971
|
}
|
|
2841
2972
|
}).addCase(layerActions.layerDelete, function (draft, action) {
|
|
2842
|
-
var _action$
|
|
2843
|
-
mapId = _action$
|
|
2844
|
-
layerId = _action$
|
|
2973
|
+
var _action$payload39 = action.payload,
|
|
2974
|
+
mapId = _action$payload39.mapId,
|
|
2975
|
+
layerId = _action$payload39.layerId;
|
|
2845
2976
|
var map = draft.byId[mapId];
|
|
2846
2977
|
if (!map) {
|
|
2847
2978
|
return;
|
|
@@ -2849,6 +2980,9 @@ var slice$6 = createSlice({
|
|
|
2849
2980
|
map.mapLayers = map.mapLayers.filter(function (id) {
|
|
2850
2981
|
return id !== layerId;
|
|
2851
2982
|
});
|
|
2983
|
+
map.featureLayers = map.featureLayers.filter(function (id) {
|
|
2984
|
+
return id !== layerId;
|
|
2985
|
+
});
|
|
2852
2986
|
// if auto layer is deleted, change auto layer ids
|
|
2853
2987
|
if (!map.mapLayers.length) {
|
|
2854
2988
|
map.autoUpdateLayerId = undefined;
|
|
@@ -2863,13 +2997,10 @@ var slice$6 = createSlice({
|
|
|
2863
2997
|
if (map.autoTimeStepLayerId === layerId) {
|
|
2864
2998
|
map.autoTimeStepLayerId = activeLayerId;
|
|
2865
2999
|
}
|
|
2866
|
-
map.featureLayers = map.featureLayers.filter(function (id) {
|
|
2867
|
-
return id !== layerId;
|
|
2868
|
-
});
|
|
2869
3000
|
}).addCase(layerActions.baseLayerDelete, function (draft, action) {
|
|
2870
|
-
var _action$
|
|
2871
|
-
mapId = _action$
|
|
2872
|
-
layerId = _action$
|
|
3001
|
+
var _action$payload40 = action.payload,
|
|
3002
|
+
mapId = _action$payload40.mapId,
|
|
3003
|
+
layerId = _action$payload40.layerId;
|
|
2873
3004
|
if (!draft.byId[mapId]) {
|
|
2874
3005
|
return;
|
|
2875
3006
|
}
|
|
@@ -2880,14 +3011,14 @@ var slice$6 = createSlice({
|
|
|
2880
3011
|
return id !== layerId;
|
|
2881
3012
|
});
|
|
2882
3013
|
}).addCase(layerActions.layerChangeDimension, function (draft, action) {
|
|
2883
|
-
var _action$
|
|
2884
|
-
layerId = _action$
|
|
2885
|
-
dimension = _action$
|
|
3014
|
+
var _action$payload41 = action.payload,
|
|
3015
|
+
layerId = _action$payload41.layerId,
|
|
3016
|
+
dimension = _action$payload41.dimension;
|
|
2886
3017
|
produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension);
|
|
2887
3018
|
}).addCase(setTimeSync, function (draft, action) {
|
|
2888
|
-
var _action$
|
|
2889
|
-
targetsFromAction = _action$
|
|
2890
|
-
source = _action$
|
|
3019
|
+
var _action$payload42 = action.payload,
|
|
3020
|
+
targetsFromAction = _action$payload42.targets,
|
|
3021
|
+
source = _action$payload42.source;
|
|
2891
3022
|
var sourceMapId = source === null || source === void 0 ? void 0 : source.payload.sourceId;
|
|
2892
3023
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2893
3024
|
var targets = [];
|
|
@@ -2945,9 +3076,9 @@ var slice$6 = createSlice({
|
|
|
2945
3076
|
}
|
|
2946
3077
|
});
|
|
2947
3078
|
}).addCase(setBboxSync, function (draft, action) {
|
|
2948
|
-
var _action$
|
|
2949
|
-
targetsFromAction = _action$
|
|
2950
|
-
source = _action$
|
|
3079
|
+
var _action$payload43 = action.payload,
|
|
3080
|
+
targetsFromAction = _action$payload43.targets,
|
|
3081
|
+
source = _action$payload43.source;
|
|
2951
3082
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2952
3083
|
var targets = [];
|
|
2953
3084
|
if (source) {
|
|
@@ -2979,9 +3110,9 @@ var slice$6 = createSlice({
|
|
|
2979
3110
|
* These targets can be used as payloads in new Layer actions.
|
|
2980
3111
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
2981
3112
|
*/
|
|
2982
|
-
var _action$
|
|
2983
|
-
targets = _action$
|
|
2984
|
-
source = _action$
|
|
3113
|
+
var _action$payload44 = action.payload,
|
|
3114
|
+
targets = _action$payload44.targets,
|
|
3115
|
+
source = _action$payload44.source;
|
|
2985
3116
|
return targets.reduce(function (prevState, target) {
|
|
2986
3117
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
2987
3118
|
var action = {
|
|
@@ -3003,9 +3134,9 @@ var slice$6 = createSlice({
|
|
|
3003
3134
|
});
|
|
3004
3135
|
return draft;
|
|
3005
3136
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
3006
|
-
var _action$
|
|
3007
|
-
mapId = _action$
|
|
3008
|
-
dimensionFromAction = _action$
|
|
3137
|
+
var _action$payload45 = action.payload,
|
|
3138
|
+
mapId = _action$payload45.mapId,
|
|
3139
|
+
dimensionFromAction = _action$payload45.dimension;
|
|
3009
3140
|
produceDraftStateSetWebMapDimension(draft, mapId, dimensionFromAction, true);
|
|
3010
3141
|
}).addCase(setMapPreset, function (draft, action) {
|
|
3011
3142
|
var mapId = action.payload.mapId;
|
|
@@ -3024,6 +3155,8 @@ var slice$6 = createSlice({
|
|
|
3024
3155
|
draft.byId[mapId].timeStep = undefined;
|
|
3025
3156
|
draft.byId[mapId].animationDelay = defaultAnimationDelayAtStart;
|
|
3026
3157
|
draft.byId[mapId].dockedLayerManagerSize = '';
|
|
3158
|
+
draft.byId[mapId].legendPosition = undefined;
|
|
3159
|
+
draft.byId[mapId].legendSize = undefined;
|
|
3027
3160
|
});
|
|
3028
3161
|
}
|
|
3029
3162
|
});
|
|
@@ -5367,6 +5500,17 @@ var getIsLayerInEditMode = createSelector(getLayerById, function (layer) {
|
|
|
5367
5500
|
var getFeatureLayerGeoJSON = createSelector(getLayerById, function (layer) {
|
|
5368
5501
|
return (layer === null || layer === void 0 ? void 0 : layer.geojson) || undefined;
|
|
5369
5502
|
}, selectorMemoizationOptions);
|
|
5503
|
+
/**
|
|
5504
|
+
* Returns the ids of the selected features of a feature layer
|
|
5505
|
+
*
|
|
5506
|
+
* Example const selectedFeatureIds = getSelectedFeatureIds(store, 'layerId1')
|
|
5507
|
+
* @param {object} store store: object - store object
|
|
5508
|
+
* @param {string} layerId layerId: string - Id of the layer
|
|
5509
|
+
* @returns {string[]} selectedFeatureIds: string[] - ids of the selected features
|
|
5510
|
+
*/
|
|
5511
|
+
var getSelectedFeatureIds$1 = createSelector(getLayerById, function (layer) {
|
|
5512
|
+
return (layer === null || layer === void 0 ? void 0 : layer.selectedFeatureIds) || [];
|
|
5513
|
+
}, selectorMemoizationOptions);
|
|
5370
5514
|
var getHasFeatureLayerGeoJSON = createSelector(getFeatureLayerGeoJSON, function (geojson) {
|
|
5371
5515
|
return !!geojson;
|
|
5372
5516
|
}, selectorMemoizationOptions);
|
|
@@ -5594,6 +5738,7 @@ var selectors$4 = /*#__PURE__*/Object.freeze({
|
|
|
5594
5738
|
getLayersIds: getLayersIds,
|
|
5595
5739
|
getOverLayers: getOverLayers,
|
|
5596
5740
|
getOverlayersForMapId: getOverlayersForMapId,
|
|
5741
|
+
getSelectedFeatureIds: getSelectedFeatureIds$1,
|
|
5597
5742
|
getTimeStepForLayerId: getTimeStepForLayerId,
|
|
5598
5743
|
getUseLatestReferenceTime: getUseLatestReferenceTime
|
|
5599
5744
|
});
|
|
@@ -6756,13 +6901,24 @@ var isTimestepAuto = createSelector(getMapById, function (store) {
|
|
|
6756
6901
|
return store ? store.isTimestepAuto : false;
|
|
6757
6902
|
}, selectorMemoizationOptions);
|
|
6758
6903
|
/**
|
|
6759
|
-
* 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.
|
|
6760
6915
|
* @param {object} store store: object - store object
|
|
6761
6916
|
* @param {string} mapId mapId: string - Id of the map
|
|
6762
6917
|
* @returns {boolean} returnType: boolean
|
|
6763
6918
|
*/
|
|
6764
6919
|
var isAnimationLengthAuto = createSelector(getMapById, function (store) {
|
|
6765
|
-
|
|
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;
|
|
6766
6922
|
}, selectorMemoizationOptions);
|
|
6767
6923
|
/**
|
|
6768
6924
|
* Returns map is timespan auto
|
|
@@ -6978,6 +7134,12 @@ var getClockPosition = createSelector(getMapById, function (store) {
|
|
|
6978
7134
|
var getClockSize = createSelector(getMapById, function (store) {
|
|
6979
7135
|
return store === null || store === void 0 ? void 0 : store.clockSize;
|
|
6980
7136
|
}, selectorMemoizationOptions);
|
|
7137
|
+
var getLegendPosition = createSelector(getMapById, function (store) {
|
|
7138
|
+
return store === null || store === void 0 ? void 0 : store.legendPosition;
|
|
7139
|
+
}, selectorMemoizationOptions);
|
|
7140
|
+
var getLegendSize = createSelector(getMapById, function (store) {
|
|
7141
|
+
return store === null || store === void 0 ? void 0 : store.legendSize;
|
|
7142
|
+
}, selectorMemoizationOptions);
|
|
6981
7143
|
/**
|
|
6982
7144
|
* Creates a MapPreset from mapId
|
|
6983
7145
|
*
|
|
@@ -6987,7 +7149,7 @@ var getClockSize = createSelector(getMapById, function (store) {
|
|
|
6987
7149
|
* @param {boolean} keepAllDims? keepAllDims: boolean - default false: whether or not to leave the time and reference_time dimentions
|
|
6988
7150
|
* @returns {MapPreset} returnType: MapPreset
|
|
6989
7151
|
*/
|
|
6990
|
-
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) {
|
|
6991
7153
|
var _getMapById$dockedLay, _getMapById;
|
|
6992
7154
|
return (_getMapById$dockedLay = (_getMapById = getMapById(store, mapId)) === null || _getMapById === void 0 ? void 0 : _getMapById.dockedLayerManagerSize) !== null && _getMapById$dockedLay !== void 0 ? _getMapById$dockedLay : 'sizeSmall';
|
|
6993
7155
|
}, function (store, mapId) {
|
|
@@ -6999,14 +7161,14 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
6999
7161
|
}, function (store, mapId) {
|
|
7000
7162
|
var _getMapById3;
|
|
7001
7163
|
return (_getMapById3 = getMapById(store, mapId)) === null || _getMapById3 === void 0 ? void 0 : _getMapById3.dockedLayerManagerDimensions;
|
|
7002
|
-
}, getIsClockVisible, getIsClockOptionsMenuVisible, getClockPosition, getClockSize, getUiStore, function (_store, mapId) {
|
|
7164
|
+
}, getIsClockVisible, getIsClockOptionsMenuVisible, getClockPosition, getClockSize, getLegendPosition, getLegendSize, getUiStore, function (_store, mapId) {
|
|
7003
7165
|
return mapId;
|
|
7004
7166
|
}, function (_store, _mapId) {
|
|
7005
7167
|
var keepAllDims = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7006
7168
|
return keepAllDims;
|
|
7007
|
-
}, 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, 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) {
|
|
7008
7170
|
var _overLayers$, _uiStore$dialogs$isOp, _uiStore$dialogs;
|
|
7009
|
-
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';
|
|
7010
7172
|
var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_ref3) {
|
|
7011
7173
|
_ref3.mapId;
|
|
7012
7174
|
var layer = _objectWithoutProperties(_ref3, _excluded$2);
|
|
@@ -7026,12 +7188,19 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
7026
7188
|
}
|
|
7027
7189
|
return layer;
|
|
7028
7190
|
});
|
|
7029
|
-
var animationPayload = {
|
|
7191
|
+
var animationPayload = _objectSpread2({
|
|
7030
7192
|
interval: mapTimeStep,
|
|
7031
7193
|
speed: mapAnimationDelay ? getSpeedFactor(mapAnimationDelay) : 1,
|
|
7032
7194
|
duration: getAnimationDuration(animationEndTime, animationStartTime)
|
|
7033
|
-
}
|
|
7195
|
+
}, animationLength && {
|
|
7196
|
+
animationLength: animationLength
|
|
7197
|
+
});
|
|
7034
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;
|
|
7199
|
+
var legendPreset = shouldShowLegend ? _objectSpread2(_objectSpread2({}, legendPosition !== undefined && {
|
|
7200
|
+
legendPosition: legendPosition
|
|
7201
|
+
}), legendSize !== undefined && {
|
|
7202
|
+
legendSize: legendSize
|
|
7203
|
+
}) : {};
|
|
7035
7204
|
var dataExplorerDialog = uiStore === null || uiStore === void 0 ? void 0 : uiStore.dialogs[DialogTypes.DataExplorer];
|
|
7036
7205
|
var shouldShowDataExplorer = (dataExplorerDialog === null || dataExplorerDialog === void 0 ? void 0 : dataExplorerDialog.isOpen) && (dataExplorerDialog === null || dataExplorerDialog === void 0 ? void 0 : dataExplorerDialog.activeMapId) === mapId || false;
|
|
7037
7206
|
var dockedLayerManagerDialog = uiStore === null || uiStore === void 0 ? void 0 : uiStore.dialogs["".concat(DialogTypes.DockedLayerManager, "-").concat(mapId)];
|
|
@@ -7046,7 +7215,7 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
7046
7215
|
}, dockedLayerManagerDimensions && {
|
|
7047
7216
|
dockedLayerManagerDimensions: dockedLayerManagerDimensions
|
|
7048
7217
|
}) : {};
|
|
7049
|
-
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
7218
|
+
return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
7050
7219
|
layers: allLayers
|
|
7051
7220
|
}, activeLayerId && {
|
|
7052
7221
|
activeLayerId: activeLayerId
|
|
@@ -7067,7 +7236,8 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
7067
7236
|
animationPayload: animationPayload,
|
|
7068
7237
|
toggleTimestepAuto: isTimestepAuto,
|
|
7069
7238
|
toggleTimeSpanAuto: isTimeSpanAuto,
|
|
7070
|
-
shouldShowLegend: shouldShowLegend
|
|
7239
|
+
shouldShowLegend: shouldShowLegend
|
|
7240
|
+
}, legendPreset), {}, {
|
|
7071
7241
|
timeSliderSpan: timeSliderSpan,
|
|
7072
7242
|
shouldShowDataExplorer: shouldShowDataExplorer,
|
|
7073
7243
|
defaultOverlayer: defaultOverlayer
|
|
@@ -7259,7 +7429,7 @@ var getAnimationListAsEpochTimes = createSelector(getAnimationList, function (li
|
|
|
7259
7429
|
* @param {string} mapId mapId: string - Id of the map
|
|
7260
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.
|
|
7261
7431
|
*/
|
|
7262
|
-
var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime,
|
|
7432
|
+
var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime, getAnimationLength, function (layers, autoTimeStepLayerId, startTime, endTime, animationLength) {
|
|
7263
7433
|
var _layers$autoTimeStepL2;
|
|
7264
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) {
|
|
7265
7435
|
return dimension.name === 'time';
|
|
@@ -7268,8 +7438,9 @@ var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, ge
|
|
|
7268
7438
|
minValue = _ref5.minValue,
|
|
7269
7439
|
maxValue = _ref5.maxValue;
|
|
7270
7440
|
var hasTimeDimension = minValue && maxValue;
|
|
7271
|
-
var
|
|
7272
|
-
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;
|
|
7273
7444
|
return {
|
|
7274
7445
|
animationStartTime: animationStartTime,
|
|
7275
7446
|
animationEndTime: animationEndTime
|
|
@@ -7311,6 +7482,12 @@ var getSelectedOverlayerByMapId = createSelector(getMapById, function (store) {
|
|
|
7311
7482
|
var getRefTimeDimensionModes = createSelector(getdefaultMapSettings, function (state) {
|
|
7312
7483
|
return state === null || state === void 0 ? void 0 : state.refTimeDimensionModes;
|
|
7313
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);
|
|
7314
7491
|
|
|
7315
7492
|
var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
7316
7493
|
__proto__: null,
|
|
@@ -7319,6 +7496,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
7319
7496
|
getAllMapsByIds: getAllMapsByIds,
|
|
7320
7497
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
7321
7498
|
getAnimationEndTime: getAnimationEndTime,
|
|
7499
|
+
getAnimationLength: getAnimationLength,
|
|
7322
7500
|
getAnimationList: getAnimationList,
|
|
7323
7501
|
getAnimationListAsEpochTimes: getAnimationListAsEpochTimes,
|
|
7324
7502
|
getAnimationRange: getAnimationRange,
|
|
@@ -7337,6 +7515,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
7337
7515
|
getFirstMap: getFirstMap,
|
|
7338
7516
|
getFirstMapId: getFirstMapId,
|
|
7339
7517
|
getHarmonieInitialProps: getHarmonieInitialProps,
|
|
7518
|
+
getInitialZoomToLayerId: getInitialZoomToLayerId,
|
|
7340
7519
|
getIsClockOptionsMenuVisible: getIsClockOptionsMenuVisible,
|
|
7341
7520
|
getIsClockVisible: getIsClockVisible,
|
|
7342
7521
|
getIsEnabledLayersForMapDimension: getIsEnabledLayersForMapDimension,
|
|
@@ -7346,6 +7525,8 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
7346
7525
|
getLayerIdByLayerName: getLayerIdByLayerName,
|
|
7347
7526
|
getLayerIds: getLayerIds,
|
|
7348
7527
|
getLayerIndexByLayerId: getLayerIndexByLayerId,
|
|
7528
|
+
getLegendPosition: getLegendPosition,
|
|
7529
|
+
getLegendSize: getLegendSize,
|
|
7349
7530
|
getMapAnimationDelay: getMapAnimationDelay,
|
|
7350
7531
|
getMapBaseLayers: getMapBaseLayers,
|
|
7351
7532
|
getMapBaseLayersIds: getMapBaseLayersIds,
|
|
@@ -8505,9 +8686,16 @@ mapListener.startListening({
|
|
|
8505
8686
|
}
|
|
8506
8687
|
}
|
|
8507
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
|
+
};
|
|
8508
8693
|
var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
|
|
8509
8694
|
var shouldEndtimeOverride$1 = shouldEndtimeOverride(listenerApi.getState(), mapId);
|
|
8510
|
-
|
|
8695
|
+
var shiftsWithLayerUpdates = function shiftsWithLayerUpdates(id) {
|
|
8696
|
+
return !derivesOwnAnimationRange(getAnimationLength(listenerApi.getState(), id));
|
|
8697
|
+
};
|
|
8698
|
+
if (shouldEndtimeOverride$1 || !shiftsWithLayerUpdates(mapId)) {
|
|
8511
8699
|
return;
|
|
8512
8700
|
}
|
|
8513
8701
|
var animationStart = getAnimationStartTime(listenerApi.getState(), mapId);
|
|
@@ -8527,7 +8715,7 @@ var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
|
|
|
8527
8715
|
var isSyncedMap = syncedMapIds.includes(mapId);
|
|
8528
8716
|
var mapIdsToUpdate = isSyncedMap ? syncedMapIds : [mapId];
|
|
8529
8717
|
// Update new animation times for the map or in case of syncgroup, all maps in the syncgroup
|
|
8530
|
-
mapIdsToUpdate.forEach(function (id) {
|
|
8718
|
+
mapIdsToUpdate.filter(shiftsWithLayerUpdates).forEach(function (id) {
|
|
8531
8719
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
8532
8720
|
mapId: id,
|
|
8533
8721
|
animationEndTime: newAnimationEndTime
|
|
@@ -8688,7 +8876,7 @@ mapListener.startListening({
|
|
|
8688
8876
|
actionCreator: mapActions.setMapPreset,
|
|
8689
8877
|
effect: function () {
|
|
8690
8878
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref6, listenerApi) {
|
|
8691
|
-
var payload, mapId, initialProps, mapPreset, _mapPreset$dimensions, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, 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;
|
|
8692
8880
|
return _regenerator().w(function (_context2) {
|
|
8693
8881
|
while (1) switch (_context2.p = _context2.n) {
|
|
8694
8882
|
case 0:
|
|
@@ -8697,11 +8885,12 @@ mapListener.startListening({
|
|
|
8697
8885
|
mapId = payload.mapId, initialProps = payload.initialProps;
|
|
8698
8886
|
mapPreset = initialProps.mapPreset;
|
|
8699
8887
|
if (!mapPreset) {
|
|
8700
|
-
_context2.n =
|
|
8888
|
+
_context2.n = 7;
|
|
8701
8889
|
break;
|
|
8702
8890
|
}
|
|
8703
|
-
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, 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;
|
|
8704
8892
|
_filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
|
|
8893
|
+
pendingInitialZoomToLayerId = null;
|
|
8705
8894
|
if (layers) {
|
|
8706
8895
|
// make sure all layers have a unique id before going forward
|
|
8707
8896
|
autoTimeStepLayerIdNew = autoTimeStepLayerId;
|
|
@@ -8726,6 +8915,12 @@ mapListener.startListening({
|
|
|
8726
8915
|
newAutoUpdateLayerId = ((_newLayerIds$layers$f2 = newLayerIds.layers.find(function (layer) {
|
|
8727
8916
|
return layer.id === newLayerIds.autoUpdateLayerId;
|
|
8728
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
|
+
}
|
|
8729
8924
|
listenerApi.dispatch(mapActions.setAutoLayerId({
|
|
8730
8925
|
mapId: mapId,
|
|
8731
8926
|
autoTimeStepLayerId: newAutoTimeStepLayerId,
|
|
@@ -8769,14 +8964,29 @@ mapListener.startListening({
|
|
|
8769
8964
|
}
|
|
8770
8965
|
throw new Error("Projection ".concat(proj.srs, " is not supported"));
|
|
8771
8966
|
case 2:
|
|
8967
|
+
listenerApi.dispatch(mapActions.setPendingInitialZoomToLayer({
|
|
8968
|
+
mapId: mapId,
|
|
8969
|
+
layerId: undefined
|
|
8970
|
+
}));
|
|
8772
8971
|
// set bbox
|
|
8773
8972
|
listenerApi.dispatch(mapActions.setBbox({
|
|
8774
8973
|
mapId: mapId,
|
|
8775
8974
|
bbox: proj.bbox,
|
|
8776
8975
|
srs: proj.srs
|
|
8777
8976
|
}));
|
|
8977
|
+
_context2.n = 4;
|
|
8978
|
+
break;
|
|
8778
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:
|
|
8779
8988
|
animationLength = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.duration;
|
|
8989
|
+
animationLengthSetting = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.animationLength;
|
|
8780
8990
|
animationEndTime = (animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.endTime) && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
8781
8991
|
shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
8782
8992
|
if (shouldEndtimeOverride) {
|
|
@@ -8854,6 +9064,18 @@ mapListener.startListening({
|
|
|
8854
9064
|
size: clockSize
|
|
8855
9065
|
}));
|
|
8856
9066
|
}
|
|
9067
|
+
if (legendPosition !== undefined) {
|
|
9068
|
+
listenerApi.dispatch(mapActions.setLegendPositionSize({
|
|
9069
|
+
mapId: mapId,
|
|
9070
|
+
position: legendPosition
|
|
9071
|
+
}));
|
|
9072
|
+
}
|
|
9073
|
+
if (legendSize !== undefined) {
|
|
9074
|
+
listenerApi.dispatch(mapActions.setLegendPositionSize({
|
|
9075
|
+
mapId: mapId,
|
|
9076
|
+
size: legendSize
|
|
9077
|
+
}));
|
|
9078
|
+
}
|
|
8857
9079
|
// sets timestep by interval of animationPayload
|
|
8858
9080
|
interval = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.interval;
|
|
8859
9081
|
if (interval) {
|
|
@@ -8915,6 +9137,34 @@ mapListener.startListening({
|
|
|
8915
9137
|
}));
|
|
8916
9138
|
}
|
|
8917
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
|
+
}
|
|
8918
9168
|
// sets animationDelay by speed of animationPayload
|
|
8919
9169
|
if (animationPayload !== null && animationPayload !== void 0 && animationPayload.speed) {
|
|
8920
9170
|
listenerApi.dispatch(mapActions.setAnimationDelay({
|
|
@@ -8996,15 +9246,15 @@ mapListener.startListening({
|
|
|
8996
9246
|
dockedLayerManagerDimensions: dockedLayerManagerDimensions
|
|
8997
9247
|
}));
|
|
8998
9248
|
}
|
|
8999
|
-
case
|
|
9000
|
-
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
9001
|
-
_context2.n =
|
|
9249
|
+
case 5:
|
|
9250
|
+
if (!(animationEndTime && !derivesOwnAnimationRange(animationLengthSetting) && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
9251
|
+
_context2.n = 7;
|
|
9002
9252
|
break;
|
|
9003
9253
|
}
|
|
9004
9254
|
fiveMinuteDelayForAnimation = 1000 * 60 * 5; // eslint-disable-next-line no-await-in-loop
|
|
9005
|
-
_context2.n =
|
|
9255
|
+
_context2.n = 6;
|
|
9006
9256
|
return listenerApi.delay(fiveMinuteDelayForAnimation);
|
|
9007
|
-
case
|
|
9257
|
+
case 6:
|
|
9008
9258
|
_animationEnd2 = getAnimationEndTime(listenerApi.getState(), mapId);
|
|
9009
9259
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
9010
9260
|
mapId: mapId,
|
|
@@ -9019,13 +9269,13 @@ mapListener.startListening({
|
|
|
9019
9269
|
minutes: 5
|
|
9020
9270
|
}).toISOString()
|
|
9021
9271
|
}));
|
|
9022
|
-
_context2.n =
|
|
9023
|
-
break;
|
|
9024
|
-
case 6:
|
|
9025
|
-
_context2.n = 8;
|
|
9272
|
+
_context2.n = 5;
|
|
9026
9273
|
break;
|
|
9027
9274
|
case 7:
|
|
9028
|
-
_context2.
|
|
9275
|
+
_context2.n = 9;
|
|
9276
|
+
break;
|
|
9277
|
+
case 8:
|
|
9278
|
+
_context2.p = 8;
|
|
9029
9279
|
_t = _context2.v;
|
|
9030
9280
|
if (_t instanceof Error) {
|
|
9031
9281
|
listenerApi.dispatch(mapActions.setMapPresetError({
|
|
@@ -9033,10 +9283,10 @@ mapListener.startListening({
|
|
|
9033
9283
|
error: _t.message
|
|
9034
9284
|
}));
|
|
9035
9285
|
}
|
|
9036
|
-
case
|
|
9286
|
+
case 9:
|
|
9037
9287
|
return _context2.a(2);
|
|
9038
9288
|
}
|
|
9039
|
-
}, _callee2, null, [[1,
|
|
9289
|
+
}, _callee2, null, [[1, 8]]);
|
|
9040
9290
|
}));
|
|
9041
9291
|
function effect(_x3, _x4) {
|
|
9042
9292
|
return _effect2.apply(this, arguments);
|
|
@@ -9044,11 +9294,66 @@ mapListener.startListening({
|
|
|
9044
9294
|
return effect;
|
|
9045
9295
|
}()
|
|
9046
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
|
+
});
|
|
9047
9351
|
mapListener.startListening({
|
|
9048
9352
|
actionCreator: mapActions.unregisterMap,
|
|
9049
|
-
effect: function effect(
|
|
9050
|
-
var payload =
|
|
9353
|
+
effect: function effect(_ref8, listenerApi) {
|
|
9354
|
+
var payload = _ref8.payload;
|
|
9051
9355
|
var mapId = payload.mapId;
|
|
9356
|
+
nowAnimationRefreshTokens["delete"](mapId);
|
|
9052
9357
|
var layerList = getLayersByMapId(listenerApi.getState(), mapId);
|
|
9053
9358
|
metronome.unregister(mapId);
|
|
9054
9359
|
layerList.map(function (layer) {
|
|
@@ -9065,8 +9370,8 @@ mapListener.startListening({
|
|
|
9065
9370
|
});
|
|
9066
9371
|
mapListener.startListening({
|
|
9067
9372
|
actionCreator: mapActions.setStepBackwardOrForward,
|
|
9068
|
-
effect: function effect(
|
|
9069
|
-
var payload =
|
|
9373
|
+
effect: function effect(_ref9, listenerApi) {
|
|
9374
|
+
var payload = _ref9.payload;
|
|
9070
9375
|
var mapId = payload.mapId,
|
|
9071
9376
|
isForwardStep = payload.isForwardStep;
|
|
9072
9377
|
// timeStep is stored in minutes
|
|
@@ -9666,7 +9971,13 @@ var slice$1 = createSlice({
|
|
|
9666
9971
|
}).addCase(layerActions.updateFeatureProperties, function (draft, action) {
|
|
9667
9972
|
var _action$payload6 = action.payload,
|
|
9668
9973
|
properties = _action$payload6.properties,
|
|
9669
|
-
layerId = _action$payload6.layerId
|
|
9974
|
+
layerId = _action$payload6.layerId,
|
|
9975
|
+
targetFeatureIndex = _action$payload6.targetFeatureIndex;
|
|
9976
|
+
// Set style props for drawMode templates
|
|
9977
|
+
// Must skip single feature specific settings
|
|
9978
|
+
if (targetFeatureIndex !== undefined) {
|
|
9979
|
+
return;
|
|
9980
|
+
}
|
|
9670
9981
|
var drawToolId = getDrawToolByLayerId(draft, layerId);
|
|
9671
9982
|
var entity = draft.entities[drawToolId];
|
|
9672
9983
|
if (drawToolId && entity !== undefined) {
|