@opengeoweb/core 7.0.0 → 8.1.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 +270 -1278
- package/package.json +14 -13
- package/src/lib/components/ConfigurableMap/ConfigurableMapConnect.d.ts +1 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeSliderMenu/TimeSliderMenu.d.ts +1 -0
- package/src/lib/components/TimeSlider/TimeSliderCurrentTimeBox/TimeSliderCurrentTimeBoxConnect.d.ts +4 -8
- package/src/lib/components/TimeSlider/changeTimeFunctions.d.ts +14 -0
- package/src/lib/components/TimeSlider/timeSliderUtils.d.ts +1 -34
- package/src/lib/components/TimeSliderLite/TimeSliderLite.d.ts +3 -0
- package/src/lib/components/TimeSliderLite/TimeSliderLiteConnect.d.ts +6 -6
- package/src/lib/components/TimeSliderLite/TimeSliderLiteOptionsMenu/TimeSliderLiteOptionsMenu.d.ts +1 -1
- package/src/lib/components/TimeSliderLite/index.d.ts +1 -1
- package/src/lib/components/TimeSliderLite/timeSliderLiteUtils.d.ts +1 -1
- package/src/lib/index.d.ts +1 -3
- package/src/lib/utils/defaultTestSettings.d.ts +3 -19
- package/src/lib/components/MapDraw/DrawingTool/DrawingTool.stories.d.ts +0 -25
- package/src/lib/components/MapDraw/DrawingTool/DrawingToolConnect.d.ts +0 -14
- package/src/lib/components/MapDraw/DrawingTool/DrawingToolConnect.stories.d.ts +0 -25
- package/src/lib/components/MapDraw/DrawingTool/DrawingToolDialog.d.ts +0 -32
- package/src/lib/components/MapDraw/DrawingTool/DrawingToolMapButtonConnect.d.ts +0 -8
- package/src/lib/components/MapDraw/DrawingTool/DrawingToolMapButtonConnect.spec.d.ts +0 -1
- package/src/lib/components/MapDraw/DrawingTool/index.d.ts +0 -3
- package/src/lib/components/MapDraw/DrawingTool/useAreaDrawDialogAction.d.ts +0 -10
- package/src/lib/components/MapDraw/DrawingTool/useAreaDrawDialogAction.spec.d.ts +0 -1
- package/src/lib/components/MapDraw/DrawingToolForm/DrawingToolForm.d.ts +0 -23
- package/src/lib/components/MapDraw/DrawingToolForm/DrawingToolForm.spec.d.ts +0 -1
- package/src/lib/components/MapDraw/DrawingToolForm/DrawingToolFormConnect.d.ts +0 -4
- package/src/lib/components/MapDraw/DrawingToolForm/DrawingToolFormConnect.spec.d.ts +0 -1
- package/src/lib/components/MapDraw/DrawingToolForm/index.d.ts +0 -2
- package/src/lib/components/MapDraw/MapDraw.stories.d.ts +0 -33
- package/src/lib/components/MapDraw/MapDrawContext.d.ts +0 -11
- package/src/lib/components/MapDraw/MapDrawContext.spec.d.ts +0 -1
- package/src/lib/components/MapDraw/MapDrawContext.stories.d.ts +0 -6
- package/src/lib/components/MapDraw/MapDrawTool.stories.d.ts +0 -12
- package/src/lib/components/MapDraw/MapDrawToolDoubleControls.stories.d.ts +0 -6
- package/src/lib/components/MapDraw/MapDrawToolIntersection.stories.d.ts +0 -11
- package/src/lib/components/MapDraw/index.d.ts +0 -4
- package/src/lib/components/MapDraw/storyComponents/EditModeButton.d.ts +0 -8
- package/src/lib/components/MapDraw/storyComponents/FeatureInfo.d.ts +0 -3
- package/src/lib/components/MapDraw/storyComponents/FeatureInfoHTML.d.ts +0 -3
- package/src/lib/components/MapDraw/storyComponents/FeatureLayers.d.ts +0 -8
- package/src/lib/components/MapDraw/storyComponents/GeoJSONTextField.d.ts +0 -11
- package/src/lib/components/MapDraw/storyComponents/IntersectionSelect.d.ts +0 -11
- package/src/lib/components/MapDraw/storyComponents/MapDrawGeoJSON.d.ts +0 -51
- package/src/lib/components/MapDraw/storyComponents/StoryLayout.d.ts +0 -9
- package/src/lib/components/MapDraw/storyComponents/Synops.d.ts +0 -3
- package/src/lib/components/MapDraw/storyComponents/ToolButton.d.ts +0 -9
- package/src/lib/components/MapDraw/useMapDrawTool.d.ts +0 -105
- package/src/lib/components/MapDraw/useMapDrawTool.spec.d.ts +0 -1
- package/src/lib/components/MapWarning/MapWarningProperties.d.ts +0 -23
- package/src/lib/components/MapWarning/MapWarningProperties.spec.d.ts +0 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/BackwardForwardStepButton/BackwardForwardStepButtonConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/NowButton/NowButtonConnect.spec.d.ts +0 -1
- package/src/lib/components/TimeSlider/TimeSliderButtons/TimeSliderButtonsConnect.spec.d.ts +0 -1
- /package/src/lib/components/{MapDraw → MapDrawToolRedux}/MapDrawToolRedux.stories.d.ts +0 -0
- /package/src/lib/components/{MapDraw/DrawingTool/DrawingToolConnect.spec.d.ts → TimeSlider/TimeSliderButtons/TimeSliderButtonsConnect.integration.spec.d.ts} +0 -0
- /package/src/lib/components/{MapDraw/DrawingTool/DrawingToolDialog.spec.d.ts → TimeSlider/changeTimeFunctions.spec.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -2,18 +2,18 @@ import * as React from 'react';
|
|
|
2
2
|
import React__default, { forwardRef, useContext, useCallback, useEffect, createElement, PureComponent, useState, useRef, useLayoutEffect } from 'react';
|
|
3
3
|
import { Grid, Box as Box$2, MenuItem, Typography, useTheme as useTheme$2, Button, Popper, ListItemText, ListItemIcon, FormControl, InputLabel, Paper, List, ListItemButton, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, LinearProgress, Backdrop, ListItem, ListItemSecondaryAction, Checkbox, Switch, styled as styled$1, Slider, Menu, Card, IconButton, Select, CardContent, RadioGroup, FormControlLabel, Radio, ToggleButtonGroup, ToggleButton, Divider, Tooltip, ButtonGroup, Snackbar } from '@mui/material';
|
|
4
4
|
import { CustomIconButton, TooltipSelect, AlertIcon, useControlledTooltip, CustomTooltip, tooltipContainerStyles, sliderHeaderStyle, CustomSlider, ToggleMenu, AlertBanner, CustomAccordion, ToolContainerDraggable, calculateDialogSizeAndPosition, CustomToggleButton, SearchHighlight, dateUtils, useMakeSureContainerStaysInsideWindow, withEggs } from '@opengeoweb/shared';
|
|
5
|
-
import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit, Close, Layers, Equalizer, Link, LinkOff, AutoUpdateInActive, Speed, Clock, Now, Animation, Options, Pause, Play, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain,
|
|
5
|
+
import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, Filter, Search, Clear, Info, DimensionsOther, DimensionsElevation, DimensionsRefTime, DimensionsTime, Edit, Close, Layers, Equalizer, Link, LinkOff, AutoUpdateInActive, Speed, Clock, Now, Animation, Options, Pause, Play, StepForward, StepBackward, dragHandlePath, ChevronDown, ChevronUp, List as List$1, ChevronRight, ChevronLeft, Resize, ExitDomain, ThemeWrapper, lightTheme } from '@opengeoweb/theme';
|
|
6
6
|
import { useDispatch, useSelector, connect, Provider } from 'react-redux';
|
|
7
|
-
import { uiTypes, uiSelectors, uiActions, layerTypes, layerUtils, layerActions, layerSelectors, serviceSelectors, serviceActions, mapSelectors, mapActions, mapEnums, mapConstants, filterLayers, getUserAddedServices, layerSelectSelectors, layerSelectActions, storeUtils, snackbarActions, layerSelectTypes, mapUtils, genericActions, syncConstants,
|
|
7
|
+
import { uiTypes, uiSelectors, uiActions, layerTypes, layerUtils, layerActions, layerSelectors, serviceSelectors, serviceActions, mapSelectors, mapActions, mapEnums, mapConstants, filterLayers, getUserAddedServices, layerSelectSelectors, layerSelectActions, storeUtils, snackbarActions, layerSelectTypes, mapUtils, genericActions, syncConstants, defaultLayers, mapStoreActions, getSingularDrawtoolDrawLayerId, syncGroupsSelectors, syncGroupsSelector, snackbarModuleConfig, snackbarSelectors, coreModuleConfig, routerUtils, routerModuleConfig, appModuleConfig, appActions } from '@opengeoweb/store';
|
|
8
8
|
import { ReactSortable } from 'react-sortablejs';
|
|
9
9
|
import { webmapUtils, WMGetServiceFromStore, getCapabilities, LayerType, clearImageCache, WMLayer } from '@opengeoweb/webmap';
|
|
10
10
|
import { jsx } from 'react/jsx-runtime';
|
|
11
|
-
import _, { isEqual as isEqual$1, debounce, groupBy, throttle as throttle$1,
|
|
11
|
+
import _, { isEqual as isEqual$1, debounce, groupBy, throttle as throttle$1, range } from 'lodash';
|
|
12
12
|
import Box$3 from '@mui/material/Box';
|
|
13
13
|
import Typography$1 from '@mui/material/Typography';
|
|
14
14
|
import Grid$1 from '@mui/material/Grid';
|
|
15
|
-
import { LegendLayout, MapControlButton, ZoomControls, CanvasComponent, MapView, MapViewLayer, LegendDialog,
|
|
16
|
-
import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField
|
|
15
|
+
import { LegendLayout, MapControlButton, ZoomControls, CanvasComponent, MapView, MapViewLayer, LegendDialog, emptyGeoJSON, MapControls, publicLayers } from '@opengeoweb/webmap-react';
|
|
16
|
+
import { ReactHookFormProvider, defaultFormOptions, ReactHookFormTextField } from '@opengeoweb/form-fields';
|
|
17
17
|
import moment from 'moment';
|
|
18
18
|
import Draggable from 'react-draggable';
|
|
19
19
|
import { flushSync } from 'react-dom';
|
|
@@ -5516,28 +5516,23 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
|
|
|
5516
5516
|
tooltipTitle = _ref.tooltipTitle,
|
|
5517
5517
|
icon = _ref.icon;
|
|
5518
5518
|
var dispatch = useDispatch();
|
|
5519
|
-
var
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
var mapId = _ref2.mapId,
|
|
5524
|
-
layerId = _ref2.layerId,
|
|
5525
|
-
layer = _ref2.layer;
|
|
5526
|
-
return dispatch(layerActions.addLayer({
|
|
5519
|
+
var duplicateLayer = React.useCallback(function (_ref2) {
|
|
5520
|
+
var newLayerId = _ref2.newLayerId,
|
|
5521
|
+
mapId = _ref2.mapId;
|
|
5522
|
+
return dispatch(layerActions.duplicateMapLayer({
|
|
5527
5523
|
mapId: mapId,
|
|
5528
|
-
|
|
5529
|
-
|
|
5524
|
+
oldLayerId: layerId,
|
|
5525
|
+
newLayerId: newLayerId,
|
|
5530
5526
|
origin: layerTypes.LayerActionOrigin.layerManager
|
|
5531
5527
|
}));
|
|
5532
|
-
}, [dispatch]);
|
|
5528
|
+
}, [dispatch, layerId]);
|
|
5533
5529
|
return /*#__PURE__*/React.createElement(LayerManagerMenuButton, {
|
|
5534
5530
|
layerId: layerId,
|
|
5535
5531
|
mapId: mapId,
|
|
5536
5532
|
onLayerDuplicate: function onLayerDuplicate() {
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
mapId: mapId
|
|
5540
|
-
layer: layer
|
|
5533
|
+
duplicateLayer({
|
|
5534
|
+
newLayerId: webmapUtils.generateLayerId(),
|
|
5535
|
+
mapId: mapId
|
|
5541
5536
|
});
|
|
5542
5537
|
},
|
|
5543
5538
|
tooltipTitle: tooltipTitle,
|
|
@@ -8971,7 +8966,7 @@ tags.forEach(function (tagName) {
|
|
|
8971
8966
|
});
|
|
8972
8967
|
|
|
8973
8968
|
/**
|
|
8974
|
-
* @mui/styled-engine v5.14.
|
|
8969
|
+
* @mui/styled-engine v5.14.10
|
|
8975
8970
|
*
|
|
8976
8971
|
* @license MIT
|
|
8977
8972
|
* This source code is licensed under the MIT license found in the
|
|
@@ -10384,10 +10379,10 @@ var ActivateLayerConnect = function ActivateLayerConnect(_ref) {
|
|
|
10384
10379
|
}
|
|
10385
10380
|
}
|
|
10386
10381
|
var current = getCurrentOptionForLayer(thisLayerHasBoth, thisLayerHasAutoTimestep, thisLayerHasAutoUpdate);
|
|
10387
|
-
var
|
|
10388
|
-
return layerSelectors.
|
|
10382
|
+
var layerHasTimeDimension = useSelector(function (store) {
|
|
10383
|
+
return layerSelectors.getLayerHasTimeDimension(store, layerId);
|
|
10389
10384
|
});
|
|
10390
|
-
if (!
|
|
10385
|
+
if (!layerHasTimeDimension) {
|
|
10391
10386
|
return /*#__PURE__*/React.createElement(CustomTooltip, {
|
|
10392
10387
|
title: "Layer has no time dimension",
|
|
10393
10388
|
placement: "top"
|
|
@@ -10461,10 +10456,10 @@ var AcceptanceTimeConnect = function AcceptanceTimeConnect(_ref) {
|
|
|
10461
10456
|
acceptanceTime: acceptanceTime
|
|
10462
10457
|
}));
|
|
10463
10458
|
};
|
|
10464
|
-
var
|
|
10465
|
-
return layerSelectors.
|
|
10459
|
+
var layerHasTimeDimension = useSelector(function (store) {
|
|
10460
|
+
return layerSelectors.getLayerHasTimeDimension(store, layerId);
|
|
10466
10461
|
});
|
|
10467
|
-
if (!
|
|
10462
|
+
if (!layerHasTimeDimension) {
|
|
10468
10463
|
return /*#__PURE__*/React__default.createElement(CustomTooltip, {
|
|
10469
10464
|
title: "Layer has no time dimension",
|
|
10470
10465
|
placement: "top"
|
|
@@ -11856,7 +11851,7 @@ var styles$6 = {
|
|
|
11856
11851
|
boxSizing: 'border-box'
|
|
11857
11852
|
}
|
|
11858
11853
|
};
|
|
11859
|
-
var calculateStartSize
|
|
11854
|
+
var calculateStartSize = function calculateStartSize(minSize, prefSize, startPosition) {
|
|
11860
11855
|
var _calculateDialogSizeA = calculateDialogSizeAndPosition(),
|
|
11861
11856
|
calcWidth = _calculateDialogSizeA.width,
|
|
11862
11857
|
calcHeight = _calculateDialogSizeA.height;
|
|
@@ -11907,7 +11902,7 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
11907
11902
|
width: 100,
|
|
11908
11903
|
height: 126
|
|
11909
11904
|
};
|
|
11910
|
-
var startSizeCalc = calculateStartSize
|
|
11905
|
+
var startSizeCalc = calculateStartSize(minSize, size, startPosition);
|
|
11911
11906
|
var _React$useState = React.useState(startSizeCalc),
|
|
11912
11907
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
11913
11908
|
sizeInState = _React$useState2[0],
|
|
@@ -12169,7 +12164,7 @@ var mergePresetsAndUserAddedServices = function mergePresetsAndUserAddedServices
|
|
|
12169
12164
|
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
12170
12165
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12171
12166
|
* */
|
|
12172
|
-
var getDialogType
|
|
12167
|
+
var getDialogType = function getDialogType(mapId, isMultiMap, isDocked) {
|
|
12173
12168
|
if (isDocked) {
|
|
12174
12169
|
return "".concat(uiTypes.DialogTypes.DockedLayerManager, "-").concat(mapId);
|
|
12175
12170
|
}
|
|
@@ -12209,7 +12204,7 @@ var LayerManagerConnect = function LayerManagerConnect(_ref) {
|
|
|
12209
12204
|
_ref$source = _ref.source,
|
|
12210
12205
|
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
12211
12206
|
var dispatch = useDispatch();
|
|
12212
|
-
var dialogType = getDialogType
|
|
12207
|
+
var dialogType = getDialogType(initialMapId, isMultiMap, isDocked);
|
|
12213
12208
|
var activeMapId = useSelector(function (store) {
|
|
12214
12209
|
return uiSelectors.getDialogMapId(store, dialogType);
|
|
12215
12210
|
});
|
|
@@ -16571,11 +16566,6 @@ var AutoUpdateButton = function AutoUpdateButton(_ref) {
|
|
|
16571
16566
|
var millisecondsInSecond = 1000;
|
|
16572
16567
|
var speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
|
|
16573
16568
|
|
|
16574
|
-
var getSelectedTime = function getSelectedTime(timeDimension) {
|
|
16575
|
-
var currentValueIsValid = timeDimension && timeDimension.currentValue && dateUtils.isValid(dateUtils.utc(timeDimension.currentValue));
|
|
16576
|
-
var selectedTime = currentValueIsValid && timeDimension ? dateUtils.unix(dateUtils.utc(timeDimension.currentValue)) : dateUtils.unix(dateUtils.utc());
|
|
16577
|
-
return selectedTime;
|
|
16578
|
-
};
|
|
16579
16569
|
/**
|
|
16580
16570
|
* Returns time bounds from the given dimension. If no time dimension given, current time is returned as default
|
|
16581
16571
|
*/
|
|
@@ -16589,27 +16579,11 @@ var getTimeBounds = function getTimeBounds(dimensions) {
|
|
|
16589
16579
|
});
|
|
16590
16580
|
var startTime = timeDimension && timeDimension.minValue ? dateUtils.unix(dateUtils.utc(timeDimension.minValue)) : defaultStartEnd;
|
|
16591
16581
|
var endTime = timeDimension && timeDimension.maxValue ? dateUtils.unix(dateUtils.utc(timeDimension.maxValue)) : defaultStartEnd;
|
|
16592
|
-
var selectedTime = getSelectedTime(timeDimension);
|
|
16593
16582
|
return {
|
|
16594
|
-
selectedTime: selectedTime,
|
|
16595
16583
|
startTime: startTime,
|
|
16596
16584
|
endTime: endTime
|
|
16597
16585
|
};
|
|
16598
16586
|
};
|
|
16599
|
-
/**
|
|
16600
|
-
* Returns time bounds as *Moment* time instances from the given dimension. If no time dimension given, current time is returned as default
|
|
16601
|
-
*/
|
|
16602
|
-
var getMomentTimeBounds = function getMomentTimeBounds(dimensions) {
|
|
16603
|
-
var _getTimeBounds = getTimeBounds(dimensions),
|
|
16604
|
-
selectedTime = _getTimeBounds.selectedTime,
|
|
16605
|
-
startTime = _getTimeBounds.startTime,
|
|
16606
|
-
endTime = _getTimeBounds.endTime;
|
|
16607
|
-
return {
|
|
16608
|
-
selectedTime: moment.unix(selectedTime),
|
|
16609
|
-
startTime: moment.unix(startTime),
|
|
16610
|
-
endTime: moment.unix(endTime)
|
|
16611
|
-
};
|
|
16612
|
-
};
|
|
16613
16587
|
var scalingCoefficient = function scalingCoefficient(end, start, width) {
|
|
16614
16588
|
return width / (end - start);
|
|
16615
16589
|
};
|
|
@@ -16622,88 +16596,6 @@ var timestampToPixel = function timestampToPixel(timestamp, centerTime, widthPx,
|
|
|
16622
16596
|
var pixelToTimestamp = function pixelToTimestamp(timePx, centerTime, widthPx, secondsPerPx) {
|
|
16623
16597
|
return centerTime - (widthPx / 2 - timePx) * secondsPerPx;
|
|
16624
16598
|
};
|
|
16625
|
-
var onsetNewDateDebounced = function onsetNewDateDebounced(dateToSet, onSetNewDate) {
|
|
16626
|
-
debounce(function () {
|
|
16627
|
-
onSetNewDate(dateToSet);
|
|
16628
|
-
}, 10, {
|
|
16629
|
-
leading: true
|
|
16630
|
-
})();
|
|
16631
|
-
};
|
|
16632
|
-
var setNewRoundedTime = function setNewRoundedTime(x, centerTime, width, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate) {
|
|
16633
|
-
var unixTime = pixelToTimestamp(x, centerTime, width, secondsPerPx);
|
|
16634
|
-
var roundedTime = mapUtils.roundWithTimeStep(unixTime, timeStep);
|
|
16635
|
-
var maxTime = Math.max(roundedTime, dataStartTime);
|
|
16636
|
-
var newTime = Math.min(maxTime, dataEndTime || roundedTime);
|
|
16637
|
-
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
16638
|
-
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
16639
|
-
};
|
|
16640
|
-
var getDataLimitsFromLayers = function getDataLimitsFromLayers(layers) {
|
|
16641
|
-
return layers.reduce(function (_ref, layer) {
|
|
16642
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
16643
|
-
start = _ref2[0],
|
|
16644
|
-
end = _ref2[1];
|
|
16645
|
-
var dimension = webmapUtils.getWMJSTimeDimensionForLayerId(layer.id);
|
|
16646
|
-
if (dimension) {
|
|
16647
|
-
var lastValue = moment(dimension.getLastValue()).unix();
|
|
16648
|
-
var firstValue = moment(dimension.getFirstValue()).unix();
|
|
16649
|
-
var newLast = lastValue > end ? lastValue : end;
|
|
16650
|
-
var newFirst = firstValue < start ? firstValue : start;
|
|
16651
|
-
return [newFirst, newLast];
|
|
16652
|
-
}
|
|
16653
|
-
return [start, end];
|
|
16654
|
-
},
|
|
16655
|
-
/* Using the maximum 32-bit value and 0 as starting points
|
|
16656
|
-
* bigger values like Number.MAX_VALUE or Number.MAX_SAFE_INTEGER
|
|
16657
|
-
* cause weird behaviour as timestamps break at 32bit limit (year 2038)
|
|
16658
|
-
*/
|
|
16659
|
-
[2147483647, 0]);
|
|
16660
|
-
};
|
|
16661
|
-
var setPreviousTimeStep = function setPreviousTimeStep(timeStep, currentTime, dataStartTime, onSetNewDate) {
|
|
16662
|
-
var nextTime = currentTime - timeStep;
|
|
16663
|
-
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
16664
|
-
var newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
16665
|
-
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
16666
|
-
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
16667
|
-
};
|
|
16668
|
-
var setNextTimeStep = function setNextTimeStep(timeStep, currentTime, dataEndTime, onSetNewDate) {
|
|
16669
|
-
var nextTime = currentTime + timeStep;
|
|
16670
|
-
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
16671
|
-
var newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
16672
|
-
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
16673
|
-
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
16674
|
-
};
|
|
16675
|
-
/**
|
|
16676
|
-
* updates unfiltered selected time and moves selected time a given distance
|
|
16677
|
-
* in pixels. Unfiltered selected time can be outside data data limits, but
|
|
16678
|
-
* selected time cannot.
|
|
16679
|
-
*/
|
|
16680
|
-
var moveSelectedTimePx = function moveSelectedTimePx(x, canvasWidth, centerTime, dataStartTime, dataEndTime, secondsPerPx, timeStep, unfilteredSelectedTime, setUnfilteredSelectedTime, onSetNewDate) {
|
|
16681
|
-
var _map = [dataStartTime, dataEndTime, unfilteredSelectedTime].map(function (timestamp) {
|
|
16682
|
-
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
16683
|
-
}),
|
|
16684
|
-
_map2 = _slicedToArray(_map, 3),
|
|
16685
|
-
leftMarkerPx = _map2[0],
|
|
16686
|
-
rightMarkerPx = _map2[1],
|
|
16687
|
-
unfilteredSelectedTimePx = _map2[2];
|
|
16688
|
-
setUnfilteredSelectedTime(pixelToTimestamp(unfilteredSelectedTimePx + x, centerTime, canvasWidth, secondsPerPx));
|
|
16689
|
-
var clickedUnfilteredSelectedTimePx = unfilteredSelectedTimePx + x;
|
|
16690
|
-
var minClickedUnfilteredSelectedTimePx = Math.min(clickedUnfilteredSelectedTimePx, rightMarkerPx);
|
|
16691
|
-
var newUnfilteredSelectedTimePx = Math.max(minClickedUnfilteredSelectedTimePx, leftMarkerPx);
|
|
16692
|
-
setNewRoundedTime(newUnfilteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
|
|
16693
|
-
};
|
|
16694
|
-
/**
|
|
16695
|
-
* This function gets the length in seconds of the data layers
|
|
16696
|
-
* @param layers
|
|
16697
|
-
* @returns dataSpanSeconds,
|
|
16698
|
-
*/
|
|
16699
|
-
var getDataSpanSeconds = function getDataSpanSeconds(layers) {
|
|
16700
|
-
var _getDataLimitsFromLay = getDataLimitsFromLayers(layers),
|
|
16701
|
-
_getDataLimitsFromLay2 = _slicedToArray(_getDataLimitsFromLay, 2),
|
|
16702
|
-
dataStartTime = _getDataLimitsFromLay2[0],
|
|
16703
|
-
dataEndTime = _getDataLimitsFromLay2[1];
|
|
16704
|
-
var dataRegionInSeconds = dataEndTime - dataStartTime;
|
|
16705
|
-
return Math.floor(dataRegionInSeconds);
|
|
16706
|
-
};
|
|
16707
16599
|
/**
|
|
16708
16600
|
* This function creates and returns an array where there is secondsPerPx
|
|
16709
16601
|
* number of the data set added for a data scale (secondsPerPx)
|
|
@@ -16776,24 +16668,6 @@ var AUTO_MOVE_AREA_PADDING = 1;
|
|
|
16776
16668
|
var getAutoMoveAreaWidth = function getAutoMoveAreaWidth(scale) {
|
|
16777
16669
|
return (scale === mapEnums.Scale.Year ? timeBoxGeom.largeWidth + timeBoxGeom.iconWidth : timeBoxGeom.smallWidth + timeBoxGeom.iconWidth) / 2 + AUTO_MOVE_AREA_PADDING;
|
|
16778
16670
|
};
|
|
16779
|
-
/** Reusable business logic for how to handle events that set time to now (closest).
|
|
16780
|
-
* Used in NowButton and TimeSliderLegend.
|
|
16781
|
-
*/
|
|
16782
|
-
var handleSetNowEvent = function handleSetNowEvent(timeStep, dataStartTime, dataEndTime, currentTime, onSetNewDate, onSetCenterTime) {
|
|
16783
|
-
if (dataStartTime < dataEndTime) {
|
|
16784
|
-
if (dataEndTime < currentTime) {
|
|
16785
|
-
onSetNewDate(moment.utc(dataEndTime * millisecondsInSecond).toISOString());
|
|
16786
|
-
onSetCenterTime(dataEndTime);
|
|
16787
|
-
} else if (dataStartTime > currentTime) {
|
|
16788
|
-
onSetNewDate(moment.utc(dataStartTime * millisecondsInSecond).toISOString());
|
|
16789
|
-
onSetCenterTime(dataStartTime);
|
|
16790
|
-
} else {
|
|
16791
|
-
var closestToCurrent = mapUtils.roundWithTimeStep(currentTime, timeStep);
|
|
16792
|
-
onSetNewDate(moment.utc(closestToCurrent * millisecondsInSecond).toISOString());
|
|
16793
|
-
onSetCenterTime(closestToCurrent);
|
|
16794
|
-
}
|
|
16795
|
-
}
|
|
16796
|
-
};
|
|
16797
16671
|
var TimeInMinutes;
|
|
16798
16672
|
(function (TimeInMinutes) {
|
|
16799
16673
|
TimeInMinutes[TimeInMinutes["YEAR"] = 525600] = "YEAR";
|
|
@@ -16889,20 +16763,11 @@ var getFundamentalScale$1 = function getFundamentalScale(secondsPerPx) {
|
|
|
16889
16763
|
|
|
16890
16764
|
var timeSliderUtils = /*#__PURE__*/Object.freeze({
|
|
16891
16765
|
__proto__: null,
|
|
16892
|
-
getSelectedTime: getSelectedTime,
|
|
16893
16766
|
getTimeBounds: getTimeBounds,
|
|
16894
|
-
getMomentTimeBounds: getMomentTimeBounds,
|
|
16895
16767
|
scalingCoefficient: scalingCoefficient,
|
|
16896
16768
|
timestampToPixelEdges: timestampToPixelEdges,
|
|
16897
16769
|
timestampToPixel: timestampToPixel,
|
|
16898
16770
|
pixelToTimestamp: pixelToTimestamp,
|
|
16899
|
-
onsetNewDateDebounced: onsetNewDateDebounced,
|
|
16900
|
-
setNewRoundedTime: setNewRoundedTime,
|
|
16901
|
-
getDataLimitsFromLayers: getDataLimitsFromLayers,
|
|
16902
|
-
setPreviousTimeStep: setPreviousTimeStep,
|
|
16903
|
-
setNextTimeStep: setNextTimeStep,
|
|
16904
|
-
moveSelectedTimePx: moveSelectedTimePx,
|
|
16905
|
-
getDataSpanSeconds: getDataSpanSeconds,
|
|
16906
16771
|
secondsPerPxValues: secondsPerPxValues,
|
|
16907
16772
|
secondsPerPxFromCanvasWidth: secondsPerPxFromCanvasWidth,
|
|
16908
16773
|
getNewCenterOfFixedPointZoom: getNewCenterOfFixedPointZoom,
|
|
@@ -16911,7 +16776,6 @@ var timeSliderUtils = /*#__PURE__*/Object.freeze({
|
|
|
16911
16776
|
timeBoxGeom: timeBoxGeom,
|
|
16912
16777
|
AUTO_MOVE_AREA_PADDING: AUTO_MOVE_AREA_PADDING,
|
|
16913
16778
|
getAutoMoveAreaWidth: getAutoMoveAreaWidth,
|
|
16914
|
-
handleSetNowEvent: handleSetNowEvent,
|
|
16915
16779
|
get TimeInMinutes () { return TimeInMinutes; },
|
|
16916
16780
|
minutesToDescribedDuration: minutesToDescribedDuration,
|
|
16917
16781
|
getFundamentalScale: getFundamentalScale$1
|
|
@@ -17270,13 +17134,13 @@ var marks$1 = [{
|
|
|
17270
17134
|
value: 12 * 3600,
|
|
17271
17135
|
text: '12h'
|
|
17272
17136
|
}, {
|
|
17273
|
-
label: '
|
|
17137
|
+
label: '24 h',
|
|
17274
17138
|
value: 24 * 3600,
|
|
17275
|
-
text: '
|
|
17139
|
+
text: '24h'
|
|
17276
17140
|
}, {
|
|
17277
|
-
label: '
|
|
17141
|
+
label: '48 h',
|
|
17278
17142
|
value: 2 * 24 * 3600,
|
|
17279
|
-
text: '
|
|
17143
|
+
text: '48h'
|
|
17280
17144
|
}, {
|
|
17281
17145
|
label: 'week',
|
|
17282
17146
|
value: 7 * 24 * 3600,
|
|
@@ -18313,6 +18177,73 @@ var drawTimeSliderLegend = function drawTimeSliderLegend(context, theme, canvasW
|
|
|
18313
18177
|
drawNeedle(ctx, theme, canvasWidth, height, visibleTimeStart, visibleTimeEnd, selectedTimeUnix);
|
|
18314
18178
|
};
|
|
18315
18179
|
|
|
18180
|
+
var onsetNewDateDebounced = function onsetNewDateDebounced(dateToSet, onSetNewDate) {
|
|
18181
|
+
debounce(function () {
|
|
18182
|
+
onSetNewDate(dateToSet);
|
|
18183
|
+
}, 10, {
|
|
18184
|
+
leading: true
|
|
18185
|
+
})();
|
|
18186
|
+
};
|
|
18187
|
+
var setPreviousTimeStep = function setPreviousTimeStep(timeStep, currentTime, dataStartTime, onSetNewDate) {
|
|
18188
|
+
var nextTime = currentTime - timeStep;
|
|
18189
|
+
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'floor');
|
|
18190
|
+
var newTime = Math.max(roundedTime, dataStartTime || roundedTime);
|
|
18191
|
+
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
18192
|
+
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
18193
|
+
};
|
|
18194
|
+
var setNextTimeStep = function setNextTimeStep(timeStep, currentTime, dataEndTime, onSetNewDate) {
|
|
18195
|
+
var nextTime = currentTime + timeStep;
|
|
18196
|
+
var roundedTime = mapUtils.roundWithTimeStep(nextTime, timeStep, 'ceil');
|
|
18197
|
+
var newTime = Math.min(roundedTime, dataEndTime || roundedTime);
|
|
18198
|
+
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
18199
|
+
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
18200
|
+
};
|
|
18201
|
+
/**
|
|
18202
|
+
* updates unfiltered selected time and moves selected time a given distance
|
|
18203
|
+
* in pixels. Unfiltered selected time can be outside data data limits, but
|
|
18204
|
+
* selected time cannot.
|
|
18205
|
+
*/
|
|
18206
|
+
var moveSelectedTimePx = function moveSelectedTimePx(x, canvasWidth, centerTime, dataStartTime, dataEndTime, secondsPerPx, timeStep, unfilteredSelectedTime, setUnfilteredSelectedTime, onSetNewDate) {
|
|
18207
|
+
var _map = [dataStartTime, dataEndTime, unfilteredSelectedTime].map(function (timestamp) {
|
|
18208
|
+
return timestampToPixel(timestamp, centerTime, canvasWidth, secondsPerPx);
|
|
18209
|
+
}),
|
|
18210
|
+
_map2 = _slicedToArray(_map, 3),
|
|
18211
|
+
leftMarkerPx = _map2[0],
|
|
18212
|
+
rightMarkerPx = _map2[1],
|
|
18213
|
+
unfilteredSelectedTimePx = _map2[2];
|
|
18214
|
+
setUnfilteredSelectedTime(pixelToTimestamp(unfilteredSelectedTimePx + x, centerTime, canvasWidth, secondsPerPx));
|
|
18215
|
+
var clickedUnfilteredSelectedTimePx = unfilteredSelectedTimePx + x;
|
|
18216
|
+
var minClickedUnfilteredSelectedTimePx = Math.min(clickedUnfilteredSelectedTimePx, rightMarkerPx);
|
|
18217
|
+
var newUnfilteredSelectedTimePx = Math.max(minClickedUnfilteredSelectedTimePx, leftMarkerPx);
|
|
18218
|
+
setNewRoundedTime(newUnfilteredSelectedTimePx, centerTime, canvasWidth, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate);
|
|
18219
|
+
};
|
|
18220
|
+
var setNewRoundedTime = function setNewRoundedTime(x, centerTime, width, secondsPerPx, timeStep, dataStartTime, dataEndTime, onSetNewDate) {
|
|
18221
|
+
var unixTime = pixelToTimestamp(x, centerTime, width, secondsPerPx);
|
|
18222
|
+
var roundedTime = mapUtils.roundWithTimeStep(unixTime, timeStep);
|
|
18223
|
+
var maxTime = Math.max(roundedTime, dataStartTime);
|
|
18224
|
+
var newTime = Math.min(maxTime, dataEndTime || roundedTime);
|
|
18225
|
+
var selectedTimeString = moment.unix(newTime).toISOString();
|
|
18226
|
+
onsetNewDateDebounced(selectedTimeString, onSetNewDate);
|
|
18227
|
+
};
|
|
18228
|
+
/** Reusable business logic for how to handle events that set time to now (closest).
|
|
18229
|
+
* Used in NowButton and TimeSliderLegend.
|
|
18230
|
+
*/
|
|
18231
|
+
var handleSetNowEvent = function handleSetNowEvent(timeStep, dataStartTime, dataEndTime, currentTime, onSetNewDate, onSetCenterTime) {
|
|
18232
|
+
if (dataStartTime < dataEndTime) {
|
|
18233
|
+
if (dataEndTime < currentTime) {
|
|
18234
|
+
onSetNewDate(moment.utc(dataEndTime * millisecondsInSecond).toISOString());
|
|
18235
|
+
onSetCenterTime(dataEndTime);
|
|
18236
|
+
} else if (dataStartTime > currentTime) {
|
|
18237
|
+
onSetNewDate(moment.utc(dataStartTime * millisecondsInSecond).toISOString());
|
|
18238
|
+
onSetCenterTime(dataStartTime);
|
|
18239
|
+
} else {
|
|
18240
|
+
var closestToCurrent = mapUtils.roundWithTimeStep(currentTime, timeStep);
|
|
18241
|
+
onSetNewDate(moment.utc(closestToCurrent * millisecondsInSecond).toISOString());
|
|
18242
|
+
onSetCenterTime(closestToCurrent);
|
|
18243
|
+
}
|
|
18244
|
+
}
|
|
18245
|
+
};
|
|
18246
|
+
|
|
18316
18247
|
/* *
|
|
18317
18248
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18318
18249
|
* you may not use this file except in compliance with the License.
|
|
@@ -19227,12 +19158,12 @@ var NowButtonConnect = function NowButtonConnect(_ref) {
|
|
|
19227
19158
|
var timeStep = useSelector(function (store) {
|
|
19228
19159
|
return mapSelectors.getMapTimeStep(store, mapId);
|
|
19229
19160
|
});
|
|
19230
|
-
var
|
|
19231
|
-
return mapSelectors.
|
|
19232
|
-
})
|
|
19233
|
-
|
|
19234
|
-
dataStartTime =
|
|
19235
|
-
dataEndTime =
|
|
19161
|
+
var _useSelector = useSelector(function (store) {
|
|
19162
|
+
return mapSelectors.getDataLimitsFromLayers(store, mapId);
|
|
19163
|
+
}),
|
|
19164
|
+
_useSelector2 = _slicedToArray(_useSelector, 2),
|
|
19165
|
+
dataStartTime = _useSelector2[0],
|
|
19166
|
+
dataEndTime = _useSelector2[1];
|
|
19236
19167
|
var isAnimating = useSelector(function (store) {
|
|
19237
19168
|
return mapSelectors.isAnimating(store, mapId);
|
|
19238
19169
|
});
|
|
@@ -19295,7 +19226,8 @@ var AnimationLengthButtonConnect = function AnimationLengthButtonConnect(_ref) {
|
|
|
19295
19226
|
var animationEndTime = moment(animationStartTime).add(length, 'minutes').toISOString();
|
|
19296
19227
|
dispatch(mapActions.setAnimationEndTime({
|
|
19297
19228
|
mapId: mapId,
|
|
19298
|
-
animationEndTime: animationEndTime
|
|
19229
|
+
animationEndTime: animationEndTime,
|
|
19230
|
+
origin: mapEnums.MapActionOrigin.map
|
|
19299
19231
|
}));
|
|
19300
19232
|
};
|
|
19301
19233
|
return /*#__PURE__*/React.createElement(AnimationLengthButton, {
|
|
@@ -19341,9 +19273,6 @@ var TimeSpanButtonConnect = function TimeSpanButtonConnect(_ref) {
|
|
|
19341
19273
|
var secondsPerPx = useSelector(function (store) {
|
|
19342
19274
|
return mapSelectors.getMapTimeSliderSecondsPerPx(store, mapId);
|
|
19343
19275
|
});
|
|
19344
|
-
var dimensions = useSelector(function (store) {
|
|
19345
|
-
return mapSelectors.getMapDimensions(store, mapId);
|
|
19346
|
-
});
|
|
19347
19276
|
var autoTimeStepLayerId = useSelector(function (store) {
|
|
19348
19277
|
return mapSelectors.getAutoTimeStepLayerId(store, mapId);
|
|
19349
19278
|
});
|
|
@@ -19373,8 +19302,9 @@ var TimeSpanButtonConnect = function TimeSpanButtonConnect(_ref) {
|
|
|
19373
19302
|
origin: mapEnums.MapActionOrigin.map
|
|
19374
19303
|
}));
|
|
19375
19304
|
}, [dispatch, isTimeSpanAuto, mapId]);
|
|
19376
|
-
var
|
|
19377
|
-
|
|
19305
|
+
var selectedTime = useSelector(function (store) {
|
|
19306
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
19307
|
+
});
|
|
19378
19308
|
return /*#__PURE__*/React.createElement(TimeSpanButton, {
|
|
19379
19309
|
timeSliderSpan: timeSliderSpan,
|
|
19380
19310
|
onChangeTimeSliderSpan: onSetTimeSliderSpan,
|
|
@@ -19524,17 +19454,15 @@ var BackwardForwardStepButtonConnect = function BackwardForwardStepButtonConnect
|
|
|
19524
19454
|
var isAnimating = useSelector(function (store) {
|
|
19525
19455
|
return mapSelectors.isAnimating(store, mapId);
|
|
19526
19456
|
});
|
|
19527
|
-
var
|
|
19528
|
-
return mapSelectors.
|
|
19529
|
-
});
|
|
19530
|
-
var selectedTime = getSelectedTime(timedim);
|
|
19531
|
-
var layers = useSelector(function (store) {
|
|
19532
|
-
return mapSelectors.getMapLayers(store, mapId);
|
|
19457
|
+
var selectedTime = useSelector(function (store) {
|
|
19458
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
19533
19459
|
});
|
|
19534
|
-
var
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19460
|
+
var _useSelector = useSelector(function (store) {
|
|
19461
|
+
return mapSelectors.getDataLimitsFromLayers(store, mapId);
|
|
19462
|
+
}),
|
|
19463
|
+
_useSelector2 = _slicedToArray(_useSelector, 2),
|
|
19464
|
+
dataStartTime = _useSelector2[0],
|
|
19465
|
+
dataEndTime = _useSelector2[1];
|
|
19538
19466
|
var onClickBF = function onClickBF() {
|
|
19539
19467
|
if (isAnimating) {
|
|
19540
19468
|
stopAnimation();
|
|
@@ -19600,12 +19528,6 @@ var TimeSliderButtonsConnectMemo = /*#__PURE__*/React.memo(TimeSliderButtonsConn
|
|
|
19600
19528
|
var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
|
|
19601
19529
|
var sourceId = _ref.sourceId,
|
|
19602
19530
|
mapId = _ref.mapId;
|
|
19603
|
-
var layers = useSelector(function (store) {
|
|
19604
|
-
return mapSelectors.getMapLayers(store, mapId);
|
|
19605
|
-
});
|
|
19606
|
-
var dimensions = useSelector(function (store) {
|
|
19607
|
-
return mapSelectors.getMapDimensions(store, mapId);
|
|
19608
|
-
});
|
|
19609
19531
|
var centerTime = useSelector(function (store) {
|
|
19610
19532
|
return mapSelectors.getMapTimeSliderCenterTime(store, mapId);
|
|
19611
19533
|
});
|
|
@@ -19633,13 +19555,16 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
|
|
|
19633
19555
|
var unfilteredSelectedTime = useSelector(function (store) {
|
|
19634
19556
|
return mapSelectors.getTimeSliderUnfilteredSelectedTime(store, mapId);
|
|
19635
19557
|
});
|
|
19636
|
-
var
|
|
19637
|
-
|
|
19558
|
+
var selectedTime = useSelector(function (store) {
|
|
19559
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
19560
|
+
});
|
|
19638
19561
|
var currentTime = moment.utc().unix();
|
|
19639
|
-
var
|
|
19640
|
-
|
|
19641
|
-
|
|
19642
|
-
|
|
19562
|
+
var _useSelector = useSelector(function (store) {
|
|
19563
|
+
return mapSelectors.getDataLimitsFromLayers(store, mapId);
|
|
19564
|
+
}),
|
|
19565
|
+
_useSelector2 = _slicedToArray(_useSelector, 2),
|
|
19566
|
+
dataStartTime = _useSelector2[0],
|
|
19567
|
+
dataEndTime = _useSelector2[1];
|
|
19643
19568
|
var dispatch = useDispatch();
|
|
19644
19569
|
return /*#__PURE__*/React.createElement(TimeSliderLegend, {
|
|
19645
19570
|
mapId: mapId,
|
|
@@ -19692,13 +19617,15 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
|
|
|
19692
19617
|
onSetAnimationStartTime: function onSetAnimationStartTime(animationStartTime) {
|
|
19693
19618
|
dispatch(mapActions.setAnimationStartTime({
|
|
19694
19619
|
mapId: mapId,
|
|
19695
|
-
animationStartTime: animationStartTime
|
|
19620
|
+
animationStartTime: animationStartTime,
|
|
19621
|
+
origin: mapEnums.MapActionOrigin.map
|
|
19696
19622
|
}));
|
|
19697
19623
|
},
|
|
19698
19624
|
onSetAnimationEndTime: function onSetAnimationEndTime(animationEndTime) {
|
|
19699
19625
|
dispatch(mapActions.setAnimationEndTime({
|
|
19700
19626
|
mapId: mapId,
|
|
19701
|
-
animationEndTime: animationEndTime
|
|
19627
|
+
animationEndTime: animationEndTime,
|
|
19628
|
+
origin: mapEnums.MapActionOrigin.map
|
|
19702
19629
|
}));
|
|
19703
19630
|
},
|
|
19704
19631
|
updateCanvasWidth: function updateCanvasWidth(storeWidth, newWidth) {
|
|
@@ -19722,8 +19649,6 @@ var TimeSliderLegendConnect = function TimeSliderLegendConnect(_ref) {
|
|
|
19722
19649
|
|
|
19723
19650
|
var connectRedux = connect(function (store, props) {
|
|
19724
19651
|
return {
|
|
19725
|
-
layers: mapSelectors.getMapLayers(store, props.mapId),
|
|
19726
|
-
dimensions: mapSelectors.getMapDimensions(store, props.mapId),
|
|
19727
19652
|
centerTime: mapSelectors.getMapTimeSliderCenterTime(store, props.mapId),
|
|
19728
19653
|
secondsPerPx: mapSelectors.getMapTimeSliderSecondsPerPx(store, props.mapId),
|
|
19729
19654
|
span: mapSelectors.getMapTimeSliderSpan(store, props.mapId),
|
|
@@ -19741,11 +19666,9 @@ var connectRedux = connect(function (store, props) {
|
|
|
19741
19666
|
var TimeSliderCurrentTimeBoxConnectComponent = function TimeSliderCurrentTimeBoxConnectComponent(_ref) {
|
|
19742
19667
|
var mapId = _ref.mapId,
|
|
19743
19668
|
sourceId = _ref.sourceId,
|
|
19744
|
-
dimensions = _ref.dimensions,
|
|
19745
19669
|
centerTime = _ref.centerTime,
|
|
19746
19670
|
secondsPerPx = _ref.secondsPerPx,
|
|
19747
19671
|
span = _ref.span,
|
|
19748
|
-
layers = _ref.layers,
|
|
19749
19672
|
timeStep = _ref.timeStep,
|
|
19750
19673
|
isAnimating = _ref.isAnimating,
|
|
19751
19674
|
isAutoUpdating = _ref.isAutoUpdating,
|
|
@@ -19754,12 +19677,15 @@ var TimeSliderCurrentTimeBoxConnectComponent = function TimeSliderCurrentTimeBox
|
|
|
19754
19677
|
setTimeSliderUnfilteredSelectedTime = _ref.setTimeSliderUnfilteredSelectedTime,
|
|
19755
19678
|
setTime = _ref.setTime,
|
|
19756
19679
|
setCenterTime = _ref.setCenterTime;
|
|
19757
|
-
var
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
|
|
19680
|
+
var selectedTime = useSelector(function (store) {
|
|
19681
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
19682
|
+
});
|
|
19683
|
+
var _useSelector = useSelector(function (store) {
|
|
19684
|
+
return mapSelectors.getDataLimitsFromLayers(store, mapId);
|
|
19685
|
+
}),
|
|
19686
|
+
_useSelector2 = _slicedToArray(_useSelector, 2),
|
|
19687
|
+
dataStartTime = _useSelector2[0],
|
|
19688
|
+
dataEndTime = _useSelector2[1];
|
|
19763
19689
|
return /*#__PURE__*/React.createElement(TimeSliderCurrentTimeBox, {
|
|
19764
19690
|
centerTime: centerTime,
|
|
19765
19691
|
secondsPerPx: secondsPerPx,
|
|
@@ -19842,14 +19768,12 @@ var useUpdateTimeSpan = function useUpdateTimeSpan(mapId, onSetTimeSliderSpan) {
|
|
|
19842
19768
|
var secondsPerPx = useSelector(function (store) {
|
|
19843
19769
|
return mapSelectors.getMapTimeSliderSecondsPerPx(store, mapId);
|
|
19844
19770
|
});
|
|
19845
|
-
var dimensions = useSelector(function (store) {
|
|
19846
|
-
return mapSelectors.getMapDimensions(store, mapId);
|
|
19847
|
-
});
|
|
19848
19771
|
var currentTimeSpan = useSelector(function (store) {
|
|
19849
19772
|
return mapSelectors.getMapTimeSliderSpan(store, mapId);
|
|
19850
19773
|
});
|
|
19851
|
-
var
|
|
19852
|
-
|
|
19774
|
+
var selectedTime = useSelector(function (store) {
|
|
19775
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
19776
|
+
});
|
|
19853
19777
|
var updateTimeSliderSpan = function updateTimeSliderSpan(spanInSeconds, newCenterTime, newSecondsPerPx) {
|
|
19854
19778
|
if (spanInSeconds !== undefined && newCenterTime !== undefined && newSecondsPerPx !== undefined) {
|
|
19855
19779
|
onSetTimeSliderSpan(spanInSeconds, newCenterTime, newSecondsPerPx);
|
|
@@ -19857,9 +19781,9 @@ var useUpdateTimeSpan = function useUpdateTimeSpan(mapId, onSetTimeSliderSpan) {
|
|
|
19857
19781
|
};
|
|
19858
19782
|
React.useEffect(function () {
|
|
19859
19783
|
if (isTimeSpanAuto && autoTimeStepLayerId) {
|
|
19860
|
-
var
|
|
19861
|
-
startTime =
|
|
19862
|
-
endTime =
|
|
19784
|
+
var _getTimeBounds = getTimeBounds([activeLayerTimeDimension]),
|
|
19785
|
+
startTime = _getTimeBounds.startTime,
|
|
19786
|
+
endTime = _getTimeBounds.endTime;
|
|
19863
19787
|
var spanInSeconds = endTime - startTime;
|
|
19864
19788
|
var newSecondsPerPx = secondsPerPxFromCanvasWidth(timeSliderWidth, spanInSeconds);
|
|
19865
19789
|
var newCenterTime = (startTime + endTime) / 2;
|
|
@@ -19930,21 +19854,18 @@ var TimeSliderConnect = function TimeSliderConnect(_ref) {
|
|
|
19930
19854
|
var timeStep = useSelector(function (store) {
|
|
19931
19855
|
return mapSelectors.getMapTimeStep(store, mapId);
|
|
19932
19856
|
});
|
|
19933
|
-
var
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19937
|
-
|
|
19938
|
-
|
|
19939
|
-
dataEndTime = _getDataLimitsFromLay2[1];
|
|
19857
|
+
var _useSelector = useSelector(function (store) {
|
|
19858
|
+
return mapSelectors.getDataLimitsFromLayers(store, mapId);
|
|
19859
|
+
}),
|
|
19860
|
+
_useSelector2 = _slicedToArray(_useSelector, 2),
|
|
19861
|
+
dataStartTime = _useSelector2[0],
|
|
19862
|
+
dataEndTime = _useSelector2[1];
|
|
19940
19863
|
var isAnimating = useSelector(function (store) {
|
|
19941
19864
|
return mapSelectors.isAnimating(store, mapId);
|
|
19942
19865
|
});
|
|
19943
|
-
var
|
|
19944
|
-
return mapSelectors.
|
|
19866
|
+
var selectedTime = useSelector(function (store) {
|
|
19867
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
19945
19868
|
});
|
|
19946
|
-
var _getTimeBounds3 = getTimeBounds(dimensions),
|
|
19947
|
-
selectedTime = _getTimeBounds3.selectedTime;
|
|
19948
19869
|
useUpdateTimestep(mapId);
|
|
19949
19870
|
useUpdateTimeSpan(mapId, onSetTimeSliderSpan);
|
|
19950
19871
|
return /*#__PURE__*/React.createElement(TimeSlider, {
|
|
@@ -20268,6 +20189,9 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
20268
20189
|
var displayMapPin = useSelector(function (store) {
|
|
20269
20190
|
return mapSelectors.getDisplayMapPin(store, mapId);
|
|
20270
20191
|
});
|
|
20192
|
+
var timestep = useSelector(function (store) {
|
|
20193
|
+
return mapSelectors.getMapTimeStep(store, mapId);
|
|
20194
|
+
});
|
|
20271
20195
|
var dispatch = useDispatch();
|
|
20272
20196
|
var mapChangeDimension = React.useCallback(function (mapDimensionPayload) {
|
|
20273
20197
|
if (mapDimensionPayload.dimension) {
|
|
@@ -20355,6 +20279,7 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
20355
20279
|
dimensions: mapDimensions,
|
|
20356
20280
|
activeLayerId: activeLayerId,
|
|
20357
20281
|
animationDelay: animationDelay,
|
|
20282
|
+
timestep: timestep,
|
|
20358
20283
|
displayMapPin: displayMapPin,
|
|
20359
20284
|
disableMapPin: disableMapPin,
|
|
20360
20285
|
onMapChangeDimension: function onMapChangeDimension(mapDimensionPayload) {
|
|
@@ -20412,10 +20337,12 @@ var MapViewConnect = function MapViewConnect(_a) {
|
|
|
20412
20337
|
});
|
|
20413
20338
|
},
|
|
20414
20339
|
onClickFeature: layer.geojson ? function (event) {
|
|
20415
|
-
|
|
20416
|
-
|
|
20417
|
-
|
|
20418
|
-
|
|
20340
|
+
if (Boolean(event === null || event === void 0 ? void 0 : event.isInEditMode) === false) {
|
|
20341
|
+
setSelectedFeature({
|
|
20342
|
+
layerId: layer.id,
|
|
20343
|
+
selectedFeatureIndex: event === null || event === void 0 ? void 0 : event.featureIndex
|
|
20344
|
+
});
|
|
20345
|
+
}
|
|
20419
20346
|
} : undefined,
|
|
20420
20347
|
updateGeojson: function updateGeojson(geojson) {
|
|
20421
20348
|
return updateFeature({
|
|
@@ -21858,11 +21785,9 @@ var resizeHandlePlacement = {
|
|
|
21858
21785
|
* */
|
|
21859
21786
|
var TimeSliderClockConnect = function TimeSliderClockConnect(_ref) {
|
|
21860
21787
|
var mapId = _ref.mapId;
|
|
21861
|
-
var
|
|
21862
|
-
return mapSelectors.
|
|
21788
|
+
var selectedTime = useSelector(function (store) {
|
|
21789
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
21863
21790
|
});
|
|
21864
|
-
var _getMomentTimeBounds = getMomentTimeBounds(dimensions),
|
|
21865
|
-
selectedTime = _getMomentTimeBounds.selectedTime;
|
|
21866
21791
|
var isTimeSliderVisible = useSelector(function (store) {
|
|
21867
21792
|
return mapSelectors.isTimeSliderVisible(store, mapId);
|
|
21868
21793
|
});
|
|
@@ -21875,7 +21800,7 @@ var TimeSliderClockConnect = function TimeSliderClockConnect(_ref) {
|
|
|
21875
21800
|
mapId: mapId,
|
|
21876
21801
|
sourceId: mapId
|
|
21877
21802
|
}),
|
|
21878
|
-
time: selectedTime
|
|
21803
|
+
time: moment.unix(selectedTime)
|
|
21879
21804
|
});
|
|
21880
21805
|
};
|
|
21881
21806
|
|
|
@@ -23882,931 +23807,14 @@ var GetFeatureInfoButtonConnect = function GetFeatureInfoButtonConnect(_ref) {
|
|
|
23882
23807
|
}, /*#__PURE__*/React.createElement(Info, null));
|
|
23883
23808
|
};
|
|
23884
23809
|
|
|
23885
|
-
var
|
|
23886
|
-
'fill-opacity': 0.5
|
|
23887
|
-
});
|
|
23888
|
-
var emptyLineString = Object.assign(Object.assign({}, lineString.features[0]), {
|
|
23889
|
-
properties: Object.assign(Object.assign({}, defaultStyleProperties), {
|
|
23890
|
-
selectionType: 'linestring'
|
|
23891
|
-
})
|
|
23892
|
-
});
|
|
23893
|
-
var emptyPoint = Object.assign(Object.assign({}, featurePoint), {
|
|
23894
|
-
properties: Object.assign(Object.assign({}, defaultStyleProperties), {
|
|
23895
|
-
selectionType: 'point'
|
|
23896
|
-
})
|
|
23897
|
-
});
|
|
23898
|
-
var emptyPolygon = Object.assign(Object.assign({}, featurePolygon), {
|
|
23899
|
-
properties: Object.assign(Object.assign({}, defaultStyleProperties), {
|
|
23900
|
-
selectionType: 'poly'
|
|
23901
|
-
})
|
|
23902
|
-
});
|
|
23903
|
-
var emptyBox = Object.assign(Object.assign({}, featurePolygon), {
|
|
23904
|
-
properties: Object.assign(Object.assign({}, defaultStyleProperties), {
|
|
23905
|
-
selectionType: 'box'
|
|
23906
|
-
})
|
|
23907
|
-
});
|
|
23908
|
-
// TODO: improve this: without a feature, the custom shape does not work on first click
|
|
23909
|
-
var emptyIntersectionShape = Object.assign(Object.assign({}, emptyGeoJSON), {
|
|
23910
|
-
features: [featurePolygon]
|
|
23911
|
-
});
|
|
23912
|
-
var defaultPoint = {
|
|
23913
|
-
id: 'drawtools-point',
|
|
23914
|
-
value: DRAWMODE.POINT,
|
|
23915
|
-
title: 'Point',
|
|
23916
|
-
icon: /*#__PURE__*/React__default.createElement(Location, null),
|
|
23917
|
-
shape: emptyPoint,
|
|
23918
|
-
isSelectable: true
|
|
23919
|
-
};
|
|
23920
|
-
var defaultPolygon = {
|
|
23921
|
-
id: 'drawtools-polygon',
|
|
23922
|
-
value: DRAWMODE.POLYGON,
|
|
23923
|
-
title: 'Polygon',
|
|
23924
|
-
icon: /*#__PURE__*/React__default.createElement(DrawPolygon, null),
|
|
23925
|
-
shape: emptyPolygon,
|
|
23926
|
-
isSelectable: true
|
|
23927
|
-
};
|
|
23928
|
-
var defaultBox = {
|
|
23929
|
-
id: 'drawtools-box',
|
|
23930
|
-
value: DRAWMODE.BOX,
|
|
23931
|
-
title: 'Box',
|
|
23932
|
-
icon: /*#__PURE__*/React__default.createElement(DrawRegion, null),
|
|
23933
|
-
shape: emptyBox,
|
|
23934
|
-
isSelectable: true
|
|
23935
|
-
};
|
|
23936
|
-
var defaultLineString = {
|
|
23937
|
-
id: 'drawtools-linestring',
|
|
23938
|
-
value: DRAWMODE.LINESTRING,
|
|
23939
|
-
title: 'LineString',
|
|
23940
|
-
icon: /*#__PURE__*/React__default.createElement(Edit, null),
|
|
23941
|
-
shape: emptyLineString,
|
|
23942
|
-
isSelectable: true
|
|
23943
|
-
};
|
|
23944
|
-
var defaultDelete = {
|
|
23945
|
-
id: 'drawtools-delete',
|
|
23946
|
-
value: 'DELETE',
|
|
23947
|
-
title: 'Delete',
|
|
23948
|
-
icon: /*#__PURE__*/React__default.createElement(Delete, null),
|
|
23949
|
-
shape: emptyGeoJSON,
|
|
23950
|
-
isSelectable: false
|
|
23951
|
-
};
|
|
23952
|
-
var defaultModes = [defaultPoint, defaultPolygon, defaultBox, defaultLineString, defaultDelete];
|
|
23953
|
-
var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
23954
|
-
var _ref$defaultEditModes = _ref.defaultEditModes,
|
|
23955
|
-
defaultEditModes = _ref$defaultEditModes === void 0 ? defaultModes : _ref$defaultEditModes,
|
|
23956
|
-
_ref$shouldAllowMulti = _ref.shouldAllowMultipleshapes,
|
|
23957
|
-
shouldAllowMultipleshapes = _ref$shouldAllowMulti === void 0 ? false : _ref$shouldAllowMulti,
|
|
23958
|
-
_ref$defaultGeoJSON = _ref.defaultGeoJSON,
|
|
23959
|
-
defaultGeoJSON = _ref$defaultGeoJSON === void 0 ? emptyGeoJSON : _ref$defaultGeoJSON,
|
|
23960
|
-
_ref$defaultGeoJSONIn = _ref.defaultGeoJSONIntersection,
|
|
23961
|
-
defaultGeoJSONIntersection = _ref$defaultGeoJSONIn === void 0 ? emptyIntersectionShape : _ref$defaultGeoJSONIn,
|
|
23962
|
-
defaultGeoJSONIntersectionBounds = _ref.defaultGeoJSONIntersectionBounds,
|
|
23963
|
-
_ref$defaultGeoJSONIn2 = _ref.defaultGeoJSONIntersectionProperties,
|
|
23964
|
-
defaultGeoJSONIntersectionProperties = _ref$defaultGeoJSONIn2 === void 0 ? defaultIntersectionStyleProperties : _ref$defaultGeoJSONIn2;
|
|
23965
|
-
// geoJSON feature collections
|
|
23966
|
-
var _React$useState = React__default.useState(defaultGeoJSON),
|
|
23967
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
23968
|
-
geoJSON = _React$useState2[0],
|
|
23969
|
-
setGeoJSON = _React$useState2[1];
|
|
23970
|
-
var _React$useState3 = React__default.useState(defaultGeoJSONIntersection),
|
|
23971
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
23972
|
-
geoJSONIntersection = _React$useState4[0],
|
|
23973
|
-
setGeoJSONIntersection = _React$useState4[1];
|
|
23974
|
-
var _React$useState5 = React__default.useState(defaultGeoJSONIntersectionBounds),
|
|
23975
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
23976
|
-
geoJSONIntersectionBounds = _React$useState6[0],
|
|
23977
|
-
setGeoJSONIntersectionBounds = _React$useState6[1];
|
|
23978
|
-
// state
|
|
23979
|
-
var _React$useState7 = React__default.useState(defaultEditModes),
|
|
23980
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
23981
|
-
editModes = _React$useState8[0],
|
|
23982
|
-
setEditModes = _React$useState8[1];
|
|
23983
|
-
var _React$useState9 = React__default.useState(''),
|
|
23984
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
23985
|
-
activeTool = _React$useState10[0],
|
|
23986
|
-
setActiveTool = _React$useState10[1];
|
|
23987
|
-
var _React$useState11 = React__default.useState(''),
|
|
23988
|
-
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
23989
|
-
drawMode = _React$useState12[0],
|
|
23990
|
-
setDrawMode = _React$useState12[1];
|
|
23991
|
-
var _React$useState13 = React__default.useState(false),
|
|
23992
|
-
_React$useState14 = _slicedToArray(_React$useState13, 2),
|
|
23993
|
-
isInEditMode = _React$useState14[0],
|
|
23994
|
-
setEditMode = _React$useState14[1];
|
|
23995
|
-
var _React$useState15 = React__default.useState(0),
|
|
23996
|
-
_React$useState16 = _slicedToArray(_React$useState15, 2),
|
|
23997
|
-
featureLayerIndex = _React$useState16[0],
|
|
23998
|
-
setFeatureLayerIndex = _React$useState16[1];
|
|
23999
|
-
var changeProperties = function changeProperties(styleProperties) {
|
|
24000
|
-
// update all modes with new properties
|
|
24001
|
-
var newModes = editModes.map(function (mode) {
|
|
24002
|
-
var shape = mode.shape.type === 'Feature' ? Object.assign(Object.assign({}, mode.shape), {
|
|
24003
|
-
properties: Object.assign(Object.assign({}, mode.shape.properties), styleProperties)
|
|
24004
|
-
}) : addFeatureProperties(mode.shape, styleProperties);
|
|
24005
|
-
return Object.assign(Object.assign({}, mode), {
|
|
24006
|
-
shape: shape
|
|
24007
|
-
});
|
|
24008
|
-
});
|
|
24009
|
-
setEditModes(newModes);
|
|
24010
|
-
// update current geoJSON with new properties
|
|
24011
|
-
var updateGeoJSON = addFeatureProperties(geoJSON, styleProperties, featureLayerIndex);
|
|
24012
|
-
setGeoJSON(updateGeoJSON);
|
|
24013
|
-
};
|
|
24014
|
-
var getProperties = function getProperties() {
|
|
24015
|
-
if (!geoJSON || !geoJSON.features.length) {
|
|
24016
|
-
return {};
|
|
24017
|
-
}
|
|
24018
|
-
return geoJSON.features[featureLayerIndex].properties;
|
|
24019
|
-
};
|
|
24020
|
-
var changeActiveTool = function changeActiveTool(newMode) {
|
|
24021
|
-
var shouldDeleteShape = newMode.value === 'DELETE';
|
|
24022
|
-
// reset if same tool is selected
|
|
24023
|
-
if (newMode.id === activeTool || shouldDeleteShape) {
|
|
24024
|
-
reset(shouldDeleteShape);
|
|
24025
|
-
return;
|
|
24026
|
-
}
|
|
24027
|
-
setActiveTool(newMode.id);
|
|
24028
|
-
// updates shape
|
|
24029
|
-
var isNewSelectedTool = !isGeoJSONFeatureCreatedByTool(geoJSON, newMode.shape);
|
|
24030
|
-
var shouldUpdateShape = !geoJSON.features.length || shouldAllowMultipleshapes || isNewSelectedTool;
|
|
24031
|
-
if (shouldUpdateShape) {
|
|
24032
|
-
var updatedGeoJSON = changeGeoJSON(newMode.shape);
|
|
24033
|
-
setFeatureLayerIndex(updatedGeoJSON.features.length - 1);
|
|
24034
|
-
}
|
|
24035
|
-
// handle modes and update feature layer index
|
|
24036
|
-
setDrawMode(newMode.value);
|
|
24037
|
-
setEditMode(!!newMode.value);
|
|
24038
|
-
};
|
|
24039
|
-
var changeGeoJSON = function changeGeoJSON(updatedGeoJSON) {
|
|
24040
|
-
var geoJSONFeatureCollection = getFeatureCollection(updatedGeoJSON, shouldAllowMultipleshapes, geoJSON);
|
|
24041
|
-
var newGeoJSON = getGeoJson(geoJSONFeatureCollection, shouldAllowMultipleshapes);
|
|
24042
|
-
setGeoJSON(newGeoJSON);
|
|
24043
|
-
if (geoJSONIntersectionBounds) {
|
|
24044
|
-
setGeoJSONIntersection(createInterSections(newGeoJSON, geoJSONIntersectionBounds, defaultGeoJSONIntersectionProperties));
|
|
24045
|
-
}
|
|
24046
|
-
return newGeoJSON;
|
|
24047
|
-
};
|
|
24048
|
-
var onSetGeoJSONIntersectionBounds = function onSetGeoJSONIntersectionBounds(newGeoJSON) {
|
|
24049
|
-
setGeoJSONIntersectionBounds(newGeoJSON);
|
|
24050
|
-
// reset all other geoJSONs
|
|
24051
|
-
setGeoJSONIntersection(emptyIntersectionShape);
|
|
24052
|
-
setGeoJSON(emptyGeoJSON);
|
|
24053
|
-
};
|
|
24054
|
-
var onSetDrawMode = function onSetDrawMode(drawMode) {
|
|
24055
|
-
setDrawMode(drawMode);
|
|
24056
|
-
var newActiveTool = editModes.find(function (mode) {
|
|
24057
|
-
return mode.value === drawMode;
|
|
24058
|
-
});
|
|
24059
|
-
if (newActiveTool) {
|
|
24060
|
-
setActiveTool(newActiveTool.id);
|
|
24061
|
-
}
|
|
24062
|
-
};
|
|
24063
|
-
var deactivateTool = function deactivateTool() {
|
|
24064
|
-
setEditMode(false);
|
|
24065
|
-
setActiveTool('');
|
|
24066
|
-
setDrawMode('');
|
|
24067
|
-
};
|
|
24068
|
-
var reset = function reset() {
|
|
24069
|
-
var shouldClearState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
24070
|
-
deactivateTool();
|
|
24071
|
-
if (shouldClearState) {
|
|
24072
|
-
setGeoJSONIntersection(emptyIntersectionShape);
|
|
24073
|
-
setGeoJSON(emptyGeoJSON);
|
|
24074
|
-
setFeatureLayerIndex(0);
|
|
24075
|
-
}
|
|
24076
|
-
};
|
|
24077
|
-
var getLayer = function getLayer(layerType, layerId) {
|
|
24078
|
-
// geoJSON
|
|
24079
|
-
if (layerType === 'geoJSON') {
|
|
24080
|
-
return {
|
|
24081
|
-
id: layerId,
|
|
24082
|
-
geojson: geoJSON,
|
|
24083
|
-
isInEditMode: isInEditMode,
|
|
24084
|
-
drawMode: drawMode,
|
|
24085
|
-
updateGeojson: changeGeoJSON,
|
|
24086
|
-
featureNrToEdit: featureLayerIndex
|
|
24087
|
-
};
|
|
24088
|
-
}
|
|
24089
|
-
// intersections
|
|
24090
|
-
return {
|
|
24091
|
-
id: layerId,
|
|
24092
|
-
geojson: layerType === 'geoJSONIntersection' ? geoJSONIntersection : geoJSONIntersectionBounds,
|
|
24093
|
-
isInEditMode: false
|
|
24094
|
-
};
|
|
24095
|
-
};
|
|
24096
|
-
var layers = [].concat(_toConsumableArray(geoJSONIntersectionBounds ? [getLayer('geoJSONIntersectionBounds', 'static-layer'), getLayer('geoJSONIntersection', 'intersection-layer')] : []), [getLayer('geoJSON', 'draw-layer')]);
|
|
23810
|
+
var titleStyle = function titleStyle(theme) {
|
|
24097
23811
|
return {
|
|
24098
|
-
|
|
24099
|
-
|
|
24100
|
-
|
|
24101
|
-
|
|
24102
|
-
|
|
24103
|
-
|
|
24104
|
-
isInEditMode: isInEditMode,
|
|
24105
|
-
changeDrawMode: onSetDrawMode,
|
|
24106
|
-
setEditMode: setEditMode,
|
|
24107
|
-
featureLayerIndex: featureLayerIndex,
|
|
24108
|
-
setFeatureLayerIndex: setFeatureLayerIndex,
|
|
24109
|
-
activeTool: activeTool,
|
|
24110
|
-
changeActiveTool: changeActiveTool,
|
|
24111
|
-
setActiveTool: setActiveTool,
|
|
24112
|
-
layers: layers,
|
|
24113
|
-
getLayer: getLayer,
|
|
24114
|
-
deactivateTool: deactivateTool,
|
|
24115
|
-
setEditModes: setEditModes,
|
|
24116
|
-
changeProperties: changeProperties,
|
|
24117
|
-
getProperties: getProperties
|
|
24118
|
-
};
|
|
24119
|
-
};
|
|
24120
|
-
|
|
24121
|
-
/* *
|
|
24122
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
24123
|
-
* you may not use this file except in compliance with the License.
|
|
24124
|
-
* You may obtain a copy of the License at
|
|
24125
|
-
*
|
|
24126
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24127
|
-
*
|
|
24128
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24129
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
24130
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24131
|
-
* See the License for the specific language governing permissions and
|
|
24132
|
-
* limitations under the License.
|
|
24133
|
-
*
|
|
24134
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
24135
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
24136
|
-
* */
|
|
24137
|
-
var MapDrawToolContext = /*#__PURE__*/React.createContext({});
|
|
24138
|
-
// currently used options
|
|
24139
|
-
var drawOptions = {
|
|
24140
|
-
defaultEditModes: [defaultPolygon, defaultDelete]
|
|
24141
|
-
};
|
|
24142
|
-
var MapDrawToolProvider = function MapDrawToolProvider(_ref) {
|
|
24143
|
-
var children = _ref.children,
|
|
24144
|
-
_ref$options = _ref.options,
|
|
24145
|
-
options = _ref$options === void 0 ? {} : _ref$options;
|
|
24146
|
-
var value = useMapDrawTool(options);
|
|
24147
|
-
return /*#__PURE__*/React.createElement(MapDrawToolContext.Provider, {
|
|
24148
|
-
value: value
|
|
24149
|
-
}, children);
|
|
24150
|
-
};
|
|
24151
|
-
function useMapDrawContext() {
|
|
24152
|
-
return React.useContext(MapDrawToolContext);
|
|
24153
|
-
}
|
|
24154
|
-
|
|
24155
|
-
/* *
|
|
24156
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
24157
|
-
* you may not use this file except in compliance with the License.
|
|
24158
|
-
* You may obtain a copy of the License at
|
|
24159
|
-
*
|
|
24160
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24161
|
-
*
|
|
24162
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24163
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
24164
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24165
|
-
* See the License for the specific language governing permissions and
|
|
24166
|
-
* limitations under the License.
|
|
24167
|
-
*
|
|
24168
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
24169
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
24170
|
-
* */
|
|
24171
|
-
var areaDialogType$1 = uiTypes.DialogTypes.AreaManager;
|
|
24172
|
-
var useAreaDrawDialogAction = function useAreaDrawDialogAction(_ref) {
|
|
24173
|
-
var mapId = _ref.mapId,
|
|
24174
|
-
source = _ref.source;
|
|
24175
|
-
var dispatch = useDispatch();
|
|
24176
|
-
var drawingDialogType = "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
|
|
24177
|
-
var geoJSONLayerId = "".concat(mapId, "-geosjon");
|
|
24178
|
-
var currentLayer = useSelector(function (store) {
|
|
24179
|
-
return layerSelectors.getLayerById(store, geoJSONLayerId);
|
|
24180
|
-
});
|
|
24181
|
-
var openAreaDialog = React__default.useCallback(function () {
|
|
24182
|
-
dispatch(uiActions.setActiveMapIdForDialog({
|
|
24183
|
-
type: areaDialogType$1,
|
|
24184
|
-
mapId: mapId,
|
|
24185
|
-
setOpen: true,
|
|
24186
|
-
source: source
|
|
24187
|
-
}));
|
|
24188
|
-
}, [dispatch, mapId, source]);
|
|
24189
|
-
var openDrawDialog = React__default.useCallback(function () {
|
|
24190
|
-
dispatch(uiActions.setActiveMapIdForDialog({
|
|
24191
|
-
type: drawingDialogType,
|
|
24192
|
-
mapId: mapId,
|
|
24193
|
-
setOpen: true,
|
|
24194
|
-
source: source
|
|
24195
|
-
}));
|
|
24196
|
-
}, [dispatch, mapId, source, drawingDialogType]);
|
|
24197
|
-
var closeDrawDialog = React__default.useCallback(function () {
|
|
24198
|
-
dispatch(drawActions.setDrawValues({
|
|
24199
|
-
mapId: mapId,
|
|
24200
|
-
area: undefined,
|
|
24201
|
-
areaName: '',
|
|
24202
|
-
id: ''
|
|
24203
|
-
}));
|
|
24204
|
-
dispatch(uiActions.setActiveMapIdForDialog({
|
|
24205
|
-
type: drawingDialogType,
|
|
24206
|
-
mapId: mapId,
|
|
24207
|
-
setOpen: false,
|
|
24208
|
-
source: source
|
|
24209
|
-
}));
|
|
24210
|
-
}, [dispatch, mapId, drawingDialogType, source]);
|
|
24211
|
-
var closeAreaDialog = React__default.useCallback(function () {
|
|
24212
|
-
if (currentLayer) {
|
|
24213
|
-
dispatch(mapStoreActions.layerDelete({
|
|
24214
|
-
layerId: geoJSONLayerId,
|
|
24215
|
-
mapId: mapId,
|
|
24216
|
-
layerIndex: 0
|
|
24217
|
-
}));
|
|
24218
|
-
}
|
|
24219
|
-
dispatch(uiActions.setActiveMapIdForDialog({
|
|
24220
|
-
type: areaDialogType$1,
|
|
24221
|
-
mapId: mapId,
|
|
24222
|
-
setOpen: false,
|
|
24223
|
-
source: source
|
|
24224
|
-
}));
|
|
24225
|
-
dispatch(drawActions.setDrawValues({
|
|
24226
|
-
mapId: mapId,
|
|
24227
|
-
area: undefined,
|
|
24228
|
-
areaName: '',
|
|
24229
|
-
id: ''
|
|
24230
|
-
}));
|
|
24231
|
-
}, [dispatch, mapId, source, currentLayer, geoJSONLayerId]);
|
|
24232
|
-
return {
|
|
24233
|
-
closeDrawDialog: closeDrawDialog,
|
|
24234
|
-
closeAreaDialog: closeAreaDialog,
|
|
24235
|
-
openAreaDialog: openAreaDialog,
|
|
24236
|
-
openDrawDialog: openDrawDialog
|
|
24237
|
-
};
|
|
24238
|
-
};
|
|
24239
|
-
|
|
24240
|
-
/* *
|
|
24241
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
24242
|
-
* you may not use this file except in compliance with the License.
|
|
24243
|
-
* You may obtain a copy of the License at
|
|
24244
|
-
*
|
|
24245
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24246
|
-
*
|
|
24247
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24248
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
24249
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24250
|
-
* See the License for the specific language governing permissions and
|
|
24251
|
-
* limitations under the License.
|
|
24252
|
-
*
|
|
24253
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
24254
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
24255
|
-
* */
|
|
24256
|
-
var areaDialogType = uiTypes.DialogTypes.AreaManager;
|
|
24257
|
-
var DrawingToolMapButtonConnect = function DrawingToolMapButtonConnect(_ref) {
|
|
24258
|
-
var mapId = _ref.mapId,
|
|
24259
|
-
_ref$source = _ref.source,
|
|
24260
|
-
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
24261
|
-
var _useMapDrawContext = useMapDrawContext(),
|
|
24262
|
-
deactivateTool = _useMapDrawContext.deactivateTool;
|
|
24263
|
-
// TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
|
|
24264
|
-
var drawingDialogType = "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
|
|
24265
|
-
// const drawingDialogType = isMultiMap
|
|
24266
|
-
// ? `${uiTypes.DialogTypes.DrawingTool}-${mapId}`
|
|
24267
|
-
// : uiTypes.DialogTypes.DrawingTool;
|
|
24268
|
-
var _useAreaDrawDialogAct = useAreaDrawDialogAction({
|
|
24269
|
-
mapId: mapId,
|
|
24270
|
-
source: source
|
|
24271
|
-
}),
|
|
24272
|
-
closeAreaDialog = _useAreaDrawDialogAct.closeAreaDialog,
|
|
24273
|
-
openDrawDialog = _useAreaDrawDialogAct.openDrawDialog,
|
|
24274
|
-
closeDrawDialog = _useAreaDrawDialogAct.closeDrawDialog;
|
|
24275
|
-
var currentActiveMapId = useSelector(function (store) {
|
|
24276
|
-
return uiSelectors.getDialogMapId(store, drawingDialogType);
|
|
24277
|
-
});
|
|
24278
|
-
var isDrawDialogOpen = useSelector(function (store) {
|
|
24279
|
-
return uiSelectors.getisDialogOpen(store, drawingDialogType);
|
|
24280
|
-
});
|
|
24281
|
-
var isAreaDialogOpen = useSelector(function (store) {
|
|
24282
|
-
return uiSelectors.getisDialogOpen(store, areaDialogType);
|
|
24283
|
-
});
|
|
24284
|
-
var openDrawingDialog = React.useCallback(function () {
|
|
24285
|
-
if (isAreaDialogOpen) {
|
|
24286
|
-
closeAreaDialog();
|
|
24287
|
-
}
|
|
24288
|
-
openDrawDialog();
|
|
24289
|
-
}, [isAreaDialogOpen, closeAreaDialog, openDrawDialog]);
|
|
24290
|
-
var closeDrawingDialog = React.useCallback(function () {
|
|
24291
|
-
deactivateTool();
|
|
24292
|
-
closeDrawDialog();
|
|
24293
|
-
}, [deactivateTool, closeDrawDialog]);
|
|
24294
|
-
var onClick = React.useCallback(function () {
|
|
24295
|
-
var shouldOpen = currentActiveMapId !== mapId ? true : !isDrawDialogOpen;
|
|
24296
|
-
shouldOpen ? openDrawingDialog() : closeDrawingDialog();
|
|
24297
|
-
}, [currentActiveMapId, isDrawDialogOpen, mapId, closeDrawingDialog, openDrawingDialog]);
|
|
24298
|
-
var isOpen = currentActiveMapId === mapId && isDrawDialogOpen;
|
|
24299
|
-
return /*#__PURE__*/React.createElement(MapControlButton, {
|
|
24300
|
-
title: "Drawing Toolbox",
|
|
24301
|
-
"data-testid": "drawingToolButton",
|
|
24302
|
-
onClick: onClick,
|
|
24303
|
-
isActive: isOpen
|
|
24304
|
-
}, /*#__PURE__*/React.createElement(DrawPolygon, null));
|
|
24305
|
-
};
|
|
24306
|
-
|
|
24307
|
-
var calculateStartSize = function calculateStartSize(minSize, prefSize, startPosition) {
|
|
24308
|
-
var _calculateDialogSizeA = calculateDialogSizeAndPosition(),
|
|
24309
|
-
calcWidth = _calculateDialogSizeA.width,
|
|
24310
|
-
calcHeight = _calculateDialogSizeA.height;
|
|
24311
|
-
return {
|
|
24312
|
-
width: Math.max(minSize.width, Math.min(prefSize.width, calcWidth)),
|
|
24313
|
-
height: Math.max(minSize.height, Math.min(prefSize.height, calcHeight - startPosition.top))
|
|
24314
|
-
};
|
|
24315
|
-
};
|
|
24316
|
-
var DERFAULT_DRAW_TOOL_SIZE = {
|
|
24317
|
-
width: 320,
|
|
24318
|
-
height: 542
|
|
24319
|
-
};
|
|
24320
|
-
var DEFAULT_DRAW_TOOL_POSITION = {
|
|
24321
|
-
top: 120,
|
|
24322
|
-
left: 50
|
|
24323
|
-
};
|
|
24324
|
-
var DEFAULT_DRAW_TOOL_MIN_SIZE = {
|
|
24325
|
-
width: 160,
|
|
24326
|
-
height: 300
|
|
24327
|
-
};
|
|
24328
|
-
var DrawingTool = function DrawingTool(_ref) {
|
|
24329
|
-
var bounds = _ref.bounds,
|
|
24330
|
-
onClose = _ref.onClose,
|
|
24331
|
-
_ref$title = _ref.title,
|
|
24332
|
-
title = _ref$title === void 0 ? 'Drawing Toolbox' : _ref$title,
|
|
24333
|
-
isOpen = _ref.isOpen,
|
|
24334
|
-
_ref$onMouseDown = _ref.onMouseDown,
|
|
24335
|
-
onMouseDown = _ref$onMouseDown === void 0 ? function () {} : _ref$onMouseDown,
|
|
24336
|
-
_ref$order = _ref.order,
|
|
24337
|
-
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
24338
|
-
_ref$source = _ref.source,
|
|
24339
|
-
source = _ref$source === void 0 ? 'app' : _ref$source,
|
|
24340
|
-
_ref$isLoading = _ref.isLoading,
|
|
24341
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
24342
|
-
error = _ref.error,
|
|
24343
|
-
_ref$isDocked = _ref.isDocked,
|
|
24344
|
-
isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
|
|
24345
|
-
_ref$size = _ref.size,
|
|
24346
|
-
size = _ref$size === void 0 ? DERFAULT_DRAW_TOOL_SIZE : _ref$size,
|
|
24347
|
-
_ref$startPosition = _ref.startPosition,
|
|
24348
|
-
startPosition = _ref$startPosition === void 0 ? DEFAULT_DRAW_TOOL_POSITION : _ref$startPosition,
|
|
24349
|
-
_ref$setFocused = _ref.setFocused,
|
|
24350
|
-
setFocused = _ref$setFocused === void 0 ? function () {} : _ref$setFocused,
|
|
24351
|
-
_ref$headerSize = _ref.headerSize,
|
|
24352
|
-
headerSize = _ref$headerSize === void 0 ? 'xs' : _ref$headerSize,
|
|
24353
|
-
children = _ref.children;
|
|
24354
|
-
var minSize = DEFAULT_DRAW_TOOL_MIN_SIZE;
|
|
24355
|
-
var startSizeCalc = calculateStartSize(minSize, size, startPosition);
|
|
24356
|
-
var _React$useState = React.useState(startSizeCalc),
|
|
24357
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24358
|
-
sizeInState = _React$useState2[0],
|
|
24359
|
-
setSizeInState = _React$useState2[1];
|
|
24360
|
-
React.useEffect(function () {
|
|
24361
|
-
if (size !== sizeInState && isDocked && isOpen) {
|
|
24362
|
-
setSizeInState(size);
|
|
24363
|
-
}
|
|
24364
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24365
|
-
}, [size, isOpen]);
|
|
24366
|
-
return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
|
|
24367
|
-
title: title,
|
|
24368
|
-
startSize: sizeInState,
|
|
24369
|
-
minWidth: minSize.width,
|
|
24370
|
-
minHeight: minSize.height,
|
|
24371
|
-
startPosition: startPosition,
|
|
24372
|
-
isOpen: isOpen,
|
|
24373
|
-
onClose: onClose,
|
|
24374
|
-
headerSize: headerSize,
|
|
24375
|
-
bounds: bounds,
|
|
24376
|
-
"data-testid": "drawingToolWindow",
|
|
24377
|
-
onMouseDown: onMouseDown,
|
|
24378
|
-
onFocus: function onFocus() {
|
|
24379
|
-
return setFocused(true);
|
|
24380
|
-
},
|
|
24381
|
-
onBlur: function onBlur() {
|
|
24382
|
-
return setFocused(false);
|
|
24383
|
-
},
|
|
24384
|
-
order: order,
|
|
24385
|
-
source: source,
|
|
24386
|
-
// TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
|
|
24387
|
-
// rightHeaderComponent={
|
|
24388
|
-
// <CustomIconButton
|
|
24389
|
-
// tooltipTitle={isDocked ? 'Undock' : 'Dock'}
|
|
24390
|
-
// data-testid="dockedBtn"
|
|
24391
|
-
// disableRipple
|
|
24392
|
-
// onClick={(): void => onToggleDock()}
|
|
24393
|
-
// >
|
|
24394
|
-
// {isDocked ? (
|
|
24395
|
-
// <CollapseWindow data-testid="dockedDrawingTool-collapse" />
|
|
24396
|
-
// ) : (
|
|
24397
|
-
// <ExpandWindow data-testid="dockedDrawingTool-uncollapse" />
|
|
24398
|
-
// )}
|
|
24399
|
-
// </CustomIconButton>
|
|
24400
|
-
// }
|
|
24401
|
-
onResizeStop: function onResizeStop(_event, _direction, node) {
|
|
24402
|
-
var width = node.offsetWidth,
|
|
24403
|
-
height = node.offsetHeight;
|
|
24404
|
-
setSizeInState({
|
|
24405
|
-
width: width,
|
|
24406
|
-
height: height
|
|
24407
|
-
});
|
|
24408
|
-
},
|
|
24409
|
-
onDragEnd: function onDragEnd(_position, dragSize) {
|
|
24410
|
-
if (dragSize !== sizeInState) {
|
|
24411
|
-
setSizeInState(dragSize);
|
|
24412
|
-
}
|
|
24413
|
-
}
|
|
24414
|
-
}, /*#__PURE__*/React.createElement(Box$2, {
|
|
24415
|
-
onKeyDown: function onKeyDown(event) {
|
|
24416
|
-
event.stopPropagation();
|
|
24417
|
-
},
|
|
24418
|
-
sx: {
|
|
24419
|
-
height: '100%'
|
|
24420
|
-
}
|
|
24421
|
-
}, isLoading && /*#__PURE__*/React.createElement(LinearProgress, {
|
|
24422
|
-
"data-testid": "loading-bar-drawingTool",
|
|
24423
|
-
color: "secondary",
|
|
24424
|
-
sx: {
|
|
24425
|
-
position: 'absolute',
|
|
24426
|
-
width: '100%'
|
|
24427
|
-
}
|
|
24428
|
-
}), error && /*#__PURE__*/React.createElement(Box$2, {
|
|
24429
|
-
sx: {
|
|
24430
|
-
padding: '0 6px'
|
|
24431
|
-
}
|
|
24432
|
-
}, /*#__PURE__*/React.createElement(AlertBanner, {
|
|
24433
|
-
title: error,
|
|
24434
|
-
shouldClose: true
|
|
24435
|
-
})), children));
|
|
24436
|
-
};
|
|
24437
|
-
|
|
24438
|
-
var opacityOptions = [100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0];
|
|
24439
|
-
var getAreaName = function getAreaName(areaName) {
|
|
24440
|
-
return areaName || "".concat(dateUtils.dateToString(new Date(), 'dd/MM/yyyy HH:mm', true), " UTC");
|
|
24441
|
-
};
|
|
24442
|
-
var SAVE_AREA_BUTTON = 'Save new area';
|
|
24443
|
-
var UPDATE_AREA_BUTTON = 'Update area';
|
|
24444
|
-
var INPUT_AREA = 'Area name';
|
|
24445
|
-
var INPUT_OPACITY = 'Opacity';
|
|
24446
|
-
var DRAW_EXIT_MODE_MESSAGE = 'press ESC to exit draw mode';
|
|
24447
|
-
var DrawingToolForm = function DrawingToolForm(_ref) {
|
|
24448
|
-
var onSubmitForm = _ref.onSubmitForm,
|
|
24449
|
-
defaultGeoJSON = _ref.area,
|
|
24450
|
-
isLoading = _ref.isLoading,
|
|
24451
|
-
_ref$id = _ref.id,
|
|
24452
|
-
id = _ref$id === void 0 ? '' : _ref$id;
|
|
24453
|
-
var _useFormContext = useFormContext(),
|
|
24454
|
-
handleSubmit = _useFormContext.handleSubmit,
|
|
24455
|
-
errors = _useFormContext.formState.errors;
|
|
24456
|
-
var _useMapDrawContext = useMapDrawContext(),
|
|
24457
|
-
editModes = _useMapDrawContext.editModes,
|
|
24458
|
-
changeActiveTool = _useMapDrawContext.changeActiveTool,
|
|
24459
|
-
activeTool = _useMapDrawContext.activeTool,
|
|
24460
|
-
deactivateTool = _useMapDrawContext.deactivateTool,
|
|
24461
|
-
geoJSON = _useMapDrawContext.geoJSON,
|
|
24462
|
-
getProperties = _useMapDrawContext.getProperties,
|
|
24463
|
-
changeProperties = _useMapDrawContext.changeProperties,
|
|
24464
|
-
isInEditMode = _useMapDrawContext.isInEditMode,
|
|
24465
|
-
setGeoJSON = _useMapDrawContext.setGeoJSON;
|
|
24466
|
-
var onSubmit = function onSubmit() {
|
|
24467
|
-
deactivateTool();
|
|
24468
|
-
handleSubmit(function (formValues) {
|
|
24469
|
-
// remove unneeded properties
|
|
24470
|
-
formValues.opacity;
|
|
24471
|
-
var allFormValues = __rest(formValues, ["opacity"]);
|
|
24472
|
-
onSubmitForm(Object.assign(Object.assign({}, allFormValues), {
|
|
24473
|
-
area: geoJSON,
|
|
24474
|
-
id: id
|
|
24475
|
-
}));
|
|
24476
|
-
})();
|
|
24477
|
-
};
|
|
24478
|
-
var hasErrors = Object.keys(errors).length > 0;
|
|
24479
|
-
var getInitialGeoJSONPropertyValue = function getInitialGeoJSONPropertyValue(property) {
|
|
24480
|
-
if (getProperties()[property]) {
|
|
24481
|
-
return getProperties()[property];
|
|
24482
|
-
}
|
|
24483
|
-
return defaultStyleProperties[property];
|
|
24484
|
-
};
|
|
24485
|
-
var _React$useState = React.useState(getInitialGeoJSONPropertyValue('fill-opacity') * 100),
|
|
24486
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24487
|
-
opacity = _React$useState2[0],
|
|
24488
|
-
setOpacity = _React$useState2[1];
|
|
24489
|
-
var onChangeOpacity = function onChangeOpacity(event) {
|
|
24490
|
-
var value = event.target.value;
|
|
24491
|
-
var parseValue = parseInt(value, 10);
|
|
24492
|
-
setOpacity(parseValue);
|
|
24493
|
-
var newOpacity = parseValue / 100;
|
|
24494
|
-
var additionalStrokeOpacity = 0.8;
|
|
24495
|
-
changeProperties({
|
|
24496
|
-
'fill-opacity': newOpacity,
|
|
24497
|
-
'stroke-opacity': clamp$1(newOpacity + additionalStrokeOpacity, 0.01, 1)
|
|
24498
|
-
});
|
|
24499
|
-
};
|
|
24500
|
-
var onKeyDown = function onKeyDown(event) {
|
|
24501
|
-
if (event.key === 'Escape') {
|
|
24502
|
-
deactivateTool();
|
|
24503
|
-
}
|
|
24504
|
-
};
|
|
24505
|
-
var onMount = function onMount() {
|
|
24506
|
-
// sets the initial values
|
|
24507
|
-
if (defaultGeoJSON) {
|
|
24508
|
-
// TODO: defaults open to poly. When creating new tools, this should be based on the selectionType properties of the given geoJSON
|
|
24509
|
-
changeActiveTool(editModes[0]);
|
|
24510
|
-
setGeoJSON(defaultGeoJSON);
|
|
24511
|
-
}
|
|
24512
|
-
};
|
|
24513
|
-
var onUnMount = function onUnMount() {
|
|
24514
|
-
// clear shape
|
|
24515
|
-
changeActiveTool(editModes.find(function (mode) {
|
|
24516
|
-
return mode.value === 'DELETE';
|
|
24517
|
-
}));
|
|
24518
|
-
};
|
|
24519
|
-
React.useEffect(function () {
|
|
24520
|
-
onMount();
|
|
24521
|
-
return function () {
|
|
24522
|
-
onUnMount();
|
|
24523
|
-
};
|
|
24524
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24525
|
-
}, []);
|
|
24526
|
-
return /*#__PURE__*/React.createElement(Box$2, {
|
|
24527
|
-
"data-testid": "drawingToolForm",
|
|
24528
|
-
sx: {
|
|
24529
|
-
padding: '16px',
|
|
24530
|
-
height: '100%'
|
|
24531
|
-
}
|
|
24532
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
24533
|
-
container: true,
|
|
24534
|
-
direction: "column",
|
|
24535
|
-
justifyContent: "space-between",
|
|
24536
|
-
sx: {
|
|
24537
|
-
height: '100%'
|
|
24538
|
-
}
|
|
24539
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
24540
|
-
item: true,
|
|
24541
|
-
container: true,
|
|
24542
|
-
direction: "column",
|
|
24543
|
-
spacing: 1
|
|
24544
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
24545
|
-
item: true
|
|
24546
|
-
}, /*#__PURE__*/React.createElement(Typography, {
|
|
24547
|
-
variant: "body2"
|
|
24548
|
-
}, "Tools")), /*#__PURE__*/React.createElement(Grid, {
|
|
24549
|
-
item: true,
|
|
24550
|
-
container: true
|
|
24551
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
24552
|
-
item: true
|
|
24553
|
-
}, editModes.map(function (mode) {
|
|
24554
|
-
return /*#__PURE__*/React.createElement(CustomIconButton, {
|
|
24555
|
-
key: mode.id,
|
|
24556
|
-
variant: "tool",
|
|
24557
|
-
tooltipTitle: mode.title,
|
|
24558
|
-
isSelected: mode.isSelectable && activeTool === mode.id,
|
|
24559
|
-
onClick: function onClick() {
|
|
24560
|
-
return changeActiveTool(mode);
|
|
24561
|
-
},
|
|
24562
|
-
sx: {
|
|
24563
|
-
marginRight: 1,
|
|
24564
|
-
marginBottom: 1
|
|
24565
|
-
},
|
|
24566
|
-
"data-testid": mode.id,
|
|
24567
|
-
onKeyDown: onKeyDown,
|
|
24568
|
-
disabled: isLoading
|
|
24569
|
-
}, mode.icon);
|
|
24570
|
-
}), isInEditMode && /*#__PURE__*/React.createElement(Typography, {
|
|
24571
|
-
component: "span",
|
|
24572
|
-
sx: {
|
|
24573
|
-
display: 'inline-block',
|
|
24574
|
-
marginLeft: 2,
|
|
24575
|
-
top: -1,
|
|
24576
|
-
position: 'relative',
|
|
24577
|
-
fontSize: 14
|
|
24578
|
-
}
|
|
24579
|
-
}, DRAW_EXIT_MODE_MESSAGE))), /*#__PURE__*/React.createElement(Grid, {
|
|
24580
|
-
item: true,
|
|
24581
|
-
container: true
|
|
24582
|
-
}, /*#__PURE__*/React.createElement(Grid, {
|
|
24583
|
-
item: true,
|
|
24584
|
-
xs: 12,
|
|
24585
|
-
sm: 6
|
|
24586
|
-
}, /*#__PURE__*/React.createElement(ReactHookFormSelect, {
|
|
24587
|
-
name: "opacity",
|
|
24588
|
-
label: INPUT_OPACITY,
|
|
24589
|
-
rules: {},
|
|
24590
|
-
disabled: isLoading,
|
|
24591
|
-
isReadOnly: false,
|
|
24592
|
-
"data-testid": "drawingToolForm-opacity",
|
|
24593
|
-
onChange: onChangeOpacity,
|
|
24594
|
-
autoFocus: true,
|
|
24595
|
-
value: opacity
|
|
24596
|
-
}, opacityOptions.map(function (opacity) {
|
|
24597
|
-
return /*#__PURE__*/React.createElement(MenuItem, {
|
|
24598
|
-
value: opacity,
|
|
24599
|
-
key: opacity
|
|
24600
|
-
}, opacity, " %");
|
|
24601
|
-
})))), /*#__PURE__*/React.createElement(Grid, {
|
|
24602
|
-
item: true
|
|
24603
|
-
}, /*#__PURE__*/React.createElement(ReactHookFormTextField, {
|
|
24604
|
-
name: "areaName",
|
|
24605
|
-
label: INPUT_AREA,
|
|
24606
|
-
rules: {
|
|
24607
|
-
required: true
|
|
24608
|
-
},
|
|
24609
|
-
disabled: isLoading,
|
|
24610
|
-
isReadOnly: false
|
|
24611
|
-
}), /*#__PURE__*/React.createElement(ReactHookFormHiddenInput, {
|
|
24612
|
-
name: "id"
|
|
24613
|
-
}))), /*#__PURE__*/React.createElement(Grid, {
|
|
24614
|
-
item: true
|
|
24615
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
24616
|
-
variant: "primary",
|
|
24617
|
-
onClick: onSubmit,
|
|
24618
|
-
sx: {
|
|
24619
|
-
width: '100%',
|
|
24620
|
-
textTransform: 'none'
|
|
24621
|
-
},
|
|
24622
|
-
"data-testid": "saveDrawingFormButton",
|
|
24623
|
-
// TODO: re-enable for: https://gitlab.com/opengeoweb/opengeoweb/-/issues/4080
|
|
24624
|
-
// disabled={isLoading || hasErrors}
|
|
24625
|
-
disabled: isLoading || id !== '' || hasErrors
|
|
24626
|
-
}, id !== '' ? UPDATE_AREA_BUTTON : SAVE_AREA_BUTTON))));
|
|
24627
|
-
};
|
|
24628
|
-
var Wrapper = function Wrapper(props) {
|
|
24629
|
-
var _props$id = props.id,
|
|
24630
|
-
id = _props$id === void 0 ? '' : _props$id,
|
|
24631
|
-
_props$areaName = props.areaName,
|
|
24632
|
-
areaName = _props$areaName === void 0 ? '' : _props$areaName,
|
|
24633
|
-
area = props.area;
|
|
24634
|
-
return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
|
|
24635
|
-
options: Object.assign(Object.assign({}, defaultFormOptions), {
|
|
24636
|
-
defaultValues: {
|
|
24637
|
-
id: id,
|
|
24638
|
-
area: area,
|
|
24639
|
-
areaName: getAreaName(areaName)
|
|
24640
|
-
}
|
|
24641
|
-
})
|
|
24642
|
-
}, /*#__PURE__*/React.createElement(DrawingToolForm, Object.assign({}, props)));
|
|
24643
|
-
};
|
|
24644
|
-
|
|
24645
|
-
/* *
|
|
24646
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
24647
|
-
* you may not use this file except in compliance with the License.
|
|
24648
|
-
* You may obtain a copy of the License at
|
|
24649
|
-
*
|
|
24650
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24651
|
-
*
|
|
24652
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24653
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
24654
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24655
|
-
* See the License for the specific language governing permissions and
|
|
24656
|
-
* limitations under the License.
|
|
24657
|
-
*
|
|
24658
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
24659
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
24660
|
-
* */
|
|
24661
|
-
var DrawingToolFormConnect = function DrawingToolFormConnect(_ref) {
|
|
24662
|
-
var mapId = _ref.mapId;
|
|
24663
|
-
var dispatch = useDispatch();
|
|
24664
|
-
var drawing = useSelector(function (store) {
|
|
24665
|
-
return drawSelectors.selectDrawByMapId(store, mapId);
|
|
24666
|
-
});
|
|
24667
|
-
var isDialogLoading = useSelector(function (store) {
|
|
24668
|
-
return uiSelectors.getDialogIsLoading(store, "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId));
|
|
24669
|
-
});
|
|
24670
|
-
var onSubmitForm = function onSubmitForm(formValues) {
|
|
24671
|
-
dispatch(drawActions.submitDrawValues({
|
|
24672
|
-
mapId: mapId,
|
|
24673
|
-
area: formValues.area,
|
|
24674
|
-
name: formValues.areaName,
|
|
24675
|
-
scope: 'user'
|
|
24676
|
-
}));
|
|
24677
|
-
};
|
|
24678
|
-
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
24679
|
-
id: drawing === null || drawing === void 0 ? void 0 : drawing.id,
|
|
24680
|
-
onSubmitForm: onSubmitForm,
|
|
24681
|
-
areaName: drawing === null || drawing === void 0 ? void 0 : drawing.areaName,
|
|
24682
|
-
area: drawing === null || drawing === void 0 ? void 0 : drawing.area,
|
|
24683
|
-
isLoading: isDialogLoading
|
|
24684
|
-
});
|
|
24685
|
-
};
|
|
24686
|
-
|
|
24687
|
-
/* *
|
|
24688
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
24689
|
-
* you may not use this file except in compliance with the License.
|
|
24690
|
-
* You may obtain a copy of the License at
|
|
24691
|
-
*
|
|
24692
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
24693
|
-
*
|
|
24694
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
24695
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
24696
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24697
|
-
* See the License for the specific language governing permissions and
|
|
24698
|
-
* limitations under the License.
|
|
24699
|
-
*
|
|
24700
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
24701
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
24702
|
-
* */
|
|
24703
|
-
var getDialogType = function getDialogType(mapId, isMultiMap, isDocked) {
|
|
24704
|
-
if (isDocked) {
|
|
24705
|
-
return "".concat(uiTypes.DialogTypes.DockedDrawingTool, "-").concat(mapId);
|
|
24706
|
-
}
|
|
24707
|
-
if (isMultiMap) {
|
|
24708
|
-
return "".concat(uiTypes.DialogTypes.DrawingTool, "-").concat(mapId);
|
|
24709
|
-
}
|
|
24710
|
-
return uiTypes.DialogTypes.DrawingTool;
|
|
24711
|
-
};
|
|
24712
|
-
var DrawingToolConnect = function DrawingToolConnect(_ref) {
|
|
24713
|
-
var bounds = _ref.bounds,
|
|
24714
|
-
_ref$title = _ref.title,
|
|
24715
|
-
title = _ref$title === void 0 ? 'Drawing Toolbox' : _ref$title,
|
|
24716
|
-
_ref$showMapIdInTitle = _ref.showMapIdInTitle,
|
|
24717
|
-
showMapIdInTitle = _ref$showMapIdInTitle === void 0 ? false : _ref$showMapIdInTitle,
|
|
24718
|
-
_ref$mapId = _ref.mapId,
|
|
24719
|
-
initialMapId = _ref$mapId === void 0 ? null : _ref$mapId,
|
|
24720
|
-
_ref$isMultiMap = _ref.isMultiMap,
|
|
24721
|
-
isMultiMap = _ref$isMultiMap === void 0 ? false : _ref$isMultiMap,
|
|
24722
|
-
_ref$isDocked = _ref.isDocked,
|
|
24723
|
-
isDocked = _ref$isDocked === void 0 ? false : _ref$isDocked,
|
|
24724
|
-
_ref$source = _ref.source,
|
|
24725
|
-
source = _ref$source === void 0 ? 'app' : _ref$source;
|
|
24726
|
-
var dialogType = getDialogType(initialMapId, isMultiMap, isDocked);
|
|
24727
|
-
var _useMapDrawContext = useMapDrawContext(),
|
|
24728
|
-
deactivateTool = _useMapDrawContext.deactivateTool;
|
|
24729
|
-
var activeMapId = useSelector(function (store) {
|
|
24730
|
-
return uiSelectors.getDialogMapId(store, dialogType);
|
|
24731
|
-
});
|
|
24732
|
-
// In case of a docked drawing toolbox or multimap, use the map id that is passed
|
|
24733
|
-
// For floating drawingtoolbox, use the currently active, selected mapid
|
|
24734
|
-
var mapId = initialMapId || activeMapId;
|
|
24735
|
-
var _useAreaDrawDialogAct = useAreaDrawDialogAction({
|
|
24736
|
-
mapId: mapId,
|
|
24737
|
-
source: source
|
|
24738
|
-
}),
|
|
24739
|
-
closeDrawDialog = _useAreaDrawDialogAct.closeDrawDialog;
|
|
24740
|
-
var _useSetupDialog = useSetupDialog(dialogType, source),
|
|
24741
|
-
dialogOrder = _useSetupDialog.dialogOrder,
|
|
24742
|
-
setDialogOrder = _useSetupDialog.setDialogOrder,
|
|
24743
|
-
isDialogOpen = _useSetupDialog.isDialogOpen,
|
|
24744
|
-
uiSource = _useSetupDialog.uiSource,
|
|
24745
|
-
uiIsLoading = _useSetupDialog.uiIsLoading,
|
|
24746
|
-
uiError = _useSetupDialog.uiError,
|
|
24747
|
-
setFocused = _useSetupDialog.setFocused;
|
|
24748
|
-
// TODO: Re-enable when we put back in the floating version when drawing tools become available: https://gitlab.com/opengeoweb/opengeoweb/-/issues/3872
|
|
24749
|
-
// const onToggleDock = (): void => {
|
|
24750
|
-
// onCloseDialog();
|
|
24751
|
-
// if (isDocked) {
|
|
24752
|
-
// // Close docked drawingtool and open the floating drawingtool
|
|
24753
|
-
// dispatch(
|
|
24754
|
-
// uiActions.setActiveMapIdForDialog({
|
|
24755
|
-
// type: uiTypes.DialogTypes.DrawingTool,
|
|
24756
|
-
// mapId,
|
|
24757
|
-
// setOpen: true,
|
|
24758
|
-
// source,
|
|
24759
|
-
// }),
|
|
24760
|
-
// );
|
|
24761
|
-
// } else {
|
|
24762
|
-
// // Close the floating drawingtool and open docked drawingtool
|
|
24763
|
-
// dispatch(
|
|
24764
|
-
// uiActions.setToggleOpenDialog({
|
|
24765
|
-
// type: `${uiTypes.DialogTypes.DockedDrawingTool}-${mapId}`,
|
|
24766
|
-
// setOpen: true,
|
|
24767
|
-
// }),
|
|
24768
|
-
// );
|
|
24769
|
-
// }
|
|
24770
|
-
// };
|
|
24771
|
-
var shownTitle = showMapIdInTitle ? "".concat(title, " ").concat(mapId) : title;
|
|
24772
|
-
var onClose = function onClose() {
|
|
24773
|
-
deactivateTool();
|
|
24774
|
-
closeDrawDialog();
|
|
24775
|
-
};
|
|
24776
|
-
if (!isDialogOpen) {
|
|
24777
|
-
return null;
|
|
24778
|
-
}
|
|
24779
|
-
return /*#__PURE__*/React.createElement(DrawingTool, {
|
|
24780
|
-
bounds: bounds,
|
|
24781
|
-
isOpen: isDialogOpen,
|
|
24782
|
-
onClose: onClose,
|
|
24783
|
-
title: shownTitle,
|
|
24784
|
-
onMouseDown: setDialogOrder,
|
|
24785
|
-
order: dialogOrder,
|
|
24786
|
-
source: uiSource,
|
|
24787
|
-
isLoading: uiIsLoading,
|
|
24788
|
-
error: uiError,
|
|
24789
|
-
// onToggleDock={onToggleDock}
|
|
24790
|
-
setFocused: setFocused,
|
|
24791
|
-
headerSize: "xs",
|
|
24792
|
-
isDocked: isDocked,
|
|
24793
|
-
startPosition: {
|
|
24794
|
-
top: 134,
|
|
24795
|
-
left: 50
|
|
24796
|
-
}
|
|
24797
|
-
}, /*#__PURE__*/React.createElement(DrawingToolFormConnect, {
|
|
24798
|
-
mapId: mapId
|
|
24799
|
-
}));
|
|
24800
|
-
};
|
|
24801
|
-
|
|
24802
|
-
var titleStyle = function titleStyle(theme) {
|
|
24803
|
-
return {
|
|
24804
|
-
position: 'absolute',
|
|
24805
|
-
padding: '5px',
|
|
24806
|
-
zIndex: 50,
|
|
24807
|
-
color: theme.palette.common.black,
|
|
24808
|
-
whiteSpace: 'nowrap',
|
|
24809
|
-
userSelect: 'none'
|
|
23812
|
+
position: 'absolute',
|
|
23813
|
+
padding: '5px',
|
|
23814
|
+
zIndex: 50,
|
|
23815
|
+
color: theme.palette.common.black,
|
|
23816
|
+
whiteSpace: 'nowrap',
|
|
23817
|
+
userSelect: 'none'
|
|
24810
23818
|
};
|
|
24811
23819
|
};
|
|
24812
23820
|
var defaultBbox = {
|
|
@@ -24818,7 +23826,7 @@ var defaultBbox = {
|
|
|
24818
23826
|
top: 11520588.9031
|
|
24819
23827
|
}
|
|
24820
23828
|
};
|
|
24821
|
-
var
|
|
23829
|
+
var ConfigurableMapConnect = function ConfigurableMapConnect(_a) {
|
|
24822
23830
|
var id = _a.id,
|
|
24823
23831
|
dockedLayerManagerSize = _a.dockedLayerManagerSize,
|
|
24824
23832
|
title = _a.title,
|
|
@@ -24911,16 +23919,20 @@ var BaseConfigurableMapConnect = function BaseConfigurableMapConnect(_a) {
|
|
|
24911
23919
|
setOpen: true
|
|
24912
23920
|
}));
|
|
24913
23921
|
}
|
|
23922
|
+
if (shouldDisplayDrawControls) {
|
|
23923
|
+
dispatch(mapStoreActions.addLayer({
|
|
23924
|
+
mapId: mapId,
|
|
23925
|
+
layer: {
|
|
23926
|
+
geojson: emptyGeoJSON,
|
|
23927
|
+
layerType: LayerType.featureLayer
|
|
23928
|
+
},
|
|
23929
|
+
layerId: getSingularDrawtoolDrawLayerId(mapId),
|
|
23930
|
+
origin: 'ConfigurableMapConnect'
|
|
23931
|
+
}));
|
|
23932
|
+
}
|
|
24914
23933
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24915
23934
|
}, []);
|
|
24916
23935
|
var mapControlsPositionTop = title ? 24 : 8;
|
|
24917
|
-
// draw tools
|
|
24918
|
-
var _useMapDrawContext = useMapDrawContext(),
|
|
24919
|
-
geoJSONLayers = _useMapDrawContext.layers,
|
|
24920
|
-
deactivateTool = _useMapDrawContext.deactivateTool;
|
|
24921
|
-
var onExitDrawMode = function onExitDrawMode() {
|
|
24922
|
-
deactivateTool();
|
|
24923
|
-
};
|
|
24924
23936
|
return /*#__PURE__*/React__default.createElement(Box$2, {
|
|
24925
23937
|
sx: {
|
|
24926
23938
|
width: '100%',
|
|
@@ -24948,8 +23960,6 @@ var BaseConfigurableMapConnect = function BaseConfigurableMapConnect(_a) {
|
|
|
24948
23960
|
mapId: mapId
|
|
24949
23961
|
}), displayGetFeatureInfoButtonInMap && /*#__PURE__*/React__default.createElement(GetFeatureInfoButtonConnect, {
|
|
24950
23962
|
mapId: mapId
|
|
24951
|
-
}), shouldDisplayDrawControls && /*#__PURE__*/React__default.createElement(DrawingToolMapButtonConnect, {
|
|
24952
|
-
mapId: mapId
|
|
24953
23963
|
}), mapControls), !disableTimeSlider && /*#__PURE__*/React__default.createElement(Box$2, {
|
|
24954
23964
|
sx: {
|
|
24955
23965
|
position: 'absolute',
|
|
@@ -24966,13 +23976,7 @@ var BaseConfigurableMapConnect = function BaseConfigurableMapConnect(_a) {
|
|
|
24966
23976
|
displayTimeInMap: displayTimeInMap,
|
|
24967
23977
|
showScaleBar: false,
|
|
24968
23978
|
mapId: mapId
|
|
24969
|
-
}, children
|
|
24970
|
-
return /*#__PURE__*/React__default.createElement(MapViewLayer, Object.assign({
|
|
24971
|
-
key: layer.id
|
|
24972
|
-
}, layer, {
|
|
24973
|
-
exitDrawModeCallback: onExitDrawMode
|
|
24974
|
-
}));
|
|
24975
|
-
})), multiLegend && /*#__PURE__*/React__default.createElement(LegendConnect, {
|
|
23979
|
+
}, children), multiLegend && /*#__PURE__*/React__default.createElement(LegendConnect, {
|
|
24976
23980
|
showMapId: true,
|
|
24977
23981
|
mapId: mapId,
|
|
24978
23982
|
multiLegend: multiLegend
|
|
@@ -24985,17 +23989,8 @@ var BaseConfigurableMapConnect = function BaseConfigurableMapConnect(_a) {
|
|
|
24985
23989
|
mapId: mapId,
|
|
24986
23990
|
bounds: "parent",
|
|
24987
23991
|
isDocked: true
|
|
24988
|
-
}), shouldDisplayDrawControls && /*#__PURE__*/React__default.createElement(DrawingToolConnect, {
|
|
24989
|
-
mapId: mapId,
|
|
24990
|
-
isDocked: true,
|
|
24991
|
-
bounds: "parent"
|
|
24992
23992
|
}));
|
|
24993
23993
|
};
|
|
24994
|
-
var ConfigurableMapConnect = function ConfigurableMapConnect(props) {
|
|
24995
|
-
return /*#__PURE__*/React__default.createElement(MapDrawToolProvider, {
|
|
24996
|
-
options: drawOptions
|
|
24997
|
-
}, /*#__PURE__*/React__default.createElement(BaseConfigurableMapConnect, Object.assign({}, props)));
|
|
24998
|
-
};
|
|
24999
23994
|
|
|
25000
23995
|
/* *
|
|
25001
23996
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -25794,6 +24789,7 @@ var HOUR_TO_SECOND = 3600;
|
|
|
25794
24789
|
var HOUR_TO_MINUTE = 60;
|
|
25795
24790
|
var MILLISECOND_TO_DAY = 1 / 86400000;
|
|
25796
24791
|
var MILLISECOND_TO_SECOND = 1 / 1000;
|
|
24792
|
+
var MILLISECOND_TO_MINUTE = 1 / 60000;
|
|
25797
24793
|
var MINUTE_TO_SECOND = 60;
|
|
25798
24794
|
var SECOND_TO_DAY = 1 / 86400;
|
|
25799
24795
|
var SECOND_TO_HOUR = 1 / 3600;
|
|
@@ -25863,6 +24859,11 @@ var getNearestSelectableTime = function getNearestSelectableTime(timeStep, start
|
|
|
25863
24859
|
var result = isBetweenObservedAndForecast ? roundedCurrentTime : floorLocalSeconds(hoveredTime + timeStepSeconds / 2, timeStepSeconds);
|
|
25864
24860
|
return result;
|
|
25865
24861
|
};
|
|
24862
|
+
var floorLocalMinutes = function floorLocalMinutes(selectedTimeMinutes, timeStepMinutes, timeZoneOffsetMinutes) {
|
|
24863
|
+
var localTimeZoneOffset = timeZoneOffsetMinutes !== null && timeZoneOffsetMinutes !== void 0 ? timeZoneOffsetMinutes : new Date().getTimezoneOffset();
|
|
24864
|
+
var unFlooredTimeSteps = (selectedTimeMinutes - localTimeZoneOffset) / timeStepMinutes;
|
|
24865
|
+
return Math.floor(unFlooredTimeSteps) * timeStepMinutes + localTimeZoneOffset;
|
|
24866
|
+
};
|
|
25866
24867
|
var floorLocalSeconds = function floorLocalSeconds(selectedTimeSeconds, timeStepSeconds, timeZoneOffsetSeconds) {
|
|
25867
24868
|
var localTimeZoneOffset = timeZoneOffsetSeconds !== null && timeZoneOffsetSeconds !== void 0 ? timeZoneOffsetSeconds : new Date().getTimezoneOffset() * 60;
|
|
25868
24869
|
var unFlooredTimeSteps = (selectedTimeSeconds - localTimeZoneOffset) / timeStepSeconds;
|
|
@@ -26016,6 +25017,54 @@ var getRemainingHours = function getRemainingHours(maxHours, days) {
|
|
|
26016
25017
|
var secondsSinceLocalMidnight = function secondsSinceLocalMidnight(currentTimeInSeconds) {
|
|
26017
25018
|
return new Date(currentTimeInSeconds * 1000).getHours() * HOUR_TO_SECOND + new Date(currentTimeInSeconds * 1000).getMinutes() * MINUTE_TO_SECOND + new Date(currentTimeInSeconds * 1000).getSeconds();
|
|
26018
25019
|
};
|
|
25020
|
+
var getTimeScaleDescription = function getTimeScaleDescription(timeScale) {
|
|
25021
|
+
if (timeScale !== 1 && timeScale < HOUR_TO_SECOND) {
|
|
25022
|
+
return "".concat(Math.round(timeScale / MINUTE_TO_SECOND), " minutes is ~1 second");
|
|
25023
|
+
}
|
|
25024
|
+
if (timeScale > 60) {
|
|
25025
|
+
var hours = Math.floor(timeScale / HOUR_TO_SECOND);
|
|
25026
|
+
var mins = Math.round((timeScale - hours * HOUR_TO_SECOND) / MINUTE_TO_SECOND);
|
|
25027
|
+
return "".concat(hours, " h ").concat(mins, " min is ~1 second");
|
|
25028
|
+
}
|
|
25029
|
+
return 'Real-time';
|
|
25030
|
+
};
|
|
25031
|
+
|
|
25032
|
+
var timeSliderLiteUtils = /*#__PURE__*/Object.freeze({
|
|
25033
|
+
__proto__: null,
|
|
25034
|
+
DAY_TO_MILLISECOND: DAY_TO_MILLISECOND,
|
|
25035
|
+
DAY_TO_SECOND: DAY_TO_SECOND,
|
|
25036
|
+
HOUR_TO_SECOND: HOUR_TO_SECOND,
|
|
25037
|
+
HOUR_TO_MINUTE: HOUR_TO_MINUTE,
|
|
25038
|
+
MILLISECOND_TO_DAY: MILLISECOND_TO_DAY,
|
|
25039
|
+
MILLISECOND_TO_SECOND: MILLISECOND_TO_SECOND,
|
|
25040
|
+
MILLISECOND_TO_MINUTE: MILLISECOND_TO_MINUTE,
|
|
25041
|
+
MINUTE_TO_SECOND: MINUTE_TO_SECOND,
|
|
25042
|
+
SECOND_TO_DAY: SECOND_TO_DAY,
|
|
25043
|
+
SECOND_TO_HOUR: SECOND_TO_HOUR,
|
|
25044
|
+
SECOND_TO_MILLISECOND: SECOND_TO_MILLISECOND,
|
|
25045
|
+
SEVEN_DAYS_IN_SECONDS: SEVEN_DAYS_IN_SECONDS,
|
|
25046
|
+
reformatFinnishDateString: reformatFinnishDateString,
|
|
25047
|
+
shortUTCTime: shortUTCTime,
|
|
25048
|
+
getMonthChanges: getMonthChanges,
|
|
25049
|
+
getSelectedTimePx: getSelectedTimePx,
|
|
25050
|
+
boundedValue: boundedValue,
|
|
25051
|
+
getSelectedTimeFromPx: getSelectedTimeFromPx,
|
|
25052
|
+
getNearestSelectableTime: getNearestSelectableTime,
|
|
25053
|
+
floorLocalMinutes: floorLocalMinutes,
|
|
25054
|
+
floorLocalSeconds: floorLocalSeconds,
|
|
25055
|
+
secondsToDaysAndHours: secondsToDaysAndHours,
|
|
25056
|
+
hoursAndDaysToSeconds: hoursAndDaysToSeconds,
|
|
25057
|
+
TIME_SLIDER_LITE_DEFAULT_MAX_FORECAST_RANGE: TIME_SLIDER_LITE_DEFAULT_MAX_FORECAST_RANGE,
|
|
25058
|
+
TIME_SLIDER_LITE_DEFAULT_MAX_OBSERVED_RANGE: TIME_SLIDER_LITE_DEFAULT_MAX_OBSERVED_RANGE,
|
|
25059
|
+
defaultTimeRange: defaultTimeRange,
|
|
25060
|
+
useDefaultTimeRange: useDefaultTimeRange,
|
|
25061
|
+
generateCustomTimeList: generateCustomTimeList,
|
|
25062
|
+
subTicksPerDay: subTicksPerDay,
|
|
25063
|
+
maxSubTicksPerDay: maxSubTicksPerDay,
|
|
25064
|
+
getRemainingHours: getRemainingHours,
|
|
25065
|
+
secondsSinceLocalMidnight: secondsSinceLocalMidnight,
|
|
25066
|
+
getTimeScaleDescription: getTimeScaleDescription
|
|
25067
|
+
});
|
|
26019
25068
|
|
|
26020
25069
|
/* *
|
|
26021
25070
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -26639,7 +25688,7 @@ var TimeSliderLiteOptionsMenu = function TimeSliderLiteOptionsMenu(_ref) {
|
|
|
26639
25688
|
speedOptionItemPrefix = _ref.speedOptionItemPrefix,
|
|
26640
25689
|
speedOptions = _ref.speedOptions,
|
|
26641
25690
|
updateIntervalOptions = _ref.updateIntervalOptions,
|
|
26642
|
-
|
|
25691
|
+
subMenuSx = _ref.subMenuSx,
|
|
26643
25692
|
sx = _ref.sx,
|
|
26644
25693
|
_ref$TimeZoneSwitch = _ref.TimeZoneSwitch,
|
|
26645
25694
|
TimeZoneSwitch$1 = _ref$TimeZoneSwitch === void 0 ? TimeZoneSwitch : _ref$TimeZoneSwitch,
|
|
@@ -26660,7 +25709,7 @@ var TimeSliderLiteOptionsMenu = function TimeSliderLiteOptionsMenu(_ref) {
|
|
|
26660
25709
|
sx: Object.assign({
|
|
26661
25710
|
left: submenuLeft,
|
|
26662
25711
|
marginLeft: '-12px'
|
|
26663
|
-
},
|
|
25712
|
+
}, subMenuSx),
|
|
26664
25713
|
setSubmenu: setSubmenu,
|
|
26665
25714
|
title: getTitle(submenu),
|
|
26666
25715
|
closeButtonIcon: closeButtonIcon
|
|
@@ -27498,6 +26547,9 @@ var TimeSliderLite = function TimeSliderLite(_ref) {
|
|
|
27498
26547
|
_ref$height = _ref.height,
|
|
27499
26548
|
height = _ref$height === void 0 ? TIME_SLIDER_LITE_DEFAULT_HEIGHT : _ref$height,
|
|
27500
26549
|
hideButton = _ref.hideButton,
|
|
26550
|
+
hideMenuButton = _ref.hideMenuButton,
|
|
26551
|
+
hideStepButtons = _ref.hideStepButtons,
|
|
26552
|
+
hidePlayButton = _ref.hidePlayButton,
|
|
27501
26553
|
isAnimating = _ref.isAnimating,
|
|
27502
26554
|
isVisible = _ref.isVisible,
|
|
27503
26555
|
_ref$locale = _ref.locale,
|
|
@@ -27508,12 +26560,12 @@ var TimeSliderLite = function TimeSliderLite(_ref) {
|
|
|
27508
26560
|
overrideAnimation = _ref.overrideAnimation,
|
|
27509
26561
|
onToggleAnimation = _ref.onToggleAnimation,
|
|
27510
26562
|
onToggleMenu = _ref.onToggleMenu,
|
|
26563
|
+
onToggleTimeSlider = _ref.onToggleTimeSlider,
|
|
27511
26564
|
needleWidth = _ref.needleWidth,
|
|
27512
26565
|
needleDragAreaWidth = _ref.needleDragAreaWidth,
|
|
27513
26566
|
needleLabelZIndex = _ref.needleLabelZIndex,
|
|
27514
26567
|
needleLabelOffset = _ref.needleLabelOffset,
|
|
27515
26568
|
draggableTimeStamp = _ref.draggableTimeStamp,
|
|
27516
|
-
onToggleTimeSlider = _ref.onToggleTimeSlider,
|
|
27517
26569
|
selectedTime = _ref.selectedTime,
|
|
27518
26570
|
setSelectedTime = _ref.setSelectedTime,
|
|
27519
26571
|
settings = _ref.settings,
|
|
@@ -27609,7 +26661,7 @@ var TimeSliderLite = function TimeSliderLite(_ref) {
|
|
|
27609
26661
|
}
|
|
27610
26662
|
}, controlButtons || /*#__PURE__*/React__default.createElement(ControlButtonGroup, {
|
|
27611
26663
|
left: true
|
|
27612
|
-
}, /*#__PURE__*/React__default.createElement(MenuButton, {
|
|
26664
|
+
}, !hideMenuButton && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(MenuButton, {
|
|
27613
26665
|
settings: settings === null || settings === void 0 ? void 0 : settings.menuButton,
|
|
27614
26666
|
menuOpen: menuOpen,
|
|
27615
26667
|
onClick: onToggleMenu
|
|
@@ -27619,12 +26671,12 @@ var TimeSliderLite = function TimeSliderLite(_ref) {
|
|
|
27619
26671
|
height: "".concat(height, "px"),
|
|
27620
26672
|
margin: '2px'
|
|
27621
26673
|
}
|
|
27622
|
-
}), /*#__PURE__*/React__default.createElement(PlayButton, {
|
|
26674
|
+
})), !hidePlayButton && /*#__PURE__*/React__default.createElement(PlayButton, {
|
|
27623
26675
|
settings: settings === null || settings === void 0 ? void 0 : settings.playButton,
|
|
27624
26676
|
isAnimating: isAnimating,
|
|
27625
26677
|
onTogglePlayButton: onToggleAnimation,
|
|
27626
26678
|
tooltipDelay: tooltipDelay
|
|
27627
|
-
}), /*#__PURE__*/React__default.createElement(StepButton, {
|
|
26679
|
+
}), !hideStepButtons && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(StepButton, {
|
|
27628
26680
|
settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
|
|
27629
26681
|
onClick: function onClick() {
|
|
27630
26682
|
return handleTimeStep(-timeStepSeconds);
|
|
@@ -27637,7 +26689,7 @@ var TimeSliderLite = function TimeSliderLite(_ref) {
|
|
|
27637
26689
|
return handleTimeStep(timeStepSeconds);
|
|
27638
26690
|
},
|
|
27639
26691
|
tooltipDelay: tooltipDelay
|
|
27640
|
-
}))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
26692
|
+
})))), /*#__PURE__*/React__default.createElement(Grid, {
|
|
27641
26693
|
item: true
|
|
27642
26694
|
}, /*#__PURE__*/React__default.createElement(TimeSliderLiteBackground, {
|
|
27643
26695
|
draggableTimeStamp: draggableTimeStamp,
|
|
@@ -27679,13 +26731,13 @@ var TimeSliderLiteConnect = function TimeSliderLiteConnect(_a) {
|
|
|
27679
26731
|
var _b, _c, _d, _e, _f;
|
|
27680
26732
|
var overrideUseTimeRange = _a.overrideUseTimeRange,
|
|
27681
26733
|
overrideUseTimeStep = _a.overrideUseTimeStep,
|
|
26734
|
+
overrideUseTimeZone = _a.overrideUseTimeZone,
|
|
27682
26735
|
sourceId = _a.sourceId,
|
|
27683
26736
|
mapId = _a.mapId,
|
|
27684
26737
|
_a$isAlwaysVisible = _a.isAlwaysVisible,
|
|
27685
26738
|
isAlwaysVisible = _a$isAlwaysVisible === void 0 ? false : _a$isAlwaysVisible,
|
|
27686
|
-
|
|
27687
|
-
|
|
27688
|
-
timeSliderProps = __rest(_a, ["overrideUseTimeRange", "overrideUseTimeStep", "sourceId", "mapId", "isAlwaysVisible", "menuSx", "subMenuSx"]);
|
|
26739
|
+
TimeSliderLiteOptionsMenuProps = _a.TimeSliderLiteOptionsMenuProps,
|
|
26740
|
+
timeSliderProps = __rest(_a, ["overrideUseTimeRange", "overrideUseTimeStep", "overrideUseTimeZone", "sourceId", "mapId", "isAlwaysVisible", "TimeSliderLiteOptionsMenuProps"]);
|
|
27689
26741
|
var _React$useState = React.useState(false),
|
|
27690
26742
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27691
26743
|
menuOpen = _React$useState2[0],
|
|
@@ -27700,10 +26752,11 @@ var TimeSliderLiteConnect = function TimeSliderLiteConnect(_a) {
|
|
|
27700
26752
|
_ref4 = _slicedToArray(_ref3, 2),
|
|
27701
26753
|
timeStep = _ref4[0],
|
|
27702
26754
|
setTimeStep = _ref4[1];
|
|
27703
|
-
var
|
|
27704
|
-
|
|
27705
|
-
|
|
27706
|
-
|
|
26755
|
+
var useTimeZone = React.useState('LT');
|
|
26756
|
+
var _ref5 = overrideUseTimeZone || useTimeZone,
|
|
26757
|
+
_ref6 = _slicedToArray(_ref5, 2),
|
|
26758
|
+
timeZone = _ref6[0],
|
|
26759
|
+
setTimeZone = _ref6[1];
|
|
27707
26760
|
var isTimeSliderVisible = useSelector(function (store) {
|
|
27708
26761
|
return mapSelectors.isTimeSliderVisible(store, mapId);
|
|
27709
26762
|
});
|
|
@@ -27732,9 +26785,6 @@ var TimeSliderLiteConnect = function TimeSliderLiteConnect(_a) {
|
|
|
27732
26785
|
}));
|
|
27733
26786
|
};
|
|
27734
26787
|
var defaultTimeStep = [5, 15];
|
|
27735
|
-
var dimensions = useSelector(function (store) {
|
|
27736
|
-
return mapSelectors.getMapDimensions(store, mapId);
|
|
27737
|
-
});
|
|
27738
26788
|
var layers = useSelector(function (store) {
|
|
27739
26789
|
return mapSelectors.getMapLayers(store, mapId);
|
|
27740
26790
|
});
|
|
@@ -27742,12 +26792,13 @@ var TimeSliderLiteConnect = function TimeSliderLiteConnect(_a) {
|
|
|
27742
26792
|
_useDefaultTimeRange2 = _slicedToArray(_useDefaultTimeRange, 2),
|
|
27743
26793
|
defaultStartTime = _useDefaultTimeRange2[0],
|
|
27744
26794
|
defaultEndTime = _useDefaultTimeRange2[1];
|
|
27745
|
-
var
|
|
27746
|
-
|
|
27747
|
-
startTime =
|
|
27748
|
-
endTime =
|
|
27749
|
-
var
|
|
27750
|
-
|
|
26795
|
+
var _ref7 = timeRange || [defaultStartTime, defaultEndTime],
|
|
26796
|
+
_ref8 = _slicedToArray(_ref7, 2),
|
|
26797
|
+
startTime = _ref8[0],
|
|
26798
|
+
endTime = _ref8[1];
|
|
26799
|
+
var selectedTime = useSelector(function (store) {
|
|
26800
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
26801
|
+
});
|
|
27751
26802
|
var onToggleAnimation = function onToggleAnimation() {
|
|
27752
26803
|
var _a, _b;
|
|
27753
26804
|
if (isAnimating) {
|
|
@@ -27786,9 +26837,7 @@ var TimeSliderLiteConnect = function TimeSliderLiteConnect(_a) {
|
|
|
27786
26837
|
}
|
|
27787
26838
|
setTimeStep(newTimeStep);
|
|
27788
26839
|
};
|
|
27789
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, isVisible && menuOpen && /*#__PURE__*/React.createElement(TimeSliderLiteOptionsMenu, {
|
|
27790
|
-
sx: menuSx,
|
|
27791
|
-
submenuSx: subMenuSx,
|
|
26840
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isVisible && menuOpen && /*#__PURE__*/React.createElement(TimeSliderLiteOptionsMenu, Object.assign({
|
|
27792
26841
|
menuOpen: menuOpen,
|
|
27793
26842
|
setMenuOpen: setMenuOpen,
|
|
27794
26843
|
defaultTimeRange: [defaultStartTime, defaultEndTime],
|
|
@@ -27800,7 +26849,7 @@ var TimeSliderLiteConnect = function TimeSliderLiteConnect(_a) {
|
|
|
27800
26849
|
closeButtonIcon: (_c = (_b = timeSliderProps.settings) === null || _b === void 0 ? void 0 : _b.closeButton) === null || _c === void 0 ? void 0 : _c.icon,
|
|
27801
26850
|
dropdownButtonIcon: (_e = (_d = timeSliderProps.settings) === null || _d === void 0 ? void 0 : _d.dropdownButton) === null || _e === void 0 ? void 0 : _e.icon,
|
|
27802
26851
|
TimeZoneSwitch: (_f = timeSliderProps === null || timeSliderProps === void 0 ? void 0 : timeSliderProps.settings) === null || _f === void 0 ? void 0 : _f.TimeZoneSwitch
|
|
27803
|
-
}), /*#__PURE__*/React.createElement(TimeSliderLite, Object.assign({
|
|
26852
|
+
}, TimeSliderLiteOptionsMenuProps)), /*#__PURE__*/React.createElement(TimeSliderLite, Object.assign({
|
|
27804
26853
|
selectedTime: selectedTime,
|
|
27805
26854
|
timeStep: timeStep !== null && timeStep !== void 0 ? timeStep : defaultTimeStep,
|
|
27806
26855
|
timeZone: timeZone,
|
|
@@ -28086,7 +27135,7 @@ var CoreThemeStoreProvider = function CoreThemeStoreProvider(_ref3) {
|
|
|
28086
27135
|
};
|
|
28087
27136
|
|
|
28088
27137
|
/**
|
|
28089
|
-
* @remix-run/router v1.
|
|
27138
|
+
* @remix-run/router v1.9.0
|
|
28090
27139
|
*
|
|
28091
27140
|
* Copyright (c) Remix Software Inc.
|
|
28092
27141
|
*
|
|
@@ -28150,7 +27199,7 @@ function warning(cond, message) {
|
|
|
28150
27199
|
try {
|
|
28151
27200
|
// Welcome to debugging history!
|
|
28152
27201
|
//
|
|
28153
|
-
// This error is thrown as a convenience so you can more easily
|
|
27202
|
+
// This error is thrown as a convenience, so you can more easily
|
|
28154
27203
|
// find the source for a warning that appears in the console by
|
|
28155
27204
|
// enabling "pause on exceptions" in your JavaScript debugger.
|
|
28156
27205
|
throw new Error(message);
|
|
@@ -28326,7 +27375,7 @@ const validMutationMethodsArr = ["post", "put", "patch", "delete"];
|
|
|
28326
27375
|
["get", ...validMutationMethodsArr];
|
|
28327
27376
|
|
|
28328
27377
|
/**
|
|
28329
|
-
* React Router v6.
|
|
27378
|
+
* React Router v6.16.0
|
|
28330
27379
|
*
|
|
28331
27380
|
* Copyright (c) Remix Software Inc.
|
|
28332
27381
|
*
|
|
@@ -28649,61 +27698,4 @@ var AppWrapperConnect = withEggs([appModuleConfig])(function (_ref) {
|
|
|
28649
27698
|
return children;
|
|
28650
27699
|
});
|
|
28651
27700
|
|
|
28652
|
-
|
|
28653
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
28654
|
-
* you may not use this file except in compliance with the License.
|
|
28655
|
-
* You may obtain a copy of the License at
|
|
28656
|
-
*
|
|
28657
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
28658
|
-
*
|
|
28659
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
28660
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28661
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
28662
|
-
* See the License for the specific language governing permissions and
|
|
28663
|
-
* limitations under the License.
|
|
28664
|
-
*
|
|
28665
|
-
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
28666
|
-
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
28667
|
-
* */
|
|
28668
|
-
var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
28669
|
-
var selectedFeatureProperties = _ref.selectedFeatureProperties,
|
|
28670
|
-
languageIndex = _ref.languageIndex,
|
|
28671
|
-
parentSize = _ref.parentSize;
|
|
28672
|
-
var language = languageIndex || 0;
|
|
28673
|
-
var newWidth = parentSize ? parentSize - 100 : 350;
|
|
28674
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
28675
|
-
style: {
|
|
28676
|
-
position: 'fixed',
|
|
28677
|
-
width: "".concat(newWidth, "px"),
|
|
28678
|
-
height: '1px',
|
|
28679
|
-
display: 'flex',
|
|
28680
|
-
justifyContent: 'center',
|
|
28681
|
-
left: '50px'
|
|
28682
|
-
}
|
|
28683
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
28684
|
-
"data-testid": "map-warning-properties",
|
|
28685
|
-
style: {
|
|
28686
|
-
marginTop: '50px',
|
|
28687
|
-
width: '350px',
|
|
28688
|
-
height: '190px',
|
|
28689
|
-
padding: '0px 20px 20px',
|
|
28690
|
-
overflow: 'auto',
|
|
28691
|
-
fontSize: '11px',
|
|
28692
|
-
backgroundColor: '#CCCCCCC0'
|
|
28693
|
-
}
|
|
28694
|
-
}, /*#__PURE__*/React__default.createElement("h1", {
|
|
28695
|
-
"data-testid": "map-warning-properties-title"
|
|
28696
|
-
}, selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].areaDesc), selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].areaDesc && /*#__PURE__*/React__default.createElement("pre", {
|
|
28697
|
-
"data-testid": "map-warning-properties-row"
|
|
28698
|
-
}, "event:", ' ', selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].event), selectedFeatureProperties.onset && /*#__PURE__*/React__default.createElement("pre", {
|
|
28699
|
-
"data-testid": "map-warning-properties-row"
|
|
28700
|
-
}, "Sent:", ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.onset), 'dd MMM yyyy, HH:mm'), ' ', "UTC"), selectedFeatureProperties.expires && /*#__PURE__*/React__default.createElement("pre", {
|
|
28701
|
-
"data-testid": "map-warning-properties-row"
|
|
28702
|
-
}, "Expires:", ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.expires), 'dd MMM yyyy, HH:mm'), ' ', "UTC"), selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].senderName && /*#__PURE__*/React__default.createElement("pre", {
|
|
28703
|
-
"data-testid": "map-warning-properties-row"
|
|
28704
|
-
}, "Sender:", ' ', selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].senderName), selectedFeatureProperties.identifier && /*#__PURE__*/React__default.createElement("pre", {
|
|
28705
|
-
"data-testid": "map-warning-properties-row"
|
|
28706
|
-
}, "Identifier: ", selectedFeatureProperties.identifier)));
|
|
28707
|
-
};
|
|
28708
|
-
|
|
28709
|
-
export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, DrawingToolConnect, DrawingToolMapButtonConnect, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, LegendConnect, LegendMapButtonConnect, MapDrawToolProvider, MapViewConnect, MapWarningProperties, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnectMemo as TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, TimeSliderLiteConnect, TimeSliderLiteOptionsMenu, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, componentsLookUp, defaultBbox, defaultBox, defaultConfigurations, defaultDelete, defaultIntersectionStyleProperties, defaultPoint, defaultPolygon, drawOptions, filterMapPresets, filterServices, store, testLayers, timeSliderUtils, useAreaDrawDialogAction, useFetchServices, useMapDrawContext, useMapDrawTool, useSetupDialog };
|
|
27701
|
+
export { AppWrapperConnect, ConfigurableMapConnect, CoreThemeProvider, CoreThemeStoreProvider, HarmonieTempAndPrecipPreset, LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LayerSelectConnect, LegendConnect, LegendMapButtonConnect, MapViewConnect, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, RouterWrapperConnect, SnackbarWrapperConnect, SyncGroupViewerConnect, TimeSlider, BackwardForwardStepButtonConnect as TimeSliderBackwardForwardStepButtonConnect, TimeSliderButtonsConnectMemo as TimeSliderButtonsConnect, TimeSliderConnect, TimeSliderLite, TimeSliderLiteConnect, TimeSliderLiteOptionsMenu, timeSliderLiteUtils as TimeSliderLiteUtils, OptionsMenuButtonConnect as TimeSliderOptionsMenuButtonConnect, PlayButtonConnect as TimeSliderPlayButtonConnect, ZoomControlConnect, componentsLookUp, defaultBbox, defaultConfigurations, filterMapPresets, filterServices, store, testLayers, timeSliderUtils, useFetchServices, useSetupDialog };
|