@opengeoweb/core 19.6.1 → 20.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +411 -220
- package/dist/src/lib/components/MapDrawToolRedux/OpenLayersFeatureLayerConnect.d.ts +27 -4
- package/dist/src/lib/components/MapViewConnect/InitialZoomToLayerConnect.d.ts +8 -0
- package/dist/src/lib/components/MapViewConnect/useGetOpenLayersView.d.ts +2 -0
- package/dist/src/lib/components/MultiMapViewConnect/storyUtils/mapPresets.d.ts +10 -10
- package/dist/src/lib/components/TimeSliderConnect/TimeSliderButtonsConnect/AnimationLengthPanelConnect.d.ts +5 -0
- package/package.json +63 -63
package/dist/index.esm.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { FormControl, MenuItem, Grid, InputLabel, Paper, Box, Typography, CircularProgress, List, ListSubheader, ListItemButton, ListItemText, DialogContentText, TextField, InputAdornment, Button, useTheme, Tooltip, ListItem, ListItemIcon, Checkbox, Popper, Fade, styled, LinearProgress, Autocomplete, Switch, Select } from '@mui/material';
|
|
3
3
|
import React, { useMemo, useState, useCallback, useEffect, useContext } from 'react';
|
|
4
|
-
import { safelyInitI18nForTestsAndStories, sharedTranslations, SHARED_NAMESPACE, TooltipSelect, CustomIconButton, CustomDialog, CustomTooltip, ToggleMenu, AlertIcon, useConfirmationDialog, useScrollingInIsolation, sliderHeaderStyle, CustomSlider, SearchField, SearchHighlight, tooltipContainerStyles, renderCounter, AlertBanner, CustomAccordion, PROJECTION, calculateStartSize, useWheelStopPropagation, ToolContainerDraggable, dateUtils, sessionStorageProvider,
|
|
5
|
-
import { webmapUtils, queryWMSLayersTree, invalidateWMSGetCapabilities, LayerType, WMJSDimension, WMDefaultStyleName,
|
|
4
|
+
import { safelyInitI18nForTestsAndStories, sharedTranslations, SHARED_NAMESPACE, TooltipSelect, CustomIconButton, CustomDialog, CustomTooltip, ToggleMenu, AlertIcon, useConfirmationDialog, useScrollingInIsolation, sliderHeaderStyle, CustomSlider, SearchField, SearchHighlight, tooltipContainerStyles, renderCounter, AlertBanner, CustomAccordion, PROJECTION, calculateStartSize, useWheelStopPropagation, ToolContainerDraggable, useDebounce, dateUtils, sessionStorageProvider, usePrevious } from '@opengeoweb/shared';
|
|
5
|
+
import { webmapUtils, queryWMSLayersTree, invalidateWMSGetCapabilities, LayerType, WMJSDimension, WMDefaultStyleName, queryWMSServiceInfo, queryWMSLayers, getWMSServiceId, handleDateUtilsISOString, generateLayerId, getWMLayerById, getMapDimURL, WMLayer } from '@opengeoweb/webmap';
|
|
6
6
|
import _, { isEqual, isArray, range, zip, throttle } from 'lodash';
|
|
7
7
|
import { useDispatch, useSelector, connect, useStore, shallowEqual, Provider } from 'react-redux';
|
|
8
8
|
import { mapSelectors, layerSelectors, layerActions, layerTypes, filterLayers, mapActions, mapEnums, loadingIndicatorSelectors, layerUtils, serviceSelectors, serviceActions, uiSelectors, uiTypes, useSetupDialog, getUserAddedServices, uiActions, genericActions, drawingToolSelectors, syncGroupsSelectors, syncConstants, getViewObjectForSyncGroup, getViewObjectForMapId, loadingIndicatorActions, genericSelectors, PUBLIC_WARNING_DRAW_TOOL_ID, defaultLayers, getSingularDrawtoolDrawLayerId, syncGroupsSelector, syncGroupsActions, routerUtils, mapUtils } from '@opengeoweb/store';
|
|
9
9
|
import i18n from 'i18next';
|
|
10
10
|
import { useTranslation, Trans, I18nextProvider } from 'react-i18next';
|
|
11
|
-
import { TIME_SLIDER_NAMESPACE, timesliderTranslations, defaultTimeSpan,
|
|
12
|
-
import { webmapReactTranslations, WEBMAP_REACT_NAMESPACE, webmapTranslations, WEBMAP_NAMESPACE, openLayersGetMapImageStore, LayerInfoButton, useStacCollection, useGetWMLayerInstance, useEDRGetCollectionDetails, getStacCollectionStyles, resolvePreferredStyleName, defaultEdrStyles, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton, Clock, LegendDialog, LegendButton, MapContext, emptyGeoJSON, MapFeatureClass, setMapCenter, makeTimeList, getIsInsideAcceptanceTime, OpenLayersLayer, isGeoJSONGeometryEmpty, OpenLayersFeatureLayer, OpenLayersMapDraw, MapMeasure, useSetIntervalWhenVisible, TimeContext, OpenLayersMapView, WMSLayer, genericOpenLayersFeatureStyle, OpenLayersGetFeatureInfo, MapControls, OpenLayersZoomControl, getLayerUpdateInfo, publicLayers } from '@opengeoweb/webmap-react';
|
|
11
|
+
import { TIME_SLIDER_NAMESPACE, timesliderTranslations, defaultTimeSpan, AnimationLengthMode, isValidAnimationLength, isWithinAnimationStepLimit, isAnchoredMode, settingRange, AnimationLengthPanel, exactAnimationLengthFrom, AutoUpdateButton, BackwardForwardStepButton, NowButton, handleSetNowEvent, PlayButton, defaultTimeStep, SpeedButton, TimeSpanButton, secondsPerPxFromCanvasWidth, getNewCenterOfFixedPointZoom, TimeStepButton, OptionsMenuButton, TimeSliderButtons, TimeSliderCurrentTimeBox, TimeSliderLegend, onsetNewDateDebounced, getFilteredTime, defaultSecondsPerPx, moveSelectedTimePx, TimeSlider } from '@opengeoweb/time-slider';
|
|
12
|
+
import { webmapReactTranslations, WEBMAP_REACT_NAMESPACE, webmapTranslations, WEBMAP_NAMESPACE, openLayersGetMapImageStore, LayerInfoButton, useStacCollection, useGetWMLayerInstance, getLayerExtentForProjection, useEDRGetCollectionDetails, getStacCollectionStyles, resolvePreferredStyleName, defaultEdrStyles, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton, Clock, LegendDialog, LegendButton, MapContext, emptyGeoJSON, MapFeatureClass, setMapCenter, makeTimeList, getIsInsideAcceptanceTime, OpenLayersLayer, isGeoJSONGeometryEmpty, calculateNewSelection, shouldExitEditModeForMultiSelect, shouldEnterEditMode, calculateBoxSelection, OpenLayersFeatureLayer, OpenLayersMapDraw, DRAWMODE, getOlFeatureKey, MapMeasure, useViewFromLayer, useSetIntervalWhenVisible, TimeContext, OpenLayersMapView, WMSLayer, genericOpenLayersFeatureStyle, OpenLayersGetFeatureInfo, MapControls, OpenLayersZoomControl, getLayerUpdateInfo, publicLayers } from '@opengeoweb/webmap-react';
|
|
13
|
+
export { getAffectedIndices } from '@opengeoweb/webmap-react';
|
|
13
14
|
import { Cached, Add, MapAdd, CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, CloudLoading, ColumnCollapsed, ColumnCollapse, DragHandle as DragHandle$1, None, FastForward, AutoUpdateActive, Both, Delete, Visibility, VisibilityOff, Copy, ZoomToLayer, Overlayers, WorldMapProjection, Layers, Search, Exclamation, MyLocation, Airplane, Region, Pinned, Close, ExitDomain, LocationInfo, Measure, Options, Info, ThemeWrapper, lightTheme, FlagBritain, FlagNetherlands, FlagFinland, FlagNorway } from '@opengeoweb/theme';
|
|
14
15
|
import { ReactSortable } from 'react-sortablejs';
|
|
15
16
|
import Sortable from 'sortablejs';
|
|
16
17
|
import { Box as Box$1, Stack } from '@mui/system';
|
|
17
|
-
import { transformExtent, toLonLat, fromLonLat } from 'ol/proj';
|
|
18
18
|
import { LayerSelectButtonConnect, LayerSelectConnect, DataExplorerButtonConnect } from '@opengeoweb/layer-select';
|
|
19
19
|
import { unByKey } from 'ol/Observable';
|
|
20
20
|
import { useQuery, QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
21
|
-
import { handleResponse } from '@opengeoweb/api';
|
|
21
|
+
import { handleResponse, authFetch } from '@opengeoweb/api';
|
|
22
22
|
import { bbox } from '@turf/turf';
|
|
23
23
|
import proj4 from 'proj4';
|
|
24
24
|
import { getIntersection } from 'ol/extent';
|
|
25
25
|
import GeoJSON from 'ol/format/GeoJSON';
|
|
26
|
+
import { toLonLat, fromLonLat } from 'ol/proj';
|
|
26
27
|
import { ImageWMS } from 'ol/source';
|
|
27
28
|
import DOMPurify from 'dompurify';
|
|
28
29
|
import { snackbarTypes, snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
@@ -2659,7 +2660,7 @@ var DimensionSelectValue = function DimensionSelectValue(_ref) {
|
|
|
2659
2660
|
skipLocalStyling = _ref.skipLocalStyling;
|
|
2660
2661
|
var _useCoreTranslation = useCoreTranslation(),
|
|
2661
2662
|
t = _useCoreTranslation.t;
|
|
2662
|
-
var dimensionValuesRaw = generatedValues.
|
|
2663
|
+
var dimensionValuesRaw = generatedValues.slice().reverse().slice(0, 100);
|
|
2663
2664
|
var latestMap = useMemo(function () {
|
|
2664
2665
|
return createLatestMap(dimensionValuesRaw);
|
|
2665
2666
|
}, [dimensionValuesRaw]);
|
|
@@ -3414,32 +3415,28 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
|
|
|
3414
3415
|
var onClickZoomToExtent = function onClickZoomToExtent() {
|
|
3415
3416
|
onLayerZoomToExtent == null || onLayerZoomToExtent();
|
|
3416
3417
|
};
|
|
3417
|
-
var
|
|
3418
|
-
text: t('layermanager-stac-layout-
|
|
3419
|
-
action: function action() {
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
controlType: 'radio',
|
|
3440
|
-
isSelected: stacDataLayout === 'spatial-tiles'
|
|
3441
|
-
}])
|
|
3442
|
-
} : undefined;
|
|
3418
|
+
var stacDataLayoutMenuItems = onChangeStacDataLayout ? [{
|
|
3419
|
+
text: t('layermanager-stac-layout-auto'),
|
|
3420
|
+
action: function action() {
|
|
3421
|
+
return onChangeStacDataLayout('auto');
|
|
3422
|
+
},
|
|
3423
|
+
controlType: 'radio',
|
|
3424
|
+
isSelected: !stacDataLayout || stacDataLayout === 'auto'
|
|
3425
|
+
}].concat(!isTiledStacCollection ? [{
|
|
3426
|
+
text: t('layermanager-stac-layout-temporal'),
|
|
3427
|
+
action: function action() {
|
|
3428
|
+
return onChangeStacDataLayout('temporal');
|
|
3429
|
+
},
|
|
3430
|
+
controlType: 'radio',
|
|
3431
|
+
isSelected: stacDataLayout === 'temporal'
|
|
3432
|
+
}] : [], [{
|
|
3433
|
+
text: t('layermanager-stac-layout-spatial-tiles'),
|
|
3434
|
+
action: function action() {
|
|
3435
|
+
return onChangeStacDataLayout('spatial-tiles');
|
|
3436
|
+
},
|
|
3437
|
+
controlType: 'radio',
|
|
3438
|
+
isSelected: stacDataLayout === 'spatial-tiles'
|
|
3439
|
+
}]) : [];
|
|
3443
3440
|
return jsx(ToggleMenu, {
|
|
3444
3441
|
buttonIcon: icon,
|
|
3445
3442
|
buttonSx: {
|
|
@@ -3470,8 +3467,10 @@ var LayerManagerMenuButton = function LayerManagerMenuButton(_ref) {
|
|
|
3470
3467
|
action: onClickZoomToExtent,
|
|
3471
3468
|
icon: jsx(ZoomToLayer, {}),
|
|
3472
3469
|
isDisabled: !canZoomToLayerExtent
|
|
3473
|
-
}]
|
|
3470
|
+
}],
|
|
3474
3471
|
menuPosition: "bottom",
|
|
3472
|
+
secondaryMenuItems: stacDataLayoutMenuItems,
|
|
3473
|
+
secondaryMenuTitle: stacDataLayoutMenuItems.length ? t('layermanager-stac-layout-title') : undefined,
|
|
3475
3474
|
tooltipTitle: nonEmptyTooltipTitle,
|
|
3476
3475
|
children: !!isFeatureLayer && jsx(SelectableFeaturesCheckboxConnect, {
|
|
3477
3476
|
disabled: isFeatureSyncLayer,
|
|
@@ -4511,13 +4510,12 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
|
|
|
4511
4510
|
if (!layerId || !mapSrs || !wmLayer) {
|
|
4512
4511
|
return;
|
|
4513
4512
|
}
|
|
4514
|
-
var
|
|
4515
|
-
if (
|
|
4516
|
-
var
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
top = _crs$bbox$getExtent[3];
|
|
4513
|
+
var extent = getLayerExtentForProjection(wmLayer, mapSrs);
|
|
4514
|
+
if (extent) {
|
|
4515
|
+
var left = extent[0],
|
|
4516
|
+
bottom = extent[1],
|
|
4517
|
+
right = extent[2],
|
|
4518
|
+
top = extent[3];
|
|
4521
4519
|
dispatch(mapActions.setBbox({
|
|
4522
4520
|
mapId: mapId,
|
|
4523
4521
|
srs: mapSrs,
|
|
@@ -4529,26 +4527,6 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
|
|
|
4529
4527
|
},
|
|
4530
4528
|
origin: layerTypes.LayerActionOrigin.layerManager
|
|
4531
4529
|
}));
|
|
4532
|
-
return;
|
|
4533
|
-
}
|
|
4534
|
-
var geo = wmLayer.geographicBoundingBox;
|
|
4535
|
-
if (geo) {
|
|
4536
|
-
var _transformExtent = transformExtent([parseFloat(geo.west), parseFloat(geo.south), parseFloat(geo.east), parseFloat(geo.north)], WMJSMAP_LONLAT_EPSGCODE, mapSrs),
|
|
4537
|
-
_left = _transformExtent[0],
|
|
4538
|
-
_bottom = _transformExtent[1],
|
|
4539
|
-
_right = _transformExtent[2],
|
|
4540
|
-
_top = _transformExtent[3];
|
|
4541
|
-
dispatch(mapActions.setBbox({
|
|
4542
|
-
mapId: mapId,
|
|
4543
|
-
srs: mapSrs,
|
|
4544
|
-
bbox: {
|
|
4545
|
-
left: _left,
|
|
4546
|
-
bottom: _bottom,
|
|
4547
|
-
right: _right,
|
|
4548
|
-
top: _top
|
|
4549
|
-
},
|
|
4550
|
-
origin: layerTypes.LayerActionOrigin.layerManager
|
|
4551
|
-
}));
|
|
4552
4530
|
}
|
|
4553
4531
|
}, [dispatch, layerId, mapId, mapSrs, wmLayer]);
|
|
4554
4532
|
var duplicateLayer = React.useCallback(function (_ref3) {
|
|
@@ -4579,9 +4557,9 @@ var LayerManagerMenuButtonConnect = function LayerManagerMenuButtonConnect(_ref)
|
|
|
4579
4557
|
icon: icon,
|
|
4580
4558
|
isFeatureLayer: isFeatureLayer,
|
|
4581
4559
|
isFeatureSyncLayer: isFeatureSyncLayer,
|
|
4560
|
+
isTiledStacCollection: isStacGeoTIFFLayer ? isTiledStacCollection : undefined,
|
|
4582
4561
|
layerId: layerId,
|
|
4583
4562
|
mapId: mapId,
|
|
4584
|
-
isTiledStacCollection: isStacGeoTIFFLayer ? isTiledStacCollection : undefined,
|
|
4585
4563
|
onChangeStacDataLayout: isStacGeoTIFFLayer ? changeStacDataLayout : undefined,
|
|
4586
4564
|
onLayerCopyToOtherMaps: copyLayerToOtherMaps,
|
|
4587
4565
|
onLayerDuplicate: function onLayerDuplicate() {
|
|
@@ -4722,6 +4700,7 @@ var RenderEDRLayers = function RenderEDRLayers(_ref) {
|
|
|
4722
4700
|
});
|
|
4723
4701
|
return (layer == null ? void 0 : layer.title) || (layer == null ? void 0 : layer.name);
|
|
4724
4702
|
});
|
|
4703
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
4725
4704
|
var tooltip = nonEmptyTooltipPrefix + " " + tooltipNames.sort(function (paramA, paramB) {
|
|
4726
4705
|
return (paramA != null ? paramA : '').localeCompare(paramB != null ? paramB : '');
|
|
4727
4706
|
}).join(', ');
|
|
@@ -6610,56 +6589,98 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
|
|
|
6610
6589
|
});
|
|
6611
6590
|
};
|
|
6612
6591
|
|
|
6613
|
-
var
|
|
6592
|
+
var AnimationLengthPanelConnect = function AnimationLengthPanelConnect(_ref) {
|
|
6593
|
+
var _storedAnimationLengt, _ref2;
|
|
6614
6594
|
var mapId = _ref.mapId;
|
|
6615
6595
|
var dispatch = useDispatch();
|
|
6596
|
+
var storedAnimationLength = useSelector(function (store) {
|
|
6597
|
+
return mapSelectors.getAnimationLength(store, mapId);
|
|
6598
|
+
});
|
|
6616
6599
|
var isAnimating = useSelector(function (store) {
|
|
6617
6600
|
return mapSelectors.isAnimating(store, mapId);
|
|
6618
6601
|
});
|
|
6619
|
-
var
|
|
6620
|
-
|
|
6621
|
-
|
|
6602
|
+
var _React$useState = React.useState(),
|
|
6603
|
+
pendingLength = _React$useState[0],
|
|
6604
|
+
setPendingLength = _React$useState[1];
|
|
6605
|
+
var isCommittableRef = React.useRef(false);
|
|
6606
|
+
var currentMode = (_storedAnimationLengt = storedAnimationLength == null ? void 0 : storedAnimationLength.mode) != null ? _storedAnimationLengt : AnimationLengthMode.Exact;
|
|
6607
|
+
var draftLength = (pendingLength == null ? void 0 : pendingLength.mode) === currentMode ? pendingLength : undefined;
|
|
6608
|
+
var debouncedLength = useDebounce(pendingLength, 500);
|
|
6609
|
+
React.useEffect(function () {
|
|
6610
|
+
setPendingLength(undefined);
|
|
6611
|
+
}, [storedAnimationLength, mapId]);
|
|
6622
6612
|
var _useSelector = useSelector(function (store) {
|
|
6623
6613
|
return mapSelectors.getAnimationRange(store, mapId);
|
|
6624
6614
|
}),
|
|
6625
6615
|
animationStartTime = _useSelector.animationStartTime,
|
|
6626
6616
|
animationEndTime = _useSelector.animationEndTime;
|
|
6627
|
-
var
|
|
6628
|
-
var handlechangeAnimationLength = function handlechangeAnimationLength(length) {
|
|
6629
|
-
var newStartTime = dateUtils.dateToIsoString(dateUtils.add(dateUtils.utc(animationEndTime), {
|
|
6630
|
-
minutes: -length
|
|
6631
|
-
}));
|
|
6632
|
-
dispatch(mapActions.setAnimationStartTime({
|
|
6633
|
-
mapId: mapId,
|
|
6634
|
-
animationStartTime: newStartTime || dateUtils.dateToIsoString(dateUtils.utc()),
|
|
6635
|
-
origin: mapEnums.MapActionOrigin.map
|
|
6636
|
-
}));
|
|
6637
|
-
dispatch(mapActions.setAnimationEndTime({
|
|
6638
|
-
mapId: mapId,
|
|
6639
|
-
animationEndTime: animationEndTime || dateUtils.dateToIsoString(dateUtils.utc()),
|
|
6640
|
-
origin: mapEnums.MapActionOrigin.map
|
|
6641
|
-
}));
|
|
6642
|
-
};
|
|
6643
|
-
var toggleAnimationLengthAuto = React.useCallback(function () {
|
|
6644
|
-
dispatch(mapActions.toggleAnimationLengthAuto({
|
|
6645
|
-
mapId: mapId,
|
|
6646
|
-
autoAnimationLength: true,
|
|
6647
|
-
origin: mapEnums.MapActionOrigin.map
|
|
6648
|
-
}));
|
|
6649
|
-
}, [dispatch, mapId]);
|
|
6650
|
-
var autoTimestepLayerId = useSelector(function (store) {
|
|
6617
|
+
var autoTimeStepLayerId = useSelector(function (store) {
|
|
6651
6618
|
return mapSelectors.getAutoTimeStepLayerId(store, mapId);
|
|
6652
6619
|
});
|
|
6620
|
+
var autoTimeStepLayerName = useSelector(function (store) {
|
|
6621
|
+
return autoTimeStepLayerId ? layerSelectors.getLayerTitleFromService(store, autoTimeStepLayerId) : undefined;
|
|
6622
|
+
});
|
|
6653
6623
|
var timeStepFromLayer = useSelector(function (store) {
|
|
6654
|
-
return layerSelectors.getTimeStepForLayerId(store,
|
|
6624
|
+
return layerSelectors.getTimeStepForLayerId(store, autoTimeStepLayerId);
|
|
6655
6625
|
});
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6626
|
+
var timeStep = useSelector(function (store) {
|
|
6627
|
+
return mapSelectors.getMapTimeStep(store, mapId);
|
|
6628
|
+
});
|
|
6629
|
+
var layerRefTimeDimension = useSelector(function (store) {
|
|
6630
|
+
return layerSelectors.getLayerDimension(store, autoTimeStepLayerId, 'reference_time');
|
|
6631
|
+
});
|
|
6632
|
+
var referenceTimeFromLayer = (layerRefTimeDimension == null ? void 0 : layerRefTimeDimension.currentValue) || undefined;
|
|
6633
|
+
var anchorTime = dateUtils.utc(referenceTimeFromLayer);
|
|
6634
|
+
var commitAnimationLength = React.useCallback(function (length) {
|
|
6635
|
+
var isUsableRange = isValidAnimationLength(length) && isWithinAnimationStepLimit(length, timeStep);
|
|
6636
|
+
var carriesOwnRange = isAnchoredMode(length.mode) || length.mode === AnimationLengthMode.Exact;
|
|
6637
|
+
var resolvedRange = carriesOwnRange && isUsableRange ? settingRange(length, anchorTime) : undefined;
|
|
6638
|
+
dispatch(mapActions.setAnimationLength(Object.assign({
|
|
6639
|
+
mapId: mapId,
|
|
6640
|
+
animationLength: length
|
|
6641
|
+
}, resolvedRange, {
|
|
6642
|
+
origin: mapEnums.MapActionOrigin.map
|
|
6643
|
+
})));
|
|
6644
|
+
}, [anchorTime, dispatch, mapId, timeStep]);
|
|
6645
|
+
React.useEffect(function () {
|
|
6646
|
+
if (debouncedLength && isCommittableRef.current) {
|
|
6647
|
+
commitAnimationLength(debouncedLength);
|
|
6648
|
+
setPendingLength(undefined);
|
|
6649
|
+
}
|
|
6650
|
+
}, [debouncedLength, commitAnimationLength]);
|
|
6651
|
+
var changeAnimationLength = function changeAnimationLength(animationLength, isStep) {
|
|
6652
|
+
var shouldDefer = isAnimating && animationLength.mode === currentMode && (isAnchoredMode(currentMode) || currentMode === AnimationLengthMode.Exact);
|
|
6653
|
+
isCommittableRef.current = shouldDefer;
|
|
6654
|
+
setPendingLength(animationLength);
|
|
6655
|
+
if (!shouldDefer) {
|
|
6656
|
+
commitAnimationLength(animationLength);
|
|
6657
|
+
return;
|
|
6658
|
+
}
|
|
6659
|
+
if (isStep) {
|
|
6660
|
+
var isUsableRange = isValidAnimationLength(animationLength) && isWithinAnimationStepLimit(animationLength, timeStep);
|
|
6661
|
+
if (isUsableRange) {
|
|
6662
|
+
dispatch(mapActions.refreshAnimationRange(Object.assign({
|
|
6663
|
+
mapId: mapId
|
|
6664
|
+
}, settingRange(animationLength, anchorTime))));
|
|
6665
|
+
}
|
|
6666
|
+
}
|
|
6667
|
+
};
|
|
6668
|
+
var cancelPendingCommit = function cancelPendingCommit() {
|
|
6669
|
+
isCommittableRef.current = false;
|
|
6670
|
+
};
|
|
6671
|
+
return jsx(AnimationLengthPanel, {
|
|
6672
|
+
animationEndTime: (draftLength == null ? void 0 : draftLength.mode) === AnimationLengthMode.Exact ? draftLength.exact.animationEndTime : animationEndTime,
|
|
6673
|
+
animationStartTime: (draftLength == null ? void 0 : draftLength.mode) === AnimationLengthMode.Exact ? draftLength.exact.animationStartTime : animationStartTime,
|
|
6674
|
+
autoTimeStepLayerName: autoTimeStepLayerName,
|
|
6675
|
+
isAutoDisabled: !timeStepFromLayer,
|
|
6676
|
+
onChange: changeAnimationLength,
|
|
6677
|
+
onInputChange: cancelPendingCommit,
|
|
6678
|
+
referenceTimeFromLayer: referenceTimeFromLayer,
|
|
6679
|
+
setting: (_ref2 = draftLength != null ? draftLength : storedAnimationLength) != null ? _ref2 : exactAnimationLengthFrom({
|
|
6680
|
+
animationStartTime: animationStartTime,
|
|
6681
|
+
animationEndTime: animationEndTime
|
|
6682
|
+
}),
|
|
6683
|
+
timeStep: timeStep
|
|
6663
6684
|
});
|
|
6664
6685
|
};
|
|
6665
6686
|
|
|
@@ -6773,6 +6794,9 @@ var PlayButtonConnectComponent = function PlayButtonConnectComponent(_ref) {
|
|
|
6773
6794
|
}),
|
|
6774
6795
|
animationStartTime = _useSelector.animationStartTime,
|
|
6775
6796
|
animationEndTime = _useSelector.animationEndTime;
|
|
6797
|
+
var selectedTime = useSelector(function (store) {
|
|
6798
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
6799
|
+
});
|
|
6776
6800
|
var animationInterval = timeStep || defaultTimeStep;
|
|
6777
6801
|
var onTogglePlay = function onTogglePlay() {
|
|
6778
6802
|
if (linkedMapAnimationInfo.isAnimating) {
|
|
@@ -6786,6 +6810,8 @@ var PlayButtonConnectComponent = function PlayButtonConnectComponent(_ref) {
|
|
|
6786
6810
|
start: animationStartTime,
|
|
6787
6811
|
end: animationEndTime,
|
|
6788
6812
|
interval: animationInterval,
|
|
6813
|
+
// Resume from the currently selected time when it falls within the animation period
|
|
6814
|
+
initialTime: dateUtils.fromUnix(selectedTime).toISOString(),
|
|
6789
6815
|
origin: mapEnums.MapActionOrigin.map
|
|
6790
6816
|
});
|
|
6791
6817
|
}
|
|
@@ -6973,9 +6999,9 @@ var OptionsMenu = function OptionsMenu(_ref) {
|
|
|
6973
6999
|
children: [jsx(NowButtonConnect, {
|
|
6974
7000
|
mapId: mapId,
|
|
6975
7001
|
sourceId: mapId
|
|
6976
|
-
}), jsx(
|
|
7002
|
+
}), jsx(AnimationLengthPanelConnect, {
|
|
6977
7003
|
mapId: mapId
|
|
6978
|
-
}), jsx(
|
|
7004
|
+
}), jsx(TimeSpanButtonConnect, {
|
|
6979
7005
|
mapId: mapId
|
|
6980
7006
|
}), jsx(_TimeStepButtonConnect, {
|
|
6981
7007
|
mapId: mapId
|
|
@@ -8357,9 +8383,91 @@ var OlMapViewLayerConnect = function OlMapViewLayerConnect(layerProps) {
|
|
|
8357
8383
|
}), "layer-" + (layer == null ? void 0 : layer.id));
|
|
8358
8384
|
};
|
|
8359
8385
|
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8386
|
+
/** Escape drops a multi selection only. A sole selection is kept, matching the
|
|
8387
|
+
* plain click behaviour, and edit mode keeps its own Escape handling. */
|
|
8388
|
+
var shouldDeselectAllOnEscape = function shouldDeselectAllOnEscape(selectedFeatureCount, isInEditMode, hasRegisteredDrawTool) {
|
|
8389
|
+
return hasRegisteredDrawTool && !isInEditMode && selectedFeatureCount > 1;
|
|
8390
|
+
};
|
|
8391
|
+
var useDeselectAllOnEscape = function useDeselectAllOnEscape(_ref) {
|
|
8392
|
+
var selectedFeatureCount = _ref.selectedFeatureCount,
|
|
8393
|
+
isInEditMode = _ref.isInEditMode,
|
|
8394
|
+
hasRegisteredDrawTool = _ref.hasRegisteredDrawTool,
|
|
8395
|
+
onDeselectAll = _ref.onDeselectAll;
|
|
8396
|
+
React.useEffect(function () {
|
|
8397
|
+
if (!shouldDeselectAllOnEscape(selectedFeatureCount, isInEditMode, hasRegisteredDrawTool)) {
|
|
8398
|
+
return undefined;
|
|
8399
|
+
}
|
|
8400
|
+
var onKeyDown = function onKeyDown(event) {
|
|
8401
|
+
if (event.key !== 'Escape' || document.activeElement !== document.body) {
|
|
8402
|
+
return;
|
|
8403
|
+
}
|
|
8404
|
+
onDeselectAll();
|
|
8405
|
+
};
|
|
8406
|
+
window.addEventListener('keydown', onKeyDown);
|
|
8407
|
+
return function () {
|
|
8408
|
+
return window.removeEventListener('keydown', onKeyDown);
|
|
8409
|
+
};
|
|
8410
|
+
}, [selectedFeatureCount, isInEditMode, hasRegisteredDrawTool, onDeselectAll]);
|
|
8411
|
+
};
|
|
8412
|
+
var shouldClearSelectionOnEmptyClick = function shouldClearSelectionOnEmptyClick(activeDrawToolId, hasRegisteredDrawTool) {
|
|
8413
|
+
return !activeDrawToolId && hasRegisteredDrawTool;
|
|
8414
|
+
};
|
|
8415
|
+
var isSketchInProgress = function isSketchInProgress(isInEditMode, drawMode, activeFeature) {
|
|
8416
|
+
if (!isInEditMode) {
|
|
8417
|
+
return false;
|
|
8418
|
+
}
|
|
8419
|
+
if (drawMode === DRAWMODE.SPLIT) {
|
|
8420
|
+
return true;
|
|
8421
|
+
}
|
|
8422
|
+
return Boolean(activeFeature && isGeoJSONGeometryEmpty(activeFeature));
|
|
8423
|
+
};
|
|
8424
|
+
/** Soundings and time series set their own highlight, so they must stay out of this. */
|
|
8425
|
+
var usesFeatureIdSelection = function usesFeatureIdSelection(isSelectable, hasRegisteredDrawTool) {
|
|
8426
|
+
return Boolean(isSelectable) || hasRegisteredDrawTool;
|
|
8427
|
+
};
|
|
8428
|
+
var getSelectionProperties = function getSelectionProperties(usesIdSelection, selectedFeatureIdSet, featureId) {
|
|
8429
|
+
if (!usesIdSelection) {
|
|
8430
|
+
return undefined;
|
|
8431
|
+
}
|
|
8432
|
+
var isSelected = featureId !== undefined && selectedFeatureIdSet.has(featureId);
|
|
8433
|
+
return {
|
|
8434
|
+
isSelected: isSelected,
|
|
8435
|
+
highlightSelectedFeature: isSelected
|
|
8436
|
+
};
|
|
8437
|
+
};
|
|
8438
|
+
var getClickedFeatureKey = getOlFeatureKey;
|
|
8439
|
+
var findFeatureIndexByKey = function findFeatureIndexByKey(geojson, feature) {
|
|
8440
|
+
var key = getClickedFeatureKey(feature);
|
|
8441
|
+
// -1 when the feature has no key, so an unidentifiable click never matches feature 0
|
|
8442
|
+
if (key === undefined || !geojson) {
|
|
8443
|
+
return -1;
|
|
8444
|
+
}
|
|
8445
|
+
return geojson.features.findIndex(function (feat) {
|
|
8446
|
+
return layerUtils.getFeatureSelectionKey(feat) === key;
|
|
8447
|
+
});
|
|
8448
|
+
};
|
|
8449
|
+
var getMovableSelectedFeatureIds = function getMovableSelectedFeatureIds(geojson, selectedFeatureIds) {
|
|
8450
|
+
if (!(geojson != null && geojson.features.length) || !(selectedFeatureIds != null && selectedFeatureIds.length)) {
|
|
8451
|
+
return [];
|
|
8452
|
+
}
|
|
8453
|
+
var selectedFeatureIdSet = new Set(selectedFeatureIds);
|
|
8454
|
+
return geojson.features.reduce(function (featureIds, feature) {
|
|
8455
|
+
var _feature$properties;
|
|
8456
|
+
var featureKey = layerUtils.getFeatureSelectionKey(feature);
|
|
8457
|
+
if (featureKey && selectedFeatureIdSet.has(featureKey) && ((_feature$properties = feature.properties) == null ? void 0 : _feature$properties.isReadonly) !== true) {
|
|
8458
|
+
featureIds.push(featureKey);
|
|
8459
|
+
}
|
|
8460
|
+
return featureIds;
|
|
8461
|
+
}, []);
|
|
8462
|
+
};
|
|
8463
|
+
/** Moving a set of shapes belongs to the drawing tool only: selection-only
|
|
8464
|
+
* reference layers stay selectable but must never be dragged. */
|
|
8465
|
+
var shouldEnableMultiShapeMove = function shouldEnableMultiShapeMove(hasRegisteredDrawTool, isInEditMode, selectedFeatureCount, movableFeatureCount) {
|
|
8466
|
+
return hasRegisteredDrawTool && !isInEditMode && selectedFeatureCount > 1 && movableFeatureCount > 0;
|
|
8467
|
+
};
|
|
8468
|
+
var getCurrentSelectedIndices = function getCurrentSelectedIndices(_ref2) {
|
|
8469
|
+
var geojson = _ref2.geojson,
|
|
8470
|
+
selectedFeatureIds = _ref2.selectedFeatureIds;
|
|
8363
8471
|
if (!(geojson != null && geojson.features.length) || !(selectedFeatureIds != null && selectedFeatureIds.length)) {
|
|
8364
8472
|
return [];
|
|
8365
8473
|
}
|
|
@@ -8372,46 +8480,13 @@ var getCurrentSelectedIndices = function getCurrentSelectedIndices(_ref) {
|
|
|
8372
8480
|
return indices;
|
|
8373
8481
|
}, []);
|
|
8374
8482
|
};
|
|
8375
|
-
var
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
return [].concat(currentSelectedIndices, [clickedIndex]);
|
|
8383
|
-
}
|
|
8384
|
-
var isSoleSelection = currentSelectedIndices.length === 1 && currentSelectedIndices[0] === clickedIndex;
|
|
8385
|
-
return isSoleSelection ? [] : [clickedIndex];
|
|
8386
|
-
};
|
|
8387
|
-
var getAffectedIndices = function getAffectedIndices(oldSelection, newSelection) {
|
|
8388
|
-
var allIndices = new Set([].concat(oldSelection, newSelection));
|
|
8389
|
-
return Array.from(allIndices).filter(function (idx) {
|
|
8390
|
-
return oldSelection.includes(idx) !== newSelection.includes(idx);
|
|
8391
|
-
});
|
|
8392
|
-
};
|
|
8393
|
-
var shouldEnterEditMode = function shouldEnterEditMode(isReadonly, isShiftClick, newSelectionCount) {
|
|
8394
|
-
return !isReadonly && !isShiftClick && newSelectionCount === 1;
|
|
8395
|
-
};
|
|
8396
|
-
var updateFeatureSelectionProperties = function updateFeatureSelectionProperties(dispatch, layerId, affectedIndices, newSelection) {
|
|
8397
|
-
affectedIndices.forEach(function (idx) {
|
|
8398
|
-
var isNowSelected = newSelection.includes(idx);
|
|
8399
|
-
dispatch(layerActions.updateFeatureProperties({
|
|
8400
|
-
layerId: layerId,
|
|
8401
|
-
properties: {
|
|
8402
|
-
highlightSelectedFeature: isNowSelected,
|
|
8403
|
-
isSelected: isNowSelected
|
|
8404
|
-
},
|
|
8405
|
-
targetFeatureIndex: idx
|
|
8406
|
-
}));
|
|
8407
|
-
});
|
|
8408
|
-
};
|
|
8409
|
-
var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2) {
|
|
8410
|
-
var layer = _ref2.layer,
|
|
8411
|
-
layerId = _ref2.layerId,
|
|
8412
|
-
zIndex = _ref2.zIndex,
|
|
8413
|
-
style = _ref2.style,
|
|
8414
|
-
hoverSelect = _ref2.hoverSelect;
|
|
8483
|
+
var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref3) {
|
|
8484
|
+
var _layer$selectedFeatur2, _layer$selectedFeatur3;
|
|
8485
|
+
var layer = _ref3.layer,
|
|
8486
|
+
layerId = _ref3.layerId,
|
|
8487
|
+
zIndex = _ref3.zIndex,
|
|
8488
|
+
style = _ref3.style,
|
|
8489
|
+
hoverSelect = _ref3.hoverSelect;
|
|
8415
8490
|
var store = useStore();
|
|
8416
8491
|
var dispatch = useDispatch();
|
|
8417
8492
|
var activeDrawToolId = useSelector(drawingToolSelectors.getActiveDrawToolId);
|
|
@@ -8433,7 +8508,7 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8433
8508
|
return drawingToolSelectors.getGeoJSONIntersectionBoundsLayerId(store, activeDrawToolId);
|
|
8434
8509
|
});
|
|
8435
8510
|
var activeFeatureIndex = React.useMemo(function () {
|
|
8436
|
-
var _layer$geojson, _currentSelectedFeatu,
|
|
8511
|
+
var _layer$geojson, _currentSelectedFeatu, _ref4;
|
|
8437
8512
|
var currentActiveFeatureIndex = layerUtils.getSelectedFeatureIndexByIds(layer.geojson, layer.selectedFeatureIds);
|
|
8438
8513
|
if (!shouldAllowMultipleShapes || !(activeDrawMode != null && activeDrawMode.selectionType) || !((_layer$geojson = layer.geojson) != null && _layer$geojson.features.length)) {
|
|
8439
8514
|
return currentActiveFeatureIndex != null ? currentActiveFeatureIndex : 0;
|
|
@@ -8444,9 +8519,9 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8444
8519
|
}
|
|
8445
8520
|
var matchingFeatureIndex;
|
|
8446
8521
|
for (var index = layer.geojson.features.length - 1; index >= 0; index -= 1) {
|
|
8447
|
-
var _feature$
|
|
8522
|
+
var _feature$properties2;
|
|
8448
8523
|
var feature = layer.geojson.features[index];
|
|
8449
|
-
if (((_feature$
|
|
8524
|
+
if (((_feature$properties2 = feature.properties) == null ? void 0 : _feature$properties2.selectionType) === activeDrawMode.selectionType) {
|
|
8450
8525
|
if (isGeoJSONGeometryEmpty(feature)) {
|
|
8451
8526
|
return index;
|
|
8452
8527
|
}
|
|
@@ -8455,32 +8530,55 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8455
8530
|
}
|
|
8456
8531
|
}
|
|
8457
8532
|
}
|
|
8458
|
-
return (
|
|
8533
|
+
return (_ref4 = matchingFeatureIndex != null ? matchingFeatureIndex : currentActiveFeatureIndex) != null ? _ref4 : 0;
|
|
8459
8534
|
}, [activeDrawMode == null ? void 0 : activeDrawMode.selectionType, layer.geojson, layer.selectedFeatureIds, shouldAllowMultipleShapes]);
|
|
8535
|
+
var sketchInProgress = React.useMemo(function () {
|
|
8536
|
+
var _layer$geojson2;
|
|
8537
|
+
return isSketchInProgress(layer.isInEditMode, layer.drawMode, (_layer$geojson2 = layer.geojson) == null ? void 0 : _layer$geojson2.features[activeFeatureIndex]);
|
|
8538
|
+
}, [layer.isInEditMode, layer.drawMode, layer.geojson, activeFeatureIndex]);
|
|
8539
|
+
var usesIdSelection = usesFeatureIdSelection(layer.isSelectable, hasRegisteredDrawTool);
|
|
8460
8540
|
var displayGeojson = React.useMemo(function () {
|
|
8461
|
-
var _layer$hoveredFeature;
|
|
8541
|
+
var _layer$hoveredFeature, _layer$selectedFeatur;
|
|
8462
8542
|
if (!layer.geojson) {
|
|
8463
8543
|
return undefined;
|
|
8464
8544
|
}
|
|
8465
8545
|
var hoveredFeatureIds = new Set((_layer$hoveredFeature = layer.hoveredFeatureIds) != null ? _layer$hoveredFeature : []);
|
|
8546
|
+
var selectedFeatureIdSet = new Set((_layer$selectedFeatur = layer.selectedFeatureIds) != null ? _layer$selectedFeatur : []);
|
|
8466
8547
|
return Object.assign({}, layer.geojson, {
|
|
8467
8548
|
features: layer.geojson.features.map(function (feature) {
|
|
8468
|
-
var _feature$
|
|
8549
|
+
var _feature$properties3;
|
|
8469
8550
|
var featureId = feature.id !== undefined ? String(feature.id) : undefined;
|
|
8470
|
-
var originalId = typeof ((_feature$
|
|
8551
|
+
var originalId = typeof ((_feature$properties3 = feature.properties) == null ? void 0 : _feature$properties3.originalId) === 'string' ? feature.properties.originalId : layer.originalId;
|
|
8552
|
+
var selectionProperties = getSelectionProperties(usesIdSelection, selectedFeatureIdSet, featureId);
|
|
8471
8553
|
return Object.assign({}, feature, {
|
|
8472
8554
|
properties: Object.assign({}, feature.properties, {
|
|
8473
8555
|
hover: featureId !== undefined && hoveredFeatureIds.has(featureId) || typeof originalId === 'string' && hoveredFeatureIds.has(originalId)
|
|
8474
|
-
})
|
|
8556
|
+
}, selectionProperties)
|
|
8475
8557
|
});
|
|
8476
8558
|
})
|
|
8477
8559
|
});
|
|
8478
|
-
}, [layer.geojson, layer.hoveredFeatureIds, layer.originalId]);
|
|
8560
|
+
}, [layer.geojson, layer.hoveredFeatureIds, layer.originalId, layer.selectedFeatureIds, usesIdSelection]);
|
|
8561
|
+
var clearSelection = React.useCallback(function () {
|
|
8562
|
+
if (!shouldClearSelectionOnEmptyClick(activeDrawToolId, hasRegisteredDrawTool)) {
|
|
8563
|
+
return;
|
|
8564
|
+
}
|
|
8565
|
+
dispatch(layerActions.setSelectedFeatures({
|
|
8566
|
+
layerId: layerId,
|
|
8567
|
+
selectedFeatureIds: []
|
|
8568
|
+
}));
|
|
8569
|
+
dispatch(layerActions.toggleFeatureMode({
|
|
8570
|
+
layerId: layerId,
|
|
8571
|
+
isInEditMode: false,
|
|
8572
|
+
drawMode: ''
|
|
8573
|
+
}));
|
|
8574
|
+
}, [activeDrawToolId, hasRegisteredDrawTool, dispatch, layerId]);
|
|
8479
8575
|
var onFeatureClick = React.useCallback(function (feature, isShiftClick) {
|
|
8480
8576
|
var _clickedFeature$prope;
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8577
|
+
if (!feature.length) {
|
|
8578
|
+
clearSelection();
|
|
8579
|
+
return;
|
|
8580
|
+
}
|
|
8581
|
+
var clickedIndex = findFeatureIndexByKey(layer.geojson, feature[0]);
|
|
8484
8582
|
if (clickedIndex === -1) {
|
|
8485
8583
|
return;
|
|
8486
8584
|
}
|
|
@@ -8490,10 +8588,9 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8490
8588
|
geojson: layer.geojson,
|
|
8491
8589
|
selectedFeatureIds: layer.selectedFeatureIds
|
|
8492
8590
|
});
|
|
8493
|
-
//
|
|
8494
|
-
//
|
|
8495
|
-
//
|
|
8496
|
-
// instead happen via empty-space click or multi-select interactions.
|
|
8591
|
+
// Drawing layers only: deselecting the active edit target collapses edit mode,
|
|
8592
|
+
// so a plain click on the sole selection keeps it. Clearing happens through
|
|
8593
|
+
// empty space or shift+click instead.
|
|
8497
8594
|
var shouldPreventDeselect = hasRegisteredDrawTool && !isReadonly && !isShiftClick && currentSelection.length === 1 && currentSelection[0] === clickedIndex;
|
|
8498
8595
|
var newSelection = shouldPreventDeselect ? [clickedIndex] : calculateNewSelection(currentSelection, clickedIndex, isShiftClick != null ? isShiftClick : false);
|
|
8499
8596
|
var nextSelectedFeatureIds = newSelection.map(function (index) {
|
|
@@ -8505,25 +8602,13 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8505
8602
|
layerId: layerId,
|
|
8506
8603
|
selectedFeatureIds: nextSelectedFeatureIds
|
|
8507
8604
|
}));
|
|
8508
|
-
if (newSelection.length === 0) {
|
|
8605
|
+
if (newSelection.length === 0 || shouldExitEditModeForMultiSelect(newSelection.length)) {
|
|
8509
8606
|
dispatch(layerActions.toggleFeatureMode({
|
|
8510
8607
|
layerId: layerId,
|
|
8511
8608
|
isInEditMode: false,
|
|
8512
8609
|
drawMode: ''
|
|
8513
8610
|
}));
|
|
8514
8611
|
}
|
|
8515
|
-
var affectedIndices = getAffectedIndices(currentSelection, newSelection);
|
|
8516
|
-
affectedIndices.forEach(function (idx) {
|
|
8517
|
-
var isNowSelected = newSelection.includes(idx);
|
|
8518
|
-
dispatch(layerActions.updateFeatureProperties({
|
|
8519
|
-
layerId: layerId,
|
|
8520
|
-
properties: {
|
|
8521
|
-
highlightSelectedFeature: isNowSelected,
|
|
8522
|
-
isSelected: isNowSelected
|
|
8523
|
-
},
|
|
8524
|
-
targetFeatureIndex: idx
|
|
8525
|
-
}));
|
|
8526
|
-
});
|
|
8527
8612
|
if (shouldEnterEditMode(isReadonly, isShiftClick != null ? isShiftClick : false, newSelection.length)) {
|
|
8528
8613
|
dispatch(layerActions.toggleFeatureMode({
|
|
8529
8614
|
layerId: layerId,
|
|
@@ -8531,27 +8616,15 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8531
8616
|
drawMode: ''
|
|
8532
8617
|
}));
|
|
8533
8618
|
}
|
|
8534
|
-
}, [hasRegisteredDrawTool, dispatch, layer.geojson, layer.selectedFeatureIds, layerId]);
|
|
8535
|
-
var onNoFeatureClick =
|
|
8536
|
-
if (activeDrawToolId) {
|
|
8537
|
-
// do not disable edit mode when a drawing tool is active
|
|
8538
|
-
return;
|
|
8539
|
-
}
|
|
8540
|
-
dispatch(layerActions.toggleFeatureMode({
|
|
8541
|
-
layerId: layerId,
|
|
8542
|
-
isInEditMode: false,
|
|
8543
|
-
drawMode: ''
|
|
8544
|
-
}));
|
|
8545
|
-
}, [activeDrawToolId, dispatch, layerId]);
|
|
8619
|
+
}, [hasRegisteredDrawTool, dispatch, layer.geojson, layer.selectedFeatureIds, layerId, clearSelection]);
|
|
8620
|
+
var onNoFeatureClick = clearSelection;
|
|
8546
8621
|
var onBoxSelect = React.useCallback(function (features, addToSelection) {
|
|
8547
|
-
var _layer$
|
|
8548
|
-
if (!((_layer$
|
|
8622
|
+
var _layer$geojson3;
|
|
8623
|
+
if (!((_layer$geojson3 = layer.geojson) != null && _layer$geojson3.features.length)) {
|
|
8549
8624
|
return;
|
|
8550
8625
|
}
|
|
8551
8626
|
var boxSelectedIndices = features.map(function (feature) {
|
|
8552
|
-
return layer.geojson
|
|
8553
|
-
return feat.id === feature.getId();
|
|
8554
|
-
});
|
|
8627
|
+
return findFeatureIndexByKey(layer.geojson, feature);
|
|
8555
8628
|
}).filter(function (idx) {
|
|
8556
8629
|
return idx !== -1;
|
|
8557
8630
|
});
|
|
@@ -8562,7 +8635,7 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8562
8635
|
geojson: layer.geojson,
|
|
8563
8636
|
selectedFeatureIds: layer.selectedFeatureIds
|
|
8564
8637
|
});
|
|
8565
|
-
var newSelection =
|
|
8638
|
+
var newSelection = calculateBoxSelection(previousSelection, boxSelectedIndices, addToSelection);
|
|
8566
8639
|
var nextSelectedFeatureIds = newSelection.map(function (index) {
|
|
8567
8640
|
return layerUtils.getFeatureSelectionKey(layer.geojson.features[index]);
|
|
8568
8641
|
}).filter(function (featureId) {
|
|
@@ -8572,21 +8645,72 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8572
8645
|
layerId: layerId,
|
|
8573
8646
|
selectedFeatureIds: nextSelectedFeatureIds
|
|
8574
8647
|
}));
|
|
8575
|
-
|
|
8576
|
-
|
|
8648
|
+
if (shouldExitEditModeForMultiSelect(newSelection.length)) {
|
|
8649
|
+
dispatch(layerActions.toggleFeatureMode({
|
|
8650
|
+
layerId: layerId,
|
|
8651
|
+
isInEditMode: false,
|
|
8652
|
+
drawMode: ''
|
|
8653
|
+
}));
|
|
8654
|
+
}
|
|
8577
8655
|
}, [dispatch, layer.geojson, layer.selectedFeatureIds, layerId]);
|
|
8578
8656
|
var boxSelectConfig = React.useMemo(function () {
|
|
8579
|
-
return
|
|
8657
|
+
return usesIdSelection && !layer.isInEditMode ? {
|
|
8580
8658
|
onBoxSelect: onBoxSelect,
|
|
8581
8659
|
active: true
|
|
8582
8660
|
} : undefined;
|
|
8583
|
-
}, [
|
|
8584
|
-
|
|
8585
|
-
|
|
8661
|
+
}, [usesIdSelection, layer.isInEditMode, onBoxSelect]);
|
|
8662
|
+
// Mutually exclusive with boxSelectConfig, so only one DragBox is ever live.
|
|
8663
|
+
var editModeBoxSelectConfig = React.useMemo(function () {
|
|
8664
|
+
return usesIdSelection && layer.isInEditMode ? {
|
|
8665
|
+
onBoxSelect: onBoxSelect,
|
|
8666
|
+
active: true
|
|
8667
|
+
} : undefined;
|
|
8668
|
+
}, [usesIdSelection, layer.isInEditMode, onBoxSelect]);
|
|
8669
|
+
var selectedFeatureIndices = React.useMemo(function () {
|
|
8670
|
+
return getCurrentSelectedIndices({
|
|
8671
|
+
geojson: layer.geojson,
|
|
8672
|
+
selectedFeatureIds: layer.selectedFeatureIds
|
|
8673
|
+
});
|
|
8674
|
+
}, [layer.geojson, layer.selectedFeatureIds]);
|
|
8675
|
+
useDeselectAllOnEscape({
|
|
8676
|
+
selectedFeatureCount: selectedFeatureIndices.length,
|
|
8677
|
+
isInEditMode: layer.isInEditMode,
|
|
8678
|
+
hasRegisteredDrawTool: hasRegisteredDrawTool,
|
|
8679
|
+
onDeselectAll: clearSelection
|
|
8680
|
+
});
|
|
8681
|
+
var movableSelectedFeatureIds = React.useMemo(function () {
|
|
8682
|
+
return getMovableSelectedFeatureIds(layer.geojson, layer.selectedFeatureIds);
|
|
8683
|
+
}, [layer.geojson, layer.selectedFeatureIds]);
|
|
8684
|
+
var onFeatureGeometriesChange = React.useCallback(function (changedFeatures) {
|
|
8685
|
+
if (!layerId || !changedFeatures.length) {
|
|
8686
|
+
return;
|
|
8687
|
+
}
|
|
8688
|
+
dispatch(layerActions.moveFeatures({
|
|
8689
|
+
layerId: layerId,
|
|
8690
|
+
movedFeatures: changedFeatures,
|
|
8691
|
+
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId,
|
|
8692
|
+
geoJSONIntersectionBoundsLayerId: geoJSONIntersectionBoundsLayerId
|
|
8693
|
+
}));
|
|
8694
|
+
}, [dispatch, layerId, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId]);
|
|
8695
|
+
var isMultiShapeInteractionEnabled = shouldEnableMultiShapeMove(hasRegisteredDrawTool, layer.isInEditMode, (_layer$selectedFeatur2 = (_layer$selectedFeatur3 = layer.selectedFeatureIds) == null ? void 0 : _layer$selectedFeatur3.length) != null ? _layer$selectedFeatur2 : 0, movableSelectedFeatureIds.length);
|
|
8696
|
+
var moveFeaturesConfig = React.useMemo(function () {
|
|
8697
|
+
return isMultiShapeInteractionEnabled ? {
|
|
8698
|
+
onMoveEnd: onFeatureGeometriesChange,
|
|
8699
|
+
active: true
|
|
8700
|
+
} : undefined;
|
|
8701
|
+
}, [isMultiShapeInteractionEnabled, onFeatureGeometriesChange]);
|
|
8702
|
+
var modifyFeaturesConfig = React.useMemo(function () {
|
|
8703
|
+
return isMultiShapeInteractionEnabled ? {
|
|
8704
|
+
onModifyEnd: onFeatureGeometriesChange,
|
|
8705
|
+
active: true
|
|
8706
|
+
} : undefined;
|
|
8707
|
+
}, [isMultiShapeInteractionEnabled, onFeatureGeometriesChange]);
|
|
8708
|
+
var onViewOnlyFeatureClick = React.useCallback(function (feature, isShiftClick) {
|
|
8709
|
+
if (sketchInProgress) {
|
|
8586
8710
|
return;
|
|
8587
8711
|
}
|
|
8588
|
-
onFeatureClick(feature);
|
|
8589
|
-
}, [
|
|
8712
|
+
onFeatureClick(feature, isShiftClick);
|
|
8713
|
+
}, [sketchInProgress, onFeatureClick]);
|
|
8590
8714
|
var updateFeature = React.useCallback(function (geojson, reason) {
|
|
8591
8715
|
if (!layerId) {
|
|
8592
8716
|
window.console.error('updateFeature without layerId');
|
|
@@ -8617,18 +8741,21 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8617
8741
|
return jsxs(Fragment, {
|
|
8618
8742
|
children: [jsx(OpenLayersFeatureLayer, {
|
|
8619
8743
|
boxSelect: boxSelectConfig,
|
|
8620
|
-
clickOnFeature: layer.
|
|
8744
|
+
clickOnFeature: usesIdSelection && !layer.isInEditMode ? {
|
|
8621
8745
|
onClick: onFeatureClick,
|
|
8622
8746
|
hitTolerance: 5
|
|
8623
8747
|
} : undefined,
|
|
8624
8748
|
featureCollection: !layer.isInEditMode ? displayGeojson : undefined,
|
|
8625
8749
|
hoverSelect: hoverSelect,
|
|
8626
8750
|
layerId: layerId,
|
|
8751
|
+
modifyFeatures: modifyFeaturesConfig,
|
|
8752
|
+
moveFeatures: moveFeaturesConfig,
|
|
8627
8753
|
opacity: layer.opacity,
|
|
8628
8754
|
style: style,
|
|
8629
8755
|
visible: layer.enabled,
|
|
8630
8756
|
zIndex: zIndex
|
|
8631
8757
|
}), jsx(OpenLayersMapDraw, {
|
|
8758
|
+
boxSelect: editModeBoxSelectConfig,
|
|
8632
8759
|
drawMode: layer.drawMode,
|
|
8633
8760
|
exitDrawModeCallback: exitFeatureDrawMode,
|
|
8634
8761
|
geojson: layer.geojson,
|
|
@@ -8636,6 +8763,7 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8636
8763
|
onNoFeatureClick: onNoFeatureClick,
|
|
8637
8764
|
onViewOnlyFeatureClick: onViewOnlyFeatureClick,
|
|
8638
8765
|
selectedFeatureIndex: activeFeatureIndex,
|
|
8766
|
+
selectedFeatureIndices: selectedFeatureIndices,
|
|
8639
8767
|
updateGeojson: updateFeature,
|
|
8640
8768
|
viewOnlyStyle: style
|
|
8641
8769
|
})]
|
|
@@ -8659,6 +8787,14 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8659
8787
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8660
8788
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8661
8789
|
* */
|
|
8790
|
+
var getStoredViewObjectForMap = function getStoredViewObjectForMap(mapId, store) {
|
|
8791
|
+
var syncGroupState = syncGroupsSelectors.getSynchronizationGroupState(store.getState());
|
|
8792
|
+
var thisAreaSyncGroupId = syncGroupState.groups.allIds.find(function (id) {
|
|
8793
|
+
var group = syncGroupState.groups.byId[id];
|
|
8794
|
+
return group.type === syncConstants.SYNCGROUPS_TYPE_SETBBOX && group.targets.allIds.includes(mapId);
|
|
8795
|
+
});
|
|
8796
|
+
return thisAreaSyncGroupId ? getViewObjectForSyncGroup(thisAreaSyncGroupId) : getViewObjectForMapId(mapId);
|
|
8797
|
+
};
|
|
8662
8798
|
var useGetOpenLayersView = function useGetOpenLayersView(mapId, store) {
|
|
8663
8799
|
var _useState = useState(),
|
|
8664
8800
|
view = _useState[0],
|
|
@@ -8666,17 +8802,9 @@ var useGetOpenLayersView = function useGetOpenLayersView(mapId, store) {
|
|
|
8666
8802
|
var _useState2 = useState(),
|
|
8667
8803
|
name = _useState2[0],
|
|
8668
8804
|
setName = _useState2[1];
|
|
8669
|
-
var
|
|
8670
|
-
var syncGroupView = useMemo(function () {
|
|
8671
|
-
var thisAreaSyncGroupId = syncGroupState.groups.allIds.find(function (id) {
|
|
8672
|
-
var group = syncGroupState.groups.byId[id];
|
|
8673
|
-
return group.type === syncConstants.SYNCGROUPS_TYPE_SETBBOX && group.targets.allIds.includes(mapId);
|
|
8674
|
-
});
|
|
8675
|
-
return thisAreaSyncGroupId ? getViewObjectForSyncGroup(thisAreaSyncGroupId) : null;
|
|
8676
|
-
}, [mapId, syncGroupState.groups]);
|
|
8805
|
+
var storedView = getStoredViewObjectForMap(mapId, store);
|
|
8677
8806
|
useEffect(function () {
|
|
8678
8807
|
var mapBbox = mapSelectors.getBbox(store.getState(), mapId);
|
|
8679
|
-
var storedView = syncGroupView || getViewObjectForMapId(mapId);
|
|
8680
8808
|
if (storedView.view.getCenter() === undefined && mapBbox.left !== undefined) {
|
|
8681
8809
|
storedView.view.fit([mapBbox.left, mapBbox.bottom, mapBbox.right, mapBbox.top]);
|
|
8682
8810
|
}
|
|
@@ -8689,7 +8817,7 @@ var useGetOpenLayersView = function useGetOpenLayersView(mapId, store) {
|
|
|
8689
8817
|
return function () {
|
|
8690
8818
|
unByKey(eventKey);
|
|
8691
8819
|
};
|
|
8692
|
-
}, [
|
|
8820
|
+
}, [storedView, mapId, store]);
|
|
8693
8821
|
return {
|
|
8694
8822
|
view: view,
|
|
8695
8823
|
name: name
|
|
@@ -9005,7 +9133,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
9005
9133
|
isLoading: true
|
|
9006
9134
|
});
|
|
9007
9135
|
_context.n = 2;
|
|
9008
|
-
return
|
|
9136
|
+
return authFetch(url);
|
|
9009
9137
|
case 2:
|
|
9010
9138
|
response = _context.v;
|
|
9011
9139
|
if (response.ok) {
|
|
@@ -9338,6 +9466,60 @@ var MapOptionsButtonConnect = function MapOptionsButtonConnect(_ref) {
|
|
|
9338
9466
|
});
|
|
9339
9467
|
};
|
|
9340
9468
|
|
|
9469
|
+
/* *
|
|
9470
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9471
|
+
* you may not use this file except in compliance with the License.
|
|
9472
|
+
* You may obtain a copy of the License at
|
|
9473
|
+
*
|
|
9474
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9475
|
+
*
|
|
9476
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9477
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9478
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9479
|
+
* See the License for the specific language governing permissions and
|
|
9480
|
+
* limitations under the License.
|
|
9481
|
+
*
|
|
9482
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9483
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
9484
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
9485
|
+
* */
|
|
9486
|
+
var InitialZoomToLayerConnect = function InitialZoomToLayerConnect(_ref) {
|
|
9487
|
+
var mapId = _ref.mapId,
|
|
9488
|
+
onHomeExtentResolved = _ref.onHomeExtentResolved;
|
|
9489
|
+
var initialZoomToLayerId = useSelector(function (store) {
|
|
9490
|
+
return mapSelectors.getInitialZoomToLayerId(store, mapId);
|
|
9491
|
+
});
|
|
9492
|
+
var layer = useSelector(function (store) {
|
|
9493
|
+
return initialZoomToLayerId ? layerSelectors.getLayerById(store, initialZoomToLayerId) : undefined;
|
|
9494
|
+
});
|
|
9495
|
+
var store = useStore();
|
|
9496
|
+
var view = useViewFromLayer(layer);
|
|
9497
|
+
var _useGetWMLayerInstanc = useGetWMLayerInstance(layer),
|
|
9498
|
+
wmLayer = _useGetWMLayerInstanc.wmLayer;
|
|
9499
|
+
var hasResolvedInitialLayerView = React.useRef(false);
|
|
9500
|
+
React.useEffect(function () {
|
|
9501
|
+
var storedView = getStoredViewObjectForMap(mapId, store);
|
|
9502
|
+
if (storedView.view !== view) {
|
|
9503
|
+
storedView.setView(view);
|
|
9504
|
+
}
|
|
9505
|
+
}, [mapId, store, view]);
|
|
9506
|
+
React.useEffect(function () {
|
|
9507
|
+
if (hasResolvedInitialLayerView.current || !wmLayer) {
|
|
9508
|
+
return;
|
|
9509
|
+
}
|
|
9510
|
+
var extent = getLayerExtentForProjection(wmLayer, view.getProjection().getCode());
|
|
9511
|
+
if (extent) {
|
|
9512
|
+
onHomeExtentResolved([].concat(extent));
|
|
9513
|
+
}
|
|
9514
|
+
hasResolvedInitialLayerView.current = true;
|
|
9515
|
+
store.dispatch(mapActions.setPendingInitialZoomToLayer({
|
|
9516
|
+
mapId: mapId,
|
|
9517
|
+
layerId: undefined
|
|
9518
|
+
}));
|
|
9519
|
+
}, [mapId, onHomeExtentResolved, store, view, wmLayer]);
|
|
9520
|
+
return null;
|
|
9521
|
+
};
|
|
9522
|
+
|
|
9341
9523
|
/**
|
|
9342
9524
|
* Connected component used to display the map and selected layers.
|
|
9343
9525
|
* Includes options to disable the map controls and legend.
|
|
@@ -9368,6 +9550,9 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9368
9550
|
var _React$useState = React.useState(),
|
|
9369
9551
|
hoverLinkedFeature = _React$useState[0],
|
|
9370
9552
|
setHoverLinkedFeature = _React$useState[1];
|
|
9553
|
+
var _React$useState2 = React.useState(undefined),
|
|
9554
|
+
derivedHomeExtent = _React$useState2[0],
|
|
9555
|
+
setDerivedHomeExtent = _React$useState2[1];
|
|
9371
9556
|
var linkedPanelIds = useSelector(function (store) {
|
|
9372
9557
|
return genericSelectors.selectLinkedPanelIdsForMap(store, mapId);
|
|
9373
9558
|
});
|
|
@@ -9796,11 +9981,11 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9796
9981
|
checkIfDataOutdated();
|
|
9797
9982
|
}, [checkIfDataOutdated]);
|
|
9798
9983
|
useMapViewLoadingIndicator(mapId, mapLayerIds);
|
|
9799
|
-
var _React$
|
|
9984
|
+
var _React$useState3 = React.useState({
|
|
9800
9985
|
debugMode: false
|
|
9801
9986
|
}),
|
|
9802
|
-
mapMode = _React$
|
|
9803
|
-
setMapMode = _React$
|
|
9987
|
+
mapMode = _React$useState3[0],
|
|
9988
|
+
setMapMode = _React$useState3[1];
|
|
9804
9989
|
React.useEffect(function () {
|
|
9805
9990
|
var handleKeyPress = function handleKeyPress(event) {
|
|
9806
9991
|
if (event.isTrusted && document.activeElement === document.body) {
|
|
@@ -9818,9 +10003,12 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9818
10003
|
document.removeEventListener('keyup', handleKeyPress);
|
|
9819
10004
|
};
|
|
9820
10005
|
}, [mapMode]);
|
|
10006
|
+
var handleInitialHomeExtentResolved = React.useCallback(function (extent) {
|
|
10007
|
+
setDerivedHomeExtent(extent);
|
|
10008
|
+
}, []);
|
|
9821
10009
|
var homeExtent = React.useMemo(function () {
|
|
9822
|
-
return initialBbox
|
|
9823
|
-
}, [initialBbox]);
|
|
10010
|
+
return initialBbox ? [initialBbox.left, initialBbox.bottom, initialBbox.right, initialBbox.top] : derivedHomeExtent;
|
|
10011
|
+
}, [derivedHomeExtent, initialBbox]);
|
|
9824
10012
|
var dialogType = uiTypes.DialogTypes.Search + "-" + mapId;
|
|
9825
10013
|
var _useSetupDialog = useSetupDialog(dialogType),
|
|
9826
10014
|
isSearchDialogOpen = _useSetupDialog.isDialogOpen;
|
|
@@ -9864,9 +10052,12 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9864
10052
|
features: linkedFeatureCollectionsWithHover.features
|
|
9865
10053
|
};
|
|
9866
10054
|
}, [linkedFeatureCollectionsWithHover]);
|
|
9867
|
-
return
|
|
10055
|
+
return jsxs(TimeContext.Provider, {
|
|
9868
10056
|
value: prefetchTimespan,
|
|
9869
|
-
children:
|
|
10057
|
+
children: [jsx(InitialZoomToLayerConnect, {
|
|
10058
|
+
mapId: mapId,
|
|
10059
|
+
onHomeExtentResolved: handleInitialHomeExtentResolved
|
|
10060
|
+
}), jsxs(OpenLayersMapView, {
|
|
9870
10061
|
holdShiftToScroll: holdShiftToScroll,
|
|
9871
10062
|
isFocused: isActiveWindowId,
|
|
9872
10063
|
isMouseWheelZoomEnabled: !isTimeScrollingEnabled,
|
|
@@ -9958,7 +10149,7 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9958
10149
|
}), !!displayTimeInMap && jsx(ClockConnect, {
|
|
9959
10150
|
mapId: mapId
|
|
9960
10151
|
}), children]
|
|
9961
|
-
})
|
|
10152
|
+
})]
|
|
9962
10153
|
});
|
|
9963
10154
|
};
|
|
9964
10155
|
|
|
@@ -9974,7 +10165,7 @@ var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_ref) {
|
|
|
9974
10165
|
var mapId = _ref.mapId,
|
|
9975
10166
|
enableKeyboardShortcut = _ref.enableKeyboardShortcut;
|
|
9976
10167
|
return jsx(OptionsMenuButton, {
|
|
9977
|
-
animationLengthBtn: jsx(
|
|
10168
|
+
animationLengthBtn: jsx(AnimationLengthPanelConnect, {
|
|
9978
10169
|
mapId: mapId
|
|
9979
10170
|
}),
|
|
9980
10171
|
enableKeyboardShortcut: enableKeyboardShortcut,
|
|
@@ -12276,4 +12467,4 @@ var storyUtils = /*#__PURE__*/Object.freeze({
|
|
|
12276
12467
|
useDefaultMapSettings: useDefaultMapSettings
|
|
12277
12468
|
});
|
|
12278
12469
|
|
|
12279
|
-
export { CORE_NAMESPACE, _ConfigurableMapConnect as ConfigurableMapConnect, CoreI18nProvider, CoreStoreProvider, CoreThemeProvider, CoreThemeStoreProvider, DemoWrapper, DemoWrapperConnect, HarmonieTempAndPrecipPreset, LanguageSelect, LayerInfoButtonConnect, LayerInfoDialogConnect, _LayerManager as LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LegendConnect, LegendMapButtonConnect, LoadingIndicatorProgressBar, LocationSearch, LocationSearchConnect, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, MyMapLocation, OlMapViewConnect, RouterWrapperConnect, SearchControlButtonConnect, SelectedFeaturesDialogConnect, SyncGroupViewerConnect, TIME_SLIDER_Z_INDEX, TimeSliderConnect, componentsLookUp, coreTranslations, defaultBbox, defaultConfigurations, filterMapPresets, filterServices, filterTimeSeriesServices,
|
|
12470
|
+
export { CORE_NAMESPACE, _ConfigurableMapConnect as ConfigurableMapConnect, CoreI18nProvider, CoreStoreProvider, CoreThemeProvider, CoreThemeStoreProvider, DemoWrapper, DemoWrapperConnect, HarmonieTempAndPrecipPreset, LanguageSelect, LayerInfoButtonConnect, LayerInfoDialogConnect, _LayerManager as LayerManager, BaseLayerRow as LayerManagerBaseLayerRow, LayerManagerConnect, DescriptionRow as LayerManagerDescriptionRow, HeaderOptions as LayerManagerHeaderOptions, LayerContainerRow as LayerManagerLayerContainerRow, LayerManagerMapButtonConnect, LegendConnect, LegendMapButtonConnect, LoadingIndicatorProgressBar, LocationSearch, LocationSearchConnect, MultiDimensionSelectMapButtonsConnect, MultiMapMultiDimensionSelectConnect as MultiMapDimensionSelectConnect, MultiMapViewConnect, MyMapLocation, OlMapViewConnect, RouterWrapperConnect, SearchControlButtonConnect, SelectedFeaturesDialogConnect, SyncGroupViewerConnect, TIME_SLIDER_Z_INDEX, TimeSliderConnect, componentsLookUp, coreTranslations, defaultBbox, defaultConfigurations, filterMapPresets, filterServices, filterTimeSeriesServices, getCenterOfLinkedFeature, getCurrentSelectedIndices, getIsOutdated, getLanguageFromLocalStorage, getRenderedDimensions, getStoredViewObjectForMap, languageLocalStorageKey, makeLayerInfoPayload, makePrefetchTimeSpan, saveLanguageToLocalStorage, storyUtils, testLayers, useFetchServices, useFitAndHighlightWarningFeature, useGetOpenLayersView, useLocationDetail, useLocationList, usePrefetchTimeSpan, useUpdateTimeSpan, useUpdateTimestep };
|
|
@@ -1,15 +1,39 @@
|
|
|
1
|
+
import type { Feature } from 'ol';
|
|
1
2
|
import type { StyleLike } from 'ol/style/Style';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import type { layerTypes } from '@opengeoweb/store';
|
|
4
5
|
import type { HoverSelect } from '@opengeoweb/webmap-react';
|
|
6
|
+
import { getAffectedIndices } from '@opengeoweb/webmap-react';
|
|
7
|
+
export { getAffectedIndices };
|
|
8
|
+
/** Escape drops a multi selection only. A sole selection is kept, matching the
|
|
9
|
+
* plain click behaviour, and edit mode keeps its own Escape handling. */
|
|
10
|
+
export declare const shouldDeselectAllOnEscape: (selectedFeatureCount: number, isInEditMode: boolean | undefined, hasRegisteredDrawTool: boolean) => boolean;
|
|
11
|
+
interface DeselectAllOnEscapeOptions {
|
|
12
|
+
selectedFeatureCount: number;
|
|
13
|
+
isInEditMode: boolean | undefined;
|
|
14
|
+
hasRegisteredDrawTool: boolean;
|
|
15
|
+
onDeselectAll: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const useDeselectAllOnEscape: ({ selectedFeatureCount, isInEditMode, hasRegisteredDrawTool, onDeselectAll, }: DeselectAllOnEscapeOptions) => void;
|
|
18
|
+
export declare const shouldClearSelectionOnEmptyClick: (activeDrawToolId: string | undefined, hasRegisteredDrawTool: boolean) => boolean;
|
|
19
|
+
export declare const isSketchInProgress: (isInEditMode: boolean | undefined, drawMode: string | undefined, activeFeature: GeoJSON.Feature | undefined) => boolean;
|
|
20
|
+
/** Soundings and time series set their own highlight, so they must stay out of this. */
|
|
21
|
+
export declare const usesFeatureIdSelection: (isSelectable: boolean | undefined, hasRegisteredDrawTool: boolean) => boolean;
|
|
22
|
+
export declare const getSelectionProperties: (usesIdSelection: boolean, selectedFeatureIdSet: Set<string>, featureId: string | undefined) => {
|
|
23
|
+
isSelected: boolean;
|
|
24
|
+
highlightSelectedFeature: boolean;
|
|
25
|
+
} | undefined;
|
|
26
|
+
export declare const getClickedFeatureKey: (feature?: Feature) => string | undefined;
|
|
27
|
+
export declare const findFeatureIndexByKey: (geojson: GeoJSON.FeatureCollection | undefined, feature?: Feature) => number;
|
|
28
|
+
export declare const getMovableSelectedFeatureIds: (geojson: GeoJSON.FeatureCollection | undefined, selectedFeatureIds: string[] | undefined) => string[];
|
|
29
|
+
/** Moving a set of shapes belongs to the drawing tool only: selection-only
|
|
30
|
+
* reference layers stay selectable but must never be dragged. */
|
|
31
|
+
export declare const shouldEnableMultiShapeMove: (hasRegisteredDrawTool: boolean, isInEditMode: boolean | undefined, selectedFeatureCount: number, movableFeatureCount: number) => boolean;
|
|
5
32
|
interface SelectionState {
|
|
6
33
|
geojson?: GeoJSON.FeatureCollection;
|
|
7
34
|
selectedFeatureIds?: string[];
|
|
8
35
|
}
|
|
9
36
|
export declare const getCurrentSelectedIndices: ({ geojson, selectedFeatureIds, }: SelectionState) => number[];
|
|
10
|
-
export declare const calculateNewSelection: (currentSelectedIndices: number[], clickedIndex: number, isShiftClick: boolean) => number[];
|
|
11
|
-
export declare const getAffectedIndices: (oldSelection: number[], newSelection: number[]) => number[];
|
|
12
|
-
export declare const shouldEnterEditMode: (isReadonly: boolean, isShiftClick: boolean, newSelectionCount: number) => boolean;
|
|
13
37
|
interface OpenLayersFeatureLayerConnectProps {
|
|
14
38
|
layer: layerTypes.ReduxLayer;
|
|
15
39
|
layerId?: string;
|
|
@@ -18,4 +42,3 @@ interface OpenLayersFeatureLayerConnectProps {
|
|
|
18
42
|
hoverSelect?: HoverSelect;
|
|
19
43
|
}
|
|
20
44
|
export declare const OpenLayersFeatureLayerConnect: React.FC<OpenLayersFeatureLayerConnectProps>;
|
|
21
|
-
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Extent } from 'ol/extent';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface InitialZoomToLayerConnectProps {
|
|
4
|
+
mapId: string;
|
|
5
|
+
onHomeExtentResolved: (extent: Extent) => void;
|
|
6
|
+
}
|
|
7
|
+
declare const InitialZoomToLayerConnect: React.FC<InitialZoomToLayerConnectProps>;
|
|
8
|
+
export default InitialZoomToLayerConnect;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Store } from '@reduxjs/toolkit';
|
|
2
2
|
import type { View } from 'ol';
|
|
3
|
+
import { getViewObjectForMapId } from '@opengeoweb/store';
|
|
3
4
|
import type { CoreAppStore } from '@opengeoweb/store';
|
|
4
5
|
interface UseGetOpenLayersViewValue {
|
|
5
6
|
view?: View;
|
|
6
7
|
name?: string;
|
|
7
8
|
}
|
|
9
|
+
export declare const getStoredViewObjectForMap: (mapId: string, store: Store<CoreAppStore>) => ReturnType<typeof getViewObjectForMapId>;
|
|
8
10
|
export declare const useGetOpenLayersView: (mapId: string, store: Store<CoreAppStore>) => UseGetOpenLayersViewValue;
|
|
9
11
|
export {};
|
|
@@ -6,7 +6,7 @@ export declare const mapPresetRadar: {
|
|
|
6
6
|
enabled: boolean;
|
|
7
7
|
style: string;
|
|
8
8
|
id: string;
|
|
9
|
-
layerType: import("
|
|
9
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
10
10
|
}[];
|
|
11
11
|
proj: {
|
|
12
12
|
bbox: {
|
|
@@ -23,7 +23,7 @@ export declare const mapPresetObsTA: {
|
|
|
23
23
|
service: string;
|
|
24
24
|
name: string;
|
|
25
25
|
id: string;
|
|
26
|
-
layerType: import("
|
|
26
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
27
27
|
}[];
|
|
28
28
|
proj: {
|
|
29
29
|
bbox: {
|
|
@@ -40,7 +40,7 @@ export declare const mapPresetObsWind: {
|
|
|
40
40
|
service: string;
|
|
41
41
|
name: string;
|
|
42
42
|
id: string;
|
|
43
|
-
layerType: import("
|
|
43
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
44
44
|
}[];
|
|
45
45
|
proj: {
|
|
46
46
|
bbox: {
|
|
@@ -57,7 +57,7 @@ export declare const mapPresetObsPP: {
|
|
|
57
57
|
service: string;
|
|
58
58
|
name: string;
|
|
59
59
|
id: string;
|
|
60
|
-
layerType: import("
|
|
60
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
61
61
|
}[];
|
|
62
62
|
proj: {
|
|
63
63
|
bbox: {
|
|
@@ -74,7 +74,7 @@ export declare const mapPresetObsRH: {
|
|
|
74
74
|
service: string;
|
|
75
75
|
name: string;
|
|
76
76
|
id: string;
|
|
77
|
-
layerType: import("
|
|
77
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
78
78
|
}[];
|
|
79
79
|
proj: {
|
|
80
80
|
bbox: {
|
|
@@ -91,7 +91,7 @@ export declare const mapPresetObsQG: {
|
|
|
91
91
|
service: string;
|
|
92
92
|
name: string;
|
|
93
93
|
id: string;
|
|
94
|
-
layerType: import("
|
|
94
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
95
95
|
}[];
|
|
96
96
|
proj: {
|
|
97
97
|
bbox: {
|
|
@@ -109,7 +109,7 @@ export declare const mapPresetEumetsat: {
|
|
|
109
109
|
name: string;
|
|
110
110
|
enabled: boolean;
|
|
111
111
|
id: string;
|
|
112
|
-
layerType: import("
|
|
112
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
113
113
|
}[];
|
|
114
114
|
proj: {
|
|
115
115
|
bbox: {
|
|
@@ -126,7 +126,7 @@ export declare const mapPresetHarmoniePrecipitationFlux: {
|
|
|
126
126
|
service: string;
|
|
127
127
|
name: string;
|
|
128
128
|
id: string;
|
|
129
|
-
layerType: import("
|
|
129
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
130
130
|
enabled: boolean;
|
|
131
131
|
}[];
|
|
132
132
|
proj: {
|
|
@@ -144,7 +144,7 @@ export declare const mapPresetHarmonieTemperature2m: {
|
|
|
144
144
|
service: string;
|
|
145
145
|
name: string;
|
|
146
146
|
id: string;
|
|
147
|
-
layerType: import("
|
|
147
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
148
148
|
enabled: boolean;
|
|
149
149
|
}[];
|
|
150
150
|
proj: {
|
|
@@ -162,7 +162,7 @@ export declare const mapPresetHarmoniePressureMSL: {
|
|
|
162
162
|
service: string;
|
|
163
163
|
name: string;
|
|
164
164
|
id: string;
|
|
165
|
-
layerType: import("
|
|
165
|
+
layerType: import("libs/webmap/dist").LayerType;
|
|
166
166
|
enabled: boolean;
|
|
167
167
|
}[];
|
|
168
168
|
proj: {
|
package/package.json
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
2
|
+
"name": "@opengeoweb/core",
|
|
3
|
+
"version": "20.0.0",
|
|
4
|
+
"description": "GeoWeb Core library for the opengeoweb project",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.esm.js",
|
|
11
|
+
"module": "./dist/index.esm.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"@opengeoweb/source": "./src/index.ts",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"default": "./dist/index.esm.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@opengeoweb/shared": "20.0.0",
|
|
24
|
+
"react-redux": "^9.2.0",
|
|
25
|
+
"@opengeoweb/store": "20.0.0",
|
|
26
|
+
"@opengeoweb/time-slider": "20.0.0",
|
|
27
|
+
"@reduxjs/toolkit": "^2.6.1",
|
|
28
|
+
"@opengeoweb/webmap-react": "20.0.0",
|
|
29
|
+
"@opengeoweb/webmap": "20.0.0",
|
|
30
|
+
"@opengeoweb/theme": "20.0.0",
|
|
31
|
+
"@opengeoweb/layer-select": "20.0.0",
|
|
32
|
+
"lodash": "^4.18.1",
|
|
33
|
+
"ol": "^10.4.0",
|
|
34
|
+
"react-sortablejs": "^6.1.4",
|
|
35
|
+
"sortablejs": "^1.15.1",
|
|
36
|
+
"@mui/system": "^9.0.1",
|
|
37
|
+
"@opengeoweb/snackbar": "20.0.0",
|
|
38
|
+
"react-draggable": "^4.4.6",
|
|
39
|
+
"i18next": "^25.0.1",
|
|
40
|
+
"react-i18next": "^15.1.1",
|
|
41
|
+
"dompurify": "^3.4.13",
|
|
42
|
+
"@mui/material": "^9.0.1",
|
|
43
|
+
"@tanstack/react-query": "^5.85.5",
|
|
44
|
+
"@opengeoweb/api": "20.0.0",
|
|
45
|
+
"@types/geojson": "^7946.0.14",
|
|
46
|
+
"@turf/turf": "^7.2.0",
|
|
47
|
+
"proj4": "^2.15.0",
|
|
48
|
+
"react-router": "^7.18.2"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"react": "19",
|
|
52
|
+
"@emotion/react": "*",
|
|
53
|
+
"@emotion/styled": "*"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"eslint-plugin-storybook": "10.3.3"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"dist",
|
|
60
|
+
"!dist/package.json",
|
|
61
|
+
"README.md",
|
|
62
|
+
"package.json"
|
|
63
|
+
]
|
|
64
|
+
}
|