@opengeoweb/core 9.35.0 → 9.36.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/README.md
CHANGED
|
@@ -24,11 +24,29 @@ import {
|
|
|
24
24
|
LegendMapButtonConnect,
|
|
25
25
|
CoreThemeStoreProvider,
|
|
26
26
|
} from '@opengeoweb/core';
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
genericListener,
|
|
29
|
+
mapStoreModuleConfig,
|
|
30
|
+
mapStoreReducers,
|
|
31
|
+
mapActions,
|
|
32
|
+
syncGroupsReducer,
|
|
33
|
+
uiReducer,
|
|
34
|
+
} from '@opengeoweb/store';
|
|
28
35
|
import { TimeSliderConnect } from '@opengeoweb/timeslider';
|
|
29
|
-
import {
|
|
36
|
+
import { configureStore } from '@reduxjs/toolkit';
|
|
30
37
|
|
|
31
|
-
const store =
|
|
38
|
+
const store = configureStore({
|
|
39
|
+
reducer: {
|
|
40
|
+
...mapStoreReducers,
|
|
41
|
+
ui: uiReducer,
|
|
42
|
+
syncronizationGroupStore: syncGroupsReducer,
|
|
43
|
+
snackbar: snackbarReducer,
|
|
44
|
+
},
|
|
45
|
+
middleware: [
|
|
46
|
+
...mapStoreModuleConfig.middlewares!,
|
|
47
|
+
genericListener.middleware,
|
|
48
|
+
],
|
|
49
|
+
});
|
|
32
50
|
|
|
33
51
|
const ConnectedMapWithTimeSlider = ({ mapId }) => {
|
|
34
52
|
const dispatch = useDispatch();
|
package/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useState, useCallback, useRef } from 'react';
|
|
4
4
|
import { Grid2, Box, MenuItem, Typography, useTheme, Popper, Fade, Tooltip, styled, LinearProgress, FormControl, InputLabel, Paper, List, ListItemButton, ListItemText, CircularProgress, ListSubheader, Dialog, DialogTitle, DialogContent, DialogContentText, TextField, InputAdornment, DialogActions, Button, circularProgressClasses, ListItemIcon, Checkbox, Switch, Select } from '@mui/material';
|
|
5
|
-
import { SHARED_NAMESPACE, sharedTranslations, CustomIconButton, CustomTooltip, TooltipSelect, AlertIcon, sliderHeaderStyle, CustomSlider, ToggleMenu, tooltipContainerStyles, renderCounter, AlertBanner, CustomAccordion, PROJECTION, calculateStartSize, useWheelStopPropagation, ToolContainerDraggable, useDebounce, dateUtils,
|
|
5
|
+
import { SHARED_NAMESPACE, sharedTranslations, CustomIconButton, CustomTooltip, TooltipSelect, AlertIcon, sliderHeaderStyle, CustomSlider, ToggleMenu, tooltipContainerStyles, renderCounter, AlertBanner, CustomAccordion, PROJECTION, calculateStartSize, useWheelStopPropagation, ToolContainerDraggable, useDebounce, dateUtils, ErrorBoundary } from '@opengeoweb/shared';
|
|
6
6
|
import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, CloudLoading, ColumnCollapsed, ColumnCollapse, Copy, None, FastForward, AutoUpdateActive, Both, Visibility, VisibilityOff, Delete, DragHandle as DragHandle$1, Cached, Add, MapAdd, WorldMapProjection, Layers, ExitDomain, Info, Search, Exclamation, MyLocation, Close, ThemeWrapper, lightTheme, FlagBritain, FlagNetherlands, FlagFinland, FlagNorway } from '@opengeoweb/theme';
|
|
7
7
|
import i18n from 'i18next';
|
|
8
8
|
import { initReactI18next, useTranslation, I18nextProvider } from 'react-i18next';
|
|
@@ -11,11 +11,11 @@ import { WEBMAP_REACT_NAMESPACE, webmapReactTranslations, WEBMAP_NAMESPACE, webm
|
|
|
11
11
|
import { useDispatch, useSelector, connect, useStore, Provider } from 'react-redux';
|
|
12
12
|
import { ReactSortable } from 'react-sortablejs';
|
|
13
13
|
import Sortable from 'sortablejs';
|
|
14
|
-
import { layerTypes, layerUtils, mapSelectors, layerActions, layerSelectors, serviceSelectors, serviceActions, mapActions, mapEnums, uiSelectors, uiTypes, useSetupDialog, filterLayers, getUserAddedServices, uiActions, genericSelectors, genericActions, drawtoolSelectors, syncConstants, loadingIndicatorActions, syncGroupsSelectors, defaultLayers, mapStoreActions, getSingularDrawtoolDrawLayerId, syncGroupsSelector, syncGroupsActions,
|
|
14
|
+
import { layerTypes, layerUtils, mapSelectors, layerActions, layerSelectors, serviceSelectors, serviceActions, mapActions, mapEnums, uiSelectors, uiTypes, useSetupDialog, filterLayers, getUserAddedServices, uiActions, genericSelectors, genericActions, drawtoolSelectors, syncConstants, loadingIndicatorActions, syncGroupsSelectors, defaultLayers, mapStoreActions, getSingularDrawtoolDrawLayerId, syncGroupsSelector, syncGroupsActions, routerUtils } from '@opengeoweb/store';
|
|
15
15
|
import { webmapUtils, WMGetServiceFromStore, getCapabilities, LayerType, handleDateUtilsISOString, wmServiceListener, EVENT_GETCAPABILITIES_START, EVENT_GETCAPABILITIES_READY, getWMSGetFeatureInfoRequestURL, WMLayer } from '@opengeoweb/webmap';
|
|
16
16
|
import { Box as Box$1, styled as styled$1 } from '@mui/system';
|
|
17
|
-
import _, { isEqual, range } from 'lodash';
|
|
18
|
-
import { LayerSelectButtonConnect, LayerSelectConnect
|
|
17
|
+
import _, { isEqual, debounce, range } from 'lodash';
|
|
18
|
+
import { LayerSelectButtonConnect, LayerSelectConnect } from '@opengeoweb/layer-select';
|
|
19
19
|
import axios from 'axios';
|
|
20
20
|
import DOMPurify from 'dompurify';
|
|
21
21
|
import { snackbarTypes, snackbarActions, SnackbarWrapperConnect } from '@opengeoweb/snackbar';
|
|
@@ -4080,7 +4080,7 @@ var preset = {
|
|
|
4080
4080
|
timeSeriesServices: [
|
|
4081
4081
|
{
|
|
4082
4082
|
name: "KNMI OBS",
|
|
4083
|
-
url: "https://gw-edr
|
|
4083
|
+
url: "https://gw-edr.pub.knmi.cloud/edr",
|
|
4084
4084
|
id: "knmi",
|
|
4085
4085
|
description: "KNMI EDR",
|
|
4086
4086
|
type: "EDR",
|
|
@@ -5640,6 +5640,12 @@ var MapViewConnect = function MapViewConnect(_ref) {
|
|
|
5640
5640
|
var mapPinLocation = useSelector(function (store) {
|
|
5641
5641
|
return mapSelectors.getPinLocation(store, mapId);
|
|
5642
5642
|
});
|
|
5643
|
+
var linkedPanelId = useSelector(function (store) {
|
|
5644
|
+
return genericSelectors.selectLinkedPanelId(store, mapId);
|
|
5645
|
+
});
|
|
5646
|
+
var selectedFeatureCoordinates = useSelector(function (store) {
|
|
5647
|
+
return genericSelectors.getSelectedFeature(store.syncronizationGroupStore, linkedPanelId);
|
|
5648
|
+
});
|
|
5643
5649
|
var disableMapPin = useSelector(function (store) {
|
|
5644
5650
|
return mapSelectors.getDisableMapPin(store, mapId);
|
|
5645
5651
|
});
|
|
@@ -5699,6 +5705,14 @@ var MapViewConnect = function MapViewConnect(_ref) {
|
|
|
5699
5705
|
var setSelectedFeature = React.useCallback(function (payload) {
|
|
5700
5706
|
dispatch(layerActions.setSelectedFeature(payload));
|
|
5701
5707
|
}, [dispatch]);
|
|
5708
|
+
var handleFeatureSelect = function handleFeatureSelect(mapId, featureId) {
|
|
5709
|
+
dispatch(genericActions.addSharedData({
|
|
5710
|
+
panelId: mapId,
|
|
5711
|
+
data: {
|
|
5712
|
+
selectedFeatureId: featureId || ''
|
|
5713
|
+
}
|
|
5714
|
+
}));
|
|
5715
|
+
};
|
|
5702
5716
|
var updateFeature = React.useCallback(function (_ref2) {
|
|
5703
5717
|
var geojson = _ref2.geojson,
|
|
5704
5718
|
reason = _ref2.reason,
|
|
@@ -5776,6 +5790,20 @@ var MapViewConnect = function MapViewConnect(_ref) {
|
|
|
5776
5790
|
}));
|
|
5777
5791
|
}, [dispatch, mapId]);
|
|
5778
5792
|
var isTimeScrollingEnabled = useSelector(syncGroupsSelectors.isTimeScrollingEnabled);
|
|
5793
|
+
var _useSelector = useSelector(function (state) {
|
|
5794
|
+
return genericSelectors.selectSharedData(state, linkedPanelId);
|
|
5795
|
+
}),
|
|
5796
|
+
hoverId = _useSelector.hoverId;
|
|
5797
|
+
var debouncedSetHoverFeature = React.useMemo(function () {
|
|
5798
|
+
return debounce(function (featureId) {
|
|
5799
|
+
return dispatch(genericActions.addSharedData({
|
|
5800
|
+
panelId: linkedPanelId,
|
|
5801
|
+
data: {
|
|
5802
|
+
hoverId: featureId
|
|
5803
|
+
}
|
|
5804
|
+
}));
|
|
5805
|
+
}, 200);
|
|
5806
|
+
}, [dispatch, linkedPanelId]);
|
|
5779
5807
|
return jsx("div", {
|
|
5780
5808
|
style: {
|
|
5781
5809
|
height: '100%'
|
|
@@ -5783,10 +5811,16 @@ var MapViewConnect = function MapViewConnect(_ref) {
|
|
|
5783
5811
|
ref: mapRef,
|
|
5784
5812
|
children: jsxs(MapView, Object.assign({}, props, {
|
|
5785
5813
|
mapId: mapId,
|
|
5814
|
+
linkedFeatures: {
|
|
5815
|
+
type: 'FeatureCollection',
|
|
5816
|
+
features: linkedFeatures.flatMap(function (feature) {
|
|
5817
|
+
return feature.geoJSON.features;
|
|
5818
|
+
})
|
|
5819
|
+
},
|
|
5786
5820
|
isTimeScrollingEnabled: isTimeScrollingEnabled,
|
|
5787
5821
|
srs: srs,
|
|
5788
5822
|
bbox: bbox,
|
|
5789
|
-
mapPinLocation: displayMapPin ? mapPinLocation : undefined,
|
|
5823
|
+
mapPinLocation: displayMapPin ? selectedFeatureCoordinates || mapPinLocation : undefined,
|
|
5790
5824
|
dimensions: mapDimensions,
|
|
5791
5825
|
activeLayerId: activeLayerId,
|
|
5792
5826
|
animationDelay: animationDelay,
|
|
@@ -5852,9 +5886,38 @@ var MapViewConnect = function MapViewConnect(_ref) {
|
|
|
5852
5886
|
}, layer), layer.id);
|
|
5853
5887
|
}), linkedFeatures == null ? void 0 : linkedFeatures.map(function (feature) {
|
|
5854
5888
|
return jsx(MapViewLayer, {
|
|
5855
|
-
id:
|
|
5856
|
-
geojson: feature == null ? void 0 : feature.geoJSON
|
|
5857
|
-
|
|
5889
|
+
id: feature.id,
|
|
5890
|
+
geojson: feature == null ? void 0 : feature.geoJSON,
|
|
5891
|
+
onHoverFeature: function onHoverFeature(hoverInfo) {
|
|
5892
|
+
if (hoverInfo === undefined && hoverId !== undefined) {
|
|
5893
|
+
debouncedSetHoverFeature();
|
|
5894
|
+
} else if (hoverInfo != null && hoverInfo.feature && feature.originalId !== hoverId) {
|
|
5895
|
+
debouncedSetHoverFeature(feature.originalId);
|
|
5896
|
+
}
|
|
5897
|
+
},
|
|
5898
|
+
onClickFeature: function onClickFeature(event) {
|
|
5899
|
+
var _event$feature$proper;
|
|
5900
|
+
var isClickOutsideFeature = !event || !event.feature;
|
|
5901
|
+
if (isClickOutsideFeature) {
|
|
5902
|
+
if (mapPinLocation) {
|
|
5903
|
+
handleFeatureSelect(linkedPanelId, undefined);
|
|
5904
|
+
}
|
|
5905
|
+
return;
|
|
5906
|
+
}
|
|
5907
|
+
// Handle clicks on station
|
|
5908
|
+
var clickedFeatureName = (_event$feature$proper = event.feature.properties) == null ? void 0 : _event$feature$proper.name;
|
|
5909
|
+
var features = linkedFeatures[0].geoJSON.features;
|
|
5910
|
+
var clickedFeatureIndex = features.findIndex(function (feature) {
|
|
5911
|
+
var _feature$properties;
|
|
5912
|
+
return ((_feature$properties = feature.properties) == null ? void 0 : _feature$properties.name) === clickedFeatureName;
|
|
5913
|
+
});
|
|
5914
|
+
if (disableMapPin === false) {
|
|
5915
|
+
var _selectedFeature$id;
|
|
5916
|
+
var selectedFeature = features[clickedFeatureIndex];
|
|
5917
|
+
handleFeatureSelect(linkedPanelId, (_selectedFeature$id = selectedFeature.id) == null ? void 0 : _selectedFeature$id.toString());
|
|
5918
|
+
}
|
|
5919
|
+
}
|
|
5920
|
+
}, feature.id);
|
|
5858
5921
|
}), featureLayers.map(function (layer) {
|
|
5859
5922
|
return jsx(MapViewLayer, Object.assign({
|
|
5860
5923
|
id: "featurelayer-" + layer.id,
|
|
@@ -8289,6 +8352,20 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
|
|
|
8289
8352
|
toggleTimeScroll = _ref.toggleTimeScroll;
|
|
8290
8353
|
var _useCoreTranslation = useCoreTranslation(),
|
|
8291
8354
|
t = _useCoreTranslation.t;
|
|
8355
|
+
React.useEffect(function () {
|
|
8356
|
+
var handleKeyDown = function handleKeyDown(event) {
|
|
8357
|
+
var target = event.target;
|
|
8358
|
+
if (target.tagName !== 'INPUT' && target.tagName !== 'TEXTAREA' && event.key === 's') {
|
|
8359
|
+
toggleTimeScroll({
|
|
8360
|
+
isTimeScrollingEnabled: !isTimeScrollingEnabled
|
|
8361
|
+
});
|
|
8362
|
+
}
|
|
8363
|
+
};
|
|
8364
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
8365
|
+
return function () {
|
|
8366
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
8367
|
+
};
|
|
8368
|
+
}, [isTimeScrollingEnabled, toggleTimeScroll]);
|
|
8292
8369
|
var _handleToggle = function handleToggle(groupCategory, groupId, sourceId) {
|
|
8293
8370
|
var _syncGroupViewState$g = syncGroupViewState[groupCategory].groups.find(function (groupObject) {
|
|
8294
8371
|
return groupObject.id === groupId;
|
|
@@ -8371,10 +8448,14 @@ var SyncGroupViewer = function SyncGroupViewer(_ref) {
|
|
|
8371
8448
|
},
|
|
8372
8449
|
children: t('workspace-time-scroll-off')
|
|
8373
8450
|
}), jsx(Switch, {
|
|
8451
|
+
inputProps: {
|
|
8452
|
+
'aria-label': 'workspace time scroll toggle'
|
|
8453
|
+
},
|
|
8374
8454
|
checked: isTimeScrollingEnabled,
|
|
8375
8455
|
onChange: function onChange() {
|
|
8376
8456
|
return toggleTimeScroll({
|
|
8377
|
-
isTimeScrollingEnabled: !isTimeScrollingEnabled
|
|
8457
|
+
isTimeScrollingEnabled: !isTimeScrollingEnabled,
|
|
8458
|
+
origin: 'user'
|
|
8378
8459
|
});
|
|
8379
8460
|
}
|
|
8380
8461
|
}), jsx(Typography, {
|
|
@@ -8610,14 +8691,14 @@ var CoreThemeProvider = function CoreThemeProvider(_ref) {
|
|
|
8610
8691
|
children: children
|
|
8611
8692
|
});
|
|
8612
8693
|
};
|
|
8613
|
-
var ThemeWrapperWithModules =
|
|
8694
|
+
var ThemeWrapperWithModules = function ThemeWrapperWithModules(_ref2) {
|
|
8614
8695
|
var theme = _ref2.theme,
|
|
8615
8696
|
children = _ref2.children;
|
|
8616
8697
|
return jsx(CoreThemeProvider, {
|
|
8617
8698
|
theme: theme,
|
|
8618
8699
|
children: children
|
|
8619
8700
|
});
|
|
8620
|
-
}
|
|
8701
|
+
};
|
|
8621
8702
|
/**
|
|
8622
8703
|
* A Provider component which provides the GeoWeb theme and store for the core.
|
|
8623
8704
|
* Note: Should only be used with core components, as the provided store is only for core.
|
|
@@ -8683,11 +8764,12 @@ var NavigateSetter = function NavigateSetter() {
|
|
|
8683
8764
|
return null;
|
|
8684
8765
|
};
|
|
8685
8766
|
|
|
8686
|
-
var RouterWrapperConnect =
|
|
8767
|
+
var RouterWrapperConnect = function RouterWrapperConnect(props) {
|
|
8768
|
+
var children = props.children;
|
|
8687
8769
|
return jsxs(Fragment, {
|
|
8688
|
-
children: [jsx(NavigateSetter, {}),
|
|
8770
|
+
children: [jsx(NavigateSetter, {}), children]
|
|
8689
8771
|
});
|
|
8690
|
-
}
|
|
8772
|
+
};
|
|
8691
8773
|
|
|
8692
8774
|
var Circle = styled$1('div')(function (_ref) {
|
|
8693
8775
|
var isRecording = _ref.isRecording;
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ export interface InitialTimeSeriesProps {
|
|
|
25
25
|
plotPreset: PlotPreset;
|
|
26
26
|
services: TimeSeriesService[];
|
|
27
27
|
}
|
|
28
|
-
export type InitialProps = InitialMapProps | InitialMultiMapProps | InitialHarmTempAndPrecipProps | ModelRunIntervalProps | mapTypes.MapPresetInitialProps | InitialSliderProps | InitialTimeSeriesProps
|
|
28
|
+
export type InitialProps = InitialMapProps | InitialMultiMapProps | InitialHarmTempAndPrecipProps | ModelRunIntervalProps | mapTypes.MapPresetInitialProps | InitialSliderProps | InitialTimeSeriesProps | Record<string, unknown>;
|
|
29
29
|
/**
|
|
30
30
|
* The lookup table is for registering your own components with the workspace.
|
|
31
31
|
* @param payload
|