@opengeoweb/store 9.4.1 → 9.6.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 +245 -132
- package/package.json +20 -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 +46 -21
- package/src/store/mapStore/map/index.d.ts +1 -2
- 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 -2
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.
|
|
@@ -797,9 +792,6 @@ var getTimeStepFromDataInterval = function getTimeStepFromDataInterval(timeInter
|
|
|
797
792
|
return defaultTimeStep;
|
|
798
793
|
}
|
|
799
794
|
};
|
|
800
|
-
var getActiveLayerTimeStep = function getActiveLayerTimeStep(timeDimension) {
|
|
801
|
-
return (timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.timeInterval) ? getTimeStepFromDataInterval(timeDimension.timeInterval) : undefined;
|
|
802
|
-
};
|
|
803
795
|
var getSpeedFactor = function getSpeedFactor(speedDelay) {
|
|
804
796
|
return defaultDelay / speedDelay;
|
|
805
797
|
};
|
|
@@ -857,7 +849,6 @@ var utils$3 = /*#__PURE__*/Object.freeze({
|
|
|
857
849
|
produceDraftStateSetMapDimensionFromLayerChangeDimension: produceDraftStateSetMapDimensionFromLayerChangeDimension,
|
|
858
850
|
moveArrayElements: moveArrayElements,
|
|
859
851
|
getTimeStepFromDataInterval: getTimeStepFromDataInterval,
|
|
860
|
-
getActiveLayerTimeStep: getActiveLayerTimeStep,
|
|
861
852
|
getSpeedFactor: getSpeedFactor,
|
|
862
853
|
getAnimationDuration: getAnimationDuration,
|
|
863
854
|
getSpeedDelay: getSpeedDelay,
|
|
@@ -1727,13 +1718,28 @@ var layerStore = function layerStore(store) {
|
|
|
1727
1718
|
* @param {string} layerId Id of the layer
|
|
1728
1719
|
* @returns {object} object containing layer information (service, name, style, enabled etc.)
|
|
1729
1720
|
*/
|
|
1730
|
-
var getLayerById = function
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1721
|
+
var getLayerById = createSelector([layerStore, function (layerStore, layerId) {
|
|
1722
|
+
return layerId;
|
|
1723
|
+
}], function (layerState, layerId) {
|
|
1724
|
+
return layerState && layerState.byId && layerState.byId[layerId];
|
|
1725
|
+
}, selectorMemoizationOptions);
|
|
1726
|
+
/**
|
|
1727
|
+
* Gets a layer from the layers part of the store by its Id, but without the time dimension. (All other dimensions are still included)
|
|
1728
|
+
*
|
|
1729
|
+
* Example: layer = getLayerByIdWithoutTimeDimension(store, 'layerId')
|
|
1730
|
+
* @param {object} store object from which the layer state will be extracted
|
|
1731
|
+
* @param {string} layerId Id of the layer
|
|
1732
|
+
* @returns {object} object containing layer information (service, name, style, enabled etc.)
|
|
1733
|
+
*/
|
|
1734
|
+
var getLayerByIdWithoutTimeDimension = createSelector([layerStore, function (layerStore, layerId) {
|
|
1735
|
+
return layerId;
|
|
1736
|
+
}], function (layerState, layerId) {
|
|
1737
|
+
var layer = layerState && layerState.byId && layerState.byId[layerId];
|
|
1738
|
+
return layer ? produce(layer, function (draftLayer) {
|
|
1739
|
+
draftLayer.dimensions = filterNonTimeDimensions(draftLayer.dimensions || []);
|
|
1740
|
+
return draftLayer;
|
|
1741
|
+
}) : undefined;
|
|
1742
|
+
}, selectorMemoizationOptions);
|
|
1737
1743
|
/**
|
|
1738
1744
|
* Retrieves all layers indexed by layerId
|
|
1739
1745
|
*
|
|
@@ -1906,7 +1912,7 @@ var getLayerDimension = createSelector(getLayerDimensions, function (_store, _la
|
|
|
1906
1912
|
*/
|
|
1907
1913
|
var getLayerOpacity = createSelector(getLayerById, function (layer) {
|
|
1908
1914
|
return layer && layer.opacity ? layer.opacity : 0;
|
|
1909
|
-
});
|
|
1915
|
+
}, selectorMemoizationOptions);
|
|
1910
1916
|
/**
|
|
1911
1917
|
* Gets whether a layer is enabled or disabled
|
|
1912
1918
|
*
|
|
@@ -1917,7 +1923,7 @@ var getLayerOpacity = createSelector(getLayerById, function (layer) {
|
|
|
1917
1923
|
*/
|
|
1918
1924
|
var getLayerEnabled = createSelector(getLayerById, function (layer) {
|
|
1919
1925
|
return Boolean(layer === null || layer === void 0 ? void 0 : layer.enabled);
|
|
1920
|
-
});
|
|
1926
|
+
}, selectorMemoizationOptions);
|
|
1921
1927
|
/**
|
|
1922
1928
|
* Gets layer name
|
|
1923
1929
|
*
|
|
@@ -1929,7 +1935,7 @@ var getLayerEnabled = createSelector(getLayerById, function (layer) {
|
|
|
1929
1935
|
var getLayerName = createSelector(getLayerById, function (layer) {
|
|
1930
1936
|
var _a;
|
|
1931
1937
|
return (_a = layer === null || layer === void 0 ? void 0 : layer.name) !== null && _a !== void 0 ? _a : '';
|
|
1932
|
-
});
|
|
1938
|
+
}, selectorMemoizationOptions);
|
|
1933
1939
|
/**
|
|
1934
1940
|
* Gets layer service
|
|
1935
1941
|
*
|
|
@@ -1941,7 +1947,7 @@ var getLayerName = createSelector(getLayerById, function (layer) {
|
|
|
1941
1947
|
var getLayerService = createSelector(getLayerById, function (layer) {
|
|
1942
1948
|
var _a;
|
|
1943
1949
|
return (_a = layer === null || layer === void 0 ? void 0 : layer.service) !== null && _a !== void 0 ? _a : '';
|
|
1944
|
-
});
|
|
1950
|
+
}, selectorMemoizationOptions);
|
|
1945
1951
|
/**
|
|
1946
1952
|
* Gets selected style of the passed layer
|
|
1947
1953
|
*
|
|
@@ -1952,7 +1958,7 @@ var getLayerService = createSelector(getLayerById, function (layer) {
|
|
|
1952
1958
|
*/
|
|
1953
1959
|
var getLayerStyle = createSelector(getLayerById, function (layer) {
|
|
1954
1960
|
return layer && layer.style ? layer.style : '';
|
|
1955
|
-
});
|
|
1961
|
+
}, selectorMemoizationOptions);
|
|
1956
1962
|
/**
|
|
1957
1963
|
* Gets layer status
|
|
1958
1964
|
*
|
|
@@ -1963,7 +1969,7 @@ var getLayerStyle = createSelector(getLayerById, function (layer) {
|
|
|
1963
1969
|
*/
|
|
1964
1970
|
var getLayerStatus = createSelector(getLayerById, function (layer) {
|
|
1965
1971
|
return layer && layer.status ? layer.status : LayerStatus["default"];
|
|
1966
|
-
});
|
|
1972
|
+
}, selectorMemoizationOptions);
|
|
1967
1973
|
/**
|
|
1968
1974
|
* Gets all available base layers for a map
|
|
1969
1975
|
*
|
|
@@ -1996,7 +2002,7 @@ var getAvailableBaseLayersForMap = createSelector(layerStore, function (_store,
|
|
|
1996
2002
|
*/
|
|
1997
2003
|
var getSelectedFeatureIndex = createSelector(getLayerById, function (layer) {
|
|
1998
2004
|
return layer === null || layer === void 0 ? void 0 : layer.selectedFeatureIndex;
|
|
1999
|
-
});
|
|
2005
|
+
}, selectorMemoizationOptions);
|
|
2000
2006
|
/**
|
|
2001
2007
|
* Returns the layer is in edit mode
|
|
2002
2008
|
*
|
|
@@ -2007,15 +2013,15 @@ var getSelectedFeatureIndex = createSelector(getLayerById, function (layer) {
|
|
|
2007
2013
|
*/
|
|
2008
2014
|
var getIsLayerInEditMode = createSelector(getLayerById, function (layer) {
|
|
2009
2015
|
return (layer === null || layer === void 0 ? void 0 : layer.isInEditMode) || false;
|
|
2010
|
-
});
|
|
2016
|
+
}, selectorMemoizationOptions);
|
|
2011
2017
|
var getFeatureLayerGeoJSON = createSelector(getLayerById, function (layer) {
|
|
2012
2018
|
return (layer === null || layer === void 0 ? void 0 : layer.geojson) || undefined;
|
|
2013
|
-
});
|
|
2019
|
+
}, selectorMemoizationOptions);
|
|
2014
2020
|
var getFeatureLayerGeoJSONProperties = createSelector(getLayerById, getSelectedFeatureIndex, function (layer) {
|
|
2015
2021
|
var selecteFeatureIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2016
2022
|
var _a, _b;
|
|
2017
2023
|
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
|
-
});
|
|
2024
|
+
}, selectorMemoizationOptions);
|
|
2019
2025
|
/**
|
|
2020
2026
|
* Gets layerIds that contain passed dimension
|
|
2021
2027
|
*
|
|
@@ -2040,7 +2046,7 @@ var getDimensionLayerIds = createSelector(getLayersIds, getLayersById, function
|
|
|
2040
2046
|
}, selectorMemoizationOptions);
|
|
2041
2047
|
var getAcceptanceTimeInMinutes = createSelector(getLayerById, function (layer) {
|
|
2042
2048
|
return layer === null || layer === void 0 ? void 0 : layer.acceptanceTimeInMinutes;
|
|
2043
|
-
});
|
|
2049
|
+
}, selectorMemoizationOptions);
|
|
2044
2050
|
var getLayerIsInsideAcceptanceTime = createSelector(getAcceptanceTimeInMinutes, getLayerCurrentTime, function (state, _layerId, mapId) {
|
|
2045
2051
|
var _a, _b, _c, _d;
|
|
2046
2052
|
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 +2069,21 @@ var getLayerIsInsideAcceptanceTime = createSelector(getAcceptanceTimeInMinutes,
|
|
|
2063
2069
|
}
|
|
2064
2070
|
}
|
|
2065
2071
|
return 'inside';
|
|
2066
|
-
});
|
|
2072
|
+
}, selectorMemoizationOptions);
|
|
2067
2073
|
var getUseLatestReferenceTime = createSelector(getLayerById, function (layer) {
|
|
2068
2074
|
return Boolean(layer === null || layer === void 0 ? void 0 : layer.useLatestReferenceTime);
|
|
2069
|
-
});
|
|
2075
|
+
}, selectorMemoizationOptions);
|
|
2076
|
+
/**
|
|
2077
|
+
* Returns the timestep for this layerId in seconds, or undefined if it has no time dimension or timeinterval.
|
|
2078
|
+
*/
|
|
2079
|
+
var getTimeStepForLayerId = createSelector(getLayerTimeDimension, function (timeDimension) {
|
|
2080
|
+
return timeDimension && timeDimension.timeInterval ? getTimeStepFromDataInterval(timeDimension.timeInterval) : undefined;
|
|
2081
|
+
}, selectorMemoizationOptions);
|
|
2070
2082
|
|
|
2071
2083
|
var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
2072
2084
|
__proto__: null,
|
|
2073
2085
|
getLayerById: getLayerById,
|
|
2086
|
+
getLayerByIdWithoutTimeDimension: getLayerByIdWithoutTimeDimension,
|
|
2074
2087
|
getLayersById: getLayersById,
|
|
2075
2088
|
getLayersIds: getLayersIds,
|
|
2076
2089
|
getAllLayers: getAllLayers,
|
|
@@ -2099,7 +2112,8 @@ var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
|
2099
2112
|
getDimensionLayerIds: getDimensionLayerIds,
|
|
2100
2113
|
getAcceptanceTimeInMinutes: getAcceptanceTimeInMinutes,
|
|
2101
2114
|
getLayerIsInsideAcceptanceTime: getLayerIsInsideAcceptanceTime,
|
|
2102
|
-
getUseLatestReferenceTime: getUseLatestReferenceTime
|
|
2115
|
+
getUseLatestReferenceTime: getUseLatestReferenceTime,
|
|
2116
|
+
getTimeStepForLayerId: getTimeStepForLayerId
|
|
2103
2117
|
});
|
|
2104
2118
|
|
|
2105
2119
|
/* *
|
|
@@ -2421,6 +2435,11 @@ var slice$5 = createSlice({
|
|
|
2421
2435
|
draft.allIds.splice(mapIndex, 1);
|
|
2422
2436
|
}
|
|
2423
2437
|
},
|
|
2438
|
+
setStepBackwardOrForward: function setStepBackwardOrForward(
|
|
2439
|
+
// eslint-disable-next-line no-unused-vars
|
|
2440
|
+
_draft,
|
|
2441
|
+
// eslint-disable-next-line no-unused-vars
|
|
2442
|
+
_action) {},
|
|
2424
2443
|
setBbox: function setBbox(draft, action) {
|
|
2425
2444
|
var _action$payload = action.payload,
|
|
2426
2445
|
mapId = _action$payload.mapId,
|
|
@@ -3037,7 +3056,7 @@ var getisDialogOpen = createSelector(getDialogDetailsByType, function (details)
|
|
|
3037
3056
|
return details.isOpen;
|
|
3038
3057
|
}
|
|
3039
3058
|
return false;
|
|
3040
|
-
});
|
|
3059
|
+
}, selectorMemoizationOptions);
|
|
3041
3060
|
/**
|
|
3042
3061
|
*For a given ui component: gets the active map Id
|
|
3043
3062
|
*
|
|
@@ -3050,7 +3069,7 @@ var getDialogMapId = createSelector(getDialogDetailsByType, function (details) {
|
|
|
3050
3069
|
return details.activeMapId;
|
|
3051
3070
|
}
|
|
3052
3071
|
return '';
|
|
3053
|
-
});
|
|
3072
|
+
}, selectorMemoizationOptions);
|
|
3054
3073
|
/**
|
|
3055
3074
|
*For a given ui component: gets the order of visible dialog
|
|
3056
3075
|
*
|
|
@@ -3073,7 +3092,7 @@ var getDialogOrder = createSelector(function (store, dialogType) {
|
|
|
3073
3092
|
return 0;
|
|
3074
3093
|
}, function (order) {
|
|
3075
3094
|
return order;
|
|
3076
|
-
});
|
|
3095
|
+
}, selectorMemoizationOptions);
|
|
3077
3096
|
/**
|
|
3078
3097
|
*For a given ui component: returns if ordered on top
|
|
3079
3098
|
*
|
|
@@ -3089,13 +3108,13 @@ var getDialogIsOrderedOnTop = createSelector(function (store, dialogType) {
|
|
|
3089
3108
|
return false;
|
|
3090
3109
|
}, function (isOrderedOnTop) {
|
|
3091
3110
|
return isOrderedOnTop;
|
|
3092
|
-
});
|
|
3111
|
+
}, selectorMemoizationOptions);
|
|
3093
3112
|
var getDialogSource = createSelector(getDialogDetailsByType, function (details) {
|
|
3094
3113
|
if (details && details.source) {
|
|
3095
3114
|
return details.source;
|
|
3096
3115
|
}
|
|
3097
3116
|
return 'app';
|
|
3098
|
-
});
|
|
3117
|
+
}, selectorMemoizationOptions);
|
|
3099
3118
|
/**
|
|
3100
3119
|
* Get the active window that should receive keyboard shortcuts
|
|
3101
3120
|
*
|
|
@@ -3109,10 +3128,10 @@ var getActiveWindowId = function getActiveWindowId(store) {
|
|
|
3109
3128
|
};
|
|
3110
3129
|
var getDialogIsLoading = createSelector(getDialogDetailsByType, function (details) {
|
|
3111
3130
|
return details && details.isLoading || false;
|
|
3112
|
-
});
|
|
3131
|
+
}, selectorMemoizationOptions);
|
|
3113
3132
|
var getDialogError = createSelector(getDialogDetailsByType, function (details) {
|
|
3114
3133
|
return details && details.error || '';
|
|
3115
|
-
});
|
|
3134
|
+
}, selectorMemoizationOptions);
|
|
3116
3135
|
|
|
3117
3136
|
var selectors$5 = /*#__PURE__*/Object.freeze({
|
|
3118
3137
|
__proto__: null,
|
|
@@ -3539,17 +3558,24 @@ var syncGroupStore = function syncGroupStore(store) {
|
|
|
3539
3558
|
*/
|
|
3540
3559
|
var getSynchronizationGroupState = createSelector(syncGroupStore, function (store) {
|
|
3541
3560
|
return store || null;
|
|
3542
|
-
});
|
|
3543
|
-
var getSynchronizationGroup = function
|
|
3544
|
-
return
|
|
3545
|
-
}
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3561
|
+
}, selectorMemoizationOptions);
|
|
3562
|
+
var getSynchronizationGroup = createSelector([syncGroupStore, function (syncGroupStore, id) {
|
|
3563
|
+
return id;
|
|
3564
|
+
}], function (syncGroupState, id) {
|
|
3565
|
+
return syncGroupState.groups.byId[id];
|
|
3566
|
+
}, selectorMemoizationOptions);
|
|
3567
|
+
var getSynchronizationGroupSource = createSelector([syncGroupStore, function (syncGroupStore, id) {
|
|
3568
|
+
return id;
|
|
3569
|
+
}], function (syncGroupState, id) {
|
|
3570
|
+
return syncGroupState.sources.byId[id];
|
|
3571
|
+
}, selectorMemoizationOptions);
|
|
3572
|
+
var getTargets = createSelector([syncGroupStore, function (syncGroupStore, payload) {
|
|
3573
|
+
return payload;
|
|
3574
|
+
}, function (syncGroupStore, payload, actionType) {
|
|
3575
|
+
return actionType;
|
|
3576
|
+
}], function (syncronizationGroupStore, payload, actionType) {
|
|
3550
3577
|
var actionPayloads = [];
|
|
3551
3578
|
var targetsInActionPayload = {};
|
|
3552
|
-
var syncronizationGroupStore = syncGroupStore(state);
|
|
3553
3579
|
if (syncronizationGroupStore && payload) {
|
|
3554
3580
|
/* Backwards compatibility, if there are no groups, connect everything */
|
|
3555
3581
|
if (syncronizationGroupStore.groups.allIds.length === 0) {
|
|
@@ -3590,9 +3616,12 @@ var getTargets = function getTargets(state, payload, actionType) {
|
|
|
3590
3616
|
});
|
|
3591
3617
|
}
|
|
3592
3618
|
return actionPayloads;
|
|
3593
|
-
};
|
|
3594
|
-
var getTargetGroups = function
|
|
3595
|
-
|
|
3619
|
+
}, selectorMemoizationOptions);
|
|
3620
|
+
var getTargetGroups = createSelector([syncGroupStore, function (syncGroupStore, payload) {
|
|
3621
|
+
return payload;
|
|
3622
|
+
}, function (syncGroupStore, payload, actionType) {
|
|
3623
|
+
return actionType;
|
|
3624
|
+
}], function (syncronizationGroupStore, payload, actionType) {
|
|
3596
3625
|
var groups = syncronizationGroupStore.groups.allIds.reduce(function (list, groupId) {
|
|
3597
3626
|
var syncronizationGroup = syncronizationGroupStore.groups.byId[groupId];
|
|
3598
3627
|
if (actionType === syncronizationGroup.type) {
|
|
@@ -3606,10 +3635,12 @@ var getTargetGroups = function getTargetGroups(state, payload, actionType) {
|
|
|
3606
3635
|
return list;
|
|
3607
3636
|
}, []);
|
|
3608
3637
|
return groups;
|
|
3609
|
-
};
|
|
3610
|
-
var getSourceId = function
|
|
3638
|
+
}, selectorMemoizationOptions);
|
|
3639
|
+
var getSourceId = createSelector([syncGroupStore, function (syncGroupStore, sourceId) {
|
|
3640
|
+
return sourceId;
|
|
3641
|
+
}], function (syncGroupState, sourceId) {
|
|
3611
3642
|
return typeof sourceId === 'string' ? sourceId : sourceId.sourceId;
|
|
3612
|
-
};
|
|
3643
|
+
}, selectorMemoizationOptions);
|
|
3613
3644
|
var getAllTargetGroupsForSource = createSelector([syncGroupStore, getSourceId], function (syncGroupStore, sourceId) {
|
|
3614
3645
|
if (syncGroupStore === null || syncGroupStore === void 0 ? void 0 : syncGroupStore.groups) {
|
|
3615
3646
|
return syncGroupStore.groups.allIds.reduce(function (linkedSyncGroupIds, groupId) {
|
|
@@ -3623,10 +3654,10 @@ var getAllTargetGroupsForSource = createSelector([syncGroupStore, getSourceId],
|
|
|
3623
3654
|
}, []);
|
|
3624
3655
|
}
|
|
3625
3656
|
return [];
|
|
3626
|
-
});
|
|
3657
|
+
}, selectorMemoizationOptions);
|
|
3627
3658
|
var syncGroupGetViewState = createSelector(syncGroupStore, function (store) {
|
|
3628
3659
|
return store.viewState;
|
|
3629
|
-
});
|
|
3660
|
+
}, selectorMemoizationOptions);
|
|
3630
3661
|
var getSyncedMapIdsForTimeslider = createSelector(syncGroupStore, function (store) {
|
|
3631
3662
|
var _a, _b;
|
|
3632
3663
|
return (_b = (_a = store.viewState.timeslider.groups[0]) === null || _a === void 0 ? void 0 : _a.selected) !== null && _b !== void 0 ? _b : [];
|
|
@@ -3645,7 +3676,7 @@ var getSyncGroupTargets = createSelector(syncGroupStore, function (store) {
|
|
|
3645
3676
|
};
|
|
3646
3677
|
}));
|
|
3647
3678
|
}, []);
|
|
3648
|
-
});
|
|
3679
|
+
}, selectorMemoizationOptions);
|
|
3649
3680
|
|
|
3650
3681
|
var selectors$4 = /*#__PURE__*/Object.freeze({
|
|
3651
3682
|
__proto__: null,
|
|
@@ -3655,6 +3686,7 @@ var selectors$4 = /*#__PURE__*/Object.freeze({
|
|
|
3655
3686
|
getSynchronizationGroupSource: getSynchronizationGroupSource,
|
|
3656
3687
|
getTargets: getTargets,
|
|
3657
3688
|
getTargetGroups: getTargetGroups,
|
|
3689
|
+
getSourceId: getSourceId,
|
|
3658
3690
|
getAllTargetGroupsForSource: getAllTargetGroupsForSource,
|
|
3659
3691
|
syncGroupGetViewState: syncGroupGetViewState,
|
|
3660
3692
|
getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider,
|
|
@@ -3847,6 +3879,9 @@ var genericActions = Object.assign(Object.assign({}, actions), {
|
|
|
3847
3879
|
setBbox: setBbox
|
|
3848
3880
|
});
|
|
3849
3881
|
|
|
3882
|
+
var getMapStore = function getMapStore(store) {
|
|
3883
|
+
return store && store.webmap;
|
|
3884
|
+
};
|
|
3850
3885
|
/**
|
|
3851
3886
|
* Gets the map state by mapId
|
|
3852
3887
|
*
|
|
@@ -3855,10 +3890,14 @@ var genericActions = Object.assign(Object.assign({}, actions), {
|
|
|
3855
3890
|
* @param {string} mapId Id of the map
|
|
3856
3891
|
* @returns {object} object containing map state (isAnimating, bbox, baseLayers, layers etc.)
|
|
3857
3892
|
*/
|
|
3858
|
-
var getMapById = function
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3893
|
+
var getMapById = createSelector([getMapStore, function (getMapStore, mapId) {
|
|
3894
|
+
return mapId;
|
|
3895
|
+
}], function (mapState, mapId) {
|
|
3896
|
+
return mapState && mapState.byId[mapId] ? mapState && mapState.byId[mapId] : undefined;
|
|
3897
|
+
}, selectorMemoizationOptions);
|
|
3898
|
+
var getAllMapsByIds = createSelector(getMapStore, function (mapState) {
|
|
3899
|
+
return mapState && mapState.byId ? mapState && mapState.byId : {};
|
|
3900
|
+
}, selectorMemoizationOptions);
|
|
3862
3901
|
/**
|
|
3863
3902
|
* Gets all mapIds
|
|
3864
3903
|
*
|
|
@@ -3866,12 +3905,9 @@ var getMapById = function getMapById(store, mapId) {
|
|
|
3866
3905
|
* @param {object} store store object from which the map state wll be extracted
|
|
3867
3906
|
* @returns {array} array containing all map ids
|
|
3868
3907
|
*/
|
|
3869
|
-
var getAllMapIds = function
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
}
|
|
3873
|
-
return [];
|
|
3874
|
-
};
|
|
3908
|
+
var getAllMapIds = createSelector(getMapStore, function (mapState) {
|
|
3909
|
+
return mapState && mapState.allIds ? mapState.allIds : [];
|
|
3910
|
+
}, selectorMemoizationOptions);
|
|
3875
3911
|
/**
|
|
3876
3912
|
* Gets the map state of the first map in the store
|
|
3877
3913
|
*
|
|
@@ -3879,9 +3915,7 @@ var getAllMapIds = function getAllMapIds(store) {
|
|
|
3879
3915
|
* @param {object} store store object from which the map state wll be extracted
|
|
3880
3916
|
* @returns {object} object containing map state (isAnimating, bbox, baseLayers, layers etc.)
|
|
3881
3917
|
*/
|
|
3882
|
-
var getFirstMap = createSelector(getAllMapIds, function (
|
|
3883
|
-
return store && store.webmap && store.webmap.byId ? store.webmap.byId : {};
|
|
3884
|
-
}, function (allMapIds, mapsById) {
|
|
3918
|
+
var getFirstMap = createSelector(getAllMapIds, getAllMapsByIds, function (allMapIds, mapsById) {
|
|
3885
3919
|
return allMapIds[0] && mapsById[allMapIds[0]] ? mapsById[allMapIds[0]] : null;
|
|
3886
3920
|
}, selectorMemoizationOptions);
|
|
3887
3921
|
/**
|
|
@@ -3893,7 +3927,7 @@ var getFirstMap = createSelector(getAllMapIds, function (store) {
|
|
|
3893
3927
|
*/
|
|
3894
3928
|
var getFirstMapId = createSelector(getFirstMap, function (map) {
|
|
3895
3929
|
return map ? map.id : '';
|
|
3896
|
-
});
|
|
3930
|
+
}, selectorMemoizationOptions);
|
|
3897
3931
|
/**
|
|
3898
3932
|
* Determines if map is present
|
|
3899
3933
|
*
|
|
@@ -3901,14 +3935,9 @@ var getFirstMapId = createSelector(getFirstMap, function (map) {
|
|
|
3901
3935
|
* @param {string} mapId mapId: string - Id of the map
|
|
3902
3936
|
* @returns {boolean} returnType:boolean - true if map is present
|
|
3903
3937
|
*/
|
|
3904
|
-
var getIsMapPresent = createSelector(function (
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
}
|
|
3908
|
-
return false;
|
|
3909
|
-
}, function (isPresent) {
|
|
3910
|
-
return isPresent;
|
|
3911
|
-
});
|
|
3938
|
+
var getIsMapPresent = createSelector(getMapById, function (map) {
|
|
3939
|
+
return !!map;
|
|
3940
|
+
}, selectorMemoizationOptions);
|
|
3912
3941
|
/**
|
|
3913
3942
|
* Gets all layerIds for a map that aren't baselayers or overlayers
|
|
3914
3943
|
*
|
|
@@ -3998,8 +4027,8 @@ var getMapOverLayers = createSelector(getMapOverLayersIds, getLayersById, functi
|
|
|
3998
4027
|
* @param {string} mapId mapId: string - Id of the map
|
|
3999
4028
|
* @returns {array} returnType: array - array containing map dimensions
|
|
4000
4029
|
*/
|
|
4001
|
-
var getMapDimensions = createSelector(getMapById, function (
|
|
4002
|
-
return
|
|
4030
|
+
var getMapDimensions = createSelector(getMapById, function (webMap) {
|
|
4031
|
+
return webMap ? webMap.dimensions : [];
|
|
4003
4032
|
}, selectorMemoizationOptions);
|
|
4004
4033
|
/**
|
|
4005
4034
|
* Gets the map dimension requested
|
|
@@ -4010,16 +4039,25 @@ var getMapDimensions = createSelector(getMapById, function (store) {
|
|
|
4010
4039
|
* @param {string} dimensionName dimensionName: string - name of the dimension
|
|
4011
4040
|
* @returns {object} returnType: object - object containing the map dimension details
|
|
4012
4041
|
*/
|
|
4013
|
-
var getMapDimension = createSelector(getMapById, function (_store,
|
|
4042
|
+
var getMapDimension = createSelector([getMapById, function (_store, mapId) {
|
|
4043
|
+
return mapId;
|
|
4044
|
+
}, function (_store, _mapId, dimensionName) {
|
|
4014
4045
|
return dimensionName;
|
|
4015
|
-
}, function (
|
|
4016
|
-
if (
|
|
4017
|
-
return
|
|
4046
|
+
}], function (mapState, _mapId, dimensionName) {
|
|
4047
|
+
if (mapState && mapState.dimensions) {
|
|
4048
|
+
return mapState.dimensions.find(function (dim) {
|
|
4018
4049
|
return dim.name === dimensionName;
|
|
4019
4050
|
});
|
|
4020
4051
|
}
|
|
4021
4052
|
return undefined;
|
|
4022
4053
|
}, selectorMemoizationOptions);
|
|
4054
|
+
/**
|
|
4055
|
+
* Returns the current time in unix time for the given map
|
|
4056
|
+
*
|
|
4057
|
+
* @param {object} store store: object - store object
|
|
4058
|
+
* @param {string} mapId mapId: string - Id of the map
|
|
4059
|
+
* @returns {object} returnType: unix time as number
|
|
4060
|
+
*/
|
|
4023
4061
|
var getSelectedTime = createSelector(function (store, mapId) {
|
|
4024
4062
|
return getMapDimension(store, mapId, 'time');
|
|
4025
4063
|
}, function (timeDimension) {
|
|
@@ -4032,7 +4070,7 @@ var getSelectedTime = createSelector(function (store, mapId) {
|
|
|
4032
4070
|
return getUnixTime(timeSliderTime);
|
|
4033
4071
|
}
|
|
4034
4072
|
return now;
|
|
4035
|
-
});
|
|
4073
|
+
}, selectorMemoizationOptions);
|
|
4036
4074
|
var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
|
|
4037
4075
|
return layers.reduce(function (_ref, layer) {
|
|
4038
4076
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
@@ -4056,7 +4094,7 @@ var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
|
|
|
4056
4094
|
* cause weird behaviour as timestamps break at 32bit limit (year 2038)
|
|
4057
4095
|
*/
|
|
4058
4096
|
[2147483647, 0]);
|
|
4059
|
-
});
|
|
4097
|
+
}, selectorMemoizationOptions);
|
|
4060
4098
|
/**
|
|
4061
4099
|
* Gets map srs
|
|
4062
4100
|
*
|
|
@@ -4067,7 +4105,7 @@ var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
|
|
|
4067
4105
|
*/
|
|
4068
4106
|
var getSrs = createSelector(getMapById, function (store) {
|
|
4069
4107
|
return store ? store.srs : '';
|
|
4070
|
-
});
|
|
4108
|
+
}, selectorMemoizationOptions);
|
|
4071
4109
|
/**
|
|
4072
4110
|
* Gets map bounding box
|
|
4073
4111
|
*
|
|
@@ -4127,7 +4165,7 @@ var linkedMapAnimationInfo = createSelector(function (store, mapId) {
|
|
|
4127
4165
|
*/
|
|
4128
4166
|
var getAnimationStartTime = createSelector(getMapById, function (store) {
|
|
4129
4167
|
return (store === null || store === void 0 ? void 0 : store.animationStartTime) ? store.animationStartTime : moment.utc().subtract(6, 'h').format(dateFormat);
|
|
4130
|
-
});
|
|
4168
|
+
}, selectorMemoizationOptions);
|
|
4131
4169
|
/**
|
|
4132
4170
|
* Gets end time of animation
|
|
4133
4171
|
*
|
|
@@ -4138,7 +4176,7 @@ var getAnimationStartTime = createSelector(getMapById, function (store) {
|
|
|
4138
4176
|
*/
|
|
4139
4177
|
var getAnimationEndTime$1 = createSelector(getMapById, function (store) {
|
|
4140
4178
|
return (store === null || store === void 0 ? void 0 : store.animationEndTime) ? store.animationEndTime : moment.utc().subtract(10, 'm').format(dateFormat);
|
|
4141
|
-
});
|
|
4179
|
+
}, selectorMemoizationOptions);
|
|
4142
4180
|
/**
|
|
4143
4181
|
* Returns map is auto updating
|
|
4144
4182
|
*
|
|
@@ -4149,7 +4187,7 @@ var getAnimationEndTime$1 = createSelector(getMapById, function (store) {
|
|
|
4149
4187
|
*/
|
|
4150
4188
|
var isAutoUpdating = createSelector(getMapById, function (store) {
|
|
4151
4189
|
return store ? store.isAutoUpdating : false;
|
|
4152
|
-
});
|
|
4190
|
+
}, selectorMemoizationOptions);
|
|
4153
4191
|
/**
|
|
4154
4192
|
* Gets if endTime and duration of animationPayload are overriding maxValue and minValue of leading layer
|
|
4155
4193
|
*
|
|
@@ -4160,7 +4198,7 @@ var isAutoUpdating = createSelector(getMapById, function (store) {
|
|
|
4160
4198
|
*/
|
|
4161
4199
|
var isEndTimeOverriding = createSelector(getMapById, function (store) {
|
|
4162
4200
|
return store ? store.isEndTimeOverriding : false;
|
|
4163
|
-
});
|
|
4201
|
+
}, selectorMemoizationOptions);
|
|
4164
4202
|
/**
|
|
4165
4203
|
* Gets activeLayerId for map
|
|
4166
4204
|
*
|
|
@@ -4173,7 +4211,7 @@ var getActiveLayerId = createSelector(getMapById, function (store) {
|
|
|
4173
4211
|
return store.autoUpdateLayerId;
|
|
4174
4212
|
}
|
|
4175
4213
|
return undefined;
|
|
4176
|
-
});
|
|
4214
|
+
}, selectorMemoizationOptions);
|
|
4177
4215
|
/**
|
|
4178
4216
|
* Gets autoUpdateLayerId for map
|
|
4179
4217
|
*
|
|
@@ -4183,7 +4221,7 @@ var getActiveLayerId = createSelector(getMapById, function (store) {
|
|
|
4183
4221
|
*/
|
|
4184
4222
|
var getAutoUpdateLayerId = createSelector(getMapById, function (store) {
|
|
4185
4223
|
return store === null || store === void 0 ? void 0 : store.autoUpdateLayerId;
|
|
4186
|
-
});
|
|
4224
|
+
}, selectorMemoizationOptions);
|
|
4187
4225
|
/**
|
|
4188
4226
|
* Gets autoUpdateLayerId for map
|
|
4189
4227
|
*
|
|
@@ -4193,7 +4231,7 @@ var getAutoUpdateLayerId = createSelector(getMapById, function (store) {
|
|
|
4193
4231
|
*/
|
|
4194
4232
|
var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
|
|
4195
4233
|
return store === null || store === void 0 ? void 0 : store.autoTimeStepLayerId;
|
|
4196
|
-
});
|
|
4234
|
+
}, selectorMemoizationOptions);
|
|
4197
4235
|
/**
|
|
4198
4236
|
* Gets span of a time slider of a map
|
|
4199
4237
|
*
|
|
@@ -4204,7 +4242,7 @@ var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
|
|
|
4204
4242
|
*/
|
|
4205
4243
|
var getMapTimeSliderSpan = createSelector(getMapById, function (store) {
|
|
4206
4244
|
return store ? store.timeSliderSpan : defaultTimeSpan;
|
|
4207
|
-
});
|
|
4245
|
+
}, selectorMemoizationOptions);
|
|
4208
4246
|
/**
|
|
4209
4247
|
* Gets time step of a map
|
|
4210
4248
|
*
|
|
@@ -4216,10 +4254,10 @@ var getMapTimeSliderSpan = createSelector(getMapById, function (store) {
|
|
|
4216
4254
|
var getMapTimeStep = createSelector(getMapById, function (store) {
|
|
4217
4255
|
var _a;
|
|
4218
4256
|
return (_a = store === null || store === void 0 ? void 0 : store.timeStep) !== null && _a !== void 0 ? _a : defaultTimeStep;
|
|
4219
|
-
});
|
|
4257
|
+
}, selectorMemoizationOptions);
|
|
4220
4258
|
var getMapTimeStepWithoutDefault = createSelector(getMapById, function (store) {
|
|
4221
4259
|
return store === null || store === void 0 ? void 0 : store.timeStep;
|
|
4222
|
-
});
|
|
4260
|
+
}, selectorMemoizationOptions);
|
|
4223
4261
|
/**
|
|
4224
4262
|
* Returns the speed of animation
|
|
4225
4263
|
*
|
|
@@ -4230,7 +4268,7 @@ var getMapTimeStepWithoutDefault = createSelector(getMapById, function (store) {
|
|
|
4230
4268
|
*/
|
|
4231
4269
|
var getMapAnimationDelay = createSelector(getMapById, function (store) {
|
|
4232
4270
|
return store ? store.animationDelay : defaultAnimationDelayAtStart;
|
|
4233
|
-
});
|
|
4271
|
+
}, selectorMemoizationOptions);
|
|
4234
4272
|
/**
|
|
4235
4273
|
* Returns the width of time slider
|
|
4236
4274
|
*
|
|
@@ -4241,7 +4279,7 @@ var getMapAnimationDelay = createSelector(getMapById, function (store) {
|
|
|
4241
4279
|
*/
|
|
4242
4280
|
var getMapTimeSliderWidth = createSelector(getMapById, function (store) {
|
|
4243
4281
|
return store ? store.timeSliderWidth : 0;
|
|
4244
|
-
});
|
|
4282
|
+
}, selectorMemoizationOptions);
|
|
4245
4283
|
/**
|
|
4246
4284
|
* Returns the center time of time slider
|
|
4247
4285
|
*
|
|
@@ -4252,7 +4290,7 @@ var getMapTimeSliderWidth = createSelector(getMapById, function (store) {
|
|
|
4252
4290
|
*/
|
|
4253
4291
|
var getMapTimeSliderCenterTime = createSelector(getMapById, function (store) {
|
|
4254
4292
|
return store ? store.timeSliderCenterTime : moment().unix();
|
|
4255
|
-
});
|
|
4293
|
+
}, selectorMemoizationOptions);
|
|
4256
4294
|
/**
|
|
4257
4295
|
* Returns the unfiltered selected time of time slider
|
|
4258
4296
|
* This is not used to set the selected time itself, which is controlled by TimeBounds where values are rounded.
|
|
@@ -4268,7 +4306,7 @@ var getTimeSliderUnfilteredSelectedTime = createSelector(getMapById, getSelected
|
|
|
4268
4306
|
return undefined;
|
|
4269
4307
|
}
|
|
4270
4308
|
return (_a = store.timeSliderUnfilteredSelectedTime) !== null && _a !== void 0 ? _a : selectedTime;
|
|
4271
|
-
});
|
|
4309
|
+
}, selectorMemoizationOptions);
|
|
4272
4310
|
/**
|
|
4273
4311
|
* Returns the number of seconds per pixel on the time slider
|
|
4274
4312
|
*
|
|
@@ -4279,7 +4317,7 @@ var getTimeSliderUnfilteredSelectedTime = createSelector(getMapById, getSelected
|
|
|
4279
4317
|
*/
|
|
4280
4318
|
var getMapTimeSliderSecondsPerPx = createSelector(getMapById, function (store) {
|
|
4281
4319
|
return store ? store.timeSliderSecondsPerPx : defaultSecondsPerPx;
|
|
4282
|
-
});
|
|
4320
|
+
}, selectorMemoizationOptions);
|
|
4283
4321
|
/**
|
|
4284
4322
|
* Returns map is timestep auto
|
|
4285
4323
|
*
|
|
@@ -4290,7 +4328,7 @@ var getMapTimeSliderSecondsPerPx = createSelector(getMapById, function (store) {
|
|
|
4290
4328
|
*/
|
|
4291
4329
|
var isTimestepAuto = createSelector(getMapById, function (store) {
|
|
4292
4330
|
return store ? store.isTimestepAuto : false;
|
|
4293
|
-
});
|
|
4331
|
+
}, selectorMemoizationOptions);
|
|
4294
4332
|
/**
|
|
4295
4333
|
* Returns map is timespan auto
|
|
4296
4334
|
*
|
|
@@ -4301,7 +4339,7 @@ var isTimestepAuto = createSelector(getMapById, function (store) {
|
|
|
4301
4339
|
*/
|
|
4302
4340
|
var isTimeSpanAuto = createSelector(getMapById, function (store) {
|
|
4303
4341
|
return store ? store.isTimeSpanAuto : false;
|
|
4304
|
-
});
|
|
4342
|
+
}, selectorMemoizationOptions);
|
|
4305
4343
|
/**
|
|
4306
4344
|
* Returns map is time slider hover
|
|
4307
4345
|
*
|
|
@@ -4312,7 +4350,7 @@ var isTimeSpanAuto = createSelector(getMapById, function (store) {
|
|
|
4312
4350
|
*/
|
|
4313
4351
|
var isTimeSliderHoverOn = createSelector(getMapById, function (store) {
|
|
4314
4352
|
return store ? store.isTimeSliderHoverOn : false;
|
|
4315
|
-
});
|
|
4353
|
+
}, selectorMemoizationOptions);
|
|
4316
4354
|
/**
|
|
4317
4355
|
* Returns map if zoomcontrols are visible
|
|
4318
4356
|
*
|
|
@@ -4323,7 +4361,7 @@ var isTimeSliderHoverOn = createSelector(getMapById, function (store) {
|
|
|
4323
4361
|
*/
|
|
4324
4362
|
var isZoomControlsVisible = createSelector(getMapById, function (store) {
|
|
4325
4363
|
return store ? store.shouldShowZoomControls : true;
|
|
4326
|
-
});
|
|
4364
|
+
}, selectorMemoizationOptions);
|
|
4327
4365
|
/**
|
|
4328
4366
|
* Returns map is time slider visible
|
|
4329
4367
|
*
|
|
@@ -4334,7 +4372,7 @@ var isZoomControlsVisible = createSelector(getMapById, function (store) {
|
|
|
4334
4372
|
*/
|
|
4335
4373
|
var isTimeSliderVisible = createSelector(getMapById, function (store) {
|
|
4336
4374
|
return store ? store.isTimeSliderVisible : true;
|
|
4337
|
-
});
|
|
4375
|
+
}, selectorMemoizationOptions);
|
|
4338
4376
|
/**
|
|
4339
4377
|
* Returns is layer is active layer
|
|
4340
4378
|
*
|
|
@@ -4348,7 +4386,7 @@ var getIsLayerActiveLayer = createSelector(getActiveLayerId, function (_store, _
|
|
|
4348
4386
|
return layerId;
|
|
4349
4387
|
}, function (activeLayerId, layerId) {
|
|
4350
4388
|
return activeLayerId === layerId;
|
|
4351
|
-
});
|
|
4389
|
+
}, selectorMemoizationOptions);
|
|
4352
4390
|
/**
|
|
4353
4391
|
* Returns the mapId for given layerId
|
|
4354
4392
|
*
|
|
@@ -4457,7 +4495,7 @@ var getPinLocation = createSelector(getMapById, function (store) {
|
|
|
4457
4495
|
*/
|
|
4458
4496
|
var getDisableMapPin = createSelector(getMapById, function (store) {
|
|
4459
4497
|
return store ? store.disableMapPin : false;
|
|
4460
|
-
});
|
|
4498
|
+
}, selectorMemoizationOptions);
|
|
4461
4499
|
/**
|
|
4462
4500
|
* Returns the display map pin boolean for the current map
|
|
4463
4501
|
*
|
|
@@ -4468,7 +4506,7 @@ var getDisableMapPin = createSelector(getMapById, function (store) {
|
|
|
4468
4506
|
*/
|
|
4469
4507
|
var getDisplayMapPin = createSelector(getMapById, function (store) {
|
|
4470
4508
|
return store ? store.displayMapPin : false;
|
|
4471
|
-
});
|
|
4509
|
+
}, selectorMemoizationOptions);
|
|
4472
4510
|
/**
|
|
4473
4511
|
* Returns the legend id
|
|
4474
4512
|
*
|
|
@@ -4479,7 +4517,7 @@ var getDisplayMapPin = createSelector(getMapById, function (store) {
|
|
|
4479
4517
|
*/
|
|
4480
4518
|
var getLegendId = createSelector(getMapById, function (store) {
|
|
4481
4519
|
return store ? store.legendId : undefined;
|
|
4482
|
-
});
|
|
4520
|
+
}, selectorMemoizationOptions);
|
|
4483
4521
|
/**
|
|
4484
4522
|
* Creates a MapPreset from mapId
|
|
4485
4523
|
*
|
|
@@ -4572,11 +4610,12 @@ var getIsEnabledLayersForMapDimension = createSelector(getMapLayerIdsEnabled, fu
|
|
|
4572
4610
|
*/
|
|
4573
4611
|
var getDockedLayerManagerSize = createSelector(getMapById, function (store) {
|
|
4574
4612
|
return store ? store.dockedLayerManagerSize : 'sizeSmall';
|
|
4575
|
-
});
|
|
4613
|
+
}, selectorMemoizationOptions);
|
|
4576
4614
|
|
|
4577
4615
|
var selectors$2 = /*#__PURE__*/Object.freeze({
|
|
4578
4616
|
__proto__: null,
|
|
4579
4617
|
getMapById: getMapById,
|
|
4618
|
+
getAllMapsByIds: getAllMapsByIds,
|
|
4580
4619
|
getAllMapIds: getAllMapIds,
|
|
4581
4620
|
getFirstMap: getFirstMap,
|
|
4582
4621
|
getFirstMapId: getFirstMapId,
|
|
@@ -5859,33 +5898,101 @@ function unregisterMapSaga(_ref7) {
|
|
|
5859
5898
|
}, _callee7);
|
|
5860
5899
|
})();
|
|
5861
5900
|
}
|
|
5901
|
+
function setStepBackwardOrForwardSaga(_ref8) {
|
|
5902
|
+
var payload = _ref8.payload;
|
|
5903
|
+
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
5904
|
+
var mapId, isForwardStep, timeStep, currentTime, _yield$select, _yield$select2, dataStartTime, dataEndTime, makeForwardStep, makeBackwardStep, selectedTimeString;
|
|
5905
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context10) {
|
|
5906
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
5907
|
+
case 0:
|
|
5908
|
+
mapId = payload.mapId, isForwardStep = payload.isForwardStep;
|
|
5909
|
+
_context10.next = 3;
|
|
5910
|
+
return select(getMapTimeStep, mapId);
|
|
5911
|
+
case 3:
|
|
5912
|
+
timeStep = _context10.sent;
|
|
5913
|
+
_context10.next = 6;
|
|
5914
|
+
return select(getSelectedTime, mapId);
|
|
5915
|
+
case 6:
|
|
5916
|
+
currentTime = _context10.sent;
|
|
5917
|
+
_context10.next = 9;
|
|
5918
|
+
return select(getDataLimitsFromLayers, mapId);
|
|
5919
|
+
case 9:
|
|
5920
|
+
_yield$select = _context10.sent;
|
|
5921
|
+
_yield$select2 = _slicedToArray(_yield$select, 2);
|
|
5922
|
+
dataStartTime = _yield$select2[0];
|
|
5923
|
+
dataEndTime = _yield$select2[1];
|
|
5924
|
+
if (!isValid(currentTime)) {
|
|
5925
|
+
_context10.next = 23;
|
|
5926
|
+
break;
|
|
5927
|
+
}
|
|
5928
|
+
makeForwardStep = function makeForwardStep() {
|
|
5929
|
+
var nextTime = currentTime + timeStep;
|
|
5930
|
+
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
5931
|
+
var newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
5932
|
+
return fromUnixTime(newTime).toISOString();
|
|
5933
|
+
};
|
|
5934
|
+
makeBackwardStep = function makeBackwardStep() {
|
|
5935
|
+
var nextTime = currentTime - timeStep;
|
|
5936
|
+
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
5937
|
+
var newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
5938
|
+
return fromUnixTime(newTime).toISOString();
|
|
5939
|
+
};
|
|
5940
|
+
selectedTimeString = isForwardStep ? makeForwardStep() : makeBackwardStep();
|
|
5941
|
+
_context10.next = 19;
|
|
5942
|
+
return put(mapActions.mapStopAnimation({
|
|
5943
|
+
mapId: mapId,
|
|
5944
|
+
origin: MapActionOrigin.map
|
|
5945
|
+
}));
|
|
5946
|
+
case 19:
|
|
5947
|
+
_context10.next = 21;
|
|
5948
|
+
return put(mapActions.toggleAutoUpdate({
|
|
5949
|
+
mapId: mapId,
|
|
5950
|
+
shouldAutoUpdate: false
|
|
5951
|
+
}));
|
|
5952
|
+
case 21:
|
|
5953
|
+
_context10.next = 23;
|
|
5954
|
+
return put(genericActions.setTime({
|
|
5955
|
+
origin: '',
|
|
5956
|
+
sourceId: mapId,
|
|
5957
|
+
value: handleMomentISOString(selectedTimeString)
|
|
5958
|
+
}));
|
|
5959
|
+
case 23:
|
|
5960
|
+
case "end":
|
|
5961
|
+
return _context10.stop();
|
|
5962
|
+
}
|
|
5963
|
+
}, _callee8);
|
|
5964
|
+
})();
|
|
5965
|
+
}
|
|
5862
5966
|
function rootSaga$5() {
|
|
5863
|
-
return _regeneratorRuntime().wrap(function rootSaga$(
|
|
5864
|
-
while (1) switch (
|
|
5967
|
+
return _regeneratorRuntime().wrap(function rootSaga$(_context11) {
|
|
5968
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
5865
5969
|
case 0:
|
|
5866
|
-
|
|
5970
|
+
_context11.next = 2;
|
|
5867
5971
|
return takeLatest(mapActions.mapStopAnimation.type, stopAnimationSaga);
|
|
5868
5972
|
case 2:
|
|
5869
|
-
|
|
5973
|
+
_context11.next = 4;
|
|
5870
5974
|
return takeLatest(mapActions.mapStartAnimation.type, startAnimationSaga);
|
|
5871
5975
|
case 4:
|
|
5872
|
-
|
|
5976
|
+
_context11.next = 6;
|
|
5873
5977
|
return takeLatest(layerActions.layerDelete.type, deleteLayerSaga);
|
|
5874
5978
|
case 6:
|
|
5875
|
-
|
|
5979
|
+
_context11.next = 8;
|
|
5876
5980
|
return takeLatest(layerActions.onUpdateLayerInformation.type, setLayerDimensionsSaga);
|
|
5877
5981
|
case 8:
|
|
5878
|
-
|
|
5982
|
+
_context11.next = 10;
|
|
5879
5983
|
return takeLatest(mapActions.toggleAutoUpdate.type, toggleAutoUpdateSaga);
|
|
5880
5984
|
case 10:
|
|
5881
|
-
|
|
5985
|
+
_context11.next = 12;
|
|
5882
5986
|
return takeEvery(mapActions.setMapPreset.type, setMapPresetSaga);
|
|
5883
5987
|
case 12:
|
|
5884
|
-
|
|
5988
|
+
_context11.next = 14;
|
|
5885
5989
|
return takeEvery(mapActions.unregisterMap.type, unregisterMapSaga);
|
|
5886
5990
|
case 14:
|
|
5991
|
+
_context11.next = 16;
|
|
5992
|
+
return takeEvery(mapActions.setStepBackwardOrForward.type, setStepBackwardOrForwardSaga);
|
|
5993
|
+
case 16:
|
|
5887
5994
|
case "end":
|
|
5888
|
-
return
|
|
5995
|
+
return _context11.stop();
|
|
5889
5996
|
}
|
|
5890
5997
|
}, _marked3$2);
|
|
5891
5998
|
}
|
|
@@ -6072,6 +6179,9 @@ var findTargets = function findTargets(state, payload, actionType, sourceMapId)
|
|
|
6072
6179
|
*/
|
|
6073
6180
|
var getLayerActionsTargets = function getLayerActionsTargets(state, payload, actionType) {
|
|
6074
6181
|
var mapId = getMapIdFromLayerId(state, payload.layerId);
|
|
6182
|
+
if (!mapId) {
|
|
6183
|
+
return [];
|
|
6184
|
+
}
|
|
6075
6185
|
var foundTargets = findTargets(state, payload, actionType, mapId);
|
|
6076
6186
|
return foundTargets.map(function (target) {
|
|
6077
6187
|
var payload = target.payload;
|
|
@@ -6148,6 +6258,9 @@ var getLayerMoveActionsTargets = function getLayerMoveActionsTargets(state, payl
|
|
|
6148
6258
|
*/
|
|
6149
6259
|
var getSetActiveLayerIdActionsTargets = function getSetActiveLayerIdActionsTargets(state, payload, actionType) {
|
|
6150
6260
|
var sourceMapId = getMapIdFromLayerId(state, payload.layerId);
|
|
6261
|
+
if (!sourceMapId) {
|
|
6262
|
+
return [];
|
|
6263
|
+
}
|
|
6151
6264
|
var foundTargets = findTargets(state, payload, actionType, sourceMapId);
|
|
6152
6265
|
return foundTargets.map(function (target) {
|
|
6153
6266
|
return {
|
|
@@ -7937,4 +8050,4 @@ var useSetupDialog = function useSetupDialog(dialogType) {
|
|
|
7937
8050
|
};
|
|
7938
8051
|
};
|
|
7939
8052
|
|
|
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 };
|
|
8053
|
+
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 };
|