@opengeoweb/core 19.6.1 → 20.0.0-nightly-20260919
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 +412 -223
- 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() {
|
|
@@ -4716,13 +4694,12 @@ var RenderEDRLayers = function RenderEDRLayers(_ref) {
|
|
|
4716
4694
|
return (_layer$title = layer.title) == null ? void 0 : _layer$title.toLowerCase().includes(searchFilter.toLowerCase());
|
|
4717
4695
|
});
|
|
4718
4696
|
var edrText = t('layermanager-EDR');
|
|
4719
|
-
var
|
|
4697
|
+
var tooltip = nonEmptyTooltipPrefix + " " + currentValues.map(function (value) {
|
|
4720
4698
|
var layer = extendedLayers.find(function (layer) {
|
|
4721
4699
|
return value === layer.name;
|
|
4722
4700
|
});
|
|
4723
4701
|
return (layer == null ? void 0 : layer.title) || (layer == null ? void 0 : layer.name);
|
|
4724
|
-
})
|
|
4725
|
-
var tooltip = nonEmptyTooltipPrefix + " " + tooltipNames.sort(function (paramA, paramB) {
|
|
4702
|
+
}).sort(function (paramA, paramB) {
|
|
4726
4703
|
return (paramA != null ? paramA : '').localeCompare(paramB != null ? paramB : '');
|
|
4727
4704
|
}).join(', ');
|
|
4728
4705
|
return jsxs(TooltipSelect, {
|
|
@@ -6610,56 +6587,98 @@ var MultiMapMultiDimensionSelectConnect = function MultiMapMultiDimensionSelectC
|
|
|
6610
6587
|
});
|
|
6611
6588
|
};
|
|
6612
6589
|
|
|
6613
|
-
var
|
|
6590
|
+
var AnimationLengthPanelConnect = function AnimationLengthPanelConnect(_ref) {
|
|
6591
|
+
var _storedAnimationLengt, _ref2;
|
|
6614
6592
|
var mapId = _ref.mapId;
|
|
6615
6593
|
var dispatch = useDispatch();
|
|
6594
|
+
var storedAnimationLength = useSelector(function (store) {
|
|
6595
|
+
return mapSelectors.getAnimationLength(store, mapId);
|
|
6596
|
+
});
|
|
6616
6597
|
var isAnimating = useSelector(function (store) {
|
|
6617
6598
|
return mapSelectors.isAnimating(store, mapId);
|
|
6618
6599
|
});
|
|
6619
|
-
var
|
|
6620
|
-
|
|
6621
|
-
|
|
6600
|
+
var _React$useState = React.useState(),
|
|
6601
|
+
pendingLength = _React$useState[0],
|
|
6602
|
+
setPendingLength = _React$useState[1];
|
|
6603
|
+
var isCommittableRef = React.useRef(false);
|
|
6604
|
+
var currentMode = (_storedAnimationLengt = storedAnimationLength == null ? void 0 : storedAnimationLength.mode) != null ? _storedAnimationLengt : AnimationLengthMode.Exact;
|
|
6605
|
+
var draftLength = (pendingLength == null ? void 0 : pendingLength.mode) === currentMode ? pendingLength : undefined;
|
|
6606
|
+
var debouncedLength = useDebounce(pendingLength, 500);
|
|
6607
|
+
React.useEffect(function () {
|
|
6608
|
+
setPendingLength(undefined);
|
|
6609
|
+
}, [storedAnimationLength, mapId]);
|
|
6622
6610
|
var _useSelector = useSelector(function (store) {
|
|
6623
6611
|
return mapSelectors.getAnimationRange(store, mapId);
|
|
6624
6612
|
}),
|
|
6625
6613
|
animationStartTime = _useSelector.animationStartTime,
|
|
6626
6614
|
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) {
|
|
6615
|
+
var autoTimeStepLayerId = useSelector(function (store) {
|
|
6651
6616
|
return mapSelectors.getAutoTimeStepLayerId(store, mapId);
|
|
6652
6617
|
});
|
|
6618
|
+
var autoTimeStepLayerName = useSelector(function (store) {
|
|
6619
|
+
return autoTimeStepLayerId ? layerSelectors.getLayerTitleFromService(store, autoTimeStepLayerId) : undefined;
|
|
6620
|
+
});
|
|
6653
6621
|
var timeStepFromLayer = useSelector(function (store) {
|
|
6654
|
-
return layerSelectors.getTimeStepForLayerId(store,
|
|
6622
|
+
return layerSelectors.getTimeStepForLayerId(store, autoTimeStepLayerId);
|
|
6655
6623
|
});
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6624
|
+
var timeStep = useSelector(function (store) {
|
|
6625
|
+
return mapSelectors.getMapTimeStep(store, mapId);
|
|
6626
|
+
});
|
|
6627
|
+
var layerRefTimeDimension = useSelector(function (store) {
|
|
6628
|
+
return layerSelectors.getLayerDimension(store, autoTimeStepLayerId, 'reference_time');
|
|
6629
|
+
});
|
|
6630
|
+
var referenceTimeFromLayer = (layerRefTimeDimension == null ? void 0 : layerRefTimeDimension.currentValue) || undefined;
|
|
6631
|
+
var anchorTime = dateUtils.utc(referenceTimeFromLayer);
|
|
6632
|
+
var commitAnimationLength = React.useCallback(function (length) {
|
|
6633
|
+
var isUsableRange = isValidAnimationLength(length) && isWithinAnimationStepLimit(length, timeStep);
|
|
6634
|
+
var carriesOwnRange = isAnchoredMode(length.mode) || length.mode === AnimationLengthMode.Exact;
|
|
6635
|
+
var resolvedRange = carriesOwnRange && isUsableRange ? settingRange(length, anchorTime) : undefined;
|
|
6636
|
+
dispatch(mapActions.setAnimationLength(Object.assign({
|
|
6637
|
+
mapId: mapId,
|
|
6638
|
+
animationLength: length
|
|
6639
|
+
}, resolvedRange, {
|
|
6640
|
+
origin: mapEnums.MapActionOrigin.map
|
|
6641
|
+
})));
|
|
6642
|
+
}, [anchorTime, dispatch, mapId, timeStep]);
|
|
6643
|
+
React.useEffect(function () {
|
|
6644
|
+
if (debouncedLength && isCommittableRef.current) {
|
|
6645
|
+
commitAnimationLength(debouncedLength);
|
|
6646
|
+
setPendingLength(undefined);
|
|
6647
|
+
}
|
|
6648
|
+
}, [debouncedLength, commitAnimationLength]);
|
|
6649
|
+
var changeAnimationLength = function changeAnimationLength(animationLength, isStep) {
|
|
6650
|
+
var shouldDefer = isAnimating && animationLength.mode === currentMode && (isAnchoredMode(currentMode) || currentMode === AnimationLengthMode.Exact);
|
|
6651
|
+
isCommittableRef.current = shouldDefer;
|
|
6652
|
+
setPendingLength(animationLength);
|
|
6653
|
+
if (!shouldDefer) {
|
|
6654
|
+
commitAnimationLength(animationLength);
|
|
6655
|
+
return;
|
|
6656
|
+
}
|
|
6657
|
+
if (isStep) {
|
|
6658
|
+
var isUsableRange = isValidAnimationLength(animationLength) && isWithinAnimationStepLimit(animationLength, timeStep);
|
|
6659
|
+
if (isUsableRange) {
|
|
6660
|
+
dispatch(mapActions.refreshAnimationRange(Object.assign({
|
|
6661
|
+
mapId: mapId
|
|
6662
|
+
}, settingRange(animationLength, anchorTime))));
|
|
6663
|
+
}
|
|
6664
|
+
}
|
|
6665
|
+
};
|
|
6666
|
+
var cancelPendingCommit = function cancelPendingCommit() {
|
|
6667
|
+
isCommittableRef.current = false;
|
|
6668
|
+
};
|
|
6669
|
+
return jsx(AnimationLengthPanel, {
|
|
6670
|
+
animationEndTime: (draftLength == null ? void 0 : draftLength.mode) === AnimationLengthMode.Exact ? draftLength.exact.animationEndTime : animationEndTime,
|
|
6671
|
+
animationStartTime: (draftLength == null ? void 0 : draftLength.mode) === AnimationLengthMode.Exact ? draftLength.exact.animationStartTime : animationStartTime,
|
|
6672
|
+
autoTimeStepLayerName: autoTimeStepLayerName,
|
|
6673
|
+
isAutoDisabled: !timeStepFromLayer,
|
|
6674
|
+
onChange: changeAnimationLength,
|
|
6675
|
+
onInputChange: cancelPendingCommit,
|
|
6676
|
+
referenceTimeFromLayer: referenceTimeFromLayer,
|
|
6677
|
+
setting: (_ref2 = draftLength != null ? draftLength : storedAnimationLength) != null ? _ref2 : exactAnimationLengthFrom({
|
|
6678
|
+
animationStartTime: animationStartTime,
|
|
6679
|
+
animationEndTime: animationEndTime
|
|
6680
|
+
}),
|
|
6681
|
+
timeStep: timeStep
|
|
6663
6682
|
});
|
|
6664
6683
|
};
|
|
6665
6684
|
|
|
@@ -6773,6 +6792,9 @@ var PlayButtonConnectComponent = function PlayButtonConnectComponent(_ref) {
|
|
|
6773
6792
|
}),
|
|
6774
6793
|
animationStartTime = _useSelector.animationStartTime,
|
|
6775
6794
|
animationEndTime = _useSelector.animationEndTime;
|
|
6795
|
+
var selectedTime = useSelector(function (store) {
|
|
6796
|
+
return mapSelectors.getSelectedTime(store, mapId);
|
|
6797
|
+
});
|
|
6776
6798
|
var animationInterval = timeStep || defaultTimeStep;
|
|
6777
6799
|
var onTogglePlay = function onTogglePlay() {
|
|
6778
6800
|
if (linkedMapAnimationInfo.isAnimating) {
|
|
@@ -6786,6 +6808,8 @@ var PlayButtonConnectComponent = function PlayButtonConnectComponent(_ref) {
|
|
|
6786
6808
|
start: animationStartTime,
|
|
6787
6809
|
end: animationEndTime,
|
|
6788
6810
|
interval: animationInterval,
|
|
6811
|
+
// Resume from the currently selected time when it falls within the animation period
|
|
6812
|
+
initialTime: dateUtils.fromUnix(selectedTime).toISOString(),
|
|
6789
6813
|
origin: mapEnums.MapActionOrigin.map
|
|
6790
6814
|
});
|
|
6791
6815
|
}
|
|
@@ -6973,9 +6997,9 @@ var OptionsMenu = function OptionsMenu(_ref) {
|
|
|
6973
6997
|
children: [jsx(NowButtonConnect, {
|
|
6974
6998
|
mapId: mapId,
|
|
6975
6999
|
sourceId: mapId
|
|
6976
|
-
}), jsx(
|
|
7000
|
+
}), jsx(AnimationLengthPanelConnect, {
|
|
6977
7001
|
mapId: mapId
|
|
6978
|
-
}), jsx(
|
|
7002
|
+
}), jsx(TimeSpanButtonConnect, {
|
|
6979
7003
|
mapId: mapId
|
|
6980
7004
|
}), jsx(_TimeStepButtonConnect, {
|
|
6981
7005
|
mapId: mapId
|
|
@@ -8357,9 +8381,91 @@ var OlMapViewLayerConnect = function OlMapViewLayerConnect(layerProps) {
|
|
|
8357
8381
|
}), "layer-" + (layer == null ? void 0 : layer.id));
|
|
8358
8382
|
};
|
|
8359
8383
|
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8384
|
+
/** Escape drops a multi selection only. A sole selection is kept, matching the
|
|
8385
|
+
* plain click behaviour, and edit mode keeps its own Escape handling. */
|
|
8386
|
+
var shouldDeselectAllOnEscape = function shouldDeselectAllOnEscape(selectedFeatureCount, isInEditMode, hasRegisteredDrawTool) {
|
|
8387
|
+
return hasRegisteredDrawTool && !isInEditMode && selectedFeatureCount > 1;
|
|
8388
|
+
};
|
|
8389
|
+
var useDeselectAllOnEscape = function useDeselectAllOnEscape(_ref) {
|
|
8390
|
+
var selectedFeatureCount = _ref.selectedFeatureCount,
|
|
8391
|
+
isInEditMode = _ref.isInEditMode,
|
|
8392
|
+
hasRegisteredDrawTool = _ref.hasRegisteredDrawTool,
|
|
8393
|
+
onDeselectAll = _ref.onDeselectAll;
|
|
8394
|
+
React.useEffect(function () {
|
|
8395
|
+
if (!shouldDeselectAllOnEscape(selectedFeatureCount, isInEditMode, hasRegisteredDrawTool)) {
|
|
8396
|
+
return undefined;
|
|
8397
|
+
}
|
|
8398
|
+
var onKeyDown = function onKeyDown(event) {
|
|
8399
|
+
if (event.key !== 'Escape' || document.activeElement !== document.body) {
|
|
8400
|
+
return;
|
|
8401
|
+
}
|
|
8402
|
+
onDeselectAll();
|
|
8403
|
+
};
|
|
8404
|
+
window.addEventListener('keydown', onKeyDown);
|
|
8405
|
+
return function () {
|
|
8406
|
+
return window.removeEventListener('keydown', onKeyDown);
|
|
8407
|
+
};
|
|
8408
|
+
}, [selectedFeatureCount, isInEditMode, hasRegisteredDrawTool, onDeselectAll]);
|
|
8409
|
+
};
|
|
8410
|
+
var shouldClearSelectionOnEmptyClick = function shouldClearSelectionOnEmptyClick(activeDrawToolId, hasRegisteredDrawTool) {
|
|
8411
|
+
return !activeDrawToolId && hasRegisteredDrawTool;
|
|
8412
|
+
};
|
|
8413
|
+
var isSketchInProgress = function isSketchInProgress(isInEditMode, drawMode, activeFeature) {
|
|
8414
|
+
if (!isInEditMode) {
|
|
8415
|
+
return false;
|
|
8416
|
+
}
|
|
8417
|
+
if (drawMode === DRAWMODE.SPLIT) {
|
|
8418
|
+
return true;
|
|
8419
|
+
}
|
|
8420
|
+
return Boolean(activeFeature && isGeoJSONGeometryEmpty(activeFeature));
|
|
8421
|
+
};
|
|
8422
|
+
/** Soundings and time series set their own highlight, so they must stay out of this. */
|
|
8423
|
+
var usesFeatureIdSelection = function usesFeatureIdSelection(isSelectable, hasRegisteredDrawTool) {
|
|
8424
|
+
return Boolean(isSelectable) || hasRegisteredDrawTool;
|
|
8425
|
+
};
|
|
8426
|
+
var getSelectionProperties = function getSelectionProperties(usesIdSelection, selectedFeatureIdSet, featureId) {
|
|
8427
|
+
if (!usesIdSelection) {
|
|
8428
|
+
return undefined;
|
|
8429
|
+
}
|
|
8430
|
+
var isSelected = featureId !== undefined && selectedFeatureIdSet.has(featureId);
|
|
8431
|
+
return {
|
|
8432
|
+
isSelected: isSelected,
|
|
8433
|
+
highlightSelectedFeature: isSelected
|
|
8434
|
+
};
|
|
8435
|
+
};
|
|
8436
|
+
var getClickedFeatureKey = getOlFeatureKey;
|
|
8437
|
+
var findFeatureIndexByKey = function findFeatureIndexByKey(geojson, feature) {
|
|
8438
|
+
var key = getClickedFeatureKey(feature);
|
|
8439
|
+
// -1 when the feature has no key, so an unidentifiable click never matches feature 0
|
|
8440
|
+
if (key === undefined || !geojson) {
|
|
8441
|
+
return -1;
|
|
8442
|
+
}
|
|
8443
|
+
return geojson.features.findIndex(function (feat) {
|
|
8444
|
+
return layerUtils.getFeatureSelectionKey(feat) === key;
|
|
8445
|
+
});
|
|
8446
|
+
};
|
|
8447
|
+
var getMovableSelectedFeatureIds = function getMovableSelectedFeatureIds(geojson, selectedFeatureIds) {
|
|
8448
|
+
if (!(geojson != null && geojson.features.length) || !(selectedFeatureIds != null && selectedFeatureIds.length)) {
|
|
8449
|
+
return [];
|
|
8450
|
+
}
|
|
8451
|
+
var selectedFeatureIdSet = new Set(selectedFeatureIds);
|
|
8452
|
+
return geojson.features.reduce(function (featureIds, feature) {
|
|
8453
|
+
var _feature$properties;
|
|
8454
|
+
var featureKey = layerUtils.getFeatureSelectionKey(feature);
|
|
8455
|
+
if (featureKey && selectedFeatureIdSet.has(featureKey) && ((_feature$properties = feature.properties) == null ? void 0 : _feature$properties.isReadonly) !== true) {
|
|
8456
|
+
featureIds.push(featureKey);
|
|
8457
|
+
}
|
|
8458
|
+
return featureIds;
|
|
8459
|
+
}, []);
|
|
8460
|
+
};
|
|
8461
|
+
/** Moving a set of shapes belongs to the drawing tool only: selection-only
|
|
8462
|
+
* reference layers stay selectable but must never be dragged. */
|
|
8463
|
+
var shouldEnableMultiShapeMove = function shouldEnableMultiShapeMove(hasRegisteredDrawTool, isInEditMode, selectedFeatureCount, movableFeatureCount) {
|
|
8464
|
+
return hasRegisteredDrawTool && !isInEditMode && selectedFeatureCount > 1 && movableFeatureCount > 0;
|
|
8465
|
+
};
|
|
8466
|
+
var getCurrentSelectedIndices = function getCurrentSelectedIndices(_ref2) {
|
|
8467
|
+
var geojson = _ref2.geojson,
|
|
8468
|
+
selectedFeatureIds = _ref2.selectedFeatureIds;
|
|
8363
8469
|
if (!(geojson != null && geojson.features.length) || !(selectedFeatureIds != null && selectedFeatureIds.length)) {
|
|
8364
8470
|
return [];
|
|
8365
8471
|
}
|
|
@@ -8372,46 +8478,13 @@ var getCurrentSelectedIndices = function getCurrentSelectedIndices(_ref) {
|
|
|
8372
8478
|
return indices;
|
|
8373
8479
|
}, []);
|
|
8374
8480
|
};
|
|
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;
|
|
8481
|
+
var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref3) {
|
|
8482
|
+
var _layer$selectedFeatur2, _layer$selectedFeatur3;
|
|
8483
|
+
var layer = _ref3.layer,
|
|
8484
|
+
layerId = _ref3.layerId,
|
|
8485
|
+
zIndex = _ref3.zIndex,
|
|
8486
|
+
style = _ref3.style,
|
|
8487
|
+
hoverSelect = _ref3.hoverSelect;
|
|
8415
8488
|
var store = useStore();
|
|
8416
8489
|
var dispatch = useDispatch();
|
|
8417
8490
|
var activeDrawToolId = useSelector(drawingToolSelectors.getActiveDrawToolId);
|
|
@@ -8433,7 +8506,7 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8433
8506
|
return drawingToolSelectors.getGeoJSONIntersectionBoundsLayerId(store, activeDrawToolId);
|
|
8434
8507
|
});
|
|
8435
8508
|
var activeFeatureIndex = React.useMemo(function () {
|
|
8436
|
-
var _layer$geojson, _currentSelectedFeatu,
|
|
8509
|
+
var _layer$geojson, _currentSelectedFeatu, _ref4;
|
|
8437
8510
|
var currentActiveFeatureIndex = layerUtils.getSelectedFeatureIndexByIds(layer.geojson, layer.selectedFeatureIds);
|
|
8438
8511
|
if (!shouldAllowMultipleShapes || !(activeDrawMode != null && activeDrawMode.selectionType) || !((_layer$geojson = layer.geojson) != null && _layer$geojson.features.length)) {
|
|
8439
8512
|
return currentActiveFeatureIndex != null ? currentActiveFeatureIndex : 0;
|
|
@@ -8444,9 +8517,9 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8444
8517
|
}
|
|
8445
8518
|
var matchingFeatureIndex;
|
|
8446
8519
|
for (var index = layer.geojson.features.length - 1; index >= 0; index -= 1) {
|
|
8447
|
-
var _feature$
|
|
8520
|
+
var _feature$properties2;
|
|
8448
8521
|
var feature = layer.geojson.features[index];
|
|
8449
|
-
if (((_feature$
|
|
8522
|
+
if (((_feature$properties2 = feature.properties) == null ? void 0 : _feature$properties2.selectionType) === activeDrawMode.selectionType) {
|
|
8450
8523
|
if (isGeoJSONGeometryEmpty(feature)) {
|
|
8451
8524
|
return index;
|
|
8452
8525
|
}
|
|
@@ -8455,32 +8528,55 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8455
8528
|
}
|
|
8456
8529
|
}
|
|
8457
8530
|
}
|
|
8458
|
-
return (
|
|
8531
|
+
return (_ref4 = matchingFeatureIndex != null ? matchingFeatureIndex : currentActiveFeatureIndex) != null ? _ref4 : 0;
|
|
8459
8532
|
}, [activeDrawMode == null ? void 0 : activeDrawMode.selectionType, layer.geojson, layer.selectedFeatureIds, shouldAllowMultipleShapes]);
|
|
8533
|
+
var sketchInProgress = React.useMemo(function () {
|
|
8534
|
+
var _layer$geojson2;
|
|
8535
|
+
return isSketchInProgress(layer.isInEditMode, layer.drawMode, (_layer$geojson2 = layer.geojson) == null ? void 0 : _layer$geojson2.features[activeFeatureIndex]);
|
|
8536
|
+
}, [layer.isInEditMode, layer.drawMode, layer.geojson, activeFeatureIndex]);
|
|
8537
|
+
var usesIdSelection = usesFeatureIdSelection(layer.isSelectable, hasRegisteredDrawTool);
|
|
8460
8538
|
var displayGeojson = React.useMemo(function () {
|
|
8461
|
-
var _layer$hoveredFeature;
|
|
8539
|
+
var _layer$hoveredFeature, _layer$selectedFeatur;
|
|
8462
8540
|
if (!layer.geojson) {
|
|
8463
8541
|
return undefined;
|
|
8464
8542
|
}
|
|
8465
8543
|
var hoveredFeatureIds = new Set((_layer$hoveredFeature = layer.hoveredFeatureIds) != null ? _layer$hoveredFeature : []);
|
|
8544
|
+
var selectedFeatureIdSet = new Set((_layer$selectedFeatur = layer.selectedFeatureIds) != null ? _layer$selectedFeatur : []);
|
|
8466
8545
|
return Object.assign({}, layer.geojson, {
|
|
8467
8546
|
features: layer.geojson.features.map(function (feature) {
|
|
8468
|
-
var _feature$
|
|
8547
|
+
var _feature$properties3;
|
|
8469
8548
|
var featureId = feature.id !== undefined ? String(feature.id) : undefined;
|
|
8470
|
-
var originalId = typeof ((_feature$
|
|
8549
|
+
var originalId = typeof ((_feature$properties3 = feature.properties) == null ? void 0 : _feature$properties3.originalId) === 'string' ? feature.properties.originalId : layer.originalId;
|
|
8550
|
+
var selectionProperties = getSelectionProperties(usesIdSelection, selectedFeatureIdSet, featureId);
|
|
8471
8551
|
return Object.assign({}, feature, {
|
|
8472
8552
|
properties: Object.assign({}, feature.properties, {
|
|
8473
8553
|
hover: featureId !== undefined && hoveredFeatureIds.has(featureId) || typeof originalId === 'string' && hoveredFeatureIds.has(originalId)
|
|
8474
|
-
})
|
|
8554
|
+
}, selectionProperties)
|
|
8475
8555
|
});
|
|
8476
8556
|
})
|
|
8477
8557
|
});
|
|
8478
|
-
}, [layer.geojson, layer.hoveredFeatureIds, layer.originalId]);
|
|
8558
|
+
}, [layer.geojson, layer.hoveredFeatureIds, layer.originalId, layer.selectedFeatureIds, usesIdSelection]);
|
|
8559
|
+
var clearSelection = React.useCallback(function () {
|
|
8560
|
+
if (!shouldClearSelectionOnEmptyClick(activeDrawToolId, hasRegisteredDrawTool)) {
|
|
8561
|
+
return;
|
|
8562
|
+
}
|
|
8563
|
+
dispatch(layerActions.setSelectedFeatures({
|
|
8564
|
+
layerId: layerId,
|
|
8565
|
+
selectedFeatureIds: []
|
|
8566
|
+
}));
|
|
8567
|
+
dispatch(layerActions.toggleFeatureMode({
|
|
8568
|
+
layerId: layerId,
|
|
8569
|
+
isInEditMode: false,
|
|
8570
|
+
drawMode: ''
|
|
8571
|
+
}));
|
|
8572
|
+
}, [activeDrawToolId, hasRegisteredDrawTool, dispatch, layerId]);
|
|
8479
8573
|
var onFeatureClick = React.useCallback(function (feature, isShiftClick) {
|
|
8480
8574
|
var _clickedFeature$prope;
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8575
|
+
if (!feature.length) {
|
|
8576
|
+
clearSelection();
|
|
8577
|
+
return;
|
|
8578
|
+
}
|
|
8579
|
+
var clickedIndex = findFeatureIndexByKey(layer.geojson, feature[0]);
|
|
8484
8580
|
if (clickedIndex === -1) {
|
|
8485
8581
|
return;
|
|
8486
8582
|
}
|
|
@@ -8490,10 +8586,9 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8490
8586
|
geojson: layer.geojson,
|
|
8491
8587
|
selectedFeatureIds: layer.selectedFeatureIds
|
|
8492
8588
|
});
|
|
8493
|
-
//
|
|
8494
|
-
//
|
|
8495
|
-
//
|
|
8496
|
-
// instead happen via empty-space click or multi-select interactions.
|
|
8589
|
+
// Drawing layers only: deselecting the active edit target collapses edit mode,
|
|
8590
|
+
// so a plain click on the sole selection keeps it. Clearing happens through
|
|
8591
|
+
// empty space or shift+click instead.
|
|
8497
8592
|
var shouldPreventDeselect = hasRegisteredDrawTool && !isReadonly && !isShiftClick && currentSelection.length === 1 && currentSelection[0] === clickedIndex;
|
|
8498
8593
|
var newSelection = shouldPreventDeselect ? [clickedIndex] : calculateNewSelection(currentSelection, clickedIndex, isShiftClick != null ? isShiftClick : false);
|
|
8499
8594
|
var nextSelectedFeatureIds = newSelection.map(function (index) {
|
|
@@ -8505,25 +8600,13 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8505
8600
|
layerId: layerId,
|
|
8506
8601
|
selectedFeatureIds: nextSelectedFeatureIds
|
|
8507
8602
|
}));
|
|
8508
|
-
if (newSelection.length === 0) {
|
|
8603
|
+
if (newSelection.length === 0 || shouldExitEditModeForMultiSelect(newSelection.length)) {
|
|
8509
8604
|
dispatch(layerActions.toggleFeatureMode({
|
|
8510
8605
|
layerId: layerId,
|
|
8511
8606
|
isInEditMode: false,
|
|
8512
8607
|
drawMode: ''
|
|
8513
8608
|
}));
|
|
8514
8609
|
}
|
|
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
8610
|
if (shouldEnterEditMode(isReadonly, isShiftClick != null ? isShiftClick : false, newSelection.length)) {
|
|
8528
8611
|
dispatch(layerActions.toggleFeatureMode({
|
|
8529
8612
|
layerId: layerId,
|
|
@@ -8531,27 +8614,15 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8531
8614
|
drawMode: ''
|
|
8532
8615
|
}));
|
|
8533
8616
|
}
|
|
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]);
|
|
8617
|
+
}, [hasRegisteredDrawTool, dispatch, layer.geojson, layer.selectedFeatureIds, layerId, clearSelection]);
|
|
8618
|
+
var onNoFeatureClick = clearSelection;
|
|
8546
8619
|
var onBoxSelect = React.useCallback(function (features, addToSelection) {
|
|
8547
|
-
var _layer$
|
|
8548
|
-
if (!((_layer$
|
|
8620
|
+
var _layer$geojson3;
|
|
8621
|
+
if (!((_layer$geojson3 = layer.geojson) != null && _layer$geojson3.features.length)) {
|
|
8549
8622
|
return;
|
|
8550
8623
|
}
|
|
8551
8624
|
var boxSelectedIndices = features.map(function (feature) {
|
|
8552
|
-
return layer.geojson
|
|
8553
|
-
return feat.id === feature.getId();
|
|
8554
|
-
});
|
|
8625
|
+
return findFeatureIndexByKey(layer.geojson, feature);
|
|
8555
8626
|
}).filter(function (idx) {
|
|
8556
8627
|
return idx !== -1;
|
|
8557
8628
|
});
|
|
@@ -8562,7 +8633,7 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8562
8633
|
geojson: layer.geojson,
|
|
8563
8634
|
selectedFeatureIds: layer.selectedFeatureIds
|
|
8564
8635
|
});
|
|
8565
|
-
var newSelection =
|
|
8636
|
+
var newSelection = calculateBoxSelection(previousSelection, boxSelectedIndices, addToSelection);
|
|
8566
8637
|
var nextSelectedFeatureIds = newSelection.map(function (index) {
|
|
8567
8638
|
return layerUtils.getFeatureSelectionKey(layer.geojson.features[index]);
|
|
8568
8639
|
}).filter(function (featureId) {
|
|
@@ -8572,21 +8643,72 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8572
8643
|
layerId: layerId,
|
|
8573
8644
|
selectedFeatureIds: nextSelectedFeatureIds
|
|
8574
8645
|
}));
|
|
8575
|
-
|
|
8576
|
-
|
|
8646
|
+
if (shouldExitEditModeForMultiSelect(newSelection.length)) {
|
|
8647
|
+
dispatch(layerActions.toggleFeatureMode({
|
|
8648
|
+
layerId: layerId,
|
|
8649
|
+
isInEditMode: false,
|
|
8650
|
+
drawMode: ''
|
|
8651
|
+
}));
|
|
8652
|
+
}
|
|
8577
8653
|
}, [dispatch, layer.geojson, layer.selectedFeatureIds, layerId]);
|
|
8578
8654
|
var boxSelectConfig = React.useMemo(function () {
|
|
8579
|
-
return
|
|
8655
|
+
return usesIdSelection && !layer.isInEditMode ? {
|
|
8580
8656
|
onBoxSelect: onBoxSelect,
|
|
8581
8657
|
active: true
|
|
8582
8658
|
} : undefined;
|
|
8583
|
-
}, [
|
|
8584
|
-
|
|
8585
|
-
|
|
8659
|
+
}, [usesIdSelection, layer.isInEditMode, onBoxSelect]);
|
|
8660
|
+
// Mutually exclusive with boxSelectConfig, so only one DragBox is ever live.
|
|
8661
|
+
var editModeBoxSelectConfig = React.useMemo(function () {
|
|
8662
|
+
return usesIdSelection && layer.isInEditMode ? {
|
|
8663
|
+
onBoxSelect: onBoxSelect,
|
|
8664
|
+
active: true
|
|
8665
|
+
} : undefined;
|
|
8666
|
+
}, [usesIdSelection, layer.isInEditMode, onBoxSelect]);
|
|
8667
|
+
var selectedFeatureIndices = React.useMemo(function () {
|
|
8668
|
+
return getCurrentSelectedIndices({
|
|
8669
|
+
geojson: layer.geojson,
|
|
8670
|
+
selectedFeatureIds: layer.selectedFeatureIds
|
|
8671
|
+
});
|
|
8672
|
+
}, [layer.geojson, layer.selectedFeatureIds]);
|
|
8673
|
+
useDeselectAllOnEscape({
|
|
8674
|
+
selectedFeatureCount: selectedFeatureIndices.length,
|
|
8675
|
+
isInEditMode: layer.isInEditMode,
|
|
8676
|
+
hasRegisteredDrawTool: hasRegisteredDrawTool,
|
|
8677
|
+
onDeselectAll: clearSelection
|
|
8678
|
+
});
|
|
8679
|
+
var movableSelectedFeatureIds = React.useMemo(function () {
|
|
8680
|
+
return getMovableSelectedFeatureIds(layer.geojson, layer.selectedFeatureIds);
|
|
8681
|
+
}, [layer.geojson, layer.selectedFeatureIds]);
|
|
8682
|
+
var onFeatureGeometriesChange = React.useCallback(function (changedFeatures) {
|
|
8683
|
+
if (!layerId || !changedFeatures.length) {
|
|
8684
|
+
return;
|
|
8685
|
+
}
|
|
8686
|
+
dispatch(layerActions.moveFeatures({
|
|
8687
|
+
layerId: layerId,
|
|
8688
|
+
movedFeatures: changedFeatures,
|
|
8689
|
+
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId,
|
|
8690
|
+
geoJSONIntersectionBoundsLayerId: geoJSONIntersectionBoundsLayerId
|
|
8691
|
+
}));
|
|
8692
|
+
}, [dispatch, layerId, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId]);
|
|
8693
|
+
var isMultiShapeInteractionEnabled = shouldEnableMultiShapeMove(hasRegisteredDrawTool, layer.isInEditMode, (_layer$selectedFeatur2 = (_layer$selectedFeatur3 = layer.selectedFeatureIds) == null ? void 0 : _layer$selectedFeatur3.length) != null ? _layer$selectedFeatur2 : 0, movableSelectedFeatureIds.length);
|
|
8694
|
+
var moveFeaturesConfig = React.useMemo(function () {
|
|
8695
|
+
return isMultiShapeInteractionEnabled ? {
|
|
8696
|
+
onMoveEnd: onFeatureGeometriesChange,
|
|
8697
|
+
active: true
|
|
8698
|
+
} : undefined;
|
|
8699
|
+
}, [isMultiShapeInteractionEnabled, onFeatureGeometriesChange]);
|
|
8700
|
+
var modifyFeaturesConfig = React.useMemo(function () {
|
|
8701
|
+
return isMultiShapeInteractionEnabled ? {
|
|
8702
|
+
onModifyEnd: onFeatureGeometriesChange,
|
|
8703
|
+
active: true
|
|
8704
|
+
} : undefined;
|
|
8705
|
+
}, [isMultiShapeInteractionEnabled, onFeatureGeometriesChange]);
|
|
8706
|
+
var onViewOnlyFeatureClick = React.useCallback(function (feature, isShiftClick) {
|
|
8707
|
+
if (sketchInProgress) {
|
|
8586
8708
|
return;
|
|
8587
8709
|
}
|
|
8588
|
-
onFeatureClick(feature);
|
|
8589
|
-
}, [
|
|
8710
|
+
onFeatureClick(feature, isShiftClick);
|
|
8711
|
+
}, [sketchInProgress, onFeatureClick]);
|
|
8590
8712
|
var updateFeature = React.useCallback(function (geojson, reason) {
|
|
8591
8713
|
if (!layerId) {
|
|
8592
8714
|
window.console.error('updateFeature without layerId');
|
|
@@ -8617,18 +8739,21 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8617
8739
|
return jsxs(Fragment, {
|
|
8618
8740
|
children: [jsx(OpenLayersFeatureLayer, {
|
|
8619
8741
|
boxSelect: boxSelectConfig,
|
|
8620
|
-
clickOnFeature: layer.
|
|
8742
|
+
clickOnFeature: usesIdSelection && !layer.isInEditMode ? {
|
|
8621
8743
|
onClick: onFeatureClick,
|
|
8622
8744
|
hitTolerance: 5
|
|
8623
8745
|
} : undefined,
|
|
8624
8746
|
featureCollection: !layer.isInEditMode ? displayGeojson : undefined,
|
|
8625
8747
|
hoverSelect: hoverSelect,
|
|
8626
8748
|
layerId: layerId,
|
|
8749
|
+
modifyFeatures: modifyFeaturesConfig,
|
|
8750
|
+
moveFeatures: moveFeaturesConfig,
|
|
8627
8751
|
opacity: layer.opacity,
|
|
8628
8752
|
style: style,
|
|
8629
8753
|
visible: layer.enabled,
|
|
8630
8754
|
zIndex: zIndex
|
|
8631
8755
|
}), jsx(OpenLayersMapDraw, {
|
|
8756
|
+
boxSelect: editModeBoxSelectConfig,
|
|
8632
8757
|
drawMode: layer.drawMode,
|
|
8633
8758
|
exitDrawModeCallback: exitFeatureDrawMode,
|
|
8634
8759
|
geojson: layer.geojson,
|
|
@@ -8636,6 +8761,7 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8636
8761
|
onNoFeatureClick: onNoFeatureClick,
|
|
8637
8762
|
onViewOnlyFeatureClick: onViewOnlyFeatureClick,
|
|
8638
8763
|
selectedFeatureIndex: activeFeatureIndex,
|
|
8764
|
+
selectedFeatureIndices: selectedFeatureIndices,
|
|
8639
8765
|
updateGeojson: updateFeature,
|
|
8640
8766
|
viewOnlyStyle: style
|
|
8641
8767
|
})]
|
|
@@ -8659,6 +8785,14 @@ var OpenLayersFeatureLayerConnect = function OpenLayersFeatureLayerConnect(_ref2
|
|
|
8659
8785
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
8660
8786
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
8661
8787
|
* */
|
|
8788
|
+
var getStoredViewObjectForMap = function getStoredViewObjectForMap(mapId, store) {
|
|
8789
|
+
var syncGroupState = syncGroupsSelectors.getSynchronizationGroupState(store.getState());
|
|
8790
|
+
var thisAreaSyncGroupId = syncGroupState.groups.allIds.find(function (id) {
|
|
8791
|
+
var group = syncGroupState.groups.byId[id];
|
|
8792
|
+
return group.type === syncConstants.SYNCGROUPS_TYPE_SETBBOX && group.targets.allIds.includes(mapId);
|
|
8793
|
+
});
|
|
8794
|
+
return thisAreaSyncGroupId ? getViewObjectForSyncGroup(thisAreaSyncGroupId) : getViewObjectForMapId(mapId);
|
|
8795
|
+
};
|
|
8662
8796
|
var useGetOpenLayersView = function useGetOpenLayersView(mapId, store) {
|
|
8663
8797
|
var _useState = useState(),
|
|
8664
8798
|
view = _useState[0],
|
|
@@ -8666,17 +8800,9 @@ var useGetOpenLayersView = function useGetOpenLayersView(mapId, store) {
|
|
|
8666
8800
|
var _useState2 = useState(),
|
|
8667
8801
|
name = _useState2[0],
|
|
8668
8802
|
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]);
|
|
8803
|
+
var storedView = getStoredViewObjectForMap(mapId, store);
|
|
8677
8804
|
useEffect(function () {
|
|
8678
8805
|
var mapBbox = mapSelectors.getBbox(store.getState(), mapId);
|
|
8679
|
-
var storedView = syncGroupView || getViewObjectForMapId(mapId);
|
|
8680
8806
|
if (storedView.view.getCenter() === undefined && mapBbox.left !== undefined) {
|
|
8681
8807
|
storedView.view.fit([mapBbox.left, mapBbox.bottom, mapBbox.right, mapBbox.top]);
|
|
8682
8808
|
}
|
|
@@ -8689,7 +8815,7 @@ var useGetOpenLayersView = function useGetOpenLayersView(mapId, store) {
|
|
|
8689
8815
|
return function () {
|
|
8690
8816
|
unByKey(eventKey);
|
|
8691
8817
|
};
|
|
8692
|
-
}, [
|
|
8818
|
+
}, [storedView, mapId, store]);
|
|
8693
8819
|
return {
|
|
8694
8820
|
view: view,
|
|
8695
8821
|
name: name
|
|
@@ -9005,7 +9131,7 @@ var GetFeatureInfoDialog = function GetFeatureInfoDialog(_ref) {
|
|
|
9005
9131
|
isLoading: true
|
|
9006
9132
|
});
|
|
9007
9133
|
_context.n = 2;
|
|
9008
|
-
return
|
|
9134
|
+
return authFetch(url);
|
|
9009
9135
|
case 2:
|
|
9010
9136
|
response = _context.v;
|
|
9011
9137
|
if (response.ok) {
|
|
@@ -9338,6 +9464,60 @@ var MapOptionsButtonConnect = function MapOptionsButtonConnect(_ref) {
|
|
|
9338
9464
|
});
|
|
9339
9465
|
};
|
|
9340
9466
|
|
|
9467
|
+
/* *
|
|
9468
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9469
|
+
* you may not use this file except in compliance with the License.
|
|
9470
|
+
* You may obtain a copy of the License at
|
|
9471
|
+
*
|
|
9472
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9473
|
+
*
|
|
9474
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9475
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9476
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9477
|
+
* See the License for the specific language governing permissions and
|
|
9478
|
+
* limitations under the License.
|
|
9479
|
+
*
|
|
9480
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9481
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
9482
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
9483
|
+
* */
|
|
9484
|
+
var InitialZoomToLayerConnect = function InitialZoomToLayerConnect(_ref) {
|
|
9485
|
+
var mapId = _ref.mapId,
|
|
9486
|
+
onHomeExtentResolved = _ref.onHomeExtentResolved;
|
|
9487
|
+
var initialZoomToLayerId = useSelector(function (store) {
|
|
9488
|
+
return mapSelectors.getInitialZoomToLayerId(store, mapId);
|
|
9489
|
+
});
|
|
9490
|
+
var layer = useSelector(function (store) {
|
|
9491
|
+
return initialZoomToLayerId ? layerSelectors.getLayerById(store, initialZoomToLayerId) : undefined;
|
|
9492
|
+
});
|
|
9493
|
+
var store = useStore();
|
|
9494
|
+
var view = useViewFromLayer(layer);
|
|
9495
|
+
var _useGetWMLayerInstanc = useGetWMLayerInstance(layer),
|
|
9496
|
+
wmLayer = _useGetWMLayerInstanc.wmLayer;
|
|
9497
|
+
var hasResolvedInitialLayerView = React.useRef(false);
|
|
9498
|
+
React.useEffect(function () {
|
|
9499
|
+
var storedView = getStoredViewObjectForMap(mapId, store);
|
|
9500
|
+
if (storedView.view !== view) {
|
|
9501
|
+
storedView.setView(view);
|
|
9502
|
+
}
|
|
9503
|
+
}, [mapId, store, view]);
|
|
9504
|
+
React.useEffect(function () {
|
|
9505
|
+
if (hasResolvedInitialLayerView.current || !wmLayer) {
|
|
9506
|
+
return;
|
|
9507
|
+
}
|
|
9508
|
+
var extent = getLayerExtentForProjection(wmLayer, view.getProjection().getCode());
|
|
9509
|
+
if (extent) {
|
|
9510
|
+
onHomeExtentResolved([].concat(extent));
|
|
9511
|
+
}
|
|
9512
|
+
hasResolvedInitialLayerView.current = true;
|
|
9513
|
+
store.dispatch(mapActions.setPendingInitialZoomToLayer({
|
|
9514
|
+
mapId: mapId,
|
|
9515
|
+
layerId: undefined
|
|
9516
|
+
}));
|
|
9517
|
+
}, [mapId, onHomeExtentResolved, store, view, wmLayer]);
|
|
9518
|
+
return null;
|
|
9519
|
+
};
|
|
9520
|
+
|
|
9341
9521
|
/**
|
|
9342
9522
|
* Connected component used to display the map and selected layers.
|
|
9343
9523
|
* Includes options to disable the map controls and legend.
|
|
@@ -9368,6 +9548,9 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9368
9548
|
var _React$useState = React.useState(),
|
|
9369
9549
|
hoverLinkedFeature = _React$useState[0],
|
|
9370
9550
|
setHoverLinkedFeature = _React$useState[1];
|
|
9551
|
+
var _React$useState2 = React.useState(undefined),
|
|
9552
|
+
derivedHomeExtent = _React$useState2[0],
|
|
9553
|
+
setDerivedHomeExtent = _React$useState2[1];
|
|
9371
9554
|
var linkedPanelIds = useSelector(function (store) {
|
|
9372
9555
|
return genericSelectors.selectLinkedPanelIdsForMap(store, mapId);
|
|
9373
9556
|
});
|
|
@@ -9796,11 +9979,11 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9796
9979
|
checkIfDataOutdated();
|
|
9797
9980
|
}, [checkIfDataOutdated]);
|
|
9798
9981
|
useMapViewLoadingIndicator(mapId, mapLayerIds);
|
|
9799
|
-
var _React$
|
|
9982
|
+
var _React$useState3 = React.useState({
|
|
9800
9983
|
debugMode: false
|
|
9801
9984
|
}),
|
|
9802
|
-
mapMode = _React$
|
|
9803
|
-
setMapMode = _React$
|
|
9985
|
+
mapMode = _React$useState3[0],
|
|
9986
|
+
setMapMode = _React$useState3[1];
|
|
9804
9987
|
React.useEffect(function () {
|
|
9805
9988
|
var handleKeyPress = function handleKeyPress(event) {
|
|
9806
9989
|
if (event.isTrusted && document.activeElement === document.body) {
|
|
@@ -9818,9 +10001,12 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9818
10001
|
document.removeEventListener('keyup', handleKeyPress);
|
|
9819
10002
|
};
|
|
9820
10003
|
}, [mapMode]);
|
|
10004
|
+
var handleInitialHomeExtentResolved = React.useCallback(function (extent) {
|
|
10005
|
+
setDerivedHomeExtent(extent);
|
|
10006
|
+
}, []);
|
|
9821
10007
|
var homeExtent = React.useMemo(function () {
|
|
9822
|
-
return initialBbox
|
|
9823
|
-
}, [initialBbox]);
|
|
10008
|
+
return initialBbox ? [initialBbox.left, initialBbox.bottom, initialBbox.right, initialBbox.top] : derivedHomeExtent;
|
|
10009
|
+
}, [derivedHomeExtent, initialBbox]);
|
|
9824
10010
|
var dialogType = uiTypes.DialogTypes.Search + "-" + mapId;
|
|
9825
10011
|
var _useSetupDialog = useSetupDialog(dialogType),
|
|
9826
10012
|
isSearchDialogOpen = _useSetupDialog.isDialogOpen;
|
|
@@ -9864,9 +10050,12 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9864
10050
|
features: linkedFeatureCollectionsWithHover.features
|
|
9865
10051
|
};
|
|
9866
10052
|
}, [linkedFeatureCollectionsWithHover]);
|
|
9867
|
-
return
|
|
10053
|
+
return jsxs(TimeContext.Provider, {
|
|
9868
10054
|
value: prefetchTimespan,
|
|
9869
|
-
children:
|
|
10055
|
+
children: [jsx(InitialZoomToLayerConnect, {
|
|
10056
|
+
mapId: mapId,
|
|
10057
|
+
onHomeExtentResolved: handleInitialHomeExtentResolved
|
|
10058
|
+
}), jsxs(OpenLayersMapView, {
|
|
9870
10059
|
holdShiftToScroll: holdShiftToScroll,
|
|
9871
10060
|
isFocused: isActiveWindowId,
|
|
9872
10061
|
isMouseWheelZoomEnabled: !isTimeScrollingEnabled,
|
|
@@ -9958,7 +10147,7 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
9958
10147
|
}), !!displayTimeInMap && jsx(ClockConnect, {
|
|
9959
10148
|
mapId: mapId
|
|
9960
10149
|
}), children]
|
|
9961
|
-
})
|
|
10150
|
+
})]
|
|
9962
10151
|
});
|
|
9963
10152
|
};
|
|
9964
10153
|
|
|
@@ -9974,7 +10163,7 @@ var OptionsMenuButtonConnect = function OptionsMenuButtonConnect(_ref) {
|
|
|
9974
10163
|
var mapId = _ref.mapId,
|
|
9975
10164
|
enableKeyboardShortcut = _ref.enableKeyboardShortcut;
|
|
9976
10165
|
return jsx(OptionsMenuButton, {
|
|
9977
|
-
animationLengthBtn: jsx(
|
|
10166
|
+
animationLengthBtn: jsx(AnimationLengthPanelConnect, {
|
|
9978
10167
|
mapId: mapId
|
|
9979
10168
|
}),
|
|
9980
10169
|
enableKeyboardShortcut: enableKeyboardShortcut,
|
|
@@ -12276,4 +12465,4 @@ var storyUtils = /*#__PURE__*/Object.freeze({
|
|
|
12276
12465
|
useDefaultMapSettings: useDefaultMapSettings
|
|
12277
12466
|
});
|
|
12278
12467
|
|
|
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,
|
|
12468
|
+
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-nightly-20260919",
|
|
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-nightly-20260919",
|
|
24
|
+
"react-redux": "^9.2.0",
|
|
25
|
+
"@opengeoweb/store": "20.0.0-nightly-20260919",
|
|
26
|
+
"@opengeoweb/time-slider": "20.0.0-nightly-20260919",
|
|
27
|
+
"@reduxjs/toolkit": "^2.6.1",
|
|
28
|
+
"@opengeoweb/webmap-react": "20.0.0-nightly-20260919",
|
|
29
|
+
"@opengeoweb/webmap": "20.0.0-nightly-20260919",
|
|
30
|
+
"@opengeoweb/theme": "20.0.0-nightly-20260919",
|
|
31
|
+
"@opengeoweb/layer-select": "20.0.0-nightly-20260919",
|
|
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-nightly-20260919",
|
|
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-nightly-20260919",
|
|
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
|
+
}
|