@opengeoweb/core 12.7.0 → 12.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +131 -108
- package/package.json +12 -11
- package/src/lib/components/LayerManager/LayerManagerUtils.d.ts +1 -1
- package/src/lib/components/LayerManager/OverlayersRow/OverlayersSelect.d.ts +7 -0
- package/src/lib/components/LayerManager/OverlayersRow/OverlayersSelectConnect.d.ts +3 -0
- package/src/lib/components/LayerManager/OverlayersRow/OverlayersSelectConnect.integration.spec.d.ts +1 -0
- package/src/lib/components/LocationSearch/utils.d.ts +1 -5
- package/src/lib/components/MultiMapViewConnect/storyUtils/mapPresets.d.ts +10 -10
- /package/{index.esm.d.ts → index.d.ts} +0 -0
package/index.esm.js
CHANGED
|
@@ -3,11 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { useState, useCallback, useEffect, useContext, useMemo } from 'react';
|
|
4
4
|
import { Grid, Box, MenuItem, Typography, useTheme, Popper, Fade, Tooltip, styled, LinearProgress, FormControl, InputLabel, Paper, List, ListItemButton, ListItemText, CircularProgress, ListSubheader, DialogContentText, TextField, InputAdornment, Button, Autocomplete, ListItemIcon, Checkbox, Switch, Select } from '@mui/material';
|
|
5
5
|
import { safelyInitI18nForTestsAndStories, sharedTranslations, SHARED_NAMESPACE, CustomIconButton, CustomTooltip, TooltipSelect, AlertIcon, useScrollingInIsolation, sliderHeaderStyle, CustomSlider, ToggleMenu, tooltipContainerStyles, renderCounter, AlertBanner, CustomAccordion, CustomDialog, PROJECTION, calculateStartSize, useWheelStopPropagation, ToolContainerDraggable, dateUtils, useDebounce, sessionStorageProvider, usePrevious, ErrorBoundary } from '@opengeoweb/shared';
|
|
6
|
-
import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, CloudLoading, ColumnCollapsed, ColumnCollapse, Copy, None, FastForward, AutoUpdateActive, Both, Delete, Visibility, VisibilityOff, DragHandle as DragHandle$1, Cached, Add, MapAdd, WorldMapProjection, Layers, ExitDomain, Info, Search, Exclamation, MyLocation, Close, ThemeWrapper, lightTheme, FlagBritain, FlagNetherlands, FlagFinland, FlagNorway } from '@opengeoweb/theme';
|
|
6
|
+
import { CollapseSmall, CollapseMedium, CollapseLarge, CollapseWindow, ExpandWindow, LayersAdd, CloudLoading, ColumnCollapsed, ColumnCollapse, Copy, None, FastForward, AutoUpdateActive, Both, Delete, Visibility, VisibilityOff, DragHandle as DragHandle$1, Cached, Add, MapAdd, WorldMapProjection, Overlayers, 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 { useTranslation, I18nextProvider } from 'react-i18next';
|
|
9
9
|
import { TIMESLIDER_NAMESPACE, timesliderTranslations, defaultTimeSpan, SpeedButton, TimeStepButton, AnimationLengthButton, AnimationLength, TimeSpanButton, secondsPerPxFromCanvasWidth, getNewCenterOfFixedPointZoom, OptionsMenuButton, PlayButton, defaultTimeStep, BackwardForwardStepButton, AutoUpdateButton, NowButton, handleSetNowEvent, TimeSliderButtons, TimeSliderCurrentTimeBox, TimeSliderLegend, onsetNewDateDebounced, defaultSecondsPerPx, moveSelectedTimePx, TimeSlider, getFilteredTime, ControlButtons, OptionsMenu, TimeSliderClock } from '@opengeoweb/timeslider';
|
|
10
|
-
import { webmapReactTranslations, WEBMAP_REACT_NAMESPACE, webmapTranslations, WEBMAP_NAMESPACE, LayerInfoButton, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton, LegendDialog, LegendButton, MapContext, emptyGeoJSON,
|
|
10
|
+
import { webmapReactTranslations, WEBMAP_REACT_NAMESPACE, webmapTranslations, WEBMAP_NAMESPACE, LayerInfoButton, LayerInfoDialog, MapControlButton, MapDimensionSelect, dimensionConfig, DimensionSelectDialog, DimensionSelectButton, LegendDialog, LegendButton, MapContext, emptyGeoJSON, MapFeatureClass, setMapCenter, OpenLayersFeatureLayer, OpenLayersMapDraw, getIsInsideAcceptanceTime, OpenLayersLayer, useSetIntervalWhenVisible, openLayersGetMapImageStore, TimeContext, OpenLayersMapView, WMSLayer, genericOpenLayersFeatureStyle, OpenLayersGetFeatureInfo, MapControls, OpenLayersZoomControl, getLayerUpdateInfo, publicLayers } from '@opengeoweb/webmap-react';
|
|
11
11
|
import { useDispatch, useSelector, connect, useStore, Provider } from 'react-redux';
|
|
12
12
|
import { ReactSortable } from 'react-sortablejs';
|
|
13
13
|
import Sortable from 'sortablejs';
|
|
@@ -46,6 +46,8 @@ var en = {
|
|
|
46
46
|
"layermanager-title": "Layer Manager",
|
|
47
47
|
"layermanager-baselayers-title": "Base layer",
|
|
48
48
|
"layermanager-baselayers-no-available": "No service available",
|
|
49
|
+
"layermanager-overlayers-title": "Select overlayer",
|
|
50
|
+
"layermanager-overlayers-overlayer": "Overlayer",
|
|
49
51
|
"layermanager-acceptance-time": "Acc Time",
|
|
50
52
|
"layermanager-dimensions-total-values": "Dimension value ({{total_dimensions}} options)",
|
|
51
53
|
"layermanager-dimensions-title": "Dimensions",
|
|
@@ -122,6 +124,8 @@ var fi = {
|
|
|
122
124
|
"layermanager-title": "Karttatasot",
|
|
123
125
|
"layermanager-baselayers-title": "Pohjakartta",
|
|
124
126
|
"layermanager-baselayers-no-available": "Palvelu ei käytettävissä",
|
|
127
|
+
"layermanager-overlayers-title": "Valitse päällystaso",
|
|
128
|
+
"layermanager-overlayers-overlayer": "Päällystaso",
|
|
125
129
|
"layermanager-acceptance-time": "Hyväksymisaika",
|
|
126
130
|
"layermanager-dimensions-total-values": "Dimension arvon ({{total_dimensions}} valinnat)",
|
|
127
131
|
"layermanager-dimensions-title": "Dimensiot",
|
|
@@ -198,6 +202,8 @@ var no = {
|
|
|
198
202
|
"layermanager-title": "Kartlag",
|
|
199
203
|
"layermanager-baselayers-title": "Basislag",
|
|
200
204
|
"layermanager-baselayers-no-available": "Ingen tjenester tilgjengelig",
|
|
205
|
+
"layermanager-overlayers-title": "ikke oversatt",
|
|
206
|
+
"layermanager-overlayers-overlayer": "ikke oversatt",
|
|
201
207
|
"layermanager-acceptance-time": "Aksep.tid",
|
|
202
208
|
"layermanager-dimensions-total-values": "Dimensjonsverdi ({{total_dimensions}} valg)",
|
|
203
209
|
"layermanager-dimensions-title": "Dimensjoner",
|
|
@@ -274,6 +280,8 @@ var nl = {
|
|
|
274
280
|
"layermanager-title": "Lagen Manager",
|
|
275
281
|
"layermanager-baselayers-title": "Basislaag",
|
|
276
282
|
"layermanager-baselayers-no-available": "Geen service beschikbaar",
|
|
283
|
+
"layermanager-overlayers-title": "Selecteer een overlayer",
|
|
284
|
+
"layermanager-overlayers-overlayer": "Overlayer",
|
|
277
285
|
"layermanager-acceptance-time": "Acc Tijd",
|
|
278
286
|
"layermanager-dimensions-total-values": "Opties voor dimensie ({{total_dimensions}})",
|
|
279
287
|
"layermanager-dimensions-title": "Dimensies",
|
|
@@ -909,7 +917,7 @@ var layerManagerStyle = {
|
|
|
909
917
|
'.is-dragging header+.MuiBox-root': {
|
|
910
918
|
overflow: 'hidden'
|
|
911
919
|
},
|
|
912
|
-
// baselayer & projection
|
|
920
|
+
// baselayer, overlayer & projection
|
|
913
921
|
'.baseLayer': {
|
|
914
922
|
width: "calc(" + flexibleAreaWidth + " * 0.25)"
|
|
915
923
|
},
|
|
@@ -972,7 +980,7 @@ var layerManagerStyle = {
|
|
|
972
980
|
'.activateLayer-btn, .enable-btn, .column-2, .column-3, .column-4, .column-5, .column-6, .column-7, .column-acceptanceTime, .column-loadDuration': {
|
|
973
981
|
display: 'none'
|
|
974
982
|
},
|
|
975
|
-
'.addLayer-column, .setProjection-column': {
|
|
983
|
+
'.addLayer-column, .setProjection-column, .overlayers-column': {
|
|
976
984
|
display: 'none'
|
|
977
985
|
},
|
|
978
986
|
'.descriptionRow': {
|
|
@@ -2480,7 +2488,7 @@ var LayerRow = styled(LayerRowUnstyled)(function (_ref9) {
|
|
|
2480
2488
|
backgroundColor: isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultCardContainer.fill : theme.palette.geowebColors.layerManager.tableRowDisabledCardContainer.fill,
|
|
2481
2489
|
border: '1px solid',
|
|
2482
2490
|
borderColor: isEnabled ? theme.palette.geowebColors.layerManager.tableRowDefaultCardContainer.borderColor : theme.palette.geowebColors.layerManager.tableRowDisabledCardContainer.borderColor,
|
|
2483
|
-
borderRadius:
|
|
2491
|
+
borderRadius: theme.shape.borderRadius,
|
|
2484
2492
|
marginBottom: theme.spacing(0.25),
|
|
2485
2493
|
minHeight: '32px'
|
|
2486
2494
|
}
|
|
@@ -3016,7 +3024,8 @@ var ActivateLayerConnect = function ActivateLayerConnect(_ref) {
|
|
|
3016
3024
|
} else if (thisLayerHasAutoTimestep) {
|
|
3017
3025
|
dispatch(mapActions.setAutoTimestepLayerId({
|
|
3018
3026
|
mapId: mapId,
|
|
3019
|
-
autoTimestepLayerId: undefined
|
|
3027
|
+
autoTimestepLayerId: undefined,
|
|
3028
|
+
origin: mapEnums.MapActionOrigin.map
|
|
3020
3029
|
}));
|
|
3021
3030
|
if (isTimestepAuto) {
|
|
3022
3031
|
dispatch(mapActions.toggleTimestepAuto({
|
|
@@ -3039,7 +3048,8 @@ var ActivateLayerConnect = function ActivateLayerConnect(_ref) {
|
|
|
3039
3048
|
} else if (thisLayerHasAutoUpdate) {
|
|
3040
3049
|
dispatch(mapActions.setAutoUpdateLayerId({
|
|
3041
3050
|
mapId: mapId,
|
|
3042
|
-
autoUpdateLayerId: undefined
|
|
3051
|
+
autoUpdateLayerId: undefined,
|
|
3052
|
+
origin: mapEnums.MapActionOrigin.map
|
|
3043
3053
|
}));
|
|
3044
3054
|
}
|
|
3045
3055
|
}
|
|
@@ -3055,7 +3065,8 @@ var ActivateLayerConnect = function ActivateLayerConnect(_ref) {
|
|
|
3055
3065
|
function handleAutoUpdateClick() {
|
|
3056
3066
|
dispatch(mapActions.setAutoUpdateLayerId({
|
|
3057
3067
|
mapId: mapId,
|
|
3058
|
-
autoUpdateLayerId: layerId
|
|
3068
|
+
autoUpdateLayerId: layerId,
|
|
3069
|
+
origin: mapEnums.MapActionOrigin.map
|
|
3059
3070
|
}));
|
|
3060
3071
|
if (thisLayerHasAutoTimestep) {
|
|
3061
3072
|
dispatch(mapActions.setAutoTimestepLayerId({
|
|
@@ -3086,7 +3097,8 @@ var ActivateLayerConnect = function ActivateLayerConnect(_ref) {
|
|
|
3086
3097
|
function handleAutoTimestepClick() {
|
|
3087
3098
|
dispatch(mapActions.setAutoTimestepLayerId({
|
|
3088
3099
|
mapId: mapId,
|
|
3089
|
-
autoTimestepLayerId: layerId
|
|
3100
|
+
autoTimestepLayerId: layerId,
|
|
3101
|
+
origin: mapEnums.MapActionOrigin.map
|
|
3090
3102
|
}));
|
|
3091
3103
|
if (thisLayerHasAutoUpdate) {
|
|
3092
3104
|
dispatch(mapActions.setAutoUpdateLayerId({
|
|
@@ -4736,6 +4748,100 @@ var ProjectionSelectConnect = function ProjectionSelectConnect(_ref) {
|
|
|
4736
4748
|
});
|
|
4737
4749
|
};
|
|
4738
4750
|
|
|
4751
|
+
var availableOverlayers = [{
|
|
4752
|
+
name: 'Default Overlayer',
|
|
4753
|
+
value: 'Default Overlayer'
|
|
4754
|
+
},
|
|
4755
|
+
// TODO: rename to 'None' when implemented: https://gitlab.com/opengeoweb/opengeoweb/-/issues/6095
|
|
4756
|
+
{
|
|
4757
|
+
name: 'None (not implemented)',
|
|
4758
|
+
value: 'None'
|
|
4759
|
+
}];
|
|
4760
|
+
var OverlayersSelect = function OverlayersSelect(_ref) {
|
|
4761
|
+
var _availableOverlayers$;
|
|
4762
|
+
var selectedOverlayer = _ref.selectedOverlayer,
|
|
4763
|
+
onChangeOverlayer = _ref.onChangeOverlayer;
|
|
4764
|
+
var _useCoreTranslation = useCoreTranslation(),
|
|
4765
|
+
t = _useCoreTranslation.t;
|
|
4766
|
+
var index = availableOverlayers.findIndex(function (layer) {
|
|
4767
|
+
return layer.value === selectedOverlayer;
|
|
4768
|
+
});
|
|
4769
|
+
var selectedOverlayerName = (_availableOverlayers$ = availableOverlayers.find(function (layer) {
|
|
4770
|
+
return layer.value === selectedOverlayer;
|
|
4771
|
+
})) == null ? void 0 : _availableOverlayers$.name;
|
|
4772
|
+
return jsxs(Grid, {
|
|
4773
|
+
container: true,
|
|
4774
|
+
className: "overlayers-column",
|
|
4775
|
+
sx: {
|
|
4776
|
+
width: '100%',
|
|
4777
|
+
height: '36px'
|
|
4778
|
+
},
|
|
4779
|
+
children: [jsx(Grid, {
|
|
4780
|
+
sx: [{
|
|
4781
|
+
marginTop: '-2px'
|
|
4782
|
+
}, leftButtonsStyle],
|
|
4783
|
+
children: jsx(CustomIconButton, {
|
|
4784
|
+
sx: {
|
|
4785
|
+
margin: 'auto 0px auto 32px'
|
|
4786
|
+
},
|
|
4787
|
+
disabled: true,
|
|
4788
|
+
children: jsx(Overlayers, {})
|
|
4789
|
+
})
|
|
4790
|
+
}), jsx(Grid, {
|
|
4791
|
+
className: columnClasses.baseLayer,
|
|
4792
|
+
children: jsx(FormControl, {
|
|
4793
|
+
style: {
|
|
4794
|
+
width: '100%'
|
|
4795
|
+
},
|
|
4796
|
+
children: jsxs(TooltipSelect, {
|
|
4797
|
+
disableUnderline: true,
|
|
4798
|
+
SelectDisplayProps: {
|
|
4799
|
+
'aria-label': 'overlayerSelect'
|
|
4800
|
+
},
|
|
4801
|
+
tooltip: t('layermanager-overlayers-overlayer') + ": " + selectedOverlayerName,
|
|
4802
|
+
isEnabled: true,
|
|
4803
|
+
style: {
|
|
4804
|
+
maxWidth: '100%'
|
|
4805
|
+
},
|
|
4806
|
+
value: selectedOverlayer,
|
|
4807
|
+
list: availableOverlayers,
|
|
4808
|
+
currentIndex: index,
|
|
4809
|
+
onChange: function onChange(event) {
|
|
4810
|
+
event.stopPropagation();
|
|
4811
|
+
onChangeOverlayer(event.target.value);
|
|
4812
|
+
},
|
|
4813
|
+
onChangeMouseWheel: function onChangeMouseWheel(e) {
|
|
4814
|
+
onChangeOverlayer(e.value);
|
|
4815
|
+
},
|
|
4816
|
+
children: [jsx(MenuItem, {
|
|
4817
|
+
disabled: true,
|
|
4818
|
+
children: t('layermanager-overlayers-title')
|
|
4819
|
+
}), availableOverlayers.map(function (_ref2) {
|
|
4820
|
+
var name = _ref2.name,
|
|
4821
|
+
value = _ref2.value;
|
|
4822
|
+
return jsx(MenuItem, {
|
|
4823
|
+
value: value,
|
|
4824
|
+
children: name
|
|
4825
|
+
}, name);
|
|
4826
|
+
})]
|
|
4827
|
+
})
|
|
4828
|
+
})
|
|
4829
|
+
})]
|
|
4830
|
+
});
|
|
4831
|
+
};
|
|
4832
|
+
|
|
4833
|
+
var OverlayersSelectConnect = function OverlayersSelectConnect() {
|
|
4834
|
+
var _React$useState = React__default.useState('Default Overlayer'),
|
|
4835
|
+
selectedOverlayer = _React$useState[0],
|
|
4836
|
+
setSelectedOverlayer = _React$useState[1];
|
|
4837
|
+
return jsx(OverlayersSelect, {
|
|
4838
|
+
selectedOverlayer: selectedOverlayer,
|
|
4839
|
+
onChangeOverlayer: function onChangeOverlayer(selection) {
|
|
4840
|
+
setSelectedOverlayer(selection);
|
|
4841
|
+
}
|
|
4842
|
+
});
|
|
4843
|
+
};
|
|
4844
|
+
|
|
4739
4845
|
var styles$1 = {
|
|
4740
4846
|
layerRowContainer: {
|
|
4741
4847
|
position: 'relative',
|
|
@@ -4892,7 +4998,7 @@ var LayerManager = function LayerManager(_ref) {
|
|
|
4892
4998
|
mapId: mapId,
|
|
4893
4999
|
settings: settings == null ? void 0 : settings.content,
|
|
4894
5000
|
collapsedColumns: collapsedColumns
|
|
4895
|
-
}), jsx(BaseLayerRow, {
|
|
5001
|
+
}), jsx(OverlayersSelectConnect, {}), jsx(BaseLayerRow, {
|
|
4896
5002
|
mapId: mapId,
|
|
4897
5003
|
tooltip: t('layermanager-baselayers-tooltip'),
|
|
4898
5004
|
preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
|
|
@@ -7123,43 +7229,6 @@ var LocationSearch = function LocationSearch(_ref) {
|
|
|
7123
7229
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
7124
7230
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
7125
7231
|
* */
|
|
7126
|
-
var myLocationDrawFunction = function myLocationDrawFunction(args) {
|
|
7127
|
-
var ctx = args.context,
|
|
7128
|
-
coord = args.coord;
|
|
7129
|
-
// Draw outer circle
|
|
7130
|
-
ctx.strokeStyle = '#fff';
|
|
7131
|
-
ctx.fillStyle = '#fff';
|
|
7132
|
-
ctx.shadowColor = '#00000080';
|
|
7133
|
-
ctx.shadowBlur = 4;
|
|
7134
|
-
ctx.beginPath();
|
|
7135
|
-
ctx.arc(coord.x, coord.y, 14, 0, 2 * Math.PI);
|
|
7136
|
-
ctx.fill();
|
|
7137
|
-
ctx.shadowBlur = 0;
|
|
7138
|
-
// Draw inner circle
|
|
7139
|
-
ctx.fillStyle = '#186dff';
|
|
7140
|
-
ctx.beginPath();
|
|
7141
|
-
ctx.arc(coord.x, coord.y, 10, 0, 2 * Math.PI);
|
|
7142
|
-
ctx.fill();
|
|
7143
|
-
};
|
|
7144
|
-
var selectedLocationDrawFunction = function selectedLocationDrawFunction(args) {
|
|
7145
|
-
var ctx = args.context,
|
|
7146
|
-
coord = args.coord;
|
|
7147
|
-
ctx.strokeStyle = '#051039';
|
|
7148
|
-
ctx.fillStyle = '#051039';
|
|
7149
|
-
ctx.beginPath();
|
|
7150
|
-
var topRadius = 7;
|
|
7151
|
-
var topHeight = 2 * topRadius;
|
|
7152
|
-
ctx.arc(coord.x, coord.y - topHeight, topRadius, Math.PI, Math.PI * 2);
|
|
7153
|
-
ctx.bezierCurveTo(coord.x + topRadius, coord.y - topHeight, coord.x + topRadius / 1.6, coord.y - topRadius, coord.x, coord.y);
|
|
7154
|
-
ctx.bezierCurveTo(coord.x, coord.y, coord.x - topRadius / 1.6, coord.y - topRadius, coord.x - topRadius, coord.y - topHeight);
|
|
7155
|
-
ctx.stroke();
|
|
7156
|
-
ctx.fill();
|
|
7157
|
-
/* Fill center circle */
|
|
7158
|
-
ctx.fillStyle = '#FFF';
|
|
7159
|
-
ctx.beginPath();
|
|
7160
|
-
ctx.arc(coord.x, coord.y - topHeight, topRadius / 2.5, Math.PI * 2, 0);
|
|
7161
|
-
ctx.fill();
|
|
7162
|
-
};
|
|
7163
7232
|
var geometryStyling = {
|
|
7164
7233
|
fill: '#FF7800',
|
|
7165
7234
|
'fill-opacity': 0.25,
|
|
@@ -7167,7 +7236,7 @@ var geometryStyling = {
|
|
|
7167
7236
|
'stroke-opacity': 1,
|
|
7168
7237
|
'stroke-width': 4
|
|
7169
7238
|
};
|
|
7170
|
-
var makeGeoJSONFeatureFromLocation = function makeGeoJSONFeatureFromLocation(location,
|
|
7239
|
+
var makeGeoJSONFeatureFromLocation = function makeGeoJSONFeatureFromLocation(location, mapFeatureClass, t) {
|
|
7171
7240
|
var _location$geometry;
|
|
7172
7241
|
var collection = {
|
|
7173
7242
|
type: 'FeatureCollection',
|
|
@@ -7177,7 +7246,6 @@ var makeGeoJSONFeatureFromLocation = function makeGeoJSONFeatureFromLocation(loc
|
|
|
7177
7246
|
var geometry = Object.assign({}, location.geometry, {
|
|
7178
7247
|
properties: Object.assign({}, geometryStyling, {
|
|
7179
7248
|
name: name,
|
|
7180
|
-
hoverDrawFunctionId: hoverDrawFunctionId,
|
|
7181
7249
|
mapFeatureClass: mapFeatureClass,
|
|
7182
7250
|
showNameOnHover: true
|
|
7183
7251
|
})
|
|
@@ -7186,8 +7254,6 @@ var makeGeoJSONFeatureFromLocation = function makeGeoJSONFeatureFromLocation(loc
|
|
|
7186
7254
|
type: 'Feature',
|
|
7187
7255
|
properties: {
|
|
7188
7256
|
name: name,
|
|
7189
|
-
drawFunctionId: drawFunctionId,
|
|
7190
|
-
hoverDrawFunctionId: hoverDrawFunctionId,
|
|
7191
7257
|
mapFeatureClass: mapFeatureClass,
|
|
7192
7258
|
showNameOnHover: true
|
|
7193
7259
|
},
|
|
@@ -7206,53 +7272,7 @@ var makeGeoJSONFeatureFromLocation = function makeGeoJSONFeatureFromLocation(loc
|
|
|
7206
7272
|
}
|
|
7207
7273
|
return collection;
|
|
7208
7274
|
};
|
|
7209
|
-
var
|
|
7210
|
-
var lines = text.split('\n');
|
|
7211
|
-
for (var i = 0; i < lines.length; i += 1) {
|
|
7212
|
-
ctx.fillText(lines[i], x, y + i * lineheight);
|
|
7213
|
-
}
|
|
7214
|
-
};
|
|
7215
|
-
var roundRect = function roundRect(ctx, w, h, x, y, radius) {
|
|
7216
|
-
if (radius === void 0) {
|
|
7217
|
-
radius = 2;
|
|
7218
|
-
}
|
|
7219
|
-
var r = x + w;
|
|
7220
|
-
var b = y + h;
|
|
7221
|
-
ctx.beginPath();
|
|
7222
|
-
ctx.moveTo(x + radius, y);
|
|
7223
|
-
ctx.lineTo(r - radius, y);
|
|
7224
|
-
ctx.quadraticCurveTo(r, y, r, y + radius);
|
|
7225
|
-
ctx.lineTo(r, y + h - radius);
|
|
7226
|
-
ctx.quadraticCurveTo(r, b, r - radius, b);
|
|
7227
|
-
ctx.lineTo(x + radius, b);
|
|
7228
|
-
ctx.quadraticCurveTo(x, b, x, b - radius);
|
|
7229
|
-
ctx.lineTo(x, y + radius);
|
|
7230
|
-
ctx.quadraticCurveTo(x, y, x + radius, y);
|
|
7231
|
-
ctx.stroke();
|
|
7232
|
-
ctx.fill();
|
|
7233
|
-
};
|
|
7234
|
-
var hoverDrawFunction = function hoverDrawFunction(args) {
|
|
7235
|
-
var ctx = args.context,
|
|
7236
|
-
coord = args.coord,
|
|
7237
|
-
feature = args.feature;
|
|
7238
|
-
var fontSize = 16;
|
|
7239
|
-
var padding = 20;
|
|
7240
|
-
// eslint-disable-next-line no-param-reassign
|
|
7241
|
-
ctx.font = fontSize + "px Roboto";
|
|
7242
|
-
var x = coord.x,
|
|
7243
|
-
y = coord.y;
|
|
7244
|
-
ctx.strokeStyle = '#000';
|
|
7245
|
-
ctx.fillStyle = '#000';
|
|
7246
|
-
roundRect(ctx, ctx.measureText(feature.properties.name).width + padding, fontSize + padding, x - padding * 0.5 - ctx.measureText(feature.properties.name).width * 0.5, y + padding);
|
|
7247
|
-
// eslint-disable-next-line no-param-reassign
|
|
7248
|
-
ctx.fillStyle = '#FFF';
|
|
7249
|
-
// eslint-disable-next-line no-param-reassign
|
|
7250
|
-
ctx.textAlign = 'left';
|
|
7251
|
-
if (feature && feature.properties) {
|
|
7252
|
-
fitText(ctx, feature.properties.name, x - ctx.measureText(feature.properties.name).width * 0.5, y + padding * 2, fontSize);
|
|
7253
|
-
}
|
|
7254
|
-
};
|
|
7255
|
-
var useDrawOnMap = function useDrawOnMap(mapId, drawFunction) {
|
|
7275
|
+
var useDrawOnMap = function useDrawOnMap(mapId) {
|
|
7256
7276
|
var dispatch = useDispatch();
|
|
7257
7277
|
var _useCoreTranslation = useCoreTranslation(),
|
|
7258
7278
|
t = _useCoreTranslation.t;
|
|
@@ -7283,16 +7303,14 @@ var useDrawOnMap = function useDrawOnMap(mapId, drawFunction) {
|
|
|
7283
7303
|
}));
|
|
7284
7304
|
}
|
|
7285
7305
|
}, [dispatch, layerId, mapId, shouldAddLayer]);
|
|
7286
|
-
var drawFunctionId = React__default.useRef(registerDrawFunction(drawFunction)).current;
|
|
7287
|
-
var hoverDrawFunctionId = React__default.useRef(registerDrawFunction(hoverDrawFunction)).current;
|
|
7288
7306
|
var updateGeoJSON = React__default.useCallback(function (location) {
|
|
7289
7307
|
var mapFeatureClass = (location == null ? void 0 : location.source) === 'MyMapLocation' ? MapFeatureClass.MyLocation : MapFeatureClass.GenericMarker;
|
|
7290
|
-
var geojson = location ? makeGeoJSONFeatureFromLocation(location,
|
|
7308
|
+
var geojson = location ? makeGeoJSONFeatureFromLocation(location, mapFeatureClass, t) : emptyGeoJSON;
|
|
7291
7309
|
dispatch(layerActions.updateFeature({
|
|
7292
7310
|
layerId: layerId,
|
|
7293
7311
|
geojson: geojson
|
|
7294
7312
|
}));
|
|
7295
|
-
}, [dispatch,
|
|
7313
|
+
}, [dispatch, layerId, t]);
|
|
7296
7314
|
var zoomToFeature = React__default.useCallback(function (location) {
|
|
7297
7315
|
if (map) {
|
|
7298
7316
|
setMapCenter(map, location.lon, location.lat);
|
|
@@ -7313,9 +7331,9 @@ var LocationSearchConnect = function LocationSearchConnect(_ref) {
|
|
|
7313
7331
|
var dialogType = uiTypes.DialogTypes.Search + "-" + mapId;
|
|
7314
7332
|
var _useSetupDialog = useSetupDialog(dialogType),
|
|
7315
7333
|
isDialogOpen = _useSetupDialog.isDialogOpen;
|
|
7316
|
-
var _useDrawOnMap = useDrawOnMap(mapId
|
|
7334
|
+
var _useDrawOnMap = useDrawOnMap(mapId),
|
|
7317
7335
|
updateMapPin = _useDrawOnMap[0];
|
|
7318
|
-
var _useDrawOnMap2 = useDrawOnMap(mapId
|
|
7336
|
+
var _useDrawOnMap2 = useDrawOnMap(mapId),
|
|
7319
7337
|
updateMyLocation = _useDrawOnMap2[0];
|
|
7320
7338
|
var mapLayers = useSelector(function (store) {
|
|
7321
7339
|
return layerSelectors.getLayersByMapId(store, mapId);
|
|
@@ -7699,7 +7717,9 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
7699
7717
|
}, [warningDialogFeatures]);
|
|
7700
7718
|
var linkedFeaturesFromState = useSelector(function (store) {
|
|
7701
7719
|
var _store$syncGroups;
|
|
7702
|
-
return genericSelectors.selectLinkedFeatures((_store$syncGroups = store.syncGroups) == null ? void 0 : _store$syncGroups.linkedState,
|
|
7720
|
+
return genericSelectors.selectLinkedFeatures((_store$syncGroups = store.syncGroups) == null ? void 0 : _store$syncGroups.linkedState, {
|
|
7721
|
+
mapId: mapId
|
|
7722
|
+
});
|
|
7703
7723
|
});
|
|
7704
7724
|
var filteredLinkedFeaturesFromState = React.useMemo(function () {
|
|
7705
7725
|
return linkedFeaturesFromState.filter(function (feature) {
|
|
@@ -7708,7 +7728,9 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
7708
7728
|
}, [linkedFeaturesFromState, warningDialogOriginalIds]);
|
|
7709
7729
|
var linkedFormFeaturesFromState = useSelector(function (store) {
|
|
7710
7730
|
var _store$syncGroups2;
|
|
7711
|
-
return genericSelectors.selectLinkedFormFeatures((_store$syncGroups2 = store.syncGroups) == null ? void 0 : _store$syncGroups2.linkedState,
|
|
7731
|
+
return genericSelectors.selectLinkedFormFeatures((_store$syncGroups2 = store.syncGroups) == null ? void 0 : _store$syncGroups2.linkedState, {
|
|
7732
|
+
mapId: mapId
|
|
7733
|
+
});
|
|
7712
7734
|
});
|
|
7713
7735
|
var linkedFeatures = React.useMemo(function () {
|
|
7714
7736
|
return {
|
|
@@ -7809,9 +7831,10 @@ var OlMapViewConnect = function OlMapViewConnect(_ref) {
|
|
|
7809
7831
|
selectedFeatureId: selectedFeatureId
|
|
7810
7832
|
}
|
|
7811
7833
|
}));
|
|
7812
|
-
selectedMapIds.
|
|
7834
|
+
var linkedMapIds = selectedMapIds.length > 0 ? selectedMapIds : [mapId];
|
|
7835
|
+
linkedMapIds.forEach(function (id) {
|
|
7813
7836
|
dispatch(mapActions.setMapPinLocation({
|
|
7814
|
-
mapId:
|
|
7837
|
+
mapId: id,
|
|
7815
7838
|
mapPinLocation: mapPinLocation
|
|
7816
7839
|
}));
|
|
7817
7840
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/core",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.9.1",
|
|
4
4
|
"description": "GeoWeb Core library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,22 +8,22 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/shared": "12.
|
|
11
|
+
"@opengeoweb/shared": "12.9.1",
|
|
12
12
|
"react-redux": "^9.2.0",
|
|
13
|
-
"@opengeoweb/store": "12.
|
|
14
|
-
"@opengeoweb/timeslider": "12.
|
|
13
|
+
"@opengeoweb/store": "12.9.1",
|
|
14
|
+
"@opengeoweb/timeslider": "12.9.1",
|
|
15
15
|
"@reduxjs/toolkit": "^2.6.1",
|
|
16
|
-
"@opengeoweb/webmap-react": "12.
|
|
17
|
-
"@opengeoweb/webmap": "12.
|
|
18
|
-
"@opengeoweb/theme": "12.
|
|
16
|
+
"@opengeoweb/webmap-react": "12.9.1",
|
|
17
|
+
"@opengeoweb/webmap": "12.9.1",
|
|
18
|
+
"@opengeoweb/theme": "12.9.1",
|
|
19
19
|
"axios": "^1.7.7",
|
|
20
|
-
"@opengeoweb/layer-select": "12.
|
|
20
|
+
"@opengeoweb/layer-select": "12.9.1",
|
|
21
21
|
"lodash": "^4.17.21",
|
|
22
22
|
"ol": "^10.4.0",
|
|
23
23
|
"react-sortablejs": "^6.1.4",
|
|
24
24
|
"sortablejs": "^1.15.1",
|
|
25
25
|
"@mui/system": "^7.0.1",
|
|
26
|
-
"@opengeoweb/snackbar": "12.
|
|
26
|
+
"@opengeoweb/snackbar": "12.9.1",
|
|
27
27
|
"react-router-dom": "^6.21.0",
|
|
28
28
|
"react-draggable": "^4.4.6",
|
|
29
29
|
"i18next": "^25.0.1",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"@mui/material": "^7.0.1",
|
|
33
33
|
"@sentry/react": "^8.34.0",
|
|
34
34
|
"@tanstack/react-query": "^5.69.2",
|
|
35
|
-
"@opengeoweb/api": "12.
|
|
35
|
+
"@opengeoweb/api": "12.9.1",
|
|
36
|
+
"@types/geojson": "^7946.0.14"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"react": "18",
|
|
@@ -42,5 +43,5 @@
|
|
|
42
43
|
"module": "./index.esm.js",
|
|
43
44
|
"type": "module",
|
|
44
45
|
"main": "./index.esm.js",
|
|
45
|
-
"types": "./index.
|
|
46
|
+
"types": "./index.d.ts"
|
|
46
47
|
}
|
|
@@ -142,7 +142,7 @@ export declare const layerManagerStyle: {
|
|
|
142
142
|
'.activateLayer-btn, .enable-btn, .column-2, .column-3, .column-4, .column-5, .column-6, .column-7, .column-acceptanceTime, .column-loadDuration': {
|
|
143
143
|
display: string;
|
|
144
144
|
};
|
|
145
|
-
'.addLayer-column, .setProjection-column': {
|
|
145
|
+
'.addLayer-column, .setProjection-column, .overlayers-column': {
|
|
146
146
|
display: string;
|
|
147
147
|
};
|
|
148
148
|
'.descriptionRow': {
|
package/src/lib/components/LayerManager/OverlayersRow/OverlayersSelectConnect.integration.spec.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { MapDrawDrawFunctionArgs } from '@opengeoweb/webmap-react';
|
|
2
1
|
import { GeoJsonProperties } from 'geojson';
|
|
3
2
|
import { LocationDetail } from './types';
|
|
4
|
-
export declare const myLocationDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
|
|
5
|
-
export declare const selectedLocationDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
|
|
6
3
|
export declare const geometryStyling: GeoJsonProperties;
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const useDrawOnMap: (mapId: string, drawFunction: (args: MapDrawDrawFunctionArgs) => void) => [(location?: LocationDetail) => void];
|
|
4
|
+
export declare const useDrawOnMap: (mapId: string) => [(location?: LocationDetail) => void];
|
|
@@ -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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").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("@opengeoweb/webmap").LayerType;
|
|
166
166
|
enabled: boolean;
|
|
167
167
|
}[];
|
|
168
168
|
proj: {
|
|
File without changes
|