@opengeoweb/store 9.4.0 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +237 -127
- package/package.json +1 -1
- package/src/store/generic/synchronizationGroups/selectors.d.ts +27 -6
- package/src/store/index.d.ts +1 -0
- package/src/store/mapStore/index.d.ts +1 -0
- package/src/store/mapStore/layers/selectors.d.ts +38 -21
- package/src/store/mapStore/map/index.d.ts +1 -1
- package/src/store/mapStore/map/reducer.d.ts +3 -1
- package/src/store/mapStore/map/sagas.d.ts +1 -0
- package/src/store/mapStore/map/selectors.d.ts +71 -51
- package/src/store/mapStore/map/utils.d.ts +1 -1
package/index.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { current, produce } from 'immer';
|
|
2
|
-
import { webmapUtils, LayerType, webmapTestSettings, WMLayer, getCapabilities } from '@opengeoweb/webmap';
|
|
2
|
+
import { webmapUtils, LayerType, webmapTestSettings, WMLayer, handleMomentISOString, getCapabilities } from '@opengeoweb/webmap';
|
|
3
3
|
import { createAction, createSlice, createSelector, createEntityAdapter, current as current$1 } from '@reduxjs/toolkit';
|
|
4
4
|
import { getGeoJson, moveFeature, createInterSections, defaultLayers, getFeatureCollection, emptyGeoJSON, defaultIntersectionStyleProperties } from '@opengeoweb/webmap-react';
|
|
5
5
|
export { defaultLayers } from '@opengeoweb/webmap-react';
|
|
6
6
|
import moment from 'moment';
|
|
7
|
-
import { differenceInMinutes, getUnixTime, parseISO, isValid } from 'date-fns';
|
|
7
|
+
import { differenceInMinutes, getUnixTime, parseISO, isValid, fromUnixTime } from 'date-fns';
|
|
8
8
|
import { isEqual, compact } from 'lodash';
|
|
9
9
|
import { createStore as createStore$1 } from '@redux-eggs/redux-toolkit';
|
|
10
10
|
import { getSagaExtension } from '@redux-eggs/saga-extension';
|
|
@@ -722,21 +722,16 @@ var produceDraftStateSetWebMapDimension = function produceDraftStateSetWebMapDim
|
|
|
722
722
|
* @param draft The WebMapState containing the state of all maps.
|
|
723
723
|
* @param layerId The layer Id to find in the maps
|
|
724
724
|
*/
|
|
725
|
-
var findMapIdFromLayerId = function findMapIdFromLayerId(
|
|
726
|
-
if (!
|
|
725
|
+
var findMapIdFromLayerId = function findMapIdFromLayerId(mapState, layerId) {
|
|
726
|
+
if (!mapState || !layerId) {
|
|
727
727
|
return null;
|
|
728
728
|
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
return mapId;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
return null;
|
|
729
|
+
var result = mapState.allIds.find(function (mapId) {
|
|
730
|
+
return mapState.byId[mapId].mapLayers.find(function (layerIdFromMap) {
|
|
731
|
+
return layerIdFromMap === layerId;
|
|
732
|
+
});
|
|
733
|
+
});
|
|
734
|
+
return result === undefined ? null : result;
|
|
740
735
|
};
|
|
741
736
|
/*
|
|
742
737
|
When a layer dimension is changed, it can affect the map dimension if the layer dimension is linked with the map.
|
|
@@ -1727,13 +1722,28 @@ var layerStore = function layerStore(store) {
|
|
|
1727
1722
|
* @param {string} layerId Id of the layer
|
|
1728
1723
|
* @returns {object} object containing layer information (service, name, style, enabled etc.)
|
|
1729
1724
|
*/
|
|
1730
|
-
var getLayerById = function
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1725
|
+
var getLayerById = createSelector([layerStore, function (layerStore, layerId) {
|
|
1726
|
+
return layerId;
|
|
1727
|
+
}], function (layerState, layerId) {
|
|
1728
|
+
return layerState && layerState.byId && layerState.byId[layerId];
|
|
1729
|
+
}, selectorMemoizationOptions);
|
|
1730
|
+
/**
|
|
1731
|
+
* Gets a layer from the layers part of the store by its Id, but without the time dimension. (All other dimensions are still included)
|
|
1732
|
+
*
|
|
1733
|
+
* Example: layer = getLayerByIdWithoutTimeDimension(store, 'layerId')
|
|
1734
|
+
* @param {object} store object from which the layer state will be extracted
|
|
1735
|
+
* @param {string} layerId Id of the layer
|
|
1736
|
+
* @returns {object} object containing layer information (service, name, style, enabled etc.)
|
|
1737
|
+
*/
|
|
1738
|
+
var getLayerByIdWithoutTimeDimension = createSelector([layerStore, function (layerStore, layerId) {
|
|
1739
|
+
return layerId;
|
|
1740
|
+
}], function (layerState, layerId) {
|
|
1741
|
+
var layer = layerState && layerState.byId && layerState.byId[layerId];
|
|
1742
|
+
return layer ? produce(layer, function (draftLayer) {
|
|
1743
|
+
draftLayer.dimensions = filterNonTimeDimensions(draftLayer.dimensions || []);
|
|
1744
|
+
return draftLayer;
|
|
1745
|
+
}) : undefined;
|
|
1746
|
+
}, selectorMemoizationOptions);
|
|
1737
1747
|
/**
|
|
1738
1748
|
* Retrieves all layers indexed by layerId
|
|
1739
1749
|
*
|
|
@@ -1906,7 +1916,7 @@ var getLayerDimension = createSelector(getLayerDimensions, function (_store, _la
|
|
|
1906
1916
|
*/
|
|
1907
1917
|
var getLayerOpacity = createSelector(getLayerById, function (layer) {
|
|
1908
1918
|
return layer && layer.opacity ? layer.opacity : 0;
|
|
1909
|
-
});
|
|
1919
|
+
}, selectorMemoizationOptions);
|
|
1910
1920
|
/**
|
|
1911
1921
|
* Gets whether a layer is enabled or disabled
|
|
1912
1922
|
*
|
|
@@ -1917,7 +1927,7 @@ var getLayerOpacity = createSelector(getLayerById, function (layer) {
|
|
|
1917
1927
|
*/
|
|
1918
1928
|
var getLayerEnabled = createSelector(getLayerById, function (layer) {
|
|
1919
1929
|
return Boolean(layer === null || layer === void 0 ? void 0 : layer.enabled);
|
|
1920
|
-
});
|
|
1930
|
+
}, selectorMemoizationOptions);
|
|
1921
1931
|
/**
|
|
1922
1932
|
* Gets layer name
|
|
1923
1933
|
*
|
|
@@ -1929,7 +1939,7 @@ var getLayerEnabled = createSelector(getLayerById, function (layer) {
|
|
|
1929
1939
|
var getLayerName = createSelector(getLayerById, function (layer) {
|
|
1930
1940
|
var _a;
|
|
1931
1941
|
return (_a = layer === null || layer === void 0 ? void 0 : layer.name) !== null && _a !== void 0 ? _a : '';
|
|
1932
|
-
});
|
|
1942
|
+
}, selectorMemoizationOptions);
|
|
1933
1943
|
/**
|
|
1934
1944
|
* Gets layer service
|
|
1935
1945
|
*
|
|
@@ -1941,7 +1951,7 @@ var getLayerName = createSelector(getLayerById, function (layer) {
|
|
|
1941
1951
|
var getLayerService = createSelector(getLayerById, function (layer) {
|
|
1942
1952
|
var _a;
|
|
1943
1953
|
return (_a = layer === null || layer === void 0 ? void 0 : layer.service) !== null && _a !== void 0 ? _a : '';
|
|
1944
|
-
});
|
|
1954
|
+
}, selectorMemoizationOptions);
|
|
1945
1955
|
/**
|
|
1946
1956
|
* Gets selected style of the passed layer
|
|
1947
1957
|
*
|
|
@@ -1952,7 +1962,7 @@ var getLayerService = createSelector(getLayerById, function (layer) {
|
|
|
1952
1962
|
*/
|
|
1953
1963
|
var getLayerStyle = createSelector(getLayerById, function (layer) {
|
|
1954
1964
|
return layer && layer.style ? layer.style : '';
|
|
1955
|
-
});
|
|
1965
|
+
}, selectorMemoizationOptions);
|
|
1956
1966
|
/**
|
|
1957
1967
|
* Gets layer status
|
|
1958
1968
|
*
|
|
@@ -1963,7 +1973,7 @@ var getLayerStyle = createSelector(getLayerById, function (layer) {
|
|
|
1963
1973
|
*/
|
|
1964
1974
|
var getLayerStatus = createSelector(getLayerById, function (layer) {
|
|
1965
1975
|
return layer && layer.status ? layer.status : LayerStatus["default"];
|
|
1966
|
-
});
|
|
1976
|
+
}, selectorMemoizationOptions);
|
|
1967
1977
|
/**
|
|
1968
1978
|
* Gets all available base layers for a map
|
|
1969
1979
|
*
|
|
@@ -1996,7 +2006,7 @@ var getAvailableBaseLayersForMap = createSelector(layerStore, function (_store,
|
|
|
1996
2006
|
*/
|
|
1997
2007
|
var getSelectedFeatureIndex = createSelector(getLayerById, function (layer) {
|
|
1998
2008
|
return layer === null || layer === void 0 ? void 0 : layer.selectedFeatureIndex;
|
|
1999
|
-
});
|
|
2009
|
+
}, selectorMemoizationOptions);
|
|
2000
2010
|
/**
|
|
2001
2011
|
* Returns the layer is in edit mode
|
|
2002
2012
|
*
|
|
@@ -2007,15 +2017,15 @@ var getSelectedFeatureIndex = createSelector(getLayerById, function (layer) {
|
|
|
2007
2017
|
*/
|
|
2008
2018
|
var getIsLayerInEditMode = createSelector(getLayerById, function (layer) {
|
|
2009
2019
|
return (layer === null || layer === void 0 ? void 0 : layer.isInEditMode) || false;
|
|
2010
|
-
});
|
|
2020
|
+
}, selectorMemoizationOptions);
|
|
2011
2021
|
var getFeatureLayerGeoJSON = createSelector(getLayerById, function (layer) {
|
|
2012
2022
|
return (layer === null || layer === void 0 ? void 0 : layer.geojson) || undefined;
|
|
2013
|
-
});
|
|
2023
|
+
}, selectorMemoizationOptions);
|
|
2014
2024
|
var getFeatureLayerGeoJSONProperties = createSelector(getLayerById, getSelectedFeatureIndex, function (layer) {
|
|
2015
2025
|
var selecteFeatureIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2016
2026
|
var _a, _b;
|
|
2017
2027
|
return ((_b = (_a = layer === null || layer === void 0 ? void 0 : layer.geojson) === null || _a === void 0 ? void 0 : _a.features[selecteFeatureIndex]) === null || _b === void 0 ? void 0 : _b.properties) || {};
|
|
2018
|
-
});
|
|
2028
|
+
}, selectorMemoizationOptions);
|
|
2019
2029
|
/**
|
|
2020
2030
|
* Gets layerIds that contain passed dimension
|
|
2021
2031
|
*
|
|
@@ -2040,7 +2050,7 @@ var getDimensionLayerIds = createSelector(getLayersIds, getLayersById, function
|
|
|
2040
2050
|
}, selectorMemoizationOptions);
|
|
2041
2051
|
var getAcceptanceTimeInMinutes = createSelector(getLayerById, function (layer) {
|
|
2042
2052
|
return layer === null || layer === void 0 ? void 0 : layer.acceptanceTimeInMinutes;
|
|
2043
|
-
});
|
|
2053
|
+
}, selectorMemoizationOptions);
|
|
2044
2054
|
var getLayerIsInsideAcceptanceTime = createSelector(getAcceptanceTimeInMinutes, getLayerCurrentTime, function (state, _layerId, mapId) {
|
|
2045
2055
|
var _a, _b, _c, _d;
|
|
2046
2056
|
return (_d = (_c = (_b = (_a = state.webmap) === null || _a === void 0 ? void 0 : _a.byId[mapId]) === null || _b === void 0 ? void 0 : _b.dimensions) === null || _c === void 0 ? void 0 : _c.find(function (dimension) {
|
|
@@ -2063,14 +2073,15 @@ var getLayerIsInsideAcceptanceTime = createSelector(getAcceptanceTimeInMinutes,
|
|
|
2063
2073
|
}
|
|
2064
2074
|
}
|
|
2065
2075
|
return 'inside';
|
|
2066
|
-
});
|
|
2076
|
+
}, selectorMemoizationOptions);
|
|
2067
2077
|
var getUseLatestReferenceTime = createSelector(getLayerById, function (layer) {
|
|
2068
2078
|
return Boolean(layer === null || layer === void 0 ? void 0 : layer.useLatestReferenceTime);
|
|
2069
|
-
});
|
|
2079
|
+
}, selectorMemoizationOptions);
|
|
2070
2080
|
|
|
2071
2081
|
var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
2072
2082
|
__proto__: null,
|
|
2073
2083
|
getLayerById: getLayerById,
|
|
2084
|
+
getLayerByIdWithoutTimeDimension: getLayerByIdWithoutTimeDimension,
|
|
2074
2085
|
getLayersById: getLayersById,
|
|
2075
2086
|
getLayersIds: getLayersIds,
|
|
2076
2087
|
getAllLayers: getAllLayers,
|
|
@@ -2421,6 +2432,11 @@ var slice$5 = createSlice({
|
|
|
2421
2432
|
draft.allIds.splice(mapIndex, 1);
|
|
2422
2433
|
}
|
|
2423
2434
|
},
|
|
2435
|
+
setStepBackwardOrForward: function setStepBackwardOrForward(
|
|
2436
|
+
// eslint-disable-next-line no-unused-vars
|
|
2437
|
+
_draft,
|
|
2438
|
+
// eslint-disable-next-line no-unused-vars
|
|
2439
|
+
_action) {},
|
|
2424
2440
|
setBbox: function setBbox(draft, action) {
|
|
2425
2441
|
var _action$payload = action.payload,
|
|
2426
2442
|
mapId = _action$payload.mapId,
|
|
@@ -3037,7 +3053,7 @@ var getisDialogOpen = createSelector(getDialogDetailsByType, function (details)
|
|
|
3037
3053
|
return details.isOpen;
|
|
3038
3054
|
}
|
|
3039
3055
|
return false;
|
|
3040
|
-
});
|
|
3056
|
+
}, selectorMemoizationOptions);
|
|
3041
3057
|
/**
|
|
3042
3058
|
*For a given ui component: gets the active map Id
|
|
3043
3059
|
*
|
|
@@ -3050,7 +3066,7 @@ var getDialogMapId = createSelector(getDialogDetailsByType, function (details) {
|
|
|
3050
3066
|
return details.activeMapId;
|
|
3051
3067
|
}
|
|
3052
3068
|
return '';
|
|
3053
|
-
});
|
|
3069
|
+
}, selectorMemoizationOptions);
|
|
3054
3070
|
/**
|
|
3055
3071
|
*For a given ui component: gets the order of visible dialog
|
|
3056
3072
|
*
|
|
@@ -3073,7 +3089,7 @@ var getDialogOrder = createSelector(function (store, dialogType) {
|
|
|
3073
3089
|
return 0;
|
|
3074
3090
|
}, function (order) {
|
|
3075
3091
|
return order;
|
|
3076
|
-
});
|
|
3092
|
+
}, selectorMemoizationOptions);
|
|
3077
3093
|
/**
|
|
3078
3094
|
*For a given ui component: returns if ordered on top
|
|
3079
3095
|
*
|
|
@@ -3089,13 +3105,13 @@ var getDialogIsOrderedOnTop = createSelector(function (store, dialogType) {
|
|
|
3089
3105
|
return false;
|
|
3090
3106
|
}, function (isOrderedOnTop) {
|
|
3091
3107
|
return isOrderedOnTop;
|
|
3092
|
-
});
|
|
3108
|
+
}, selectorMemoizationOptions);
|
|
3093
3109
|
var getDialogSource = createSelector(getDialogDetailsByType, function (details) {
|
|
3094
3110
|
if (details && details.source) {
|
|
3095
3111
|
return details.source;
|
|
3096
3112
|
}
|
|
3097
3113
|
return 'app';
|
|
3098
|
-
});
|
|
3114
|
+
}, selectorMemoizationOptions);
|
|
3099
3115
|
/**
|
|
3100
3116
|
* Get the active window that should receive keyboard shortcuts
|
|
3101
3117
|
*
|
|
@@ -3109,10 +3125,10 @@ var getActiveWindowId = function getActiveWindowId(store) {
|
|
|
3109
3125
|
};
|
|
3110
3126
|
var getDialogIsLoading = createSelector(getDialogDetailsByType, function (details) {
|
|
3111
3127
|
return details && details.isLoading || false;
|
|
3112
|
-
});
|
|
3128
|
+
}, selectorMemoizationOptions);
|
|
3113
3129
|
var getDialogError = createSelector(getDialogDetailsByType, function (details) {
|
|
3114
3130
|
return details && details.error || '';
|
|
3115
|
-
});
|
|
3131
|
+
}, selectorMemoizationOptions);
|
|
3116
3132
|
|
|
3117
3133
|
var selectors$5 = /*#__PURE__*/Object.freeze({
|
|
3118
3134
|
__proto__: null,
|
|
@@ -3539,17 +3555,24 @@ var syncGroupStore = function syncGroupStore(store) {
|
|
|
3539
3555
|
*/
|
|
3540
3556
|
var getSynchronizationGroupState = createSelector(syncGroupStore, function (store) {
|
|
3541
3557
|
return store || null;
|
|
3542
|
-
});
|
|
3543
|
-
var getSynchronizationGroup = function
|
|
3544
|
-
return
|
|
3545
|
-
}
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3558
|
+
}, selectorMemoizationOptions);
|
|
3559
|
+
var getSynchronizationGroup = createSelector([syncGroupStore, function (syncGroupStore, id) {
|
|
3560
|
+
return id;
|
|
3561
|
+
}], function (syncGroupState, id) {
|
|
3562
|
+
return syncGroupState.groups.byId[id];
|
|
3563
|
+
}, selectorMemoizationOptions);
|
|
3564
|
+
var getSynchronizationGroupSource = createSelector([syncGroupStore, function (syncGroupStore, id) {
|
|
3565
|
+
return id;
|
|
3566
|
+
}], function (syncGroupState, id) {
|
|
3567
|
+
return syncGroupState.sources.byId[id];
|
|
3568
|
+
}, selectorMemoizationOptions);
|
|
3569
|
+
var getTargets = createSelector([syncGroupStore, function (syncGroupStore, payload) {
|
|
3570
|
+
return payload;
|
|
3571
|
+
}, function (syncGroupStore, payload, actionType) {
|
|
3572
|
+
return actionType;
|
|
3573
|
+
}], function (syncronizationGroupStore, payload, actionType) {
|
|
3550
3574
|
var actionPayloads = [];
|
|
3551
3575
|
var targetsInActionPayload = {};
|
|
3552
|
-
var syncronizationGroupStore = syncGroupStore(state);
|
|
3553
3576
|
if (syncronizationGroupStore && payload) {
|
|
3554
3577
|
/* Backwards compatibility, if there are no groups, connect everything */
|
|
3555
3578
|
if (syncronizationGroupStore.groups.allIds.length === 0) {
|
|
@@ -3590,9 +3613,12 @@ var getTargets = function getTargets(state, payload, actionType) {
|
|
|
3590
3613
|
});
|
|
3591
3614
|
}
|
|
3592
3615
|
return actionPayloads;
|
|
3593
|
-
};
|
|
3594
|
-
var getTargetGroups = function
|
|
3595
|
-
|
|
3616
|
+
}, selectorMemoizationOptions);
|
|
3617
|
+
var getTargetGroups = createSelector([syncGroupStore, function (syncGroupStore, payload) {
|
|
3618
|
+
return payload;
|
|
3619
|
+
}, function (syncGroupStore, payload, actionType) {
|
|
3620
|
+
return actionType;
|
|
3621
|
+
}], function (syncronizationGroupStore, payload, actionType) {
|
|
3596
3622
|
var groups = syncronizationGroupStore.groups.allIds.reduce(function (list, groupId) {
|
|
3597
3623
|
var syncronizationGroup = syncronizationGroupStore.groups.byId[groupId];
|
|
3598
3624
|
if (actionType === syncronizationGroup.type) {
|
|
@@ -3606,10 +3632,12 @@ var getTargetGroups = function getTargetGroups(state, payload, actionType) {
|
|
|
3606
3632
|
return list;
|
|
3607
3633
|
}, []);
|
|
3608
3634
|
return groups;
|
|
3609
|
-
};
|
|
3610
|
-
var getSourceId = function
|
|
3635
|
+
}, selectorMemoizationOptions);
|
|
3636
|
+
var getSourceId = createSelector([syncGroupStore, function (syncGroupStore, sourceId) {
|
|
3637
|
+
return sourceId;
|
|
3638
|
+
}], function (syncGroupState, sourceId) {
|
|
3611
3639
|
return typeof sourceId === 'string' ? sourceId : sourceId.sourceId;
|
|
3612
|
-
};
|
|
3640
|
+
}, selectorMemoizationOptions);
|
|
3613
3641
|
var getAllTargetGroupsForSource = createSelector([syncGroupStore, getSourceId], function (syncGroupStore, sourceId) {
|
|
3614
3642
|
if (syncGroupStore === null || syncGroupStore === void 0 ? void 0 : syncGroupStore.groups) {
|
|
3615
3643
|
return syncGroupStore.groups.allIds.reduce(function (linkedSyncGroupIds, groupId) {
|
|
@@ -3623,10 +3651,10 @@ var getAllTargetGroupsForSource = createSelector([syncGroupStore, getSourceId],
|
|
|
3623
3651
|
}, []);
|
|
3624
3652
|
}
|
|
3625
3653
|
return [];
|
|
3626
|
-
});
|
|
3654
|
+
}, selectorMemoizationOptions);
|
|
3627
3655
|
var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
|
|
3628
3656
|
return store.viewState;
|
|
3629
|
-
});
|
|
3657
|
+
}, selectorMemoizationOptions);
|
|
3630
3658
|
var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (store) {
|
|
3631
3659
|
var _a, _b;
|
|
3632
3660
|
return (_b = (_a = store.viewState.timeslider.groups[0]) === null || _a === void 0 ? void 0 : _a.selected) !== null && _b !== void 0 ? _b : [];
|
|
@@ -3645,7 +3673,7 @@ var getSyncGroupTargets = createSelector(syncGroupStore, function (store) {
|
|
|
3645
3673
|
};
|
|
3646
3674
|
}));
|
|
3647
3675
|
}, []);
|
|
3648
|
-
});
|
|
3676
|
+
}, selectorMemoizationOptions);
|
|
3649
3677
|
|
|
3650
3678
|
var selectors$4 = /*#__PURE__*/Object.freeze({
|
|
3651
3679
|
__proto__: null,
|
|
@@ -3655,6 +3683,7 @@ var selectors$4 = /*#__PURE__*/Object.freeze({
|
|
|
3655
3683
|
getSynchronizationGroupSource: getSynchronizationGroupSource,
|
|
3656
3684
|
getTargets: getTargets,
|
|
3657
3685
|
getTargetGroups: getTargetGroups,
|
|
3686
|
+
getSourceId: getSourceId,
|
|
3658
3687
|
getAllTargetGroupsForSource: getAllTargetGroupsForSource,
|
|
3659
3688
|
syncGroupGetViewState: syncGroupGetViewState,
|
|
3660
3689
|
getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider,
|
|
@@ -3847,6 +3876,9 @@ var genericActions = Object.assign(Object.assign({}, actions), {
|
|
|
3847
3876
|
setBbox: setBbox
|
|
3848
3877
|
});
|
|
3849
3878
|
|
|
3879
|
+
var getMapStore = function getMapStore(store) {
|
|
3880
|
+
return store && store.webmap;
|
|
3881
|
+
};
|
|
3850
3882
|
/**
|
|
3851
3883
|
* Gets the map state by mapId
|
|
3852
3884
|
*
|
|
@@ -3855,10 +3887,14 @@ var genericActions = Object.assign(Object.assign({}, actions), {
|
|
|
3855
3887
|
* @param {string} mapId Id of the map
|
|
3856
3888
|
* @returns {object} object containing map state (isAnimating, bbox, baseLayers, layers etc.)
|
|
3857
3889
|
*/
|
|
3858
|
-
var getMapById = function
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3890
|
+
var getMapById = createSelector([getMapStore, function (getMapStore, mapId) {
|
|
3891
|
+
return mapId;
|
|
3892
|
+
}], function (mapState, mapId) {
|
|
3893
|
+
return mapState && mapState.byId[mapId] ? mapState && mapState.byId[mapId] : undefined;
|
|
3894
|
+
}, selectorMemoizationOptions);
|
|
3895
|
+
var getAllMapsByIds = createSelector(getMapStore, function (mapState) {
|
|
3896
|
+
return mapState && mapState.byId ? mapState && mapState.byId : {};
|
|
3897
|
+
}, selectorMemoizationOptions);
|
|
3862
3898
|
/**
|
|
3863
3899
|
* Gets all mapIds
|
|
3864
3900
|
*
|
|
@@ -3866,12 +3902,9 @@ var getMapById = function getMapById(store, mapId) {
|
|
|
3866
3902
|
* @param {object} store store object from which the map state wll be extracted
|
|
3867
3903
|
* @returns {array} array containing all map ids
|
|
3868
3904
|
*/
|
|
3869
|
-
var getAllMapIds = function
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
}
|
|
3873
|
-
return [];
|
|
3874
|
-
};
|
|
3905
|
+
var getAllMapIds = createSelector(getMapStore, function (mapState) {
|
|
3906
|
+
return mapState && mapState.allIds ? mapState.allIds : [];
|
|
3907
|
+
}, selectorMemoizationOptions);
|
|
3875
3908
|
/**
|
|
3876
3909
|
* Gets the map state of the first map in the store
|
|
3877
3910
|
*
|
|
@@ -3879,9 +3912,7 @@ var getAllMapIds = function getAllMapIds(store) {
|
|
|
3879
3912
|
* @param {object} store store object from which the map state wll be extracted
|
|
3880
3913
|
* @returns {object} object containing map state (isAnimating, bbox, baseLayers, layers etc.)
|
|
3881
3914
|
*/
|
|
3882
|
-
var getFirstMap = createSelector(getAllMapIds, function (
|
|
3883
|
-
return store && store.webmap && store.webmap.byId ? store.webmap.byId : {};
|
|
3884
|
-
}, function (allMapIds, mapsById) {
|
|
3915
|
+
var getFirstMap = createSelector(getAllMapIds, getAllMapsByIds, function (allMapIds, mapsById) {
|
|
3885
3916
|
return allMapIds[0] && mapsById[allMapIds[0]] ? mapsById[allMapIds[0]] : null;
|
|
3886
3917
|
}, selectorMemoizationOptions);
|
|
3887
3918
|
/**
|
|
@@ -3893,7 +3924,7 @@ var getFirstMap = createSelector(getAllMapIds, function (store) {
|
|
|
3893
3924
|
*/
|
|
3894
3925
|
var getFirstMapId = createSelector(getFirstMap, function (map) {
|
|
3895
3926
|
return map ? map.id : '';
|
|
3896
|
-
});
|
|
3927
|
+
}, selectorMemoizationOptions);
|
|
3897
3928
|
/**
|
|
3898
3929
|
* Determines if map is present
|
|
3899
3930
|
*
|
|
@@ -3901,14 +3932,9 @@ var getFirstMapId = createSelector(getFirstMap, function (map) {
|
|
|
3901
3932
|
* @param {string} mapId mapId: string - Id of the map
|
|
3902
3933
|
* @returns {boolean} returnType:boolean - true if map is present
|
|
3903
3934
|
*/
|
|
3904
|
-
var getIsMapPresent = createSelector(function (
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
}
|
|
3908
|
-
return false;
|
|
3909
|
-
}, function (isPresent) {
|
|
3910
|
-
return isPresent;
|
|
3911
|
-
});
|
|
3935
|
+
var getIsMapPresent = createSelector(getMapById, function (map) {
|
|
3936
|
+
return !!map;
|
|
3937
|
+
}, selectorMemoizationOptions);
|
|
3912
3938
|
/**
|
|
3913
3939
|
* Gets all layerIds for a map that aren't baselayers or overlayers
|
|
3914
3940
|
*
|
|
@@ -3998,8 +4024,8 @@ var getMapOverLayers = createSelector(getMapOverLayersIds, getLayersById, functi
|
|
|
3998
4024
|
* @param {string} mapId mapId: string - Id of the map
|
|
3999
4025
|
* @returns {array} returnType: array - array containing map dimensions
|
|
4000
4026
|
*/
|
|
4001
|
-
var getMapDimensions = createSelector(getMapById, function (
|
|
4002
|
-
return
|
|
4027
|
+
var getMapDimensions = createSelector(getMapById, function (webMap) {
|
|
4028
|
+
return webMap ? webMap.dimensions : [];
|
|
4003
4029
|
}, selectorMemoizationOptions);
|
|
4004
4030
|
/**
|
|
4005
4031
|
* Gets the map dimension requested
|
|
@@ -4010,16 +4036,25 @@ var getMapDimensions = createSelector(getMapById, function (store) {
|
|
|
4010
4036
|
* @param {string} dimensionName dimensionName: string - name of the dimension
|
|
4011
4037
|
* @returns {object} returnType: object - object containing the map dimension details
|
|
4012
4038
|
*/
|
|
4013
|
-
var getMapDimension = createSelector(getMapById, function (_store,
|
|
4039
|
+
var getMapDimension = createSelector([getMapById, function (_store, mapId) {
|
|
4040
|
+
return mapId;
|
|
4041
|
+
}, function (_store, _mapId, dimensionName) {
|
|
4014
4042
|
return dimensionName;
|
|
4015
|
-
}, function (
|
|
4016
|
-
if (
|
|
4017
|
-
return
|
|
4043
|
+
}], function (mapState, _mapId, dimensionName) {
|
|
4044
|
+
if (mapState && mapState.dimensions) {
|
|
4045
|
+
return mapState.dimensions.find(function (dim) {
|
|
4018
4046
|
return dim.name === dimensionName;
|
|
4019
4047
|
});
|
|
4020
4048
|
}
|
|
4021
4049
|
return undefined;
|
|
4022
4050
|
}, selectorMemoizationOptions);
|
|
4051
|
+
/**
|
|
4052
|
+
* Returns the current time in unix time for the given map
|
|
4053
|
+
*
|
|
4054
|
+
* @param {object} store store: object - store object
|
|
4055
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
4056
|
+
* @returns {object} returnType: unix time as number
|
|
4057
|
+
*/
|
|
4023
4058
|
var getSelectedTime = createSelector(function (store, mapId) {
|
|
4024
4059
|
return getMapDimension(store, mapId, 'time');
|
|
4025
4060
|
}, function (timeDimension) {
|
|
@@ -4032,7 +4067,7 @@ var getSelectedTime = createSelector(function (store, mapId) {
|
|
|
4032
4067
|
return getUnixTime(timeSliderTime);
|
|
4033
4068
|
}
|
|
4034
4069
|
return now;
|
|
4035
|
-
});
|
|
4070
|
+
}, selectorMemoizationOptions);
|
|
4036
4071
|
var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
|
|
4037
4072
|
return layers.reduce(function (_ref, layer) {
|
|
4038
4073
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
@@ -4056,7 +4091,7 @@ var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
|
|
|
4056
4091
|
* cause weird behaviour as timestamps break at 32bit limit (year 2038)
|
|
4057
4092
|
*/
|
|
4058
4093
|
[2147483647, 0]);
|
|
4059
|
-
});
|
|
4094
|
+
}, selectorMemoizationOptions);
|
|
4060
4095
|
/**
|
|
4061
4096
|
* Gets map srs
|
|
4062
4097
|
*
|
|
@@ -4067,7 +4102,7 @@ var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
|
|
|
4067
4102
|
*/
|
|
4068
4103
|
var getSrs = createSelector(getMapById, function (store) {
|
|
4069
4104
|
return store ? store.srs : '';
|
|
4070
|
-
});
|
|
4105
|
+
}, selectorMemoizationOptions);
|
|
4071
4106
|
/**
|
|
4072
4107
|
* Gets map bounding box
|
|
4073
4108
|
*
|
|
@@ -4127,7 +4162,7 @@ var linkedMapAnimationInfo = createSelector(function (store, mapId) {
|
|
|
4127
4162
|
*/
|
|
4128
4163
|
var getAnimationStartTime = createSelector(getMapById, function (store) {
|
|
4129
4164
|
return (store === null || store === void 0 ? void 0 : store.animationStartTime) ? store.animationStartTime : moment.utc().subtract(6, 'h').format(dateFormat);
|
|
4130
|
-
});
|
|
4165
|
+
}, selectorMemoizationOptions);
|
|
4131
4166
|
/**
|
|
4132
4167
|
* Gets end time of animation
|
|
4133
4168
|
*
|
|
@@ -4138,7 +4173,7 @@ var getAnimationStartTime = createSelector(getMapById, function (store) {
|
|
|
4138
4173
|
*/
|
|
4139
4174
|
var getAnimationEndTime$1 = createSelector(getMapById, function (store) {
|
|
4140
4175
|
return (store === null || store === void 0 ? void 0 : store.animationEndTime) ? store.animationEndTime : moment.utc().subtract(10, 'm').format(dateFormat);
|
|
4141
|
-
});
|
|
4176
|
+
}, selectorMemoizationOptions);
|
|
4142
4177
|
/**
|
|
4143
4178
|
* Returns map is auto updating
|
|
4144
4179
|
*
|
|
@@ -4149,7 +4184,7 @@ var getAnimationEndTime$1 = createSelector(getMapById, function (store) {
|
|
|
4149
4184
|
*/
|
|
4150
4185
|
var isAutoUpdating = createSelector(getMapById, function (store) {
|
|
4151
4186
|
return store ? store.isAutoUpdating : false;
|
|
4152
|
-
});
|
|
4187
|
+
}, selectorMemoizationOptions);
|
|
4153
4188
|
/**
|
|
4154
4189
|
* Gets if endTime and duration of animationPayload are overriding maxValue and minValue of leading layer
|
|
4155
4190
|
*
|
|
@@ -4160,7 +4195,7 @@ var isAutoUpdating = createSelector(getMapById, function (store) {
|
|
|
4160
4195
|
*/
|
|
4161
4196
|
var isEndTimeOverriding = createSelector(getMapById, function (store) {
|
|
4162
4197
|
return store ? store.isEndTimeOverriding : false;
|
|
4163
|
-
});
|
|
4198
|
+
}, selectorMemoizationOptions);
|
|
4164
4199
|
/**
|
|
4165
4200
|
* Gets activeLayerId for map
|
|
4166
4201
|
*
|
|
@@ -4173,7 +4208,7 @@ var getActiveLayerId = createSelector(getMapById, function (store) {
|
|
|
4173
4208
|
return store.autoUpdateLayerId;
|
|
4174
4209
|
}
|
|
4175
4210
|
return undefined;
|
|
4176
|
-
});
|
|
4211
|
+
}, selectorMemoizationOptions);
|
|
4177
4212
|
/**
|
|
4178
4213
|
* Gets autoUpdateLayerId for map
|
|
4179
4214
|
*
|
|
@@ -4183,7 +4218,7 @@ var getActiveLayerId = createSelector(getMapById, function (store) {
|
|
|
4183
4218
|
*/
|
|
4184
4219
|
var getAutoUpdateLayerId = createSelector(getMapById, function (store) {
|
|
4185
4220
|
return store === null || store === void 0 ? void 0 : store.autoUpdateLayerId;
|
|
4186
|
-
});
|
|
4221
|
+
}, selectorMemoizationOptions);
|
|
4187
4222
|
/**
|
|
4188
4223
|
* Gets autoUpdateLayerId for map
|
|
4189
4224
|
*
|
|
@@ -4193,7 +4228,7 @@ var getAutoUpdateLayerId = createSelector(getMapById, function (store) {
|
|
|
4193
4228
|
*/
|
|
4194
4229
|
var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
|
|
4195
4230
|
return store === null || store === void 0 ? void 0 : store.autoTimeStepLayerId;
|
|
4196
|
-
});
|
|
4231
|
+
}, selectorMemoizationOptions);
|
|
4197
4232
|
/**
|
|
4198
4233
|
* Gets span of a time slider of a map
|
|
4199
4234
|
*
|
|
@@ -4204,7 +4239,7 @@ var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
|
|
|
4204
4239
|
*/
|
|
4205
4240
|
var getMapTimeSliderSpan = createSelector(getMapById, function (store) {
|
|
4206
4241
|
return store ? store.timeSliderSpan : defaultTimeSpan;
|
|
4207
|
-
});
|
|
4242
|
+
}, selectorMemoizationOptions);
|
|
4208
4243
|
/**
|
|
4209
4244
|
* Gets time step of a map
|
|
4210
4245
|
*
|
|
@@ -4216,10 +4251,10 @@ var getMapTimeSliderSpan = createSelector(getMapById, function (store) {
|
|
|
4216
4251
|
var getMapTimeStep = createSelector(getMapById, function (store) {
|
|
4217
4252
|
var _a;
|
|
4218
4253
|
return (_a = store === null || store === void 0 ? void 0 : store.timeStep) !== null && _a !== void 0 ? _a : defaultTimeStep;
|
|
4219
|
-
});
|
|
4254
|
+
}, selectorMemoizationOptions);
|
|
4220
4255
|
var getMapTimeStepWithoutDefault = createSelector(getMapById, function (store) {
|
|
4221
4256
|
return store === null || store === void 0 ? void 0 : store.timeStep;
|
|
4222
|
-
});
|
|
4257
|
+
}, selectorMemoizationOptions);
|
|
4223
4258
|
/**
|
|
4224
4259
|
* Returns the speed of animation
|
|
4225
4260
|
*
|
|
@@ -4230,7 +4265,7 @@ var getMapTimeStepWithoutDefault = createSelector(getMapById, function (store) {
|
|
|
4230
4265
|
*/
|
|
4231
4266
|
var getMapAnimationDelay = createSelector(getMapById, function (store) {
|
|
4232
4267
|
return store ? store.animationDelay : defaultAnimationDelayAtStart;
|
|
4233
|
-
});
|
|
4268
|
+
}, selectorMemoizationOptions);
|
|
4234
4269
|
/**
|
|
4235
4270
|
* Returns the width of time slider
|
|
4236
4271
|
*
|
|
@@ -4241,7 +4276,7 @@ var getMapAnimationDelay = createSelector(getMapById, function (store) {
|
|
|
4241
4276
|
*/
|
|
4242
4277
|
var getMapTimeSliderWidth = createSelector(getMapById, function (store) {
|
|
4243
4278
|
return store ? store.timeSliderWidth : 0;
|
|
4244
|
-
});
|
|
4279
|
+
}, selectorMemoizationOptions);
|
|
4245
4280
|
/**
|
|
4246
4281
|
* Returns the center time of time slider
|
|
4247
4282
|
*
|
|
@@ -4252,7 +4287,7 @@ var getMapTimeSliderWidth = createSelector(getMapById, function (store) {
|
|
|
4252
4287
|
*/
|
|
4253
4288
|
var getMapTimeSliderCenterTime = createSelector(getMapById, function (store) {
|
|
4254
4289
|
return store ? store.timeSliderCenterTime : moment().unix();
|
|
4255
|
-
});
|
|
4290
|
+
}, selectorMemoizationOptions);
|
|
4256
4291
|
/**
|
|
4257
4292
|
* Returns the unfiltered selected time of time slider
|
|
4258
4293
|
* This is not used to set the selected time itself, which is controlled by TimeBounds where values are rounded.
|
|
@@ -4268,7 +4303,7 @@ var getTimeSliderUnfilteredSelectedTime = createSelector(getMapById, getSelected
|
|
|
4268
4303
|
return undefined;
|
|
4269
4304
|
}
|
|
4270
4305
|
return (_a = store.timeSliderUnfilteredSelectedTime) !== null && _a !== void 0 ? _a : selectedTime;
|
|
4271
|
-
});
|
|
4306
|
+
}, selectorMemoizationOptions);
|
|
4272
4307
|
/**
|
|
4273
4308
|
* Returns the number of seconds per pixel on the time slider
|
|
4274
4309
|
*
|
|
@@ -4279,7 +4314,7 @@ var getTimeSliderUnfilteredSelectedTime = createSelector(getMapById, getSelected
|
|
|
4279
4314
|
*/
|
|
4280
4315
|
var getMapTimeSliderSecondsPerPx = createSelector(getMapById, function (store) {
|
|
4281
4316
|
return store ? store.timeSliderSecondsPerPx : defaultSecondsPerPx;
|
|
4282
|
-
});
|
|
4317
|
+
}, selectorMemoizationOptions);
|
|
4283
4318
|
/**
|
|
4284
4319
|
* Returns map is timestep auto
|
|
4285
4320
|
*
|
|
@@ -4290,7 +4325,7 @@ var getMapTimeSliderSecondsPerPx = createSelector(getMapById, function (store) {
|
|
|
4290
4325
|
*/
|
|
4291
4326
|
var isTimestepAuto = createSelector(getMapById, function (store) {
|
|
4292
4327
|
return store ? store.isTimestepAuto : false;
|
|
4293
|
-
});
|
|
4328
|
+
}, selectorMemoizationOptions);
|
|
4294
4329
|
/**
|
|
4295
4330
|
* Returns map is timespan auto
|
|
4296
4331
|
*
|
|
@@ -4301,7 +4336,7 @@ var isTimestepAuto = createSelector(getMapById, function (store) {
|
|
|
4301
4336
|
*/
|
|
4302
4337
|
var isTimeSpanAuto = createSelector(getMapById, function (store) {
|
|
4303
4338
|
return store ? store.isTimeSpanAuto : false;
|
|
4304
|
-
});
|
|
4339
|
+
}, selectorMemoizationOptions);
|
|
4305
4340
|
/**
|
|
4306
4341
|
* Returns map is time slider hover
|
|
4307
4342
|
*
|
|
@@ -4312,7 +4347,7 @@ var isTimeSpanAuto = createSelector(getMapById, function (store) {
|
|
|
4312
4347
|
*/
|
|
4313
4348
|
var isTimeSliderHoverOn = createSelector(getMapById, function (store) {
|
|
4314
4349
|
return store ? store.isTimeSliderHoverOn : false;
|
|
4315
|
-
});
|
|
4350
|
+
}, selectorMemoizationOptions);
|
|
4316
4351
|
/**
|
|
4317
4352
|
* Returns map if zoomcontrols are visible
|
|
4318
4353
|
*
|
|
@@ -4323,7 +4358,7 @@ var isTimeSliderHoverOn = createSelector(getMapById, function (store) {
|
|
|
4323
4358
|
*/
|
|
4324
4359
|
var isZoomControlsVisible = createSelector(getMapById, function (store) {
|
|
4325
4360
|
return store ? store.shouldShowZoomControls : true;
|
|
4326
|
-
});
|
|
4361
|
+
}, selectorMemoizationOptions);
|
|
4327
4362
|
/**
|
|
4328
4363
|
* Returns map is time slider visible
|
|
4329
4364
|
*
|
|
@@ -4334,7 +4369,7 @@ var isZoomControlsVisible = createSelector(getMapById, function (store) {
|
|
|
4334
4369
|
*/
|
|
4335
4370
|
var isTimeSliderVisible = createSelector(getMapById, function (store) {
|
|
4336
4371
|
return store ? store.isTimeSliderVisible : true;
|
|
4337
|
-
});
|
|
4372
|
+
}, selectorMemoizationOptions);
|
|
4338
4373
|
/**
|
|
4339
4374
|
* Returns is layer is active layer
|
|
4340
4375
|
*
|
|
@@ -4348,7 +4383,7 @@ var getIsLayerActiveLayer = createSelector(getActiveLayerId, function (_store, _
|
|
|
4348
4383
|
return layerId;
|
|
4349
4384
|
}, function (activeLayerId, layerId) {
|
|
4350
4385
|
return activeLayerId === layerId;
|
|
4351
|
-
});
|
|
4386
|
+
}, selectorMemoizationOptions);
|
|
4352
4387
|
/**
|
|
4353
4388
|
* Returns the mapId for given layerId
|
|
4354
4389
|
*
|
|
@@ -4457,7 +4492,7 @@ var getPinLocation = createSelector(getMapById, function (store) {
|
|
|
4457
4492
|
*/
|
|
4458
4493
|
var getDisableMapPin = createSelector(getMapById, function (store) {
|
|
4459
4494
|
return store ? store.disableMapPin : false;
|
|
4460
|
-
});
|
|
4495
|
+
}, selectorMemoizationOptions);
|
|
4461
4496
|
/**
|
|
4462
4497
|
* Returns the display map pin boolean for the current map
|
|
4463
4498
|
*
|
|
@@ -4468,7 +4503,7 @@ var getDisableMapPin = createSelector(getMapById, function (store) {
|
|
|
4468
4503
|
*/
|
|
4469
4504
|
var getDisplayMapPin = createSelector(getMapById, function (store) {
|
|
4470
4505
|
return store ? store.displayMapPin : false;
|
|
4471
|
-
});
|
|
4506
|
+
}, selectorMemoizationOptions);
|
|
4472
4507
|
/**
|
|
4473
4508
|
* Returns the legend id
|
|
4474
4509
|
*
|
|
@@ -4479,7 +4514,7 @@ var getDisplayMapPin = createSelector(getMapById, function (store) {
|
|
|
4479
4514
|
*/
|
|
4480
4515
|
var getLegendId = createSelector(getMapById, function (store) {
|
|
4481
4516
|
return store ? store.legendId : undefined;
|
|
4482
|
-
});
|
|
4517
|
+
}, selectorMemoizationOptions);
|
|
4483
4518
|
/**
|
|
4484
4519
|
* Creates a MapPreset from mapId
|
|
4485
4520
|
*
|
|
@@ -4572,11 +4607,12 @@ var getIsEnabledLayersForMapDimension = createSelector(getMapLayerIdsEnabled, fu
|
|
|
4572
4607
|
*/
|
|
4573
4608
|
var getDockedLayerManagerSize = createSelector(getMapById, function (store) {
|
|
4574
4609
|
return store ? store.dockedLayerManagerSize : 'sizeSmall';
|
|
4575
|
-
});
|
|
4610
|
+
}, selectorMemoizationOptions);
|
|
4576
4611
|
|
|
4577
4612
|
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
4578
4613
|
__proto__: null,
|
|
4579
4614
|
getMapById: getMapById,
|
|
4615
|
+
getAllMapsByIds: getAllMapsByIds,
|
|
4580
4616
|
getAllMapIds: getAllMapIds,
|
|
4581
4617
|
getFirstMap: getFirstMap,
|
|
4582
4618
|
getFirstMapId: getFirstMapId,
|
|
@@ -5859,33 +5895,101 @@ function unregisterMapSaga(_ref7) {
|
|
|
5859
5895
|
}, _callee7);
|
|
5860
5896
|
})();
|
|
5861
5897
|
}
|
|
5898
|
+
function setStepBackwardOrForwardSaga(_ref8) {
|
|
5899
|
+
var payload = _ref8.payload;
|
|
5900
|
+
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
5901
|
+
var mapId, isForwardStep, timeStep, currentTime, _yield$select, _yield$select2, dataStartTime, dataEndTime, makeForwardStep, makeBackwardStep, selectedTimeString;
|
|
5902
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context10) {
|
|
5903
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
5904
|
+
case 0:
|
|
5905
|
+
mapId = payload.mapId, isForwardStep = payload.isForwardStep;
|
|
5906
|
+
_context10.next = 3;
|
|
5907
|
+
return select(getMapTimeStep, mapId);
|
|
5908
|
+
case 3:
|
|
5909
|
+
timeStep = _context10.sent;
|
|
5910
|
+
_context10.next = 6;
|
|
5911
|
+
return select(getSelectedTime, mapId);
|
|
5912
|
+
case 6:
|
|
5913
|
+
currentTime = _context10.sent;
|
|
5914
|
+
_context10.next = 9;
|
|
5915
|
+
return select(getDataLimitsFromLayers, mapId);
|
|
5916
|
+
case 9:
|
|
5917
|
+
_yield$select = _context10.sent;
|
|
5918
|
+
_yield$select2 = _slicedToArray(_yield$select, 2);
|
|
5919
|
+
dataStartTime = _yield$select2[0];
|
|
5920
|
+
dataEndTime = _yield$select2[1];
|
|
5921
|
+
if (!isValid(currentTime)) {
|
|
5922
|
+
_context10.next = 23;
|
|
5923
|
+
break;
|
|
5924
|
+
}
|
|
5925
|
+
makeForwardStep = function makeForwardStep() {
|
|
5926
|
+
var nextTime = currentTime + timeStep;
|
|
5927
|
+
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
5928
|
+
var newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
5929
|
+
return fromUnixTime(newTime).toISOString();
|
|
5930
|
+
};
|
|
5931
|
+
makeBackwardStep = function makeBackwardStep() {
|
|
5932
|
+
var nextTime = currentTime - timeStep;
|
|
5933
|
+
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
5934
|
+
var newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
5935
|
+
return fromUnixTime(newTime).toISOString();
|
|
5936
|
+
};
|
|
5937
|
+
selectedTimeString = isForwardStep ? makeForwardStep() : makeBackwardStep();
|
|
5938
|
+
_context10.next = 19;
|
|
5939
|
+
return put(mapActions.mapStopAnimation({
|
|
5940
|
+
mapId: mapId,
|
|
5941
|
+
origin: MapActionOrigin.map
|
|
5942
|
+
}));
|
|
5943
|
+
case 19:
|
|
5944
|
+
_context10.next = 21;
|
|
5945
|
+
return put(mapActions.toggleAutoUpdate({
|
|
5946
|
+
mapId: mapId,
|
|
5947
|
+
shouldAutoUpdate: false
|
|
5948
|
+
}));
|
|
5949
|
+
case 21:
|
|
5950
|
+
_context10.next = 23;
|
|
5951
|
+
return put(genericActions.setTime({
|
|
5952
|
+
origin: '',
|
|
5953
|
+
sourceId: mapId,
|
|
5954
|
+
value: handleMomentISOString(selectedTimeString)
|
|
5955
|
+
}));
|
|
5956
|
+
case 23:
|
|
5957
|
+
case "end":
|
|
5958
|
+
return _context10.stop();
|
|
5959
|
+
}
|
|
5960
|
+
}, _callee8);
|
|
5961
|
+
})();
|
|
5962
|
+
}
|
|
5862
5963
|
function rootSaga$5() {
|
|
5863
|
-
return _regeneratorRuntime().wrap(function rootSaga$(
|
|
5864
|
-
while (1) switch (
|
|
5964
|
+
return _regeneratorRuntime().wrap(function rootSaga$(_context11) {
|
|
5965
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
5865
5966
|
case 0:
|
|
5866
|
-
|
|
5967
|
+
_context11.next = 2;
|
|
5867
5968
|
return takeLatest(mapActions.mapStopAnimation.type, stopAnimationSaga);
|
|
5868
5969
|
case 2:
|
|
5869
|
-
|
|
5970
|
+
_context11.next = 4;
|
|
5870
5971
|
return takeLatest(mapActions.mapStartAnimation.type, startAnimationSaga);
|
|
5871
5972
|
case 4:
|
|
5872
|
-
|
|
5973
|
+
_context11.next = 6;
|
|
5873
5974
|
return takeLatest(layerActions.layerDelete.type, deleteLayerSaga);
|
|
5874
5975
|
case 6:
|
|
5875
|
-
|
|
5976
|
+
_context11.next = 8;
|
|
5876
5977
|
return takeLatest(layerActions.onUpdateLayerInformation.type, setLayerDimensionsSaga);
|
|
5877
5978
|
case 8:
|
|
5878
|
-
|
|
5979
|
+
_context11.next = 10;
|
|
5879
5980
|
return takeLatest(mapActions.toggleAutoUpdate.type, toggleAutoUpdateSaga);
|
|
5880
5981
|
case 10:
|
|
5881
|
-
|
|
5982
|
+
_context11.next = 12;
|
|
5882
5983
|
return takeEvery(mapActions.setMapPreset.type, setMapPresetSaga);
|
|
5883
5984
|
case 12:
|
|
5884
|
-
|
|
5985
|
+
_context11.next = 14;
|
|
5885
5986
|
return takeEvery(mapActions.unregisterMap.type, unregisterMapSaga);
|
|
5886
5987
|
case 14:
|
|
5988
|
+
_context11.next = 16;
|
|
5989
|
+
return takeEvery(mapActions.setStepBackwardOrForward.type, setStepBackwardOrForwardSaga);
|
|
5990
|
+
case 16:
|
|
5887
5991
|
case "end":
|
|
5888
|
-
return
|
|
5992
|
+
return _context11.stop();
|
|
5889
5993
|
}
|
|
5890
5994
|
}, _marked3$2);
|
|
5891
5995
|
}
|
|
@@ -6072,6 +6176,9 @@ var findTargets = function findTargets(state, payload, actionType, sourceMapId)
|
|
|
6072
6176
|
*/
|
|
6073
6177
|
var getLayerActionsTargets = function getLayerActionsTargets(state, payload, actionType) {
|
|
6074
6178
|
var mapId = getMapIdFromLayerId(state, payload.layerId);
|
|
6179
|
+
if (!mapId) {
|
|
6180
|
+
return [];
|
|
6181
|
+
}
|
|
6075
6182
|
var foundTargets = findTargets(state, payload, actionType, mapId);
|
|
6076
6183
|
return foundTargets.map(function (target) {
|
|
6077
6184
|
var payload = target.payload;
|
|
@@ -6148,6 +6255,9 @@ var getLayerMoveActionsTargets = function getLayerMoveActionsTargets(state, payl
|
|
|
6148
6255
|
*/
|
|
6149
6256
|
var getSetActiveLayerIdActionsTargets = function getSetActiveLayerIdActionsTargets(state, payload, actionType) {
|
|
6150
6257
|
var sourceMapId = getMapIdFromLayerId(state, payload.layerId);
|
|
6258
|
+
if (!sourceMapId) {
|
|
6259
|
+
return [];
|
|
6260
|
+
}
|
|
6151
6261
|
var foundTargets = findTargets(state, payload, actionType, sourceMapId);
|
|
6152
6262
|
return foundTargets.map(function (target) {
|
|
6153
6263
|
return {
|
|
@@ -7937,4 +8047,4 @@ var useSetupDialog = function useSetupDialog(dialogType) {
|
|
|
7937
8047
|
};
|
|
7938
8048
|
};
|
|
7939
8049
|
|
|
7940
|
-
export { ThemeStoreProvider, appActions, appModuleConfig, coreModuleConfig, createStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, rootSaga$3 as genericSaga, selectors$3 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, initialState$4 as initialState, layerActions, reducer$7 as layerReducer, selectors$6 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, mapActions, constants$1 as mapConstants, enums as mapEnums, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants as syncConstants, actions as syncGroupsActions, reducer$4 as syncGroupsReducer, selector as syncGroupsSelector, selectors$4 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$6 as uiReducer, selectors$5 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$5 as webmapReducer };
|
|
8050
|
+
export { ThemeStoreProvider, appActions, appModuleConfig, coreModuleConfig, createStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, rootSaga$3 as genericSaga, selectors$3 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, initialState$4 as initialState, layerActions, reducer$7 as layerReducer, selectors$6 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, mapActions, constants$1 as mapConstants, enums as mapEnums, rootSaga$5 as mapSaga, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants as syncConstants, actions as syncGroupsActions, reducer$4 as syncGroupsReducer, selector as syncGroupsSelector, selectors$4 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$6 as uiReducer, selectors$5 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$5 as webmapReducer };
|