@opengeoweb/store 12.12.0 → 13.0.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 +497 -305
- package/package.json +6 -6
- package/src/store/generic/linking/constants.d.ts +2 -1
- package/src/store/generic/selectors.d.ts +7 -28
- package/src/store/generic/synchronizationActions/types.d.ts +10 -1
- package/src/store/generic/types.d.ts +2 -1
- package/src/store/map/layer/reducer.d.ts +3 -1
- package/src/store/map/layer/selectors.d.ts +310 -0
- package/src/store/map/layer/types.d.ts +7 -1
- package/src/store/map/map/index.d.ts +2 -1
- package/src/store/map/map/reducer.d.ts +3 -3
- package/src/store/map/map/selectors.d.ts +151 -1
- package/src/store/map/map/types.d.ts +2 -1
- package/src/store/map/map/utils.d.ts +3 -1
- package/src/store/map/service/selectors.d.ts +90 -0
package/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createSlice, createSelector, createAction, createListenerMiddleware, isAnyOf, createEntityAdapter, combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
2
2
|
import { isEqual, isEmpty, compact } from 'lodash';
|
|
3
3
|
import { dateUtils, PROJECTION, defaultDelay } from '@opengeoweb/shared';
|
|
4
|
-
import { webmapUtils, parseISO8601IntervalToDateInterval, LayerType, webmapTestSettings, WMLayer, getWMLayerById, WMInvalidDateValues,
|
|
5
|
-
import { defaultSecondsPerPx, defaultAnimationDelayAtStart, defaultTimeStep,
|
|
4
|
+
import { webmapUtils, parseISO8601IntervalToDateInterval, LayerType, handleDateUtilsISOString, webmapTestSettings, WMLayer, getWMLayerById, WMInvalidDateValues, isProjectionSupported, queryWMSLayers } from '@opengeoweb/webmap';
|
|
5
|
+
import { secondsPerPxFromCanvasWidth, defaultTimeSpan, defaultSecondsPerPx, defaultAnimationDelayAtStart, defaultTimeStep, roundWithTimeStep, getSpeedDelay } from '@opengeoweb/time-slider';
|
|
6
6
|
import { produce } from 'immer';
|
|
7
7
|
import { getLastEmptyFeatureIndex, getGeoJson, moveFeature, createInterSections, defaultLayers, emptyGeoJSON, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, getFeatureCollection } from '@opengeoweb/webmap-react';
|
|
8
8
|
export { defaultLayers } from '@opengeoweb/webmap-react';
|
|
@@ -689,11 +689,24 @@ var getLayerStyles = createSelector(getLayerFromService, function (layer) {
|
|
|
689
689
|
var _layer$styles;
|
|
690
690
|
return (_layer$styles = layer === null || layer === void 0 ? void 0 : layer.styles) !== null && _layer$styles !== void 0 ? _layer$styles : [];
|
|
691
691
|
}, selectorMemoizationOptions);
|
|
692
|
+
/**
|
|
693
|
+
* Gets the layer title from the servicestore using the serviceUrl and layerName
|
|
694
|
+
*
|
|
695
|
+
* Example: layerStyles = getLayerTitle(store, layerService, layerName);
|
|
696
|
+
* @param {object} store store: object - store from which the layers state will be extracted
|
|
697
|
+
* @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
|
|
698
|
+
* @param {string} layerName layerName: string - Name of the layer in the service
|
|
699
|
+
* @returns {array} returnType: string - string containing layer title
|
|
700
|
+
*/
|
|
701
|
+
var getLayerTitle = createSelector(getLayerFromService, function (layer) {
|
|
702
|
+
return layer === null || layer === void 0 ? void 0 : layer.title;
|
|
703
|
+
}, selectorMemoizationOptions);
|
|
692
704
|
|
|
693
705
|
var selectors$7 = /*#__PURE__*/Object.freeze({
|
|
694
706
|
__proto__: null,
|
|
695
707
|
getLayerFromService: getLayerFromService,
|
|
696
708
|
getLayerStyles: getLayerStyles,
|
|
709
|
+
getLayerTitle: getLayerTitle,
|
|
697
710
|
getLayersFromServiceSelector: getLayersFromServiceSelector,
|
|
698
711
|
getServiceByUrl: getServiceByUrl,
|
|
699
712
|
getServiceIds: getServiceIds,
|
|
@@ -1139,6 +1152,17 @@ var parseTimeDimToISO8601Interval = function parseTimeDimToISO8601Interval(timeI
|
|
|
1139
1152
|
return interval.startTime && interval.endTime && interval.duration;
|
|
1140
1153
|
});
|
|
1141
1154
|
};
|
|
1155
|
+
var produceTimeSliderTimeSpan = function produceTimeSliderTimeSpan(draft, mapId, timeSliderSpan) {
|
|
1156
|
+
if (!draft.byId[mapId] || !timeSliderSpan) {
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
draft.byId[mapId].timeSliderSpan = timeSliderSpan;
|
|
1160
|
+
if (draft.byId[mapId].timeSliderWidth) {
|
|
1161
|
+
draft.byId[mapId].timeSliderSecondsPerPx = secondsPerPxFromCanvasWidth(draft.byId[mapId].timeSliderWidth, draft.byId[mapId].timeSliderSpan || defaultTimeSpan);
|
|
1162
|
+
} else {
|
|
1163
|
+
draft.byId[mapId].timeSliderSecondsPerPx = draft.byId[mapId].timeSliderSecondsPerPx || defaultSecondsPerPx;
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1142
1166
|
|
|
1143
1167
|
var utils$2 = /*#__PURE__*/Object.freeze({
|
|
1144
1168
|
__proto__: null,
|
|
@@ -1154,7 +1178,8 @@ var utils$2 = /*#__PURE__*/Object.freeze({
|
|
|
1154
1178
|
moveArrayElements: moveArrayElements,
|
|
1155
1179
|
parseTimeDimToISO8601Interval: parseTimeDimToISO8601Interval,
|
|
1156
1180
|
produceDraftStateSetMapDimensionFromLayerChangeDimension: produceDraftStateSetMapDimensionFromLayerChangeDimension,
|
|
1157
|
-
produceDraftStateSetWebMapDimension: produceDraftStateSetWebMapDimension
|
|
1181
|
+
produceDraftStateSetWebMapDimension: produceDraftStateSetWebMapDimension,
|
|
1182
|
+
produceTimeSliderTimeSpan: produceTimeSliderTimeSpan
|
|
1158
1183
|
});
|
|
1159
1184
|
|
|
1160
1185
|
var replaceLayerIdsToEnsureUniqueLayerIdsInStore = function replaceLayerIdsToEnsureUniqueLayerIdsInStore(layerIds) {
|
|
@@ -1393,6 +1418,7 @@ var LayerActionOrigin;
|
|
|
1393
1418
|
LayerActionOrigin["updateLayerInformationListener"] = "updateLayerInformationListener";
|
|
1394
1419
|
LayerActionOrigin["toggleAutoUpdateListener"] = "toggleAutoUpdateListener";
|
|
1395
1420
|
LayerActionOrigin["unregisterMapListener"] = "unregisterMapListener";
|
|
1421
|
+
LayerActionOrigin["dataExplorer"] = "dataExplorer";
|
|
1396
1422
|
})(LayerActionOrigin || (LayerActionOrigin = {}));
|
|
1397
1423
|
|
|
1398
1424
|
var types$3 = /*#__PURE__*/Object.freeze({
|
|
@@ -1708,18 +1734,26 @@ var slice$6 = createSlice({
|
|
|
1708
1734
|
draft.byId[layerId].name = name;
|
|
1709
1735
|
}
|
|
1710
1736
|
},
|
|
1711
|
-
|
|
1737
|
+
layerChangeOptions: function layerChangeOptions(draft, action) {
|
|
1712
1738
|
var _action$payload9 = action.payload,
|
|
1713
1739
|
layerId = _action$payload9.layerId,
|
|
1714
|
-
|
|
1740
|
+
options = _action$payload9.options;
|
|
1741
|
+
if (draft.byId[layerId] && options) {
|
|
1742
|
+
draft.byId[layerId].options = _objectSpread2({}, options);
|
|
1743
|
+
}
|
|
1744
|
+
},
|
|
1745
|
+
layerChangeGeojson: function layerChangeGeojson(draft, action) {
|
|
1746
|
+
var _action$payload0 = action.payload,
|
|
1747
|
+
layerId = _action$payload0.layerId,
|
|
1748
|
+
geojson = _action$payload0.geojson;
|
|
1715
1749
|
if (draft.byId[layerId]) {
|
|
1716
1750
|
draft.byId[layerId].geojson = geojson;
|
|
1717
1751
|
}
|
|
1718
1752
|
},
|
|
1719
1753
|
layerSetGeojsonFromLayer: function layerSetGeojsonFromLayer(draft, action) {
|
|
1720
|
-
var _action$
|
|
1721
|
-
layerId = _action$
|
|
1722
|
-
sourceLayerId = _action$
|
|
1754
|
+
var _action$payload1 = action.payload,
|
|
1755
|
+
layerId = _action$payload1.layerId,
|
|
1756
|
+
sourceLayerId = _action$payload1.sourceLayerId;
|
|
1723
1757
|
if (draft.byId[layerId]) {
|
|
1724
1758
|
var _draft$byId$sourceLay;
|
|
1725
1759
|
draft.byId[layerId].geojson = (_draft$byId$sourceLay = draft.byId[sourceLayerId]) === null || _draft$byId$sourceLay === void 0 ? void 0 : _draft$byId$sourceLay.geojson;
|
|
@@ -1753,9 +1787,9 @@ var slice$6 = createSlice({
|
|
|
1753
1787
|
}
|
|
1754
1788
|
},
|
|
1755
1789
|
setLayers: function setLayers(draft, action) {
|
|
1756
|
-
var _action$
|
|
1757
|
-
layers = _action$
|
|
1758
|
-
mapId = _action$
|
|
1790
|
+
var _action$payload10 = action.payload,
|
|
1791
|
+
layers = _action$payload10.layers,
|
|
1792
|
+
mapId = _action$payload10.mapId;
|
|
1759
1793
|
if (!checkValidLayersPayload(layers, mapId)) {
|
|
1760
1794
|
return;
|
|
1761
1795
|
}
|
|
@@ -1783,9 +1817,9 @@ var slice$6 = createSlice({
|
|
|
1783
1817
|
});
|
|
1784
1818
|
},
|
|
1785
1819
|
setBaseLayers: function setBaseLayers(draft, action) {
|
|
1786
|
-
var _action$
|
|
1787
|
-
layers = _action$
|
|
1788
|
-
mapId = _action$
|
|
1820
|
+
var _action$payload11 = action.payload,
|
|
1821
|
+
layers = _action$payload11.layers,
|
|
1822
|
+
mapId = _action$payload11.mapId;
|
|
1789
1823
|
var filtererdBaseLayers = layers.filter(function (layer) {
|
|
1790
1824
|
return layer.layerType === LayerType.baseLayer || layer.layerType === LayerType.overLayer;
|
|
1791
1825
|
});
|
|
@@ -1831,9 +1865,9 @@ var slice$6 = createSlice({
|
|
|
1831
1865
|
}
|
|
1832
1866
|
},
|
|
1833
1867
|
layerSetDimensions: function layerSetDimensions(draft, action) {
|
|
1834
|
-
var _action$
|
|
1835
|
-
dimensions = _action$
|
|
1836
|
-
layerId = _action$
|
|
1868
|
+
var _action$payload12 = action.payload,
|
|
1869
|
+
dimensions = _action$payload12.dimensions,
|
|
1870
|
+
layerId = _action$payload12.layerId;
|
|
1837
1871
|
if (draft.byId[layerId]) {
|
|
1838
1872
|
draft.byId[layerId].dimensions = dimensions;
|
|
1839
1873
|
}
|
|
@@ -1867,9 +1901,9 @@ var slice$6 = createSlice({
|
|
|
1867
1901
|
},
|
|
1868
1902
|
// Overwrites all baselayer for a certain map
|
|
1869
1903
|
setAvailableBaseLayers: function setAvailableBaseLayers(draft, action) {
|
|
1870
|
-
var _action$
|
|
1871
|
-
layers = _action$
|
|
1872
|
-
mapId = _action$
|
|
1904
|
+
var _action$payload13 = action.payload,
|
|
1905
|
+
layers = _action$payload13.layers,
|
|
1906
|
+
mapId = _action$payload13.mapId;
|
|
1873
1907
|
// remove current baselayers for passed map
|
|
1874
1908
|
draft.availableBaseLayers.allIds = draft.availableBaseLayers.allIds.filter(function (layerId) {
|
|
1875
1909
|
if (draft.availableBaseLayers.byId[layerId] && draft.availableBaseLayers.byId[layerId].mapId === mapId) {
|
|
@@ -1888,9 +1922,9 @@ var slice$6 = createSlice({
|
|
|
1888
1922
|
});
|
|
1889
1923
|
},
|
|
1890
1924
|
setUseLatestReferenceTime: function setUseLatestReferenceTime(draft, action) {
|
|
1891
|
-
var _action$
|
|
1892
|
-
id = _action$
|
|
1893
|
-
useLatestReferenceTime = _action$
|
|
1925
|
+
var _action$payload14 = action.payload,
|
|
1926
|
+
id = _action$payload14.id,
|
|
1927
|
+
useLatestReferenceTime = _action$payload14.useLatestReferenceTime;
|
|
1894
1928
|
var layer = draft.byId[id];
|
|
1895
1929
|
if (!layer) {
|
|
1896
1930
|
return;
|
|
@@ -1898,10 +1932,10 @@ var slice$6 = createSlice({
|
|
|
1898
1932
|
layer.useLatestReferenceTime = useLatestReferenceTime;
|
|
1899
1933
|
},
|
|
1900
1934
|
onUpdateLayerInformation: function onUpdateLayerInformation(draft, action) {
|
|
1901
|
-
var _action$
|
|
1902
|
-
layerStyle = _action$
|
|
1903
|
-
layerDimensions = _action$
|
|
1904
|
-
error = _action$
|
|
1935
|
+
var _action$payload15 = action.payload,
|
|
1936
|
+
layerStyle = _action$payload15.layerStyle,
|
|
1937
|
+
layerDimensions = _action$payload15.layerDimensions,
|
|
1938
|
+
error = _action$payload15.error;
|
|
1905
1939
|
if (error) {
|
|
1906
1940
|
draft.byId[error.layerId].status = LayerStatus.error;
|
|
1907
1941
|
return;
|
|
@@ -1944,6 +1978,7 @@ var slice$6 = createSlice({
|
|
|
1944
1978
|
return dim.name === newLayerDimension.name;
|
|
1945
1979
|
});
|
|
1946
1980
|
if (existingDimension) {
|
|
1981
|
+
var _newLayerDimension$va;
|
|
1947
1982
|
if (existingDimension.name === 'reference_time' && reduxLayer.useLatestReferenceTime && newLayerDimension.maxValue) {
|
|
1948
1983
|
existingDimension.currentValue = newLayerDimension.maxValue;
|
|
1949
1984
|
}
|
|
@@ -1954,6 +1989,11 @@ var slice$6 = createSlice({
|
|
|
1954
1989
|
if (!existingDimension.units) {
|
|
1955
1990
|
existingDimension.units = newLayerDimension.units;
|
|
1956
1991
|
}
|
|
1992
|
+
/* For non time dimensions also update the current value, but only if the currentValue does not exist in the new dimension values */
|
|
1993
|
+
var listOfValues = (_newLayerDimension$va = newLayerDimension.values) === null || _newLayerDimension$va === void 0 ? void 0 : _newLayerDimension$va.split(',');
|
|
1994
|
+
if (existingDimension.name !== 'time' && existingDimension.name !== 'reference_time' && !(listOfValues !== null && listOfValues !== void 0 && listOfValues.includes(existingDimension.currentValue))) {
|
|
1995
|
+
existingDimension.currentValue = newLayerDimension.currentValue;
|
|
1996
|
+
}
|
|
1957
1997
|
} else if (layerId === layerDimensions.layerId) {
|
|
1958
1998
|
/* Otherwise add a new one, but only for this layer. */
|
|
1959
1999
|
reduxDimensions.push(_objectSpread2({}, newLayerDimension));
|
|
@@ -1990,25 +2030,25 @@ var slice$6 = createSlice({
|
|
|
1990
2030
|
},
|
|
1991
2031
|
// feature layer actions
|
|
1992
2032
|
setSelectedFeature: function setSelectedFeature(draft, action) {
|
|
1993
|
-
var _action$
|
|
1994
|
-
layerId = _action$
|
|
1995
|
-
selectedFeatureIndex = _action$
|
|
2033
|
+
var _action$payload16 = action.payload,
|
|
2034
|
+
layerId = _action$payload16.layerId,
|
|
2035
|
+
selectedFeatureIndex = _action$payload16.selectedFeatureIndex;
|
|
1996
2036
|
if (!draft.byId[layerId]) {
|
|
1997
2037
|
return;
|
|
1998
2038
|
}
|
|
1999
2039
|
draft.byId[layerId].selectedFeatureIndex = selectedFeatureIndex;
|
|
2000
2040
|
},
|
|
2001
2041
|
updateFeature: function updateFeature(draft, action) {
|
|
2002
|
-
var _action$
|
|
2003
|
-
layerId = _action$
|
|
2004
|
-
geojson = _action$
|
|
2005
|
-
_action$
|
|
2006
|
-
shouldAllowMultipleShapes = _action$
|
|
2007
|
-
_action$
|
|
2008
|
-
reason = _action$
|
|
2009
|
-
geoJSONIntersectionLayerId = _action$
|
|
2010
|
-
geoJSONIntersectionBoundsLayerId = _action$
|
|
2011
|
-
selectionType = _action$
|
|
2042
|
+
var _action$payload17 = action.payload,
|
|
2043
|
+
layerId = _action$payload17.layerId,
|
|
2044
|
+
geojson = _action$payload17.geojson,
|
|
2045
|
+
_action$payload17$sho = _action$payload17.shouldAllowMultipleShapes,
|
|
2046
|
+
shouldAllowMultipleShapes = _action$payload17$sho === void 0 ? false : _action$payload17$sho,
|
|
2047
|
+
_action$payload17$rea = _action$payload17.reason,
|
|
2048
|
+
reason = _action$payload17$rea === void 0 ? '' : _action$payload17$rea,
|
|
2049
|
+
geoJSONIntersectionLayerId = _action$payload17.geoJSONIntersectionLayerId,
|
|
2050
|
+
geoJSONIntersectionBoundsLayerId = _action$payload17.geoJSONIntersectionBoundsLayerId,
|
|
2051
|
+
selectionType = _action$payload17.selectionType;
|
|
2012
2052
|
var currentLayer = draft.byId[layerId];
|
|
2013
2053
|
if (!currentLayer) {
|
|
2014
2054
|
return;
|
|
@@ -2037,10 +2077,10 @@ var slice$6 = createSlice({
|
|
|
2037
2077
|
}
|
|
2038
2078
|
},
|
|
2039
2079
|
updateFeatureProperties: function updateFeatureProperties(draft, action) {
|
|
2040
|
-
var _action$
|
|
2041
|
-
layerId = _action$
|
|
2042
|
-
properties = _action$
|
|
2043
|
-
selectedFeatureIndex = _action$
|
|
2080
|
+
var _action$payload18 = action.payload,
|
|
2081
|
+
layerId = _action$payload18.layerId,
|
|
2082
|
+
properties = _action$payload18.properties,
|
|
2083
|
+
selectedFeatureIndex = _action$payload18.selectedFeatureIndex;
|
|
2044
2084
|
var currentLayer = draft.byId[layerId];
|
|
2045
2085
|
if (!currentLayer) {
|
|
2046
2086
|
return;
|
|
@@ -2056,10 +2096,10 @@ var slice$6 = createSlice({
|
|
|
2056
2096
|
}
|
|
2057
2097
|
},
|
|
2058
2098
|
toggleFeatureMode: function toggleFeatureMode(draft, action) {
|
|
2059
|
-
var _action$
|
|
2060
|
-
layerId = _action$
|
|
2061
|
-
isInEditMode = _action$
|
|
2062
|
-
drawMode = _action$
|
|
2099
|
+
var _action$payload19 = action.payload,
|
|
2100
|
+
layerId = _action$payload19.layerId,
|
|
2101
|
+
isInEditMode = _action$payload19.isInEditMode,
|
|
2102
|
+
drawMode = _action$payload19.drawMode;
|
|
2063
2103
|
if (!draft.byId[layerId]) {
|
|
2064
2104
|
return;
|
|
2065
2105
|
}
|
|
@@ -2071,10 +2111,10 @@ var slice$6 = createSlice({
|
|
|
2071
2111
|
}
|
|
2072
2112
|
},
|
|
2073
2113
|
exitFeatureDrawMode: function exitFeatureDrawMode(draft, action) {
|
|
2074
|
-
var _action$
|
|
2075
|
-
layerId = _action$
|
|
2076
|
-
shouldAllowMultipleShapes = _action$
|
|
2077
|
-
reason = _action$
|
|
2114
|
+
var _action$payload20 = action.payload,
|
|
2115
|
+
layerId = _action$payload20.layerId,
|
|
2116
|
+
shouldAllowMultipleShapes = _action$payload20.shouldAllowMultipleShapes,
|
|
2117
|
+
reason = _action$payload20.reason;
|
|
2078
2118
|
if (!draft.byId[layerId]) {
|
|
2079
2119
|
return;
|
|
2080
2120
|
}
|
|
@@ -2099,9 +2139,9 @@ var slice$6 = createSlice({
|
|
|
2099
2139
|
},
|
|
2100
2140
|
// layer info actions
|
|
2101
2141
|
showLayerInfo: function showLayerInfo(draft, action) {
|
|
2102
|
-
var _action$
|
|
2103
|
-
serviceUrl = _action$
|
|
2104
|
-
layerName = _action$
|
|
2142
|
+
var _action$payload21 = action.payload,
|
|
2143
|
+
serviceUrl = _action$payload21.serviceUrl,
|
|
2144
|
+
layerName = _action$payload21.layerName;
|
|
2105
2145
|
draft.activeLayerInfo = {
|
|
2106
2146
|
serviceUrl: serviceUrl,
|
|
2107
2147
|
layerName: layerName
|
|
@@ -2113,9 +2153,9 @@ var slice$6 = createSlice({
|
|
|
2113
2153
|
},
|
|
2114
2154
|
extraReducers: function extraReducers(builder) {
|
|
2115
2155
|
builder.addCase(setTimeSync, function (draft, action) {
|
|
2116
|
-
var _action$
|
|
2117
|
-
targetsFromAction = _action$
|
|
2118
|
-
source = _action$
|
|
2156
|
+
var _action$payload22 = action.payload,
|
|
2157
|
+
targetsFromAction = _action$payload22.targets,
|
|
2158
|
+
source = _action$payload22.source;
|
|
2119
2159
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2120
2160
|
var targets = [];
|
|
2121
2161
|
if (source) {
|
|
@@ -2129,11 +2169,14 @@ var slice$6 = createSlice({
|
|
|
2129
2169
|
targets.forEach(function (payload) {
|
|
2130
2170
|
var targetId = payload.targetId,
|
|
2131
2171
|
value = payload.value;
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2172
|
+
if (value !== null && value !== void 0 && value.currentTime) {
|
|
2173
|
+
var currentTime = value.currentTime;
|
|
2174
|
+
var dimension = {
|
|
2175
|
+
name: 'time',
|
|
2176
|
+
currentValue: currentTime
|
|
2177
|
+
};
|
|
2178
|
+
produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, targetId, null);
|
|
2179
|
+
}
|
|
2137
2180
|
});
|
|
2138
2181
|
}).addCase(setLayerActionSync, function (draft, action) {
|
|
2139
2182
|
/*
|
|
@@ -2142,9 +2185,9 @@ var slice$6 = createSlice({
|
|
|
2142
2185
|
* These targets can be used as payloads in new Layer actions.
|
|
2143
2186
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
2144
2187
|
*/
|
|
2145
|
-
var _action$
|
|
2146
|
-
targets = _action$
|
|
2147
|
-
source = _action$
|
|
2188
|
+
var _action$payload23 = action.payload,
|
|
2189
|
+
targets = _action$payload23.targets,
|
|
2190
|
+
source = _action$payload23.source;
|
|
2148
2191
|
return targets.reduce(function (prevState, target) {
|
|
2149
2192
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
2150
2193
|
var action = {
|
|
@@ -2435,10 +2478,7 @@ var slice$4 = createSlice({
|
|
|
2435
2478
|
var _action$payload4 = action.payload,
|
|
2436
2479
|
mapId = _action$payload4.mapId,
|
|
2437
2480
|
timeSliderSpan = _action$payload4.timeSliderSpan;
|
|
2438
|
-
|
|
2439
|
-
return;
|
|
2440
|
-
}
|
|
2441
|
-
draft.byId[mapId].timeSliderSpan = timeSliderSpan;
|
|
2481
|
+
produceTimeSliderTimeSpan(draft, mapId, timeSliderSpan);
|
|
2442
2482
|
},
|
|
2443
2483
|
setTimeStep: function setTimeStep(draft, action) {
|
|
2444
2484
|
var _action$payload5 = action.payload,
|
|
@@ -2537,6 +2577,7 @@ var slice$4 = createSlice({
|
|
|
2537
2577
|
return;
|
|
2538
2578
|
}
|
|
2539
2579
|
draft.byId[mapId].timeSliderWidth = timeSliderWidth;
|
|
2580
|
+
draft.byId[mapId].timeSliderSecondsPerPx = secondsPerPxFromCanvasWidth(timeSliderWidth, draft.byId[mapId].timeSliderSpan || defaultTimeSpan);
|
|
2540
2581
|
},
|
|
2541
2582
|
setTimeSliderCenterTime: function setTimeSliderCenterTime(draft, action) {
|
|
2542
2583
|
var _action$payload12 = action.payload,
|
|
@@ -2547,118 +2588,109 @@ var slice$4 = createSlice({
|
|
|
2547
2588
|
}
|
|
2548
2589
|
draft.byId[mapId].timeSliderCenterTime = timeSliderCenterTime;
|
|
2549
2590
|
},
|
|
2550
|
-
|
|
2591
|
+
toggleAutoUpdate: function toggleAutoUpdate(draft, action) {
|
|
2551
2592
|
var _action$payload13 = action.payload,
|
|
2552
2593
|
mapId = _action$payload13.mapId,
|
|
2553
|
-
|
|
2554
|
-
if (!draft.byId[mapId]) {
|
|
2555
|
-
return;
|
|
2556
|
-
}
|
|
2557
|
-
draft.byId[mapId].timeSliderSecondsPerPx = timeSliderSecondsPerPx;
|
|
2558
|
-
},
|
|
2559
|
-
toggleAutoUpdate: function toggleAutoUpdate(draft, action) {
|
|
2560
|
-
var _action$payload14 = action.payload,
|
|
2561
|
-
mapId = _action$payload14.mapId,
|
|
2562
|
-
shouldAutoUpdate = _action$payload14.shouldAutoUpdate;
|
|
2594
|
+
shouldAutoUpdate = _action$payload13.shouldAutoUpdate;
|
|
2563
2595
|
if (!draft.byId[mapId]) {
|
|
2564
2596
|
return;
|
|
2565
2597
|
}
|
|
2566
2598
|
draft.byId[mapId].isAutoUpdating = shouldAutoUpdate;
|
|
2567
2599
|
},
|
|
2568
2600
|
setEndTimeOverriding: function setEndTimeOverriding(draft, action) {
|
|
2569
|
-
var _action$
|
|
2570
|
-
mapId = _action$
|
|
2571
|
-
shouldEndtimeOverride = _action$
|
|
2601
|
+
var _action$payload14 = action.payload,
|
|
2602
|
+
mapId = _action$payload14.mapId,
|
|
2603
|
+
shouldEndtimeOverride = _action$payload14.shouldEndtimeOverride;
|
|
2572
2604
|
if (!draft.byId[mapId]) {
|
|
2573
2605
|
return;
|
|
2574
2606
|
}
|
|
2575
2607
|
draft.byId[mapId].shouldEndtimeOverride = shouldEndtimeOverride;
|
|
2576
2608
|
},
|
|
2577
2609
|
toggleTimestepAuto: function toggleTimestepAuto(draft, action) {
|
|
2578
|
-
var _action$
|
|
2579
|
-
mapId = _action$
|
|
2580
|
-
timestepAuto = _action$
|
|
2610
|
+
var _action$payload15 = action.payload,
|
|
2611
|
+
mapId = _action$payload15.mapId,
|
|
2612
|
+
timestepAuto = _action$payload15.timestepAuto;
|
|
2581
2613
|
if (!draft.byId[mapId]) {
|
|
2582
2614
|
return;
|
|
2583
2615
|
}
|
|
2584
2616
|
draft.byId[mapId].isTimestepAuto = timestepAuto;
|
|
2585
2617
|
},
|
|
2586
2618
|
toggleTimeSpanAuto: function toggleTimeSpanAuto(draft, action) {
|
|
2587
|
-
var _action$
|
|
2588
|
-
mapId = _action$
|
|
2589
|
-
timeSpanAuto = _action$
|
|
2619
|
+
var _action$payload16 = action.payload,
|
|
2620
|
+
mapId = _action$payload16.mapId,
|
|
2621
|
+
timeSpanAuto = _action$payload16.timeSpanAuto;
|
|
2590
2622
|
if (!draft.byId[mapId]) {
|
|
2591
2623
|
return;
|
|
2592
2624
|
}
|
|
2593
2625
|
draft.byId[mapId].isTimeSpanAuto = timeSpanAuto;
|
|
2594
2626
|
},
|
|
2595
2627
|
toggleAnimationLengthAuto: function toggleAnimationLengthAuto(draft, action) {
|
|
2596
|
-
var _action$
|
|
2597
|
-
mapId = _action$
|
|
2598
|
-
autoAnimationLength = _action$
|
|
2628
|
+
var _action$payload17 = action.payload,
|
|
2629
|
+
mapId = _action$payload17.mapId,
|
|
2630
|
+
autoAnimationLength = _action$payload17.autoAnimationLength;
|
|
2599
2631
|
if (!draft.byId[mapId]) {
|
|
2600
2632
|
return;
|
|
2601
2633
|
}
|
|
2602
2634
|
draft.byId[mapId].isAnimationLengthAuto = autoAnimationLength;
|
|
2603
2635
|
},
|
|
2604
2636
|
toggleTimeSliderHover: function toggleTimeSliderHover(draft, action) {
|
|
2605
|
-
var _action$
|
|
2606
|
-
mapId = _action$
|
|
2607
|
-
isTimeSliderHoverOn = _action$
|
|
2637
|
+
var _action$payload18 = action.payload,
|
|
2638
|
+
mapId = _action$payload18.mapId,
|
|
2639
|
+
isTimeSliderHoverOn = _action$payload18.isTimeSliderHoverOn;
|
|
2608
2640
|
if (!draft.byId[mapId]) {
|
|
2609
2641
|
return;
|
|
2610
2642
|
}
|
|
2611
2643
|
draft.byId[mapId].isTimeSliderHoverOn = isTimeSliderHoverOn;
|
|
2612
2644
|
},
|
|
2613
2645
|
toggleTimeSliderIsVisible: function toggleTimeSliderIsVisible(draft, action) {
|
|
2614
|
-
var _action$
|
|
2615
|
-
mapId = _action$
|
|
2616
|
-
isTimeSliderVisible = _action$
|
|
2646
|
+
var _action$payload19 = action.payload,
|
|
2647
|
+
mapId = _action$payload19.mapId,
|
|
2648
|
+
isTimeSliderVisible = _action$payload19.isTimeSliderVisible;
|
|
2617
2649
|
if (!draft.byId[mapId]) {
|
|
2618
2650
|
return;
|
|
2619
2651
|
}
|
|
2620
2652
|
draft.byId[mapId].isTimeSliderVisible = isTimeSliderVisible;
|
|
2621
2653
|
},
|
|
2622
2654
|
toggleZoomControls: function toggleZoomControls(draft, action) {
|
|
2623
|
-
var _action$
|
|
2624
|
-
mapId = _action$
|
|
2625
|
-
shouldShowZoomControls = _action$
|
|
2655
|
+
var _action$payload20 = action.payload,
|
|
2656
|
+
mapId = _action$payload20.mapId,
|
|
2657
|
+
shouldShowZoomControls = _action$payload20.shouldShowZoomControls;
|
|
2626
2658
|
if (!draft.byId[mapId]) {
|
|
2627
2659
|
return;
|
|
2628
2660
|
}
|
|
2629
2661
|
draft.byId[mapId].shouldShowZoomControls = shouldShowZoomControls;
|
|
2630
2662
|
},
|
|
2631
2663
|
setMapPinLocation: function setMapPinLocation(draft, action) {
|
|
2632
|
-
var _action$
|
|
2633
|
-
mapId = _action$
|
|
2634
|
-
mapPinLocation = _action$
|
|
2664
|
+
var _action$payload21 = action.payload,
|
|
2665
|
+
mapId = _action$payload21.mapId,
|
|
2666
|
+
mapPinLocation = _action$payload21.mapPinLocation;
|
|
2635
2667
|
if (!draft.byId[mapId]) {
|
|
2636
2668
|
return;
|
|
2637
2669
|
}
|
|
2638
2670
|
draft.byId[mapId].mapPinLocation = mapPinLocation;
|
|
2639
2671
|
},
|
|
2640
2672
|
setDisableMapPin: function setDisableMapPin(draft, action) {
|
|
2641
|
-
var _action$
|
|
2642
|
-
mapId = _action$
|
|
2643
|
-
disableMapPin = _action$
|
|
2673
|
+
var _action$payload22 = action.payload,
|
|
2674
|
+
mapId = _action$payload22.mapId,
|
|
2675
|
+
disableMapPin = _action$payload22.disableMapPin;
|
|
2644
2676
|
if (!draft.byId[mapId]) {
|
|
2645
2677
|
return;
|
|
2646
2678
|
}
|
|
2647
2679
|
draft.byId[mapId].disableMapPin = disableMapPin;
|
|
2648
2680
|
},
|
|
2649
2681
|
toggleMapPinIsVisible: function toggleMapPinIsVisible(draft, action) {
|
|
2650
|
-
var _action$
|
|
2651
|
-
mapId = _action$
|
|
2652
|
-
displayMapPin = _action$
|
|
2682
|
+
var _action$payload23 = action.payload,
|
|
2683
|
+
mapId = _action$payload23.mapId,
|
|
2684
|
+
displayMapPin = _action$payload23.displayMapPin;
|
|
2653
2685
|
if (!draft.byId[mapId]) {
|
|
2654
2686
|
return;
|
|
2655
2687
|
}
|
|
2656
2688
|
draft.byId[mapId].displayMapPin = displayMapPin;
|
|
2657
2689
|
},
|
|
2658
2690
|
setDockedLayerManagerSize: function setDockedLayerManagerSize(draft, action) {
|
|
2659
|
-
var _action$
|
|
2660
|
-
mapId = _action$
|
|
2661
|
-
dockedLayerManagerSize = _action$
|
|
2691
|
+
var _action$payload24 = action.payload,
|
|
2692
|
+
mapId = _action$payload24.mapId,
|
|
2693
|
+
dockedLayerManagerSize = _action$payload24.dockedLayerManagerSize;
|
|
2662
2694
|
if (!draft.byId[mapId]) {
|
|
2663
2695
|
return;
|
|
2664
2696
|
}
|
|
@@ -2673,9 +2705,9 @@ var slice$4 = createSlice({
|
|
|
2673
2705
|
draft.defaultMapSettings = action.payload.preset;
|
|
2674
2706
|
},
|
|
2675
2707
|
changeOverlayer: function changeOverlayer(draft, action) {
|
|
2676
|
-
var _action$
|
|
2677
|
-
mapId = _action$
|
|
2678
|
-
selectedOverlayer = _action$
|
|
2708
|
+
var _action$payload25 = action.payload,
|
|
2709
|
+
mapId = _action$payload25.mapId,
|
|
2710
|
+
selectedOverlayer = _action$payload25.selectedOverlayer;
|
|
2679
2711
|
if (!draft.byId[mapId]) {
|
|
2680
2712
|
return;
|
|
2681
2713
|
}
|
|
@@ -2684,10 +2716,10 @@ var slice$4 = createSlice({
|
|
|
2684
2716
|
},
|
|
2685
2717
|
extraReducers: function extraReducers(builder) {
|
|
2686
2718
|
builder.addCase(layerActions.addLayer, function (draft, action) {
|
|
2687
|
-
var _action$
|
|
2688
|
-
layerId = _action$
|
|
2689
|
-
mapId = _action$
|
|
2690
|
-
layer = _action$
|
|
2719
|
+
var _action$payload26 = action.payload,
|
|
2720
|
+
layerId = _action$payload26.layerId,
|
|
2721
|
+
mapId = _action$payload26.mapId,
|
|
2722
|
+
layer = _action$payload26.layer;
|
|
2691
2723
|
if (!draft.byId[mapId]) {
|
|
2692
2724
|
return;
|
|
2693
2725
|
}
|
|
@@ -2706,9 +2738,9 @@ var slice$4 = createSlice({
|
|
|
2706
2738
|
draft.byId[mapId].mapLayers.unshift(layerId);
|
|
2707
2739
|
}
|
|
2708
2740
|
}).addCase(layerActions.duplicateMapLayer, function (draft, action) {
|
|
2709
|
-
var _action$
|
|
2710
|
-
newLayerId = _action$
|
|
2711
|
-
mapId = _action$
|
|
2741
|
+
var _action$payload27 = action.payload,
|
|
2742
|
+
newLayerId = _action$payload27.newLayerId,
|
|
2743
|
+
mapId = _action$payload27.mapId;
|
|
2712
2744
|
if (!draft.byId[mapId]) {
|
|
2713
2745
|
return;
|
|
2714
2746
|
}
|
|
@@ -2718,10 +2750,10 @@ var slice$4 = createSlice({
|
|
|
2718
2750
|
}
|
|
2719
2751
|
draft.byId[mapId].mapLayers.unshift(newLayerId);
|
|
2720
2752
|
}).addCase(layerActions.addBaseLayer, function (draft, action) {
|
|
2721
|
-
var _action$
|
|
2722
|
-
layer = _action$
|
|
2723
|
-
layerId = _action$
|
|
2724
|
-
mapId = _action$
|
|
2753
|
+
var _action$payload28 = action.payload,
|
|
2754
|
+
layer = _action$payload28.layer,
|
|
2755
|
+
layerId = _action$payload28.layerId,
|
|
2756
|
+
mapId = _action$payload28.mapId;
|
|
2725
2757
|
if (!draft.byId[mapId]) {
|
|
2726
2758
|
return;
|
|
2727
2759
|
}
|
|
@@ -2751,9 +2783,9 @@ var slice$4 = createSlice({
|
|
|
2751
2783
|
draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
|
|
2752
2784
|
}
|
|
2753
2785
|
}).addCase(layerActions.setBaseLayers, function (draft, action) {
|
|
2754
|
-
var _action$
|
|
2755
|
-
layers = _action$
|
|
2756
|
-
mapId = _action$
|
|
2786
|
+
var _action$payload29 = action.payload,
|
|
2787
|
+
layers = _action$payload29.layers,
|
|
2788
|
+
mapId = _action$payload29.mapId;
|
|
2757
2789
|
// Split into base and overlayers
|
|
2758
2790
|
var baseLayers = [];
|
|
2759
2791
|
var overLayers = [];
|
|
@@ -2783,9 +2815,9 @@ var slice$4 = createSlice({
|
|
|
2783
2815
|
}
|
|
2784
2816
|
}
|
|
2785
2817
|
}).addCase(layerActions.layerDelete, function (draft, action) {
|
|
2786
|
-
var _action$
|
|
2787
|
-
mapId = _action$
|
|
2788
|
-
layerId = _action$
|
|
2818
|
+
var _action$payload30 = action.payload,
|
|
2819
|
+
mapId = _action$payload30.mapId,
|
|
2820
|
+
layerId = _action$payload30.layerId;
|
|
2789
2821
|
var map = draft.byId[mapId];
|
|
2790
2822
|
if (!map) {
|
|
2791
2823
|
return;
|
|
@@ -2811,9 +2843,9 @@ var slice$4 = createSlice({
|
|
|
2811
2843
|
return id !== layerId;
|
|
2812
2844
|
});
|
|
2813
2845
|
}).addCase(layerActions.baseLayerDelete, function (draft, action) {
|
|
2814
|
-
var _action$
|
|
2815
|
-
mapId = _action$
|
|
2816
|
-
layerId = _action$
|
|
2846
|
+
var _action$payload31 = action.payload,
|
|
2847
|
+
mapId = _action$payload31.mapId,
|
|
2848
|
+
layerId = _action$payload31.layerId;
|
|
2817
2849
|
if (!draft.byId[mapId]) {
|
|
2818
2850
|
return;
|
|
2819
2851
|
}
|
|
@@ -2824,14 +2856,14 @@ var slice$4 = createSlice({
|
|
|
2824
2856
|
return id !== layerId;
|
|
2825
2857
|
});
|
|
2826
2858
|
}).addCase(layerActions.layerChangeDimension, function (draft, action) {
|
|
2827
|
-
var _action$
|
|
2828
|
-
layerId = _action$
|
|
2829
|
-
dimension = _action$
|
|
2859
|
+
var _action$payload32 = action.payload,
|
|
2860
|
+
layerId = _action$payload32.layerId,
|
|
2861
|
+
dimension = _action$payload32.dimension;
|
|
2830
2862
|
produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension);
|
|
2831
2863
|
}).addCase(setTimeSync, function (draft, action) {
|
|
2832
|
-
var _action$
|
|
2833
|
-
targetsFromAction = _action$
|
|
2834
|
-
source = _action$
|
|
2864
|
+
var _action$payload33 = action.payload,
|
|
2865
|
+
targetsFromAction = _action$payload33.targets,
|
|
2866
|
+
source = _action$payload33.source;
|
|
2835
2867
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2836
2868
|
var targets = [];
|
|
2837
2869
|
if (source) {
|
|
@@ -2846,18 +2878,47 @@ var slice$4 = createSlice({
|
|
|
2846
2878
|
var targetId = target.targetId,
|
|
2847
2879
|
value = target.value;
|
|
2848
2880
|
if (draft.byId[targetId]) {
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
}
|
|
2853
|
-
|
|
2854
|
-
|
|
2881
|
+
// SetTimeSliderSpan
|
|
2882
|
+
if (value !== null && value !== void 0 && value.timeSliderSpan) {
|
|
2883
|
+
produceTimeSliderTimeSpan(draft, targetId, value.timeSliderSpan);
|
|
2884
|
+
}
|
|
2885
|
+
// SetTimeSliderCenterTime
|
|
2886
|
+
if (value !== null && value !== void 0 && value.timeSliderCenterTime) {
|
|
2887
|
+
draft.byId[targetId].timeSliderCenterTime = value.timeSliderCenterTime;
|
|
2888
|
+
}
|
|
2889
|
+
// SetTimeSliderStep
|
|
2890
|
+
if (value !== null && value !== void 0 && value.timeSliderStep) {
|
|
2891
|
+
draft.byId[targetId].timeStep = value.timeSliderStep;
|
|
2892
|
+
// When timestep is synced between slider, isTimestepAuto should be set to false.
|
|
2893
|
+
draft.byId[targetId].isTimestepAuto = false;
|
|
2894
|
+
}
|
|
2895
|
+
// SetAnimationStartTime
|
|
2896
|
+
if (value !== null && value !== void 0 && value.timeSliderAnimationStartTime) {
|
|
2897
|
+
draft.byId[targetId].animationStartTime = value.timeSliderAnimationStartTime;
|
|
2898
|
+
}
|
|
2899
|
+
// SetAnimationEndTime
|
|
2900
|
+
if (value !== null && value !== void 0 && value.timeSliderAnimationEndTime) {
|
|
2901
|
+
draft.byId[targetId].animationEndTime = value.timeSliderAnimationEndTime;
|
|
2902
|
+
}
|
|
2903
|
+
// SetAnimationDelay
|
|
2904
|
+
if (value !== null && value !== void 0 && value.timeSliderAnimationDelay) {
|
|
2905
|
+
draft.byId[targetId].animationDelay = value.timeSliderAnimationDelay;
|
|
2906
|
+
}
|
|
2907
|
+
// SetTime / update actual current value
|
|
2908
|
+
if (value !== null && value !== void 0 && value.currentTime) {
|
|
2909
|
+
var dimension = {
|
|
2910
|
+
name: 'time',
|
|
2911
|
+
currentValue: value.currentTime
|
|
2912
|
+
};
|
|
2913
|
+
produceDraftStateSetWebMapDimension(draft, targetId, dimension, true);
|
|
2914
|
+
produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, targetId, dimension);
|
|
2915
|
+
}
|
|
2855
2916
|
}
|
|
2856
2917
|
});
|
|
2857
2918
|
}).addCase(setBboxSync, function (draft, action) {
|
|
2858
|
-
var _action$
|
|
2859
|
-
targetsFromAction = _action$
|
|
2860
|
-
source = _action$
|
|
2919
|
+
var _action$payload34 = action.payload,
|
|
2920
|
+
targetsFromAction = _action$payload34.targets,
|
|
2921
|
+
source = _action$payload34.source;
|
|
2861
2922
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2862
2923
|
var targets = [];
|
|
2863
2924
|
if (source) {
|
|
@@ -2889,9 +2950,9 @@ var slice$4 = createSlice({
|
|
|
2889
2950
|
* These targets can be used as payloads in new Layer actions.
|
|
2890
2951
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
2891
2952
|
*/
|
|
2892
|
-
var _action$
|
|
2893
|
-
targets = _action$
|
|
2894
|
-
source = _action$
|
|
2953
|
+
var _action$payload35 = action.payload,
|
|
2954
|
+
targets = _action$payload35.targets,
|
|
2955
|
+
source = _action$payload35.source;
|
|
2895
2956
|
return targets.reduce(function (prevState, target) {
|
|
2896
2957
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
2897
2958
|
var action = {
|
|
@@ -2913,9 +2974,9 @@ var slice$4 = createSlice({
|
|
|
2913
2974
|
});
|
|
2914
2975
|
return draft;
|
|
2915
2976
|
}).addCase(mapChangeDimension, function (draft, action) {
|
|
2916
|
-
var _action$
|
|
2917
|
-
mapId = _action$
|
|
2918
|
-
dimensionFromAction = _action$
|
|
2977
|
+
var _action$payload36 = action.payload,
|
|
2978
|
+
mapId = _action$payload36.mapId,
|
|
2979
|
+
dimensionFromAction = _action$payload36.dimension;
|
|
2919
2980
|
produceDraftStateSetWebMapDimension(draft, mapId, dimensionFromAction, true);
|
|
2920
2981
|
}).addCase(setMapPreset, function (draft, action) {
|
|
2921
2982
|
var mapId = action.payload.mapId;
|
|
@@ -2935,9 +2996,9 @@ var slice$4 = createSlice({
|
|
|
2935
2996
|
draft.byId[mapId].animationDelay = defaultAnimationDelayAtStart;
|
|
2936
2997
|
draft.byId[mapId].dockedLayerManagerSize = '';
|
|
2937
2998
|
}).addCase(uiActions.registerDialog, function (draft, action) {
|
|
2938
|
-
var _action$
|
|
2939
|
-
mapId = _action$
|
|
2940
|
-
type = _action$
|
|
2999
|
+
var _action$payload37 = action.payload,
|
|
3000
|
+
mapId = _action$payload37.mapId,
|
|
3001
|
+
type = _action$payload37.type;
|
|
2941
3002
|
if (!draft.byId[mapId]) {
|
|
2942
3003
|
return;
|
|
2943
3004
|
}
|
|
@@ -3187,8 +3248,13 @@ var getLayerEnabled = createSelector(getLayerById, function (layer) {
|
|
|
3187
3248
|
* @returns {string} returnType: string - layer name
|
|
3188
3249
|
*/
|
|
3189
3250
|
var getLayerName = createSelector(getLayerById, function (layer) {
|
|
3190
|
-
|
|
3191
|
-
|
|
3251
|
+
if (!layer) {
|
|
3252
|
+
return '';
|
|
3253
|
+
}
|
|
3254
|
+
if (layer.layerType === LayerType.edrFeatureLayer && layer.options && layer.options.parameterNames.length) {
|
|
3255
|
+
return layer.options.parameterNames[0];
|
|
3256
|
+
}
|
|
3257
|
+
return (layer === null || layer === void 0 ? void 0 : layer.name) || '';
|
|
3192
3258
|
}, selectorMemoizationOptions);
|
|
3193
3259
|
/**
|
|
3194
3260
|
* Gets layer service
|
|
@@ -3371,6 +3437,13 @@ var getTimeStepForLayerId = createSelector(getLayerTimeDimension, function (time
|
|
|
3371
3437
|
var getActiveLayerInfo = createSelector(layerStore, function (store) {
|
|
3372
3438
|
return store === null || store === void 0 ? void 0 : store.activeLayerInfo;
|
|
3373
3439
|
});
|
|
3440
|
+
var getLayerType = createSelector(getLayerById, function (layer) {
|
|
3441
|
+
var _layer$layerType;
|
|
3442
|
+
return (_layer$layerType = layer === null || layer === void 0 ? void 0 : layer.layerType) !== null && _layer$layerType !== void 0 ? _layer$layerType : 'mapLayer';
|
|
3443
|
+
}, selectorMemoizationOptions);
|
|
3444
|
+
var getLayerOptions = createSelector(getLayerById, function (layer) {
|
|
3445
|
+
return layer === null || layer === void 0 ? void 0 : layer.options;
|
|
3446
|
+
}, selectorMemoizationOptions);
|
|
3374
3447
|
/**
|
|
3375
3448
|
* Gets all overlayers for a given mapId
|
|
3376
3449
|
* Example: overlayers = getOverlayersForMapId(store, 'mapId123')
|
|
@@ -3392,6 +3465,47 @@ var getOverlayersForMapId = createSelector([layerStore, function (_store, mapId)
|
|
|
3392
3465
|
});
|
|
3393
3466
|
return overLayers;
|
|
3394
3467
|
}, selectorMemoizationOptions);
|
|
3468
|
+
/**
|
|
3469
|
+
* Gets the layer title from the service store using the layerId
|
|
3470
|
+
*
|
|
3471
|
+
* Example: layerTitle = getLayerTitleFromService(store, 'layerId_1')
|
|
3472
|
+
* @param {object} store store: object - object from which the layers state will be extracted
|
|
3473
|
+
* @param {string} layerId layerId: string - Id of the layer
|
|
3474
|
+
* @returns {string} returnType: string - string containing layer title
|
|
3475
|
+
*/
|
|
3476
|
+
var getLayerTitleFromService = createSelector(function (store) {
|
|
3477
|
+
return store;
|
|
3478
|
+
}, getLayerService, getLayerName, function (store, service, name) {
|
|
3479
|
+
return getLayerTitle(store, service, name);
|
|
3480
|
+
}, selectorMemoizationOptions);
|
|
3481
|
+
/**
|
|
3482
|
+
* Gets layer displayname. For EDR layers with multiple parameters, the collectionId is used as displayname. Otherwise the layer title from the service is used.
|
|
3483
|
+
*
|
|
3484
|
+
* Example: layerName = getLayerDisplayName(store, 'layerId_1')
|
|
3485
|
+
* @param {object} store store: object - object from which the layers state will be extracted
|
|
3486
|
+
* @param {string} layerId layerId: string - Id of the layer
|
|
3487
|
+
* @returns {string} returnType: string - layer displayname
|
|
3488
|
+
*/
|
|
3489
|
+
var getLayerDisplayName = createSelector(getLayerType, getLayerOptions, getLayerTitleFromService, getLayerName, function (layerType, layerOptions, layerTitle, layerName) {
|
|
3490
|
+
if (layerType === LayerType.edrFeatureLayer && layerOptions) {
|
|
3491
|
+
return (layerOptions === null || layerOptions === void 0 ? void 0 : layerOptions.parameterNames.length) > 1 && layerOptions.collectionId ? layerOptions.collectionId : layerTitle || layerName;
|
|
3492
|
+
}
|
|
3493
|
+
return layerTitle || layerName;
|
|
3494
|
+
}, selectorMemoizationOptions);
|
|
3495
|
+
/**
|
|
3496
|
+
* Gets the layer missing status. A layer is missing if it is not found in the service store or if its status is 'error'.
|
|
3497
|
+
*
|
|
3498
|
+
* Example: isLayerMissing = getIsLayerMissing(store, 'layerId_1')
|
|
3499
|
+
* @param {object} store store: object - object from which the layers state will be extracted
|
|
3500
|
+
* @param {string} layerId layerId: string - Id of the layer
|
|
3501
|
+
* @returns {boolean} returnType: boolean - true if layer is missing
|
|
3502
|
+
*/
|
|
3503
|
+
var getIsLayerMissing = createSelector(function (store) {
|
|
3504
|
+
return store;
|
|
3505
|
+
}, getLayerService, getLayerName, getLayerStatus, function (store, service, name, status) {
|
|
3506
|
+
var layer = getLayerFromService(store, service, name);
|
|
3507
|
+
return !layer || status === LayerStatus.error;
|
|
3508
|
+
}, selectorMemoizationOptions);
|
|
3395
3509
|
|
|
3396
3510
|
var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
3397
3511
|
__proto__: null,
|
|
@@ -3406,22 +3520,27 @@ var selectors$6 = /*#__PURE__*/Object.freeze({
|
|
|
3406
3520
|
getFeatureLayers: getFeatureLayers,
|
|
3407
3521
|
getHasFeatureLayerGeoJSON: getHasFeatureLayerGeoJSON,
|
|
3408
3522
|
getIsLayerInEditMode: getIsLayerInEditMode,
|
|
3523
|
+
getIsLayerMissing: getIsLayerMissing,
|
|
3409
3524
|
getIsLayerPresent: getIsLayerPresent,
|
|
3410
3525
|
getLayerById: getLayerById,
|
|
3411
3526
|
getLayerByIdWithoutTimeDimension: getLayerByIdWithoutTimeDimension,
|
|
3412
3527
|
getLayerCurrentTime: getLayerCurrentTime,
|
|
3413
3528
|
getLayerDimension: getLayerDimension,
|
|
3414
3529
|
getLayerDimensions: getLayerDimensions,
|
|
3530
|
+
getLayerDisplayName: getLayerDisplayName,
|
|
3415
3531
|
getLayerEnabled: getLayerEnabled,
|
|
3416
3532
|
getLayerHasTimeDimension: getLayerHasTimeDimension,
|
|
3417
3533
|
getLayerIsInsideAcceptanceTime: getLayerIsInsideAcceptanceTime,
|
|
3418
3534
|
getLayerName: getLayerName,
|
|
3419
3535
|
getLayerNonTimeDimensions: getLayerNonTimeDimensions,
|
|
3420
3536
|
getLayerOpacity: getLayerOpacity,
|
|
3537
|
+
getLayerOptions: getLayerOptions,
|
|
3421
3538
|
getLayerService: getLayerService,
|
|
3422
3539
|
getLayerStatus: getLayerStatus,
|
|
3423
3540
|
getLayerStyle: getLayerStyle,
|
|
3424
3541
|
getLayerTimeDimension: getLayerTimeDimension,
|
|
3542
|
+
getLayerTitleFromService: getLayerTitleFromService,
|
|
3543
|
+
getLayerType: getLayerType,
|
|
3425
3544
|
getLayers: getLayers,
|
|
3426
3545
|
getLayersById: getLayersById,
|
|
3427
3546
|
getLayersByMapId: getLayersByMapId,
|
|
@@ -4587,19 +4706,17 @@ var getSelectedFeature = createSelector([
|
|
|
4587
4706
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
4588
4707
|
function (state, mapId) {
|
|
4589
4708
|
var _state$linkedState;
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
_ref$features = _ref.features,
|
|
4593
|
-
features = _ref$features === void 0 ? [] : _ref$features,
|
|
4594
|
-
selectedFeatureId = _ref.selectedFeatureId;
|
|
4595
|
-
return {
|
|
4596
|
-
features: features,
|
|
4597
|
-
selectedFeatureId: selectedFeatureId
|
|
4598
|
-
};
|
|
4599
|
-
}], function (_ref2) {
|
|
4709
|
+
return (_state$linkedState = state.linkedState) === null || _state$linkedState === void 0 ? void 0 : _state$linkedState.sharedData[mapId];
|
|
4710
|
+
}], function (sharedData) {
|
|
4600
4711
|
var _features$;
|
|
4601
|
-
|
|
4602
|
-
|
|
4712
|
+
if (!sharedData) {
|
|
4713
|
+
return null;
|
|
4714
|
+
}
|
|
4715
|
+
var features = sharedData.features,
|
|
4716
|
+
selectedFeatureId = sharedData.selectedFeatureId;
|
|
4717
|
+
if (!features || !selectedFeatureId) {
|
|
4718
|
+
return null;
|
|
4719
|
+
}
|
|
4603
4720
|
var selectedFeature = (_features$ = features[0]) === null || _features$ === void 0 ? void 0 : _features$.geoJSON.features.find(function (feature) {
|
|
4604
4721
|
return feature.id === selectedFeatureId;
|
|
4605
4722
|
});
|
|
@@ -4629,26 +4746,21 @@ function (state, mapId) {
|
|
|
4629
4746
|
});
|
|
4630
4747
|
var getSelectedFeatureAsGeoJSON = createSelector([function (state, mapId) {
|
|
4631
4748
|
var _state$linkedState2;
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
return {
|
|
4638
|
-
features: features,
|
|
4639
|
-
selectedFeatureId: selectedFeatureId
|
|
4640
|
-
};
|
|
4641
|
-
}], function (_ref4) {
|
|
4642
|
-
var features = _ref4.features,
|
|
4643
|
-
selectedFeatureId = _ref4.selectedFeatureId;
|
|
4644
|
-
if (features && selectedFeatureId) {
|
|
4645
|
-
var _features$2;
|
|
4646
|
-
var selectedFeature = (_features$2 = features[0]) === null || _features$2 === void 0 ? void 0 : _features$2.geoJSON.features.find(function (feature) {
|
|
4647
|
-
return feature.id === selectedFeatureId;
|
|
4648
|
-
});
|
|
4649
|
-
return selectedFeature;
|
|
4749
|
+
return (_state$linkedState2 = state.linkedState) === null || _state$linkedState2 === void 0 ? void 0 : _state$linkedState2.sharedData[mapId];
|
|
4750
|
+
}], function (sharedData) {
|
|
4751
|
+
var _features$2;
|
|
4752
|
+
if (!sharedData) {
|
|
4753
|
+
return null;
|
|
4650
4754
|
}
|
|
4651
|
-
|
|
4755
|
+
var features = sharedData.features,
|
|
4756
|
+
selectedFeatureId = sharedData.selectedFeatureId;
|
|
4757
|
+
if (!features || !selectedFeatureId) {
|
|
4758
|
+
return null;
|
|
4759
|
+
}
|
|
4760
|
+
var selectedFeature = (_features$2 = features[0]) === null || _features$2 === void 0 ? void 0 : _features$2.geoJSON.features.find(function (feature) {
|
|
4761
|
+
return feature.id === selectedFeatureId;
|
|
4762
|
+
});
|
|
4763
|
+
return selectedFeature;
|
|
4652
4764
|
});
|
|
4653
4765
|
|
|
4654
4766
|
var selectors$3 = /*#__PURE__*/Object.freeze({
|
|
@@ -5146,16 +5258,16 @@ var isAnimating = function isAnimating(store, mapId) {
|
|
|
5146
5258
|
* @param {string} mapId mapId: string - Id of the map
|
|
5147
5259
|
* @returns {object} returnType: object - object containing isAnimating boolean and id string
|
|
5148
5260
|
*/
|
|
5149
|
-
var linkedMapAnimationInfo = function
|
|
5150
|
-
var _genericSelectors$get;
|
|
5261
|
+
var linkedMapAnimationInfo = createSelector(getMapStore, getSynchronizationGroupStore, getMapById, function (mapStore, syncStore, mapState) {
|
|
5151
5262
|
var animationInfo = {
|
|
5152
|
-
isAnimating:
|
|
5153
|
-
id:
|
|
5263
|
+
isAnimating: (mapState === null || mapState === void 0 ? void 0 : mapState.isAnimating) || false,
|
|
5264
|
+
id: (mapState === null || mapState === void 0 ? void 0 : mapState.id) || ''
|
|
5154
5265
|
};
|
|
5155
|
-
|
|
5156
|
-
if (
|
|
5157
|
-
|
|
5158
|
-
|
|
5266
|
+
syncStore === null || syncStore === void 0 || syncStore.groups.allIds.forEach(function (groupId) {
|
|
5267
|
+
if (syncStore.groups.byId[groupId].targets.byId[animationInfo.id] && syncStore.groups.byId[groupId].targets.byId[animationInfo.id].linked) {
|
|
5268
|
+
syncStore.groups.byId[groupId].targets.allIds.forEach(function (id) {
|
|
5269
|
+
var _mapStore$byId$id;
|
|
5270
|
+
if ((mapStore === null || mapStore === void 0 || (_mapStore$byId$id = mapStore.byId[id]) === null || _mapStore$byId$id === void 0 ? void 0 : _mapStore$byId$id.isAnimating) === true) {
|
|
5159
5271
|
animationInfo.isAnimating = true;
|
|
5160
5272
|
animationInfo.id = id;
|
|
5161
5273
|
}
|
|
@@ -5163,7 +5275,7 @@ var linkedMapAnimationInfo = function linkedMapAnimationInfo(store, mapId) {
|
|
|
5163
5275
|
}
|
|
5164
5276
|
});
|
|
5165
5277
|
return animationInfo;
|
|
5166
|
-
};
|
|
5278
|
+
}, selectorMemoizationOptions);
|
|
5167
5279
|
/**
|
|
5168
5280
|
* Gets start time of animation
|
|
5169
5281
|
*
|
|
@@ -5550,7 +5662,8 @@ var getLegendId = createSelector(getMapById, function (store) {
|
|
|
5550
5662
|
var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, getMapTimeSliderSpan, isTimestepAuto, isTimeSpanAuto, getLegendId, getUiStore, function (_store, mapId) {
|
|
5551
5663
|
return mapId;
|
|
5552
5664
|
}, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, animationStartTime, animationEndTime, timeSliderSpan, isTimestepAuto, isTimeSpanAuto, legendId, uiStore, mapId) {
|
|
5553
|
-
var _uiStore$dialogs$lege;
|
|
5665
|
+
var _overLayers$, _uiStore$dialogs$lege;
|
|
5666
|
+
var defaultOverlayer = arguments.length > 23 && arguments[23] !== undefined ? arguments[23] : ((_overLayers$ = overLayers[0]) === null || _overLayers$ === void 0 ? void 0 : _overLayers$.name) || 'none';
|
|
5554
5667
|
var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_ref3) {
|
|
5555
5668
|
_ref3.mapId;
|
|
5556
5669
|
var layer = _objectWithoutProperties(_ref3, _excluded$2);
|
|
@@ -5596,7 +5709,8 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
|
|
|
5596
5709
|
toggleTimeSpanAuto: isTimeSpanAuto,
|
|
5597
5710
|
shouldShowLegend: shouldShowLegend,
|
|
5598
5711
|
timeSliderSpan: timeSliderSpan,
|
|
5599
|
-
shouldShowDataExplorer: shouldShowDataExplorer
|
|
5712
|
+
shouldShowDataExplorer: shouldShowDataExplorer,
|
|
5713
|
+
defaultOverlayer: defaultOverlayer
|
|
5600
5714
|
});
|
|
5601
5715
|
}, selectorMemoizationOptions);
|
|
5602
5716
|
/**
|
|
@@ -5680,6 +5794,11 @@ var getAnimationList = createSelector(getLayersById, getMapById, getAnimationSta
|
|
|
5680
5794
|
}
|
|
5681
5795
|
return animationList;
|
|
5682
5796
|
}, selectorMemoizationOptions);
|
|
5797
|
+
var getAnimationListAsEpochTimes = createSelector(getAnimationList, function (list) {
|
|
5798
|
+
return list.map(function (kvp) {
|
|
5799
|
+
return dateUtils.parseISO(handleDateUtilsISOString(kvp.value)).getTime();
|
|
5800
|
+
});
|
|
5801
|
+
}, selectorMemoizationOptions);
|
|
5683
5802
|
/**
|
|
5684
5803
|
* @param {object} store store: object - store object
|
|
5685
5804
|
* @param {string} mapId mapId: string - Id of the map
|
|
@@ -5737,6 +5856,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
|
|
|
5737
5856
|
getAllUniqueDimensions: getAllUniqueDimensions,
|
|
5738
5857
|
getAnimationEndTime: getAnimationEndTime,
|
|
5739
5858
|
getAnimationList: getAnimationList,
|
|
5859
|
+
getAnimationListAsEpochTimes: getAnimationListAsEpochTimes,
|
|
5740
5860
|
getAnimationRange: getAnimationRange,
|
|
5741
5861
|
getAnimationStartTime: getAnimationStartTime,
|
|
5742
5862
|
getAutoTimeStepLayerId: getAutoTimeStepLayerId,
|
|
@@ -5858,7 +5978,7 @@ var filterLayers = function filterLayers() {
|
|
|
5858
5978
|
overLayers: overLayers
|
|
5859
5979
|
};
|
|
5860
5980
|
}
|
|
5861
|
-
if (layer.layerType === LayerType.mapLayer || layer.layerType === LayerType.
|
|
5981
|
+
if (layer.layerType === LayerType.mapLayer || layer.layerType === LayerType.edrFeatureLayer) {
|
|
5862
5982
|
return {
|
|
5863
5983
|
mapLayers: mapLayers.concat(parsedLayer),
|
|
5864
5984
|
baseLayers: baseLayers,
|
|
@@ -6275,20 +6395,23 @@ genericListener.startListening({
|
|
|
6275
6395
|
actionCreator: setTime,
|
|
6276
6396
|
effect: function () {
|
|
6277
6397
|
var _effect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref, listenerApi) {
|
|
6278
|
-
var payload, value, origin, targets, groups;
|
|
6398
|
+
var payload, value, origin, currentTime, targets, groups;
|
|
6279
6399
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6280
6400
|
while (1) switch (_context.prev = _context.next) {
|
|
6281
6401
|
case 0:
|
|
6282
6402
|
payload = _ref.payload;
|
|
6283
6403
|
listenerApi.cancelActiveListeners();
|
|
6284
6404
|
value = payload.value, origin = payload.origin;
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6405
|
+
if (value !== null && value !== void 0 && value.currentTime) {
|
|
6406
|
+
currentTime = value.currentTime;
|
|
6407
|
+
/* Test if the current is according to the expected time format */
|
|
6408
|
+
if (!setTimeValidatorRexexp.test(currentTime)) {
|
|
6409
|
+
console.error("setTime value ".concat(currentTime, " does not conform to format [YYYY-MM-DDThh:mm:ssZ]. It was triggered by ").concat(origin));
|
|
6410
|
+
} else {
|
|
6411
|
+
targets = getTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETTIME);
|
|
6412
|
+
groups = getTargetGroups(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETTIME);
|
|
6413
|
+
listenerApi.dispatch(setTimeSync(payload, targets, groups));
|
|
6414
|
+
}
|
|
6292
6415
|
}
|
|
6293
6416
|
case 4:
|
|
6294
6417
|
case "end":
|
|
@@ -6302,20 +6425,37 @@ genericListener.startListening({
|
|
|
6302
6425
|
return effect;
|
|
6303
6426
|
}()
|
|
6304
6427
|
});
|
|
6428
|
+
// Synchronize timeslider settings for actions 'centertime', 'span' and 'timestep'.
|
|
6305
6429
|
genericListener.startListening({
|
|
6306
|
-
|
|
6430
|
+
matcher: isAnyOf(mapActions.setTimeSliderCenterTime, mapActions.setTimeSliderSpan, mapActions.setTimeStep, mapActions.setAnimationStartTime, mapActions.setAnimationEndTime, mapActions.setAnimationDelay),
|
|
6307
6431
|
effect: function () {
|
|
6308
6432
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2, listenerApi) {
|
|
6309
|
-
var
|
|
6433
|
+
var _synchronizationGroup;
|
|
6434
|
+
var payload, type, sourceId, syncGroupState, newPayload, targets, groups;
|
|
6310
6435
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6311
6436
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6312
6437
|
case 0:
|
|
6313
|
-
payload = _ref2.payload;
|
|
6438
|
+
payload = _ref2.payload, type = _ref2.type;
|
|
6314
6439
|
listenerApi.cancelActiveListeners();
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6440
|
+
sourceId = payload.mapId;
|
|
6441
|
+
syncGroupState = (_synchronizationGroup = getSynchronizationGroupSource(listenerApi.getState(), sourceId)) === null || _synchronizationGroup === void 0 || (_synchronizationGroup = _synchronizationGroup.payloadByType['SYNCGROUPS_TYPE_SETTIME']) === null || _synchronizationGroup === void 0 ? void 0 : _synchronizationGroup.value;
|
|
6442
|
+
newPayload = {
|
|
6443
|
+
sourceId: sourceId,
|
|
6444
|
+
origin: 'timeslidersynclistener',
|
|
6445
|
+
value: {
|
|
6446
|
+
currentTime: syncGroupState === null || syncGroupState === void 0 ? void 0 : syncGroupState.currentTime,
|
|
6447
|
+
timeSliderCenterTime: type === mapActions.setTimeSliderCenterTime.type ? payload.timeSliderCenterTime : (syncGroupState === null || syncGroupState === void 0 ? void 0 : syncGroupState.timeSliderCenterTime) || 0,
|
|
6448
|
+
timeSliderSpan: type === mapActions.setTimeSliderSpan.type ? payload.timeSliderSpan : syncGroupState === null || syncGroupState === void 0 ? void 0 : syncGroupState.timeSliderSpan,
|
|
6449
|
+
timeSliderStep: type === mapActions.setTimeStep.type ? payload.timeStep : syncGroupState === null || syncGroupState === void 0 ? void 0 : syncGroupState.timeSliderStep,
|
|
6450
|
+
timeSliderAnimationStartTime: type === mapActions.setAnimationStartTime.type ? payload.animationStartTime : syncGroupState === null || syncGroupState === void 0 ? void 0 : syncGroupState.timeSliderAnimationStartTime,
|
|
6451
|
+
timeSliderAnimationEndTime: type === mapActions.setAnimationEndTime.type ? payload.animationEndTime : syncGroupState === null || syncGroupState === void 0 ? void 0 : syncGroupState.timeSliderAnimationEndTime,
|
|
6452
|
+
timeSliderAnimationDelay: type === mapActions.setAnimationDelay.type ? payload.animationDelay : syncGroupState === null || syncGroupState === void 0 ? void 0 : syncGroupState.timeSliderAnimationDelay
|
|
6453
|
+
}
|
|
6454
|
+
};
|
|
6455
|
+
targets = getTargets(listenerApi.getState(), newPayload, SYNCGROUPS_TYPE_SETTIME);
|
|
6456
|
+
groups = getTargetGroups(listenerApi.getState(), newPayload, SYNCGROUPS_TYPE_SETTIME);
|
|
6457
|
+
listenerApi.dispatch(setTimeSync(newPayload, targets, groups));
|
|
6458
|
+
case 8:
|
|
6319
6459
|
case "end":
|
|
6320
6460
|
return _context2.stop();
|
|
6321
6461
|
}
|
|
@@ -6328,27 +6468,19 @@ genericListener.startListening({
|
|
|
6328
6468
|
}()
|
|
6329
6469
|
});
|
|
6330
6470
|
genericListener.startListening({
|
|
6331
|
-
|
|
6471
|
+
actionCreator: setBbox,
|
|
6332
6472
|
effect: function () {
|
|
6333
6473
|
var _effect3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref3, listenerApi) {
|
|
6334
|
-
var payload,
|
|
6474
|
+
var payload, targets, groups;
|
|
6335
6475
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
6336
6476
|
while (1) switch (_context3.prev = _context3.next) {
|
|
6337
6477
|
case 0:
|
|
6338
|
-
payload = _ref3.payload
|
|
6478
|
+
payload = _ref3.payload;
|
|
6339
6479
|
listenerApi.cancelActiveListeners();
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
}
|
|
6345
|
-
return _context3.abrupt("return");
|
|
6346
|
-
case 4:
|
|
6347
|
-
targets = getLayerActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6348
|
-
if (targets && targets.length > 0) {
|
|
6349
|
-
listenerApi.dispatch(setLayerActionSync(payload, targets, type));
|
|
6350
|
-
}
|
|
6351
|
-
case 6:
|
|
6480
|
+
targets = getTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETBBOX);
|
|
6481
|
+
groups = getTargetGroups(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETBBOX);
|
|
6482
|
+
listenerApi.dispatch(setBboxSync(payload, targets, groups));
|
|
6483
|
+
case 5:
|
|
6352
6484
|
case "end":
|
|
6353
6485
|
return _context3.stop();
|
|
6354
6486
|
}
|
|
@@ -6361,7 +6493,7 @@ genericListener.startListening({
|
|
|
6361
6493
|
}()
|
|
6362
6494
|
});
|
|
6363
6495
|
genericListener.startListening({
|
|
6364
|
-
|
|
6496
|
+
matcher: isAnyOf(layerActions.layerChangeName, layerActions.layerChangeEnabled, layerActions.layerChangeOpacity, layerActions.layerChangeDimension, layerActions.layerChangeStyle),
|
|
6365
6497
|
effect: function () {
|
|
6366
6498
|
var _effect4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4, listenerApi) {
|
|
6367
6499
|
var payload, type, targets;
|
|
@@ -6377,7 +6509,7 @@ genericListener.startListening({
|
|
|
6377
6509
|
}
|
|
6378
6510
|
return _context4.abrupt("return");
|
|
6379
6511
|
case 4:
|
|
6380
|
-
targets =
|
|
6512
|
+
targets = getLayerActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6381
6513
|
if (targets && targets.length > 0) {
|
|
6382
6514
|
listenerApi.dispatch(setLayerActionSync(payload, targets, type));
|
|
6383
6515
|
}
|
|
@@ -6394,24 +6526,25 @@ genericListener.startListening({
|
|
|
6394
6526
|
}()
|
|
6395
6527
|
});
|
|
6396
6528
|
genericListener.startListening({
|
|
6397
|
-
actionCreator: layerActions.
|
|
6529
|
+
actionCreator: layerActions.addLayer,
|
|
6398
6530
|
effect: function () {
|
|
6399
6531
|
var _effect5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref5, listenerApi) {
|
|
6400
|
-
var payload,
|
|
6532
|
+
var payload, type, targets;
|
|
6401
6533
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
6402
6534
|
while (1) switch (_context5.prev = _context5.next) {
|
|
6403
6535
|
case 0:
|
|
6404
|
-
payload = _ref5.payload;
|
|
6536
|
+
payload = _ref5.payload, type = _ref5.type;
|
|
6405
6537
|
listenerApi.cancelActiveListeners();
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6538
|
+
/* Should not listen to actions from itself */
|
|
6539
|
+
if (!(payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)) {
|
|
6540
|
+
_context5.next = 4;
|
|
6541
|
+
break;
|
|
6542
|
+
}
|
|
6543
|
+
return _context5.abrupt("return");
|
|
6544
|
+
case 4:
|
|
6545
|
+
targets = getAddLayerActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6413
6546
|
if (targets && targets.length > 0) {
|
|
6414
|
-
listenerApi.dispatch(setLayerActionSync(
|
|
6547
|
+
listenerApi.dispatch(setLayerActionSync(payload, targets, type));
|
|
6415
6548
|
}
|
|
6416
6549
|
case 6:
|
|
6417
6550
|
case "end":
|
|
@@ -6426,25 +6559,24 @@ genericListener.startListening({
|
|
|
6426
6559
|
}()
|
|
6427
6560
|
});
|
|
6428
6561
|
genericListener.startListening({
|
|
6429
|
-
actionCreator:
|
|
6562
|
+
actionCreator: layerActions.duplicateMapLayer,
|
|
6430
6563
|
effect: function () {
|
|
6431
6564
|
var _effect6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref6, listenerApi) {
|
|
6432
|
-
var payload,
|
|
6565
|
+
var payload, sourceLayer, newPayload, targets;
|
|
6433
6566
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
6434
6567
|
while (1) switch (_context6.prev = _context6.next) {
|
|
6435
6568
|
case 0:
|
|
6436
|
-
payload = _ref6.payload
|
|
6569
|
+
payload = _ref6.payload;
|
|
6437
6570
|
listenerApi.cancelActiveListeners();
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
targets = getLayerMoveActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6571
|
+
sourceLayer = getLayerById(listenerApi.getState(), payload.oldLayerId);
|
|
6572
|
+
newPayload = {
|
|
6573
|
+
mapId: payload.mapId,
|
|
6574
|
+
layer: sourceLayer,
|
|
6575
|
+
origin: payload.origin
|
|
6576
|
+
};
|
|
6577
|
+
targets = getAddLayerActionsTargets(listenerApi.getState(), newPayload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6446
6578
|
if (targets && targets.length > 0) {
|
|
6447
|
-
listenerApi.dispatch(setLayerActionSync(
|
|
6579
|
+
listenerApi.dispatch(setLayerActionSync(newPayload, targets, layerActions.addLayer.type));
|
|
6448
6580
|
}
|
|
6449
6581
|
case 6:
|
|
6450
6582
|
case "end":
|
|
@@ -6459,7 +6591,7 @@ genericListener.startListening({
|
|
|
6459
6591
|
}()
|
|
6460
6592
|
});
|
|
6461
6593
|
genericListener.startListening({
|
|
6462
|
-
|
|
6594
|
+
actionCreator: mapActions.layerMoveLayer,
|
|
6463
6595
|
effect: function () {
|
|
6464
6596
|
var _effect7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref7, listenerApi) {
|
|
6465
6597
|
var payload, type, targets;
|
|
@@ -6468,11 +6600,18 @@ genericListener.startListening({
|
|
|
6468
6600
|
case 0:
|
|
6469
6601
|
payload = _ref7.payload, type = _ref7.type;
|
|
6470
6602
|
listenerApi.cancelActiveListeners();
|
|
6471
|
-
|
|
6603
|
+
/* Should not listen to actions from itself */
|
|
6604
|
+
if (!(payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)) {
|
|
6605
|
+
_context7.next = 4;
|
|
6606
|
+
break;
|
|
6607
|
+
}
|
|
6608
|
+
return _context7.abrupt("return");
|
|
6609
|
+
case 4:
|
|
6610
|
+
targets = getLayerMoveActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6472
6611
|
if (targets && targets.length > 0) {
|
|
6473
6612
|
listenerApi.dispatch(setLayerActionSync(payload, targets, type));
|
|
6474
6613
|
}
|
|
6475
|
-
case
|
|
6614
|
+
case 6:
|
|
6476
6615
|
case "end":
|
|
6477
6616
|
return _context7.stop();
|
|
6478
6617
|
}
|
|
@@ -6485,7 +6624,7 @@ genericListener.startListening({
|
|
|
6485
6624
|
}()
|
|
6486
6625
|
});
|
|
6487
6626
|
genericListener.startListening({
|
|
6488
|
-
|
|
6627
|
+
matcher: isAnyOf(mapActions.setAutoLayerId, mapActions.setAutoUpdateLayerId, mapActions.setAutoTimestepLayerId),
|
|
6489
6628
|
effect: function () {
|
|
6490
6629
|
var _effect8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_ref8, listenerApi) {
|
|
6491
6630
|
var payload, type, targets;
|
|
@@ -6494,18 +6633,11 @@ genericListener.startListening({
|
|
|
6494
6633
|
case 0:
|
|
6495
6634
|
payload = _ref8.payload, type = _ref8.type;
|
|
6496
6635
|
listenerApi.cancelActiveListeners();
|
|
6497
|
-
|
|
6498
|
-
if (!(payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)) {
|
|
6499
|
-
_context8.next = 4;
|
|
6500
|
-
break;
|
|
6501
|
-
}
|
|
6502
|
-
return _context8.abrupt("return");
|
|
6503
|
-
case 4:
|
|
6504
|
-
targets = getMapBaseLayerActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6636
|
+
targets = getSetAutoLayerIdActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6505
6637
|
if (targets && targets.length > 0) {
|
|
6506
6638
|
listenerApi.dispatch(setLayerActionSync(payload, targets, type));
|
|
6507
6639
|
}
|
|
6508
|
-
case
|
|
6640
|
+
case 4:
|
|
6509
6641
|
case "end":
|
|
6510
6642
|
return _context8.stop();
|
|
6511
6643
|
}
|
|
@@ -6518,7 +6650,7 @@ genericListener.startListening({
|
|
|
6518
6650
|
}()
|
|
6519
6651
|
});
|
|
6520
6652
|
genericListener.startListening({
|
|
6521
|
-
actionCreator: layerActions.
|
|
6653
|
+
actionCreator: layerActions.setBaseLayers,
|
|
6522
6654
|
effect: function () {
|
|
6523
6655
|
var _effect9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref9, listenerApi) {
|
|
6524
6656
|
var payload, type, targets;
|
|
@@ -6534,7 +6666,7 @@ genericListener.startListening({
|
|
|
6534
6666
|
}
|
|
6535
6667
|
return _context9.abrupt("return");
|
|
6536
6668
|
case 4:
|
|
6537
|
-
targets =
|
|
6669
|
+
targets = getMapBaseLayerActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6538
6670
|
if (targets && targets.length > 0) {
|
|
6539
6671
|
listenerApi.dispatch(setLayerActionSync(payload, targets, type));
|
|
6540
6672
|
}
|
|
@@ -6550,6 +6682,39 @@ genericListener.startListening({
|
|
|
6550
6682
|
return effect;
|
|
6551
6683
|
}()
|
|
6552
6684
|
});
|
|
6685
|
+
genericListener.startListening({
|
|
6686
|
+
actionCreator: layerActions.layerDelete,
|
|
6687
|
+
effect: function () {
|
|
6688
|
+
var _effect0 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee0(_ref0, listenerApi) {
|
|
6689
|
+
var payload, type, targets;
|
|
6690
|
+
return _regeneratorRuntime().wrap(function _callee0$(_context0) {
|
|
6691
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
6692
|
+
case 0:
|
|
6693
|
+
payload = _ref0.payload, type = _ref0.type;
|
|
6694
|
+
listenerApi.cancelActiveListeners();
|
|
6695
|
+
/* Should not listen to actions from itself */
|
|
6696
|
+
if (!(payload && payload.origin === LayerActionOrigin.ReactMapViewParseLayer)) {
|
|
6697
|
+
_context0.next = 4;
|
|
6698
|
+
break;
|
|
6699
|
+
}
|
|
6700
|
+
return _context0.abrupt("return");
|
|
6701
|
+
case 4:
|
|
6702
|
+
targets = getLayerDeleteActionsTargets(listenerApi.getState(), payload, SYNCGROUPS_TYPE_SETLAYERACTIONS);
|
|
6703
|
+
if (targets && targets.length > 0) {
|
|
6704
|
+
listenerApi.dispatch(setLayerActionSync(payload, targets, type));
|
|
6705
|
+
}
|
|
6706
|
+
case 6:
|
|
6707
|
+
case "end":
|
|
6708
|
+
return _context0.stop();
|
|
6709
|
+
}
|
|
6710
|
+
}, _callee0);
|
|
6711
|
+
}));
|
|
6712
|
+
function effect(_x17, _x18) {
|
|
6713
|
+
return _effect0.apply(this, arguments);
|
|
6714
|
+
}
|
|
6715
|
+
return effect;
|
|
6716
|
+
}()
|
|
6717
|
+
});
|
|
6553
6718
|
|
|
6554
6719
|
/* A map with all the timerIds and their current step */
|
|
6555
6720
|
var stepMap = new Map();
|
|
@@ -6641,14 +6806,14 @@ var isNextStepAvailable = function isNextStepAvailable(reduxLayers, nextTimeStri
|
|
|
6641
6806
|
};
|
|
6642
6807
|
}
|
|
6643
6808
|
var olSource = layer.olSource;
|
|
6644
|
-
var hasImageAvailableForRequestedTimeStep = olSource.
|
|
6809
|
+
var hasImageAvailableForRequestedTimeStep = olSource.isImageLoadingForTimestep(closestValue);
|
|
6645
6810
|
// If there is no image available for requested timestep, return true and flag that this thing is not ready yet.
|
|
6646
6811
|
if (hasImageAvailableForRequestedTimeStep) {
|
|
6647
6812
|
return {
|
|
6648
6813
|
status: true
|
|
6649
6814
|
};
|
|
6650
6815
|
}
|
|
6651
|
-
olSource.
|
|
6816
|
+
olSource.setImageForTimeValue(closestValue);
|
|
6652
6817
|
return {
|
|
6653
6818
|
status: false
|
|
6654
6819
|
};
|
|
@@ -6684,7 +6849,9 @@ var olMetronomeHandler = function olMetronomeHandler(timerIds, listenerApi) {
|
|
|
6684
6849
|
// When there are no targets, default to one
|
|
6685
6850
|
targets.push({
|
|
6686
6851
|
targetId: timerId,
|
|
6687
|
-
value:
|
|
6852
|
+
value: {
|
|
6853
|
+
currentTime: ''
|
|
6854
|
+
}
|
|
6688
6855
|
});
|
|
6689
6856
|
}
|
|
6690
6857
|
var timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
|
|
@@ -6703,7 +6870,9 @@ var olMetronomeHandler = function olMetronomeHandler(timerIds, listenerApi) {
|
|
|
6703
6870
|
var updatedValue = animationListValues[timerStep];
|
|
6704
6871
|
targetsWithUpdateValue.push.apply(targetsWithUpdateValue, _toConsumableArray(targets.map(function (target) {
|
|
6705
6872
|
return _objectSpread2(_objectSpread2({}, target), {}, {
|
|
6706
|
-
value:
|
|
6873
|
+
value: {
|
|
6874
|
+
currentTime: updatedValue
|
|
6875
|
+
}
|
|
6707
6876
|
});
|
|
6708
6877
|
})));
|
|
6709
6878
|
var speedDelay = getMapAnimationDelay(listenerApi.getState(), timerId);
|
|
@@ -6741,7 +6910,8 @@ mapListener.startListening({
|
|
|
6741
6910
|
var payload = _ref.payload;
|
|
6742
6911
|
var mapId = payload.mapId;
|
|
6743
6912
|
var layers = getMapLayersWithoutDimensionCurrentValue(listenerApi.getState(), mapId);
|
|
6744
|
-
|
|
6913
|
+
var isAnimating$1 = isAnimating(listenerApi.getState(), mapId);
|
|
6914
|
+
if (!layers.length && isAnimating$1) {
|
|
6745
6915
|
listenerApi.dispatch(mapActions.mapStopAnimation({
|
|
6746
6916
|
mapId: mapId
|
|
6747
6917
|
}));
|
|
@@ -6798,7 +6968,9 @@ mapListener.startListening({
|
|
|
6798
6968
|
return listenerApi.dispatch(setTime({
|
|
6799
6969
|
origin: LayerActionOrigin.updateLayerInformationListener,
|
|
6800
6970
|
sourceId: syncedMapId,
|
|
6801
|
-
value:
|
|
6971
|
+
value: {
|
|
6972
|
+
currentTime: incomingMaxTime
|
|
6973
|
+
}
|
|
6802
6974
|
}));
|
|
6803
6975
|
});
|
|
6804
6976
|
}
|
|
@@ -6880,7 +7052,9 @@ mapListener.startListening({
|
|
|
6880
7052
|
return listenerApi.dispatch(setTime({
|
|
6881
7053
|
origin: LayerActionOrigin.toggleAutoUpdateListener,
|
|
6882
7054
|
sourceId: syncedMapId,
|
|
6883
|
-
value:
|
|
7055
|
+
value: {
|
|
7056
|
+
currentTime: timeDimension.maxValue
|
|
7057
|
+
}
|
|
6884
7058
|
}));
|
|
6885
7059
|
});
|
|
6886
7060
|
}
|
|
@@ -6994,7 +7168,7 @@ mapListener.startListening({
|
|
|
6994
7168
|
actionCreator: mapActions.setMapPreset,
|
|
6995
7169
|
effect: function () {
|
|
6996
7170
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref6, listenerApi) {
|
|
6997
|
-
var payload, mapId, initialProps, mapPreset, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, shouldShowDataExplorer, dockedLayerManagerSize, timeSliderSpan, toggleTimeSpanAuto, _filterLayers, mapLayers, baseLayers, overLayers, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, checkIsprojectionSupported, animationLength, animationEndTime, shouldEndtimeOverride, interval, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, duration, _animationEnd, animationStart, shouldOpenLegend, legendId, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart;
|
|
7171
|
+
var payload, mapId, initialProps, mapPreset, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, shouldShowDataExplorer, dockedLayerManagerSize, timeSliderSpan, toggleTimeSpanAuto, defaultOverlayer, _filterLayers, mapLayers, baseLayers, overLayers, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, _overlayersFromStore$, overlayersFromStore, foundOverlayerId, checkIsprojectionSupported, animationLength, animationEndTime, shouldEndtimeOverride, interval, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, duration, _animationEnd, animationStart, shouldOpenLegend, legendId, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart;
|
|
6998
7172
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6999
7173
|
while (1) switch (_context2.prev = _context2.next) {
|
|
7000
7174
|
case 0:
|
|
@@ -7003,10 +7177,10 @@ mapListener.startListening({
|
|
|
7003
7177
|
mapId = payload.mapId, initialProps = payload.initialProps;
|
|
7004
7178
|
mapPreset = initialProps.mapPreset;
|
|
7005
7179
|
if (!mapPreset) {
|
|
7006
|
-
_context2.next =
|
|
7180
|
+
_context2.next = 52;
|
|
7007
7181
|
break;
|
|
7008
7182
|
}
|
|
7009
|
-
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, shouldShowDataExplorer = mapPreset.shouldShowDataExplorer, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto;
|
|
7183
|
+
layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, shouldShowDataExplorer = mapPreset.shouldShowDataExplorer, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto, defaultOverlayer = mapPreset.defaultOverlayer;
|
|
7010
7184
|
_filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
|
|
7011
7185
|
if (layers) {
|
|
7012
7186
|
// make sure all layers have a unique id before going forward
|
|
@@ -7053,24 +7227,35 @@ mapListener.startListening({
|
|
|
7053
7227
|
});
|
|
7054
7228
|
});
|
|
7055
7229
|
handleBaseLayers(mapId, allBaseLayers, listenerApi);
|
|
7230
|
+
if (defaultOverlayer) {
|
|
7231
|
+
overlayersFromStore = getOverlayersForMapId(listenerApi.getState(), mapId);
|
|
7232
|
+
foundOverlayerId = ((_overlayersFromStore$ = overlayersFromStore.find(function (overlayer) {
|
|
7233
|
+
return overlayer.name === defaultOverlayer;
|
|
7234
|
+
})) === null || _overlayersFromStore$ === void 0 ? void 0 : _overlayersFromStore$.id) || 'none';
|
|
7235
|
+
listenerApi.dispatch(mapActions.changeOverlayer({
|
|
7236
|
+
mapId: mapId,
|
|
7237
|
+
selectedOverlayer: foundOverlayerId,
|
|
7238
|
+
origin: 'mapListener'
|
|
7239
|
+
}));
|
|
7240
|
+
}
|
|
7056
7241
|
if (!proj) {
|
|
7057
|
-
_context2.next =
|
|
7242
|
+
_context2.next = 21;
|
|
7058
7243
|
break;
|
|
7059
7244
|
}
|
|
7060
7245
|
checkIsprojectionSupported = isProjectionSupported(proj.srs);
|
|
7061
7246
|
if (checkIsprojectionSupported) {
|
|
7062
|
-
_context2.next =
|
|
7247
|
+
_context2.next = 20;
|
|
7063
7248
|
break;
|
|
7064
7249
|
}
|
|
7065
7250
|
throw new Error("Projection ".concat(proj.srs, " is not supported"));
|
|
7066
|
-
case
|
|
7251
|
+
case 20:
|
|
7067
7252
|
// set bbox
|
|
7068
7253
|
listenerApi.dispatch(mapActions.setBbox({
|
|
7069
7254
|
mapId: mapId,
|
|
7070
7255
|
bbox: proj.bbox,
|
|
7071
7256
|
srs: proj.srs
|
|
7072
7257
|
}));
|
|
7073
|
-
case
|
|
7258
|
+
case 21:
|
|
7074
7259
|
animationLength = animationPayload && animationPayload.duration;
|
|
7075
7260
|
animationEndTime = animationPayload && animationPayload.endTime && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
|
|
7076
7261
|
shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
|
|
@@ -7146,7 +7331,9 @@ mapListener.startListening({
|
|
|
7146
7331
|
listenerApi.dispatch(genericActions.setTime({
|
|
7147
7332
|
origin: '',
|
|
7148
7333
|
sourceId: mapId,
|
|
7149
|
-
value:
|
|
7334
|
+
value: {
|
|
7335
|
+
currentTime: startTime
|
|
7336
|
+
}
|
|
7150
7337
|
}));
|
|
7151
7338
|
centerTimeInSeconds = new Date(handleDateUtilsISOString(endTime)).getTime();
|
|
7152
7339
|
listenerApi.dispatch(mapActions.setTimeSliderCenterTime({
|
|
@@ -7167,7 +7354,9 @@ mapListener.startListening({
|
|
|
7167
7354
|
listenerApi.dispatch(genericActions.setTime({
|
|
7168
7355
|
origin: '',
|
|
7169
7356
|
sourceId: mapId,
|
|
7170
|
-
value:
|
|
7357
|
+
value: {
|
|
7358
|
+
currentTime: _startTime
|
|
7359
|
+
}
|
|
7171
7360
|
}));
|
|
7172
7361
|
}
|
|
7173
7362
|
// sets animationDelay by speed of animationPayload
|
|
@@ -7228,15 +7417,15 @@ mapListener.startListening({
|
|
|
7228
7417
|
dockedLayerManagerSize: dockedLayerManagerSize
|
|
7229
7418
|
}));
|
|
7230
7419
|
}
|
|
7231
|
-
case
|
|
7420
|
+
case 42:
|
|
7232
7421
|
if (!(animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate)))) {
|
|
7233
|
-
_context2.next =
|
|
7422
|
+
_context2.next = 52;
|
|
7234
7423
|
break;
|
|
7235
7424
|
}
|
|
7236
7425
|
fiveMinuteDelayForAnimation = 1000 * 60 * 5; // eslint-disable-next-line no-await-in-loop
|
|
7237
|
-
_context2.next =
|
|
7426
|
+
_context2.next = 46;
|
|
7238
7427
|
return listenerApi.delay(fiveMinuteDelayForAnimation);
|
|
7239
|
-
case
|
|
7428
|
+
case 46:
|
|
7240
7429
|
_animationEnd2 = getAnimationEndTime(listenerApi.getState(), mapId);
|
|
7241
7430
|
listenerApi.dispatch(mapActions.setAnimationEndTime({
|
|
7242
7431
|
mapId: mapId,
|
|
@@ -7251,13 +7440,13 @@ mapListener.startListening({
|
|
|
7251
7440
|
minutes: 5
|
|
7252
7441
|
}).toISOString()
|
|
7253
7442
|
}));
|
|
7254
|
-
_context2.next =
|
|
7443
|
+
_context2.next = 42;
|
|
7255
7444
|
break;
|
|
7256
|
-
case
|
|
7257
|
-
_context2.next =
|
|
7445
|
+
case 52:
|
|
7446
|
+
_context2.next = 57;
|
|
7258
7447
|
break;
|
|
7259
|
-
case
|
|
7260
|
-
_context2.prev =
|
|
7448
|
+
case 54:
|
|
7449
|
+
_context2.prev = 54;
|
|
7261
7450
|
_context2.t0 = _context2["catch"](1);
|
|
7262
7451
|
if (_context2.t0 instanceof Error) {
|
|
7263
7452
|
listenerApi.dispatch(mapActions.setMapPresetError({
|
|
@@ -7265,11 +7454,11 @@ mapListener.startListening({
|
|
|
7265
7454
|
error: _context2.t0.message
|
|
7266
7455
|
}));
|
|
7267
7456
|
}
|
|
7268
|
-
case
|
|
7457
|
+
case 57:
|
|
7269
7458
|
case "end":
|
|
7270
7459
|
return _context2.stop();
|
|
7271
7460
|
}
|
|
7272
|
-
}, _callee2, null, [[1,
|
|
7461
|
+
}, _callee2, null, [[1, 54]]);
|
|
7273
7462
|
}));
|
|
7274
7463
|
function effect(_x3, _x4) {
|
|
7275
7464
|
return _effect2.apply(this, arguments);
|
|
@@ -7332,7 +7521,9 @@ mapListener.startListening({
|
|
|
7332
7521
|
listenerApi.dispatch(genericActions.setTime({
|
|
7333
7522
|
origin: '',
|
|
7334
7523
|
sourceId: mapId,
|
|
7335
|
-
value:
|
|
7524
|
+
value: {
|
|
7525
|
+
currentTime: handleDateUtilsISOString(selectedTimeString)
|
|
7526
|
+
}
|
|
7336
7527
|
}));
|
|
7337
7528
|
}
|
|
7338
7529
|
}
|
|
@@ -8721,8 +8912,9 @@ var SupportedComponentTypes;
|
|
|
8721
8912
|
(function (SupportedComponentTypes) {
|
|
8722
8913
|
SupportedComponentTypes["WarningList"] = "WarningList";
|
|
8723
8914
|
SupportedComponentTypes["TimeSeries"] = "TimeSeries";
|
|
8915
|
+
SupportedComponentTypes["Soundings"] = "Soundings";
|
|
8724
8916
|
})(SupportedComponentTypes || (SupportedComponentTypes = {}));
|
|
8725
|
-
var supportedComponentTypesForLinking = [SupportedComponentTypes.WarningList, SupportedComponentTypes.TimeSeries];
|
|
8917
|
+
var supportedComponentTypesForLinking = [SupportedComponentTypes.WarningList, SupportedComponentTypes.TimeSeries, SupportedComponentTypes.Soundings];
|
|
8726
8918
|
|
|
8727
8919
|
var constants = /*#__PURE__*/Object.freeze({
|
|
8728
8920
|
__proto__: null,
|