@opengeoweb/webmap-react 15.3.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +1140 -352
- package/package.json +5 -5
- package/src/index.d.ts +0 -11
- package/src/lib/components/Clock/Clock.d.ts +0 -20
- package/src/lib/components/Clock/Clock.spec.d.ts +0 -1
- package/src/lib/components/Clock/Clock.stories.d.ts +0 -9
- package/src/lib/components/Clock/ClockContainer.d.ts +0 -13
- package/src/lib/components/Clock/clockContainerUtils.d.ts +0 -1
- package/src/lib/components/Clock/clockContainerUtils.spec.d.ts +0 -1
- package/src/lib/components/Clock/index.d.ts +0 -1
- package/src/lib/components/HoldShiftToZoomMessage/HoldShiftToZoomMessage.d.ts +0 -2
- package/src/lib/components/HoldShiftToZoomMessage/HoldShiftToZoomMessage.spec.d.ts +0 -1
- package/src/lib/components/LayerInfo/LayerInfoButton.d.ts +0 -8
- package/src/lib/components/LayerInfo/LayerInfoButton.spec.d.ts +0 -1
- package/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +0 -16
- package/src/lib/components/LayerInfo/LayerInfoDialog.spec.d.ts +0 -1
- package/src/lib/components/LayerInfo/LayerInfoDialog.stories.d.ts +0 -10
- package/src/lib/components/LayerInfo/LayerInfoLegend.d.ts +0 -8
- package/src/lib/components/LayerInfo/LayerInfoLegend.spec.d.ts +0 -1
- package/src/lib/components/LayerInfo/LayerInfoList.d.ts +0 -10
- package/src/lib/components/LayerInfo/LayerInfoText.d.ts +0 -16
- package/src/lib/components/LayerInfo/LayerInfoUtils.d.ts +0 -9
- package/src/lib/components/LayerInfo/LayerInfoUtils.spec.d.ts +0 -1
- package/src/lib/components/LayerInfo/index.d.ts +0 -6
- package/src/lib/components/Legend/Legend.d.ts +0 -7
- package/src/lib/components/Legend/Legend.spec.d.ts +0 -1
- package/src/lib/components/Legend/Legend.stories.d.ts +0 -10
- package/src/lib/components/Legend/LegendButton.d.ts +0 -5
- package/src/lib/components/Legend/LegendButton.spec.d.ts +0 -1
- package/src/lib/components/Legend/LegendDialog.d.ts +0 -15
- package/src/lib/components/Legend/LegendDialog.spec.d.ts +0 -1
- package/src/lib/components/Legend/LegendLayout.d.ts +0 -12
- package/src/lib/components/Legend/LegendLayout.spec.d.ts +0 -1
- package/src/lib/components/Legend/index.d.ts +0 -4
- package/src/lib/components/MapControls/MapControlButton.d.ts +0 -10
- package/src/lib/components/MapControls/MapControlButton.spec.d.ts +0 -1
- package/src/lib/components/MapControls/MapControls.d.ts +0 -7
- package/src/lib/components/MapControls/MapControls.spec.d.ts +0 -1
- package/src/lib/components/MapControls/ZoomControls.d.ts +0 -8
- package/src/lib/components/MapControls/ZoomControls.spec.d.ts +0 -1
- package/src/lib/components/MapControls/index.d.ts +0 -3
- package/src/lib/components/MapDimensionSelect/DimensionSelectButton.d.ts +0 -8
- package/src/lib/components/MapDimensionSelect/DimensionSelectButton.spec.d.ts +0 -1
- package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.d.ts +0 -14
- package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.stories.d.ts +0 -13
- package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.d.ts +0 -14
- package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.spec.d.ts +0 -1
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.d.ts +0 -12
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.spec.d.ts +0 -1
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.stories.d.ts +0 -10
- package/src/lib/components/MapDimensionSelect/index.d.ts +0 -6
- package/src/lib/components/MapDimensionSelect/utils.d.ts +0 -18
- package/src/lib/components/MapDimensionSelect/utils.spec.d.ts +0 -1
- package/src/lib/components/MapMeasure/MapMeasure.d.ts +0 -5
- package/src/lib/components/MapMeasure/MapMeasure.spec.d.ts +0 -1
- package/src/lib/components/MapMeasure/index.d.ts +0 -1
- package/src/lib/components/MapMousePosition/MapMousePosition.d.ts +0 -2
- package/src/lib/components/MapMousePosition/MapMousePosition.spec.d.ts +0 -1
- package/src/lib/components/MapMousePosition/index.d.ts +0 -1
- package/src/lib/components/MapTime/MapTime.d.ts +0 -11
- package/src/lib/components/MapTime/MapTime.spec.d.ts +0 -1
- package/src/lib/components/MapTime/index.d.ts +0 -1
- package/src/lib/components/MapWarning/MapWarningProperties.d.ts +0 -22
- package/src/lib/components/MapWarning/MapWarningProperties.spec.d.ts +0 -1
- package/src/lib/components/MapWarning/index.d.ts +0 -1
- package/src/lib/components/OpenLayers/OlColors.d.ts +0 -5
- package/src/lib/components/OpenLayers/OlStyles.d.ts +0 -50
- package/src/lib/components/OpenLayers/OlStyles.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/OpenLayers.BaseLayer.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayers.ClickFeatureLayer.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayers.ClickOnMapTool.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayers.FeatureLayer.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayers.FeatureLayerOpacity.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayers.GeoTIFFLayer.stories.d.ts +0 -17
- package/src/lib/components/OpenLayers/OpenLayers.GetFeatureInfo.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayers.HoverFeatureLayer.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayers.Prefetch.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayers.TimeAwareWMTSLayer.stories.d.ts +0 -10
- package/src/lib/components/OpenLayers/OpenLayersConstants.d.ts +0 -2
- package/src/lib/components/OpenLayers/OpenLayersMapView.Error.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.MapPin.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.Measure.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.NoTimeDim.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.Passive.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.RadarAnimation.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.RadarData.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.ReferenceTimeModes.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.SetProjectionBBox.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.SetProjectionBBoxLocalState.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.ShiftToZoom.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.ShowLayerInfo.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/OpenLayersMapView.TiledBaseLayers.stories.d.ts +0 -17
- package/src/lib/components/OpenLayers/OpenLayersMapView.VFXData.stories.d.ts +0 -6
- package/src/lib/components/OpenLayers/component/OpenLayersMapView.d.ts +0 -13
- package/src/lib/components/OpenLayers/component/OpenLayersMapView.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/context/MapContext.d.ts +0 -6
- package/src/lib/components/OpenLayers/context/TimeContext.d.ts +0 -6
- package/src/lib/components/OpenLayers/controls/OpenLayersGetFeatureInfo.d.ts +0 -8
- package/src/lib/components/OpenLayers/controls/OpenLayersZoomControl.d.ts +0 -6
- package/src/lib/components/OpenLayers/controls/OpenLayersZoomControl.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/controls/index.d.ts +0 -2
- package/src/lib/components/OpenLayers/draw/OpenLayersMapDraw.d.ts +0 -29
- package/src/lib/components/OpenLayers/draw/OpenLayersMapDraw.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/draw/OpenLayersMapDraw.stories.d.ts +0 -8
- package/src/lib/components/OpenLayers/draw/geojsonShapes.d.ts +0 -19
- package/src/lib/components/OpenLayers/draw/index.d.ts +0 -11
- package/src/lib/components/OpenLayers/draw/mapDrawUtils.d.ts +0 -10
- package/src/lib/components/OpenLayers/draw/storyComponents/EditModeButton.d.ts +0 -7
- package/src/lib/components/OpenLayers/draw/storyComponents/FeatureLayers.d.ts +0 -8
- package/src/lib/components/OpenLayers/draw/storyComponents/GeoJSONTextField.d.ts +0 -11
- package/src/lib/components/OpenLayers/draw/storyComponents/IntersectionSelect.d.ts +0 -12
- package/src/lib/components/OpenLayers/draw/storyComponents/SelectField.d.ts +0 -9
- package/src/lib/components/OpenLayers/draw/storyComponents/StoryLayout.d.ts +0 -9
- package/src/lib/components/OpenLayers/draw/storyComponents/StoryLayoutGrid.d.ts +0 -4
- package/src/lib/components/OpenLayers/draw/storyComponents/ToolButton.d.ts +0 -9
- package/src/lib/components/OpenLayers/draw/storyComponents/geojsonExamples.d.ts +0 -12
- package/src/lib/components/OpenLayers/draw/storyComponents/index.d.ts +0 -8
- package/src/lib/components/OpenLayers/draw/storyComponents/storyUtils.d.ts +0 -48
- package/src/lib/components/OpenLayers/draw/storyExamplesMapDrawTool.d.ts +0 -9
- package/src/lib/components/OpenLayers/draw/storyExamplesMapDrawToolIntersection.d.ts +0 -9
- package/src/lib/components/OpenLayers/draw/storyExamplesMapDrawToolMultipleDrawTools.d.ts +0 -12
- package/src/lib/components/OpenLayers/draw/types.d.ts +0 -42
- package/src/lib/components/OpenLayers/draw/useMapDrawTool.d.ts +0 -60
- package/src/lib/components/OpenLayers/draw/utils.d.ts +0 -69
- package/src/lib/components/OpenLayers/draw/utils.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/index.d.ts +0 -14
- package/src/lib/components/OpenLayers/layers/DefaultBaseLayers.d.ts +0 -9
- package/src/lib/components/OpenLayers/layers/FeatureLayer.d.ts +0 -15
- package/src/lib/components/OpenLayers/layers/GeoTIFFLayer.d.ts +0 -11
- package/src/lib/components/OpenLayers/layers/OpenLayersFeatureLayer.d.ts +0 -15
- package/src/lib/components/OpenLayers/layers/OpenLayersFeatureLayer.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/layers/OpenLayersLayer.d.ts +0 -20
- package/src/lib/components/OpenLayers/layers/OpenLayersLayer.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/layers/TiledWMSLayer.d.ts +0 -10
- package/src/lib/components/OpenLayers/layers/TimeAwareEDRLocationLayer.d.ts +0 -14
- package/src/lib/components/OpenLayers/layers/TimeAwareEDRLocationLayer.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/layers/TimeAwareGeoTIFFLayer.d.ts +0 -15
- package/src/lib/components/OpenLayers/layers/TimeAwareWMTSLayer.d.ts +0 -17
- package/src/lib/components/OpenLayers/layers/TimeAwareWMTSLayer.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/layers/TimeawareGeoTIFFLayer.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/layers/TimeawareImageSourceWMSLayer.d.ts +0 -18
- package/src/lib/components/OpenLayers/layers/TimeawareImageSourceWMSLayer.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/layers/WMSLayer.d.ts +0 -10
- package/src/lib/components/OpenLayers/layers/WMTSLayer.d.ts +0 -10
- package/src/lib/components/OpenLayers/layers/XYZLayer.d.ts +0 -9
- package/src/lib/components/OpenLayers/layers/index.d.ts +0 -11
- package/src/lib/components/OpenLayers/layers/utils.d.ts +0 -2
- package/src/lib/components/OpenLayers/layers/utils.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/storyComponents/OlStoryLayout.d.ts +0 -10
- package/src/lib/components/OpenLayers/storyComponents/index.d.ts +0 -1
- package/src/lib/components/OpenLayers/styles/useIconStyle.d.ts +0 -25
- package/src/lib/components/OpenLayers/tools/ClickOnMapTool.d.ts +0 -9
- package/src/lib/components/OpenLayers/tools/index.d.ts +0 -1
- package/src/lib/components/OpenLayers/types/Timespan.d.ts +0 -11
- package/src/lib/components/OpenLayers/types/WorkerQueue.d.ts +0 -6
- package/src/lib/components/OpenLayers/useProjectionDropDown.d.ts +0 -17
- package/src/lib/components/OpenLayers/utils/ShowTimeAwareLayerInfo.d.ts +0 -10
- package/src/lib/components/OpenLayers/utils/ShowTimeAwareLayerInfo.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/utils/TimeAwareImageWrapper.d.ts +0 -44
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.d.ts +0 -69
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/utils/WorkerQueue.d.ts +0 -14
- package/src/lib/components/OpenLayers/utils/constants.d.ts +0 -8
- package/src/lib/components/OpenLayers/utils/makeDimValuesToPrefetch.d.ts +0 -26
- package/src/lib/components/OpenLayers/utils/makeDimValuesToPrefetch.spec.d.ts +0 -1
- package/src/lib/components/OpenLayers/utils/projections.d.ts +0 -16
- package/src/lib/components/OpenLayers/utils/setMapCenter.d.ts +0 -2
- package/src/lib/components/OpenLayers/utils/types.d.ts +0 -15
- package/src/lib/components/OpenLayers/utils/viewUtils.d.ts +0 -11
- package/src/lib/components/Providers/Providers.d.ts +0 -2
- package/src/lib/components/Providers/index.d.ts +0 -1
- package/src/lib/components/TanStackDemo/TanStackDemo.GetCapabilitiesLiveUpdate.stories.d.ts +0 -9
- package/src/lib/components/TanStackDemo/storyUtils.d.ts +0 -6
- package/src/lib/components/WMSViewerDemo/components/WMSDimTimeYearSelector.d.ts +0 -18
- package/src/lib/components/WMSViewerDemo/components/WMSLayerSelector.d.ts +0 -9
- package/src/lib/components/WMSViewerDemo/components/WMSStyleSelector.d.ts +0 -8
- package/src/lib/components/WMSViewerDemo/components/WMSTimeSlider.d.ts +0 -8
- package/src/lib/components/index.d.ts +0 -9
- package/src/lib/edr-layer-api/api.d.ts +0 -7
- package/src/lib/edr-layer-api/colormaps/colormaps.d.ts +0 -9
- package/src/lib/edr-layer-api/colormaps/edrOlLegendUtils.d.ts +0 -32
- package/src/lib/edr-layer-api/colormaps/edrOlLegendUtils.spec.d.ts +0 -1
- package/src/lib/edr-layer-api/colormaps/index.d.ts +0 -2
- package/src/lib/edr-layer-api/fakeApi.d.ts +0 -1
- package/src/lib/edr-layer-api/hooks.d.ts +0 -14
- package/src/lib/edr-layer-api/hooks.spec.d.ts +0 -1
- package/src/lib/edr-layer-api/index.d.ts +0 -4
- package/src/lib/edr-layer-api/utils/coverageCollectionToFeatureCollection.d.ts +0 -2
- package/src/lib/edr-layer-api/utils/coverageCollectionToFeatureCollection.spec.d.ts +0 -1
- package/src/lib/edr-layer-api/utils/useEDRWMLayer.d.ts +0 -11
- package/src/lib/edr-layer-api/utils/useEDRWMLayer.spec.d.ts +0 -1
- package/src/lib/geotiff-layer-api/api.d.ts +0 -43
- package/src/lib/geotiff-layer-api/fakeApi.d.ts +0 -1
- package/src/lib/geotiff-layer-api/hooks.d.ts +0 -5
- package/src/lib/geotiff-layer-api/index.d.ts +0 -2
- package/src/lib/geotiff-layer-api/utils/useGetStacGeoTIFFLayerInstance .d.ts +0 -11
- package/src/lib/hooks/index.d.ts +0 -4
- package/src/lib/hooks/useAnimationForLayer.d.ts +0 -9
- package/src/lib/hooks/useAnimationForLayer.spec.d.ts +0 -1
- package/src/lib/hooks/useHooksGetCapabilities.d.ts +0 -63
- package/src/lib/hooks/useHooksGetCapabilities.spec.d.ts +0 -1
- package/src/lib/hooks/useSetInterValWhenVisible.d.ts +0 -1
- package/src/lib/hooks/useViewFromLayer.d.ts +0 -7
- package/src/lib/hooks/useViewFromLayer.spec.d.ts +0 -1
- package/src/lib/index.d.ts +0 -8
- package/src/lib/layers/defaultLayers.d.ts +0 -15
- package/src/lib/layers/defaultStorybookSettings.d.ts +0 -9
- package/src/lib/layers/index.d.ts +0 -3
- package/src/lib/layers/profileLayers.d.ts +0 -19
- package/src/lib/layers/publicLayers.d.ts +0 -310
- package/src/lib/layers/publicServices.d.ts +0 -90
- package/src/lib/types/index.d.ts +0 -1
- package/src/lib/types/types.d.ts +0 -64
- package/src/lib/utils/i18n.d.ts +0 -8
- package/src/lib/utils/index.d.ts +0 -1
- package/src/lib/utils/utils.d.ts +0 -4
- package/src/lib/utils/utils.spec.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -9,16 +9,16 @@ import { fromResolutionLike } from 'ol/resolution';
|
|
|
9
9
|
import ImageSource, { getRequestExtent } from 'ol/source/Image';
|
|
10
10
|
import ImageWrapper, { load } from 'ol/Image';
|
|
11
11
|
import { getImageSrc, getRequestParams, createLoader } from 'ol/source/wms';
|
|
12
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
13
12
|
import { CustomTooltip, CanvasComponent, useWheelStopPropagation, ToolContainerDraggable, CustomIconButton, dateUtils, useMakeSureContainerStaysInsideWindow, Draggable, Resizable } from '@opengeoweb/shared';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { Point, MultiPoint, LineString, Polygon } from 'ol/geom';
|
|
17
|
-
import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
|
|
18
|
-
import { arrowUpPath, Home, Add, Minus, List, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath, rotatePath, Location, DrawToolSmoothLine, DrawToolFreehand, DrawToolOval, DrawToolCircle, DrawToolSquare, Delete, DrawToolLineString, DrawToolRectangle, DrawToolPolygon, DrawToolPoint, DrawFIRLand, ArrowUp, darkTheme, ChevronRight, Clock as Clock$1, Resize } from '@opengeoweb/theme';
|
|
19
|
-
import { http, HttpResponse } from 'msw';
|
|
13
|
+
import { useTheme, Card, Box, Typography, Grid, styled, Slider, FormGroup, FormControlLabel, Checkbox, TextField, FormControl, InputLabel, Select, MenuItem, Icon as Icon$2, FormLabel, Switch, Paper, ThemeProvider } from '@mui/material';
|
|
14
|
+
import { Visibility, VisibilityOff, arrowUpPath, Home, Add, Minus, List, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath, rotatePath, Location, DrawToolSmoothLine, DrawToolFreehand, DrawToolOval, DrawToolCircle, DrawToolSquare, Delete, DrawToolLineString, DrawToolRectangle, DrawToolPolygon, DrawToolPoint, DrawFIRLand, ArrowUp, darkTheme, ChevronRight, Options, Clock as Clock$1 } from '@opengeoweb/theme';
|
|
20
15
|
import 'i18next';
|
|
21
16
|
import { useTranslation } from 'react-i18next';
|
|
17
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
18
|
+
import { useQuery, queryOptions } from '@tanstack/react-query';
|
|
19
|
+
import { Point, MultiPoint, Polygon, LineString } from 'ol/geom';
|
|
20
|
+
import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
|
|
21
|
+
import { http, HttpResponse } from 'msw';
|
|
22
22
|
import Box$1 from '@mui/material/Box';
|
|
23
23
|
import Typography$1 from '@mui/material/Typography';
|
|
24
24
|
import { View, Map, Feature, Collection, Overlay } from 'ol';
|
|
@@ -30,7 +30,7 @@ import EventType from 'ol/pointer/EventType';
|
|
|
30
30
|
import { toLonLat, fromLonLat, transform } from 'ol/proj';
|
|
31
31
|
import { register } from 'ol/proj/proj4';
|
|
32
32
|
import proj4 from 'proj4';
|
|
33
|
-
import { feature, simplify, booleanPointInPolygon, intersect, cleanCoords, polygonToLine, booleanClockwise, rewind,
|
|
33
|
+
import { bbox, feature, simplify, booleanPointInPolygon, intersect, cleanCoords, polygonToLine, booleanClockwise, rewind, toWgs84, toMercator, coordEach } from '@turf/turf';
|
|
34
34
|
import { produce } from 'immer';
|
|
35
35
|
import ImageLayer from 'ol/layer/Image';
|
|
36
36
|
import WMTSCapabilities from 'ol/format/WMTSCapabilities';
|
|
@@ -103,7 +103,11 @@ var en = {
|
|
|
103
103
|
"webmap-react-legend-no-image": "No legend graphic available",
|
|
104
104
|
"webmap-react-map-measure-help-tooltip": "Click to measure",
|
|
105
105
|
"clock-show": "Show clock",
|
|
106
|
-
"clock-hide": "Hide clock"
|
|
106
|
+
"clock-hide": "Hide clock",
|
|
107
|
+
"clock-animation-options": "Animation options",
|
|
108
|
+
"webmap-react-show-layer-legend": "Show layer legend",
|
|
109
|
+
"webmap-react-show-layer": "Show layer in legend",
|
|
110
|
+
"webmap-react-hide-layer": "Hide layer in legend"
|
|
107
111
|
};
|
|
108
112
|
var fi = {
|
|
109
113
|
"webmap-react-event": "tapahtuma:",
|
|
@@ -152,7 +156,11 @@ var fi = {
|
|
|
152
156
|
"webmap-react-linestring": "Viivajono",
|
|
153
157
|
"webmap-react-delete": "Poista",
|
|
154
158
|
"clock-show": "Näytä kello",
|
|
155
|
-
"clock-hide": "Piilota kello"
|
|
159
|
+
"clock-hide": "Piilota kello",
|
|
160
|
+
"clock-animation-options": "Animoinnin asetukset",
|
|
161
|
+
"webmap-react-show-layer-legend": "Näytä karttatason selite",
|
|
162
|
+
"webmap-react-show-layer": "Näytä karttataso selitteessä",
|
|
163
|
+
"webmap-react-hide-layer": "Piilota karttataso selitteestä"
|
|
156
164
|
};
|
|
157
165
|
var no = {
|
|
158
166
|
"webmap-react-event": "hendelse:",
|
|
@@ -201,7 +209,11 @@ var no = {
|
|
|
201
209
|
"webmap-react-linestring": "Linje",
|
|
202
210
|
"webmap-react-delete": "Fjerne",
|
|
203
211
|
"clock-show": "Vis klokke",
|
|
204
|
-
"clock-hide": "Skjul klokke"
|
|
212
|
+
"clock-hide": "Skjul klokke",
|
|
213
|
+
"clock-animation-options": "Animasjonsinnstillinger",
|
|
214
|
+
"webmap-react-show-layer-legend": "Vis",
|
|
215
|
+
"webmap-react-show-layer": "Vis laget i tegnforklaringen",
|
|
216
|
+
"webmap-react-hide-layer": "Skjul laget i tegnforklaringen"
|
|
205
217
|
};
|
|
206
218
|
var nl = {
|
|
207
219
|
"webmap-react-event": "event:",
|
|
@@ -258,7 +270,11 @@ var nl = {
|
|
|
258
270
|
"webmap-react-legend-no-image": "Geen legenda beschikbaar",
|
|
259
271
|
"webmap-react-map-measure-help-tooltip": "Klik om te meten",
|
|
260
272
|
"clock-show": "Klok tonen",
|
|
261
|
-
"clock-hide": "Klok verbergen"
|
|
273
|
+
"clock-hide": "Klok verbergen",
|
|
274
|
+
"clock-animation-options": "Animatie opties",
|
|
275
|
+
"webmap-react-show-layer-legend": "Toon laag in legenda",
|
|
276
|
+
"webmap-react-show-layer": "Toon laag in legenda",
|
|
277
|
+
"webmap-react-hide-layer": "Verberg laag in legenda"
|
|
262
278
|
};
|
|
263
279
|
var webmapReactTranslations = {
|
|
264
280
|
en: en,
|
|
@@ -284,6 +300,7 @@ var webmapReactTranslations = {
|
|
|
284
300
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
285
301
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
286
302
|
* */
|
|
303
|
+
|
|
287
304
|
var TimeContext = /*#__PURE__*/createContext({});
|
|
288
305
|
|
|
289
306
|
function _OverloadYield(e, d) {
|
|
@@ -811,12 +828,14 @@ function _regeneratorRuntime() {
|
|
|
811
828
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
812
829
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
813
830
|
* */
|
|
831
|
+
|
|
814
832
|
var MAX_NUMBER_TO_PREFETCH = 200;
|
|
815
833
|
var MAX_NUMBER_STEPS_IN_TIME_SLIDER_TO_PREFETCH = 10000;
|
|
816
834
|
var NUMBER_PREFETCH_WORKERS = 4;
|
|
817
835
|
var NUM_IMAGES_TO_CACHE = 10000;
|
|
818
836
|
var WMS_EXTENT_RATIO_TO_VIEWPORT = 1.2;
|
|
819
837
|
var TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = 'Image did not load succesfully';
|
|
838
|
+
|
|
820
839
|
// // To debug what dimensions are actually being used in the map, use:
|
|
821
840
|
// export const ADD_SHOW_DIMS_OPTION = true;
|
|
822
841
|
// export const WMS_EXTENT_RATIO_TO_VIEWPORT = 1.0;
|
|
@@ -851,6 +870,7 @@ var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsT
|
|
|
851
870
|
var pastPrefetchValues = timePrefetchValuesArray.filter(function (timeStepAsTime) {
|
|
852
871
|
return timeStepAsTime < currentTimeOfLayer;
|
|
853
872
|
});
|
|
873
|
+
|
|
854
874
|
// eslint-disable-next-line @typescript-eslint/require-array-sort-compare
|
|
855
875
|
futurePrefetchValues.sort();
|
|
856
876
|
isAnimating ?
|
|
@@ -867,6 +887,7 @@ var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsT
|
|
|
867
887
|
}
|
|
868
888
|
return [];
|
|
869
889
|
};
|
|
890
|
+
|
|
870
891
|
/**
|
|
871
892
|
* We use the WMLayer dimension logic to obtain the dimension value to use in the WMS GetMap request. The input is the dimensions array which is typically the properties set for the layer component.
|
|
872
893
|
* The input time is descretized to the closest value which is available in the WMS layer.
|
|
@@ -882,6 +903,7 @@ var getDimensionParamsForWMS = function getDimensionParamsForWMS(dimensions, wmL
|
|
|
882
903
|
}
|
|
883
904
|
var dimProps = {};
|
|
884
905
|
var wmLayerDims = wmLayer.getDimensions();
|
|
906
|
+
|
|
885
907
|
// Loop without forEach so we can exit and return.
|
|
886
908
|
var _iterator = _createForOfIteratorHelper(wmLayerDims),
|
|
887
909
|
_step;
|
|
@@ -920,6 +942,7 @@ var getDimensionParamsForWMS = function getDimensionParamsForWMS(dimensions, wmL
|
|
|
920
942
|
}
|
|
921
943
|
return dimProps;
|
|
922
944
|
};
|
|
945
|
+
|
|
923
946
|
/**
|
|
924
947
|
* Calculates number of timesteps for given timespan
|
|
925
948
|
* @param timespan Object of Timespan, with start/stop/end in milliseconds
|
|
@@ -950,6 +973,7 @@ var timeSpanToTimeList = function timeSpanToTimeList(timespan) {
|
|
|
950
973
|
}
|
|
951
974
|
return [];
|
|
952
975
|
};
|
|
976
|
+
|
|
953
977
|
/**
|
|
954
978
|
* Calculates number of timesteps for given timespan
|
|
955
979
|
* @param timespan Object of Timespan, with start/stop/end in milliseconds
|
|
@@ -968,6 +992,9 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
968
992
|
var _this;
|
|
969
993
|
_classCallCheck(this, TimeAwareImageWrapper);
|
|
970
994
|
_this = _callSuper(this, TimeAwareImageWrapper, [extent, resolution, pixelRatio, ImageState.IDLE]);
|
|
995
|
+
_this._extentToLoad = void 0;
|
|
996
|
+
_this._resolutionToLoad = void 0;
|
|
997
|
+
_this._pixelRatioToLoad = void 0;
|
|
971
998
|
_this._paramsToLoad = {};
|
|
972
999
|
_this._dimPropsToLoad = {};
|
|
973
1000
|
_this._getMapUrl = null;
|
|
@@ -1008,6 +1035,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1008
1035
|
var resolution = resolutionToLoad;
|
|
1009
1036
|
var requestResolution = Array.isArray(resolution) ? resolution[0] : resolution || 1;
|
|
1010
1037
|
var newPixelRatio = pixelRatio;
|
|
1038
|
+
|
|
1011
1039
|
// Load 1.2^2 % larger WMS extents than the current view
|
|
1012
1040
|
var ratio = WMS_EXTENT_RATIO_TO_VIEWPORT;
|
|
1013
1041
|
var extent = extentToLoad;
|
|
@@ -1175,6 +1203,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1175
1203
|
var WorkerQueue = /*#__PURE__*/function () {
|
|
1176
1204
|
function WorkerQueue(concurrency) {
|
|
1177
1205
|
_classCallCheck(this, WorkerQueue);
|
|
1206
|
+
this.maxConcurrency = void 0;
|
|
1178
1207
|
this.tasksInProcess = [];
|
|
1179
1208
|
this.taskQueue = [];
|
|
1180
1209
|
this.disposed = false;
|
|
@@ -1245,6 +1274,7 @@ var WorkerQueue = /*#__PURE__*/function () {
|
|
|
1245
1274
|
|
|
1246
1275
|
var initImageWrapper = function initImageWrapper() {
|
|
1247
1276
|
var emptyButLoading = new TimeAwareImageWrapper([0, 0, 0, 0], 1, 1);
|
|
1277
|
+
|
|
1248
1278
|
// Set to loaded to indicate to ol that it can be displayed immediately
|
|
1249
1279
|
emptyButLoading.setState(ImageState.LOADED);
|
|
1250
1280
|
emptyButLoading.setImage(document.createElement('img'));
|
|
@@ -1263,6 +1293,29 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1263
1293
|
visible = _ref.visible;
|
|
1264
1294
|
_classCallCheck(this, TimeawareImageSource);
|
|
1265
1295
|
_this = _callSuper(this, TimeawareImageSource, [{}]);
|
|
1296
|
+
_this._wmsUrl = void 0;
|
|
1297
|
+
_this._extraWMSParams = void 0;
|
|
1298
|
+
_this._timeStampsToPrefetch = void 0;
|
|
1299
|
+
_this._prefetchWorkers = void 0;
|
|
1300
|
+
_this._lastRequestedExtent = void 0;
|
|
1301
|
+
_this._lastRequestedResolution = void 0;
|
|
1302
|
+
_this._lastRequestedPixelRatio = void 0;
|
|
1303
|
+
_this._lastRequestedProjection = void 0;
|
|
1304
|
+
_this._loadedExtent = void 0;
|
|
1305
|
+
_this._loadedResolution = void 0;
|
|
1306
|
+
_this._loadedPixelRatio = void 0;
|
|
1307
|
+
_this._loadedProjection = void 0;
|
|
1308
|
+
_this._previousPrefetchExtent = void 0;
|
|
1309
|
+
_this._dimProperties = void 0;
|
|
1310
|
+
_this._imWrapperEmptyButLoading = void 0;
|
|
1311
|
+
_this._imWrapperForOlSource = void 0;
|
|
1312
|
+
_this._imWrapperForAltImage = void 0;
|
|
1313
|
+
_this._styleName = void 0;
|
|
1314
|
+
_this._layerName = void 0;
|
|
1315
|
+
_this._imWrapperForPrefetch = void 0;
|
|
1316
|
+
_this.throttledPrefetch = void 0;
|
|
1317
|
+
_this.throttledImageLoad = void 0;
|
|
1318
|
+
_this._layerId = void 0;
|
|
1266
1319
|
_this._wmsUrl = wmsUrl;
|
|
1267
1320
|
_this._extraWMSParams = _objectSpread2({}, params);
|
|
1268
1321
|
_this._layerName = layerName;
|
|
@@ -1351,6 +1404,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1351
1404
|
value: function prefetch(extent, resolution, pixelRatio, projection) {
|
|
1352
1405
|
var _this3 = this;
|
|
1353
1406
|
var dimensionsToPrefetchUnFiltered = this._timeStampsToPrefetch;
|
|
1407
|
+
|
|
1354
1408
|
// Only work on imagery that still needs to be loaded.
|
|
1355
1409
|
var dimensionsToPrefetch = dimensionsToPrefetchUnFiltered.filter(function (dimValue) {
|
|
1356
1410
|
var hasExactImage = _this3._imWrapperForOlSource.hasImage(extent, resolution, pixelRatio, projection, _this3._wmsUrl, _this3._extraWMSParams, _this3._layerName, _this3._styleName, _objectSpread2(_objectSpread2({}, _this3._dimProperties), {}, {
|
|
@@ -1425,6 +1479,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1425
1479
|
this._lastRequestedPixelRatio = pixelRatio;
|
|
1426
1480
|
this._lastRequestedProjection = projection;
|
|
1427
1481
|
this.throttledImageLoad();
|
|
1482
|
+
|
|
1428
1483
|
// While we are loading, check if there is an alternative image available
|
|
1429
1484
|
var altImage = this._loadedExtent && this._imWrapperForOlSource.getAlternativeImage(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, requestDimProperties);
|
|
1430
1485
|
if (altImage && altImage.isLoaded) {
|
|
@@ -1432,6 +1487,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1432
1487
|
this._imWrapperForAltImage.setGeoReferencedImage(altImage);
|
|
1433
1488
|
return this._imWrapperForAltImage;
|
|
1434
1489
|
}
|
|
1490
|
+
|
|
1435
1491
|
// This thing is has nothing to show yet.
|
|
1436
1492
|
return this._imWrapperEmptyButLoading;
|
|
1437
1493
|
}
|
|
@@ -1444,6 +1500,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1444
1500
|
this._dimProperties = _objectSpread2({}, params);
|
|
1445
1501
|
this.changed();
|
|
1446
1502
|
}
|
|
1503
|
+
|
|
1447
1504
|
/**
|
|
1448
1505
|
* Check if an image is available and loaded for requested date. Used for showlayerinfo to proceed.
|
|
1449
1506
|
* @param isoTime
|
|
@@ -1515,6 +1572,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1515
1572
|
}
|
|
1516
1573
|
var dimPropWithRequestedDate = _objectSpread2({}, this._dimProperties);
|
|
1517
1574
|
dimPropWithRequestedDate['TIME'] = timeStampsToPrefetch;
|
|
1575
|
+
|
|
1518
1576
|
// While we are loading, check if there is an alternative image available
|
|
1519
1577
|
var altImage = this._loadedExtent && this._imWrapperForOlSource.getAlternativeImage(this._loadedExtent, this._loadedResolution, this._loadedPixelRatio, this._loadedProjection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimPropWithRequestedDate);
|
|
1520
1578
|
if (altImage && altImage.isLoaded) {
|
|
@@ -1549,26 +1607,111 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1549
1607
|
}]);
|
|
1550
1608
|
}(ImageSource);
|
|
1551
1609
|
|
|
1610
|
+
var WEBMAP_REACT_NAMESPACE = 'webmapreact';
|
|
1611
|
+
var useWebmapReactTranslation = function useWebmapReactTranslation() {
|
|
1612
|
+
var ns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : WEBMAP_REACT_NAMESPACE;
|
|
1613
|
+
return useTranslation(ns);
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1616
|
+
/* *
|
|
1617
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1618
|
+
* you may not use this file except in compliance with the License.
|
|
1619
|
+
* You may obtain a copy of the License at
|
|
1620
|
+
*
|
|
1621
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1622
|
+
*
|
|
1623
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1624
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1625
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1626
|
+
* See the License for the specific language governing permissions and
|
|
1627
|
+
* limitations under the License.
|
|
1628
|
+
*
|
|
1629
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
1630
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
1631
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
1632
|
+
* */
|
|
1633
|
+
|
|
1552
1634
|
var LegendLayout = function LegendLayout(_ref) {
|
|
1553
1635
|
var title = _ref.title,
|
|
1554
|
-
name = _ref.name,
|
|
1555
|
-
dimensions = _ref.dimensions,
|
|
1556
1636
|
children = _ref.children,
|
|
1557
1637
|
height = _ref.height,
|
|
1558
1638
|
width = _ref.width,
|
|
1559
|
-
|
|
1560
|
-
|
|
1639
|
+
_ref$showLayerLegend = _ref.showLayerLegend,
|
|
1640
|
+
showLayerLegend = _ref$showLayerLegend === void 0 ? true : _ref$showLayerLegend,
|
|
1641
|
+
toggleLayerLegendVisibility = _ref.toggleLayerLegendVisibility;
|
|
1642
|
+
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
1643
|
+
t = _useWebmapReactTransl.t;
|
|
1644
|
+
var theme = useTheme();
|
|
1645
|
+
return /*#__PURE__*/jsxs(Card, {
|
|
1561
1646
|
"data-testid": "legend",
|
|
1562
1647
|
sx: {
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
backgroundColor: '#FFF',
|
|
1648
|
+
border: 'none',
|
|
1649
|
+
// eslint-disable-next-line no-nested-ternary
|
|
1650
|
+
backgroundColor: toggleLayerLegendVisibility ? showLayerLegend ? 'geowebColors.cards.cardContainer' : 'geowebColors.cards.cardContainerDisabled' : '#FFF',
|
|
1566
1651
|
overflow: 'hidden',
|
|
1567
|
-
marginBottom: 0.5
|
|
1652
|
+
marginBottom: 0.5,
|
|
1653
|
+
boxShadow: 0,
|
|
1654
|
+
borderRadius: '3px',
|
|
1655
|
+
padding: toggleLayerLegendVisibility ? 'none' : '10px'
|
|
1568
1656
|
},
|
|
1569
|
-
children: [jsx(Box, {
|
|
1657
|
+
children: [toggleLayerLegendVisibility ? /*#__PURE__*/jsx(Box, {
|
|
1658
|
+
"data-testid": "legend-title",
|
|
1659
|
+
children: /*#__PURE__*/jsx(CustomTooltip, {
|
|
1660
|
+
title: showLayerLegend ? t('webmap-react-hide-layer') : t('webmap-react-show-layer'),
|
|
1661
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
1662
|
+
alignItems: "center",
|
|
1663
|
+
component: "button",
|
|
1664
|
+
display: "flex",
|
|
1665
|
+
gap: 1,
|
|
1666
|
+
onClick: function onClick(event) {
|
|
1667
|
+
event.stopPropagation();
|
|
1668
|
+
toggleLayerLegendVisibility(!showLayerLegend);
|
|
1669
|
+
},
|
|
1670
|
+
sx: {
|
|
1671
|
+
fontFamily: 'Roboto, Helvetica, Arial',
|
|
1672
|
+
fontSize: '12px',
|
|
1673
|
+
width: "".concat(width, "px"),
|
|
1674
|
+
minWidth: '100%',
|
|
1675
|
+
padding: '4px',
|
|
1676
|
+
margin: '0 0 1px',
|
|
1677
|
+
wordWrap: 'break-word',
|
|
1678
|
+
color: showLayerLegend ? 'geowebColors.typographyAndIcons.text' : 'geowebColors.typographyAndIcons.inactiveText',
|
|
1679
|
+
whiteSpace: 'nowrap',
|
|
1680
|
+
border: showLayerLegend ? 'none' : "1px solid ".concat(theme.palette.geowebColors.cards.cardContainerDisabledBorder),
|
|
1681
|
+
backgroundColor: showLayerLegend ? 'geowebColors.cards.cardContainer' : 'geowebColors.cards.cardContainerDisabled',
|
|
1682
|
+
textAlign: 'left',
|
|
1683
|
+
cursor: 'pointer',
|
|
1684
|
+
'&:hover': {
|
|
1685
|
+
backgroundColor: 'geowebColors.cards.cardContainerMouseOver',
|
|
1686
|
+
border: showLayerLegend ? 'none' : "1px solid ".concat(theme.palette.geowebColors.cards.cardContainerBorder)
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
variant: "subtitle2",
|
|
1690
|
+
children: [showLayerLegend ? /*#__PURE__*/jsx(Visibility, {
|
|
1691
|
+
fontSize: "medium",
|
|
1692
|
+
sx: {
|
|
1693
|
+
margin: 'auto 0px'
|
|
1694
|
+
}
|
|
1695
|
+
}) : /*#__PURE__*/jsx(VisibilityOff, {
|
|
1696
|
+
fontSize: "medium",
|
|
1697
|
+
sx: {
|
|
1698
|
+
margin: 'auto 0px'
|
|
1699
|
+
}
|
|
1700
|
+
}), /*#__PURE__*/jsx("span", {
|
|
1701
|
+
style: {
|
|
1702
|
+
overflow: 'hidden',
|
|
1703
|
+
textOverflow: 'ellipsis'
|
|
1704
|
+
},
|
|
1705
|
+
children: title
|
|
1706
|
+
})]
|
|
1707
|
+
})
|
|
1708
|
+
})
|
|
1709
|
+
}) : /*#__PURE__*/jsx(Box, {
|
|
1570
1710
|
"data-testid": "legend-title",
|
|
1571
|
-
|
|
1711
|
+
sx: {
|
|
1712
|
+
backgroundColor: '#FFF'
|
|
1713
|
+
},
|
|
1714
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1572
1715
|
sx: {
|
|
1573
1716
|
fontFamily: 'Roboto, Helvetica, Arial',
|
|
1574
1717
|
fontSize: '10px',
|
|
@@ -1580,41 +1723,19 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1580
1723
|
variant: "h3",
|
|
1581
1724
|
children: title
|
|
1582
1725
|
})
|
|
1583
|
-
}), jsx(CustomTooltip, {
|
|
1726
|
+
}), !!showLayerLegend && /*#__PURE__*/jsx(CustomTooltip, {
|
|
1584
1727
|
placement: "top",
|
|
1585
1728
|
title: title || 'loading',
|
|
1586
|
-
children: jsx(Box, {
|
|
1729
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
1587
1730
|
sx: {
|
|
1588
|
-
margin: '10px 0px 10px 0px',
|
|
1731
|
+
margin: toggleLayerLegendVisibility ? '2px 0 8px 12px' : '10px 0px 10px 0px',
|
|
1589
1732
|
height: "".concat(height, "px"),
|
|
1590
|
-
width: "".concat(width, "px")
|
|
1733
|
+
width: "".concat(width, "px"),
|
|
1734
|
+
minWidth: '100%',
|
|
1735
|
+
backgroundColor: '#FFF'
|
|
1591
1736
|
},
|
|
1592
1737
|
children: children
|
|
1593
1738
|
})
|
|
1594
|
-
}), jsx(Box, {
|
|
1595
|
-
"data-testid": "legend-info",
|
|
1596
|
-
sx: _objectSpread2({
|
|
1597
|
-
fontFamily: 'Roboto, Helvetica, Arial',
|
|
1598
|
-
fontSize: 10,
|
|
1599
|
-
color: 'common.black',
|
|
1600
|
-
overflowX: 'hidden',
|
|
1601
|
-
wordWrap: 'break-word',
|
|
1602
|
-
whiteSpace: 'nowrap'
|
|
1603
|
-
}, minWidth && {
|
|
1604
|
-
minWidth: "".concat(minWidth, "px")
|
|
1605
|
-
}),
|
|
1606
|
-
children: dimensions === null || dimensions === void 0 ? void 0 : dimensions.map(function (dim) {
|
|
1607
|
-
return jsx(Box, {
|
|
1608
|
-
children: dim.name === 'time' ? "".concat(dim.currentValue) : jsxs(Fragment, {
|
|
1609
|
-
children: [jsxs(Box, {
|
|
1610
|
-
style: {
|
|
1611
|
-
fontWeight: 500
|
|
1612
|
-
},
|
|
1613
|
-
children: [dim.name, ":"]
|
|
1614
|
-
}), dim.currentValue, " ", dim.units]
|
|
1615
|
-
})
|
|
1616
|
-
}, name + dim.name);
|
|
1617
|
-
})
|
|
1618
1739
|
})]
|
|
1619
1740
|
});
|
|
1620
1741
|
};
|
|
@@ -1636,6 +1757,7 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1636
1757
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
1637
1758
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
1638
1759
|
* */
|
|
1760
|
+
|
|
1639
1761
|
// This function is a copy of /libs/api/src/utils.ts which cannot be used here due to circular dependency
|
|
1640
1762
|
var handleResponse = /*#__PURE__*/function () {
|
|
1641
1763
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(response) {
|
|
@@ -1697,6 +1819,13 @@ var joinUrlParams = function joinUrlParams(params) {
|
|
|
1697
1819
|
return x !== undefined && x.length > 0;
|
|
1698
1820
|
}).join('/');
|
|
1699
1821
|
};
|
|
1822
|
+
|
|
1823
|
+
// This is a copy from libs/api/src/utils.ts due to circular dependency
|
|
1824
|
+
var withJsonFormat = function withJsonFormat(url) {
|
|
1825
|
+
var urlObj = new URL(url);
|
|
1826
|
+
urlObj.searchParams.set('f', 'json');
|
|
1827
|
+
return urlObj.toString();
|
|
1828
|
+
};
|
|
1700
1829
|
var fetchEDRCollectionDetails = /*#__PURE__*/function () {
|
|
1701
1830
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(edrBaseUrlWithCollection) {
|
|
1702
1831
|
var instanceId,
|
|
@@ -1705,7 +1834,7 @@ var fetchEDRCollectionDetails = /*#__PURE__*/function () {
|
|
|
1705
1834
|
while (1) switch (_context3.prev = _context3.next) {
|
|
1706
1835
|
case 0:
|
|
1707
1836
|
instanceId = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : '';
|
|
1708
|
-
return _context3.abrupt("return", fetch(joinUrlParams([edrBaseUrlWithCollection, instanceId])).then(handleResponse));
|
|
1837
|
+
return _context3.abrupt("return", fetch(withJsonFormat(joinUrlParams([edrBaseUrlWithCollection, instanceId]))).then(handleResponse));
|
|
1709
1838
|
case 2:
|
|
1710
1839
|
case "end":
|
|
1711
1840
|
return _context3.stop();
|
|
@@ -1834,6 +1963,7 @@ var fetchEDRParameter = /*#__PURE__*/function () {
|
|
|
1834
1963
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
1835
1964
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
1836
1965
|
* */
|
|
1966
|
+
|
|
1837
1967
|
var coverageCollectionToFeatureCollection = function coverageCollectionToFeatureCollection(cov, parameterNames) {
|
|
1838
1968
|
if (cov === undefined) {
|
|
1839
1969
|
return {
|
|
@@ -1841,6 +1971,7 @@ var coverageCollectionToFeatureCollection = function coverageCollectionToFeature
|
|
|
1841
1971
|
type: 'FeatureCollection'
|
|
1842
1972
|
};
|
|
1843
1973
|
}
|
|
1974
|
+
|
|
1844
1975
|
// For coverage collection
|
|
1845
1976
|
if (cov && _typeof(cov) === 'object' && 'coverages' in cov) {
|
|
1846
1977
|
var _cov$coverages$reduce, _cov$coverages;
|
|
@@ -1885,7 +2016,9 @@ var coverageCollectionToFeatureCollection = function coverageCollectionToFeature
|
|
|
1885
2016
|
};
|
|
1886
2017
|
return _featurePoint;
|
|
1887
2018
|
}
|
|
2019
|
+
|
|
1888
2020
|
// For Coverage
|
|
2021
|
+
|
|
1889
2022
|
var paramVals = {};
|
|
1890
2023
|
parameterNames.split(',').forEach(function (parameterName) {
|
|
1891
2024
|
var _cov$ranges$parameter;
|
|
@@ -1908,6 +2041,7 @@ var coverageCollectionToFeatureCollection = function coverageCollectionToFeature
|
|
|
1908
2041
|
};
|
|
1909
2042
|
|
|
1910
2043
|
var DEFAULT_STALE_TIME$1 = 60000; // One minute
|
|
2044
|
+
|
|
1911
2045
|
// Ensures every webmap-react query starts with the same query key
|
|
1912
2046
|
var generateWebmapQueryKeys = function generateWebmapQueryKeys(queryKeys) {
|
|
1913
2047
|
return ['webmap-react'].concat(queryKeys);
|
|
@@ -1995,6 +2129,7 @@ var useEDRGetParameterData = function useEDRGetParameterData(edrBaseUrlWithColle
|
|
|
1995
2129
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
1996
2130
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
1997
2131
|
* */
|
|
2132
|
+
|
|
1998
2133
|
var temperatureLegendColorsWoW = ['#2E2E73', '#282898', '#201FBB', '#1A1ADC', '#3654DE', '#548EDC', '#72CADE', '#6DD8DF', '#55CDE2', '#38BBDC', '#20B0DC', '#19BAA6', '#1CCE6A', '#1BDF22', '#82C319', '#DCA819', '#DD921A', '#DE7C1A', '#DF671A', '#DE501A', '#DD3819', '#DD2319', '#D21A1E', '#C31927', '#AD1A30', '#9A1A3B', '#871A44', '#871A44'];
|
|
1999
2134
|
var precipitationMMLegendColorsWoW = ['#BACDCB', '#A3C3C9', '#8BBCC8', '#6AAEC1', '#42A1C0', '#377EAF', '#46669C', '#56528D', '#86008D', '#610066'];
|
|
2000
2135
|
var temperatureLegendColorsCWK = ['#BFB1FF', '#8E7EE4', '#6450CC', '#422BB1', '#260E99', '#B1E4FF', '#7EC3E4', '#50A3CC', '#2B85B1', '#0E6B99', '#E4FFB1', '#C3E47E', '#A3CC50', '#85B12B', '#6B990E', '#FFD8B1', '#E4B17E', '#CC8E50', '#B16E2B', '#99540E', '#FFB1B1', '#E47E7E', '#CC5050', '#B12B2B', '#990E0E', '#BFB1FF', '#8E7EE4', '#6450CC', '#422BB1', '#260E99', '#B1E4FF', '#7EC3E4', '#50A3CC', '#2B85B1', '#0E6B99', '#E4FFB1', '#C3E47E', '#A3CC50', '#85B12B', '#6B990E', '#FFD8B1', '#E4B17E', '#CC8E50', '#B16E2B', '#99540E', '#FFB1B1', '#E47E7E', '#CC5050', '#B12B2B', '#990E0E', '#BFB1FF', '#8E7EE4', '#6450CC', '#422BB1', '#260E99', '#B1E4FF', '#7EC3E4', '#50A3CC', '#2B85B1', '#0E6B99', '#E4FFB1', '#C3E47E', '#A3CC50', '#85B12B', '#6B990E', '#FFD8B1', '#E4B17E', '#CC8E50', '#B16E2B', '#99540E', '#FFB1B1', '#E47E7E', '#CC5050', '#B12B2B', '#990E0E'];
|
|
@@ -2127,6 +2262,7 @@ var generateImageFromLegend = function generateImageFromLegend(edrColorLegend, c
|
|
|
2127
2262
|
var gap = 10; // gap between box and text
|
|
2128
2263
|
var rowSpacing = 2; // vertical spacing between rows
|
|
2129
2264
|
var font = '11px Arial';
|
|
2265
|
+
|
|
2130
2266
|
// Compute required canvas height
|
|
2131
2267
|
var legendCount = edrColorLegend.legend.length;
|
|
2132
2268
|
var requiredHeight = yStart + legendCount * (rowSpacing + boxSize);
|
|
@@ -2139,6 +2275,7 @@ var generateImageFromLegend = function generateImageFromLegend(edrColorLegend, c
|
|
|
2139
2275
|
ctx.textBaseline = 'middle';
|
|
2140
2276
|
// eslint-disable-next-line no-param-reassign
|
|
2141
2277
|
ctx.fillStyle = '#111';
|
|
2278
|
+
|
|
2142
2279
|
// sort the legend based on highest value first
|
|
2143
2280
|
var sortedLegend = _toConsumableArray(edrColorLegend.legend).sort(function (itemA, itemB) {
|
|
2144
2281
|
return itemB.max - itemA.max;
|
|
@@ -2149,12 +2286,14 @@ var generateImageFromLegend = function generateImageFromLegend(edrColorLegend, c
|
|
|
2149
2286
|
color = item.color;
|
|
2150
2287
|
var text = "".concat(formatNumber(min), " : ").concat(formatNumber(max));
|
|
2151
2288
|
var y = yStart + index * (rowSpacing + boxSize);
|
|
2289
|
+
|
|
2152
2290
|
// Draw colored box
|
|
2153
2291
|
// eslint-disable-next-line no-param-reassign
|
|
2154
2292
|
ctx.globalAlpha = opacity || 1;
|
|
2155
2293
|
// eslint-disable-next-line no-param-reassign
|
|
2156
2294
|
ctx.fillStyle = color;
|
|
2157
2295
|
ctx.fillRect(x, y, boxSize, boxSize);
|
|
2296
|
+
|
|
2158
2297
|
// Draw text
|
|
2159
2298
|
// eslint-disable-next-line no-param-reassign
|
|
2160
2299
|
ctx.globalAlpha = 1;
|
|
@@ -2242,6 +2381,7 @@ var makeFeatureStyleWind = function makeFeatureStyleWind(feature) {
|
|
|
2242
2381
|
lineWidth: 1
|
|
2243
2382
|
}
|
|
2244
2383
|
});
|
|
2384
|
+
|
|
2245
2385
|
// speed label
|
|
2246
2386
|
var speedStyle = new Style({
|
|
2247
2387
|
text: new Text({
|
|
@@ -2265,12 +2405,14 @@ var makeFeatureStyleMultiParam = function makeFeatureStyleMultiParam(feature) {
|
|
|
2265
2405
|
var _feature$getPropertie2 = feature.getProperties(),
|
|
2266
2406
|
values = _feature$getPropertie2.values;
|
|
2267
2407
|
var paramValues = Object.values(values);
|
|
2408
|
+
|
|
2268
2409
|
// Determine offset between columns (long strings need more space)
|
|
2269
2410
|
var maxLength = Math.max.apply(Math, _toConsumableArray(paramValues.map(function (el) {
|
|
2270
2411
|
return el ? el.toString().length : 1;
|
|
2271
2412
|
})));
|
|
2272
2413
|
var factor = maxLength > 5 ? 1.4 : 1;
|
|
2273
2414
|
var offsetValues = getOffsetValues(factor);
|
|
2415
|
+
|
|
2274
2416
|
// Don't allow showing more than 15 params
|
|
2275
2417
|
var params = paramValues.slice(0, 15);
|
|
2276
2418
|
return params.map(function (paramVal, index) {
|
|
@@ -2355,6 +2497,7 @@ var defaultLegend$1 = makeLegendFromColorMap({
|
|
|
2355
2497
|
min: -18,
|
|
2356
2498
|
max: 38
|
|
2357
2499
|
});
|
|
2500
|
+
|
|
2358
2501
|
/**
|
|
2359
2502
|
* Converts a stylename to openlayers style for features
|
|
2360
2503
|
* @param styleName Strings like temperatureLegendColorsWoW:0,20 will get the legend temperatureLegendColorsWoW with a range from 0,20. This makes it flexible to adjust the colorrange via the stylename.
|
|
@@ -2441,6 +2584,7 @@ var useCreateEDRWMLayer = function useCreateEDRWMLayer(serviceUrl, name, id, onL
|
|
|
2441
2584
|
});
|
|
2442
2585
|
webmapUtils.registerWMLayer(_wmLayer, layerId);
|
|
2443
2586
|
}
|
|
2587
|
+
|
|
2444
2588
|
// Set the name and parse the layer
|
|
2445
2589
|
var wmLayer = webmapUtils.getWMLayerById(layerId);
|
|
2446
2590
|
wmLayer.setName(name).then(function () {
|
|
@@ -10491,6 +10635,7 @@ var knmi_kdp_edr_collections_10_minute_in_situ_meteorological_observations_updat
|
|
|
10491
10635
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
10492
10636
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
10493
10637
|
* */
|
|
10638
|
+
|
|
10494
10639
|
var fakeEdrLayerApiHandlers = [http.get('https://gw-edr.pub.knmi.cloud/edr/collections/10-minute-in-situ-meteorological-observations', function () {
|
|
10495
10640
|
return HttpResponse.json(knmi_kdp_edr_collections_10_minute_in_situ_meteorological_observations);
|
|
10496
10641
|
}), http.get('https://gw-edr.pub.knmi.cloud/edr/collections/10-minute-in-situ-meteorological-observations-update', function () {
|
|
@@ -10527,14 +10672,9 @@ var fakeEdrLayerApiHandlers = [http.get('https://gw-edr.pub.knmi.cloud/edr/colle
|
|
|
10527
10672
|
});
|
|
10528
10673
|
})];
|
|
10529
10674
|
|
|
10530
|
-
var WEBMAP_REACT_NAMESPACE = 'webmapreact';
|
|
10531
|
-
var useWebmapReactTranslation = function useWebmapReactTranslation() {
|
|
10532
|
-
var ns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : WEBMAP_REACT_NAMESPACE;
|
|
10533
|
-
return useTranslation(ns);
|
|
10534
|
-
};
|
|
10535
|
-
|
|
10536
10675
|
var defaultCanvasWidth = 150;
|
|
10537
10676
|
var defaultCanvasHeight = 30;
|
|
10677
|
+
|
|
10538
10678
|
/**
|
|
10539
10679
|
* Renders a legendgraphic image based on a WMImage.
|
|
10540
10680
|
*
|
|
@@ -10559,21 +10699,25 @@ var renderLegendGraphic = function renderLegendGraphic(wmImage, ctx, width, heig
|
|
|
10559
10699
|
ctx.fillText('error :(', 10, 10);
|
|
10560
10700
|
} else {
|
|
10561
10701
|
/* All OK, just draw the legend image */
|
|
10702
|
+
|
|
10562
10703
|
ctx.drawImage(wmImage.getElement(), 0, 0, Math.min(wmImage.getElement().width, width), Math.min(wmImage.getElement().height, height));
|
|
10563
10704
|
}
|
|
10564
10705
|
}
|
|
10565
10706
|
};
|
|
10566
10707
|
var Legend = function Legend(_ref) {
|
|
10567
10708
|
var _layer$options;
|
|
10568
|
-
var layer = _ref.layer
|
|
10709
|
+
var layer = _ref.layer,
|
|
10710
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
10569
10711
|
/* Variable to remember the previous image */
|
|
10570
10712
|
var previousLegendImage = useRef(null);
|
|
10713
|
+
|
|
10571
10714
|
/* Function to force rerender of this component when legend image loads */
|
|
10572
10715
|
// eslint-disable-next-line react/hook-use-state
|
|
10573
10716
|
var _useState = useState(),
|
|
10574
10717
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10575
10718
|
setState = _useState2[1];
|
|
10576
10719
|
var layerId = layer === null || layer === void 0 ? void 0 : layer.id;
|
|
10720
|
+
|
|
10577
10721
|
/* The canvas listens to the size of its container. We will update it according to the image size. */
|
|
10578
10722
|
var _useState3 = useState(defaultCanvasWidth),
|
|
10579
10723
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -10589,6 +10733,7 @@ var Legend = function Legend(_ref) {
|
|
|
10589
10733
|
t = _useWebmapReactTransl.t;
|
|
10590
10734
|
var legendPrefix = t('webmap-react-legend');
|
|
10591
10735
|
var legendNoImageText = t('webmap-react-legend-no-image');
|
|
10736
|
+
|
|
10592
10737
|
/* Register callback to legendImagestore to trigger rerender when image is loaded. */
|
|
10593
10738
|
useEffect(function () {
|
|
10594
10739
|
legendImageStore.addImageEventCallback(function (image, id, imageEventType) {
|
|
@@ -10600,6 +10745,7 @@ var Legend = function Legend(_ref) {
|
|
|
10600
10745
|
legendImageStore.removeEventCallback("".concat(legendPrefix, "_").concat(layerId));
|
|
10601
10746
|
};
|
|
10602
10747
|
}, [layerId, legendPrefix]);
|
|
10748
|
+
|
|
10603
10749
|
/* Should not do anything if no layer is given */
|
|
10604
10750
|
if (!layer) {
|
|
10605
10751
|
return null;
|
|
@@ -10609,27 +10755,33 @@ var Legend = function Legend(_ref) {
|
|
|
10609
10755
|
return null;
|
|
10610
10756
|
}
|
|
10611
10757
|
var layerOpacity = layer.opacity ? layer.opacity : 1;
|
|
10612
|
-
|
|
10758
|
+
|
|
10759
|
+
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
10613
10760
|
like a title and the WMS legendgraphic url */
|
|
10614
10761
|
var wmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
10615
10762
|
var isEdrLayer = layer.layerType === LayerType.edrFeatureLayer;
|
|
10616
10763
|
var title = isEdrLayer ? (_layer$options = layer.options) === null || _layer$options === void 0 ? void 0 : _layer$options.collectionId : wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title;
|
|
10617
|
-
|
|
10618
|
-
|
|
10764
|
+
|
|
10765
|
+
/* Custom legend toggle for layer */
|
|
10766
|
+
var toggleLayerLegendVisibility = function toggleLayerLegendVisibility(showLegend) {
|
|
10767
|
+
return onToggleLayerLegendVisibility(layerId, showLegend);
|
|
10768
|
+
};
|
|
10769
|
+
return /*#__PURE__*/jsx(LegendLayout, {
|
|
10619
10770
|
height: canvasContainerHeight,
|
|
10620
|
-
|
|
10621
|
-
name: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.name,
|
|
10771
|
+
showLayerLegend: layer === null || layer === void 0 ? void 0 : layer.showLayerLegend,
|
|
10622
10772
|
title: title,
|
|
10773
|
+
toggleLayerLegendVisibility: toggleLayerLegendVisibility,
|
|
10623
10774
|
width: canvasContainerWidth,
|
|
10624
|
-
children: jsx(CanvasComponent, {
|
|
10775
|
+
children: /*#__PURE__*/jsx(CanvasComponent, {
|
|
10625
10776
|
onRenderCanvas: function onRenderCanvas(ctx, width, height) {
|
|
10626
|
-
/*
|
|
10777
|
+
/*
|
|
10627
10778
|
Check if the wmLayer is available, this happens when the WMS GetCapabilities is loaded and parsed.
|
|
10628
10779
|
Note that we cannot use the wmLayer variable above, as this one could contain a non initialized WMJSLayer.
|
|
10629
10780
|
*/
|
|
10630
10781
|
var legendWmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
10631
10782
|
var legendUrl = getLegendGraphicURLForLayer(legendWmLayer);
|
|
10632
10783
|
var image = legendImageStore.getImage(legendUrl);
|
|
10784
|
+
|
|
10633
10785
|
// for edr a legend is generated based on chosen style
|
|
10634
10786
|
if (layer.style && isEdrLayer) {
|
|
10635
10787
|
var style = layer.style,
|
|
@@ -10659,14 +10811,17 @@ var Legend = function Legend(_ref) {
|
|
|
10659
10811
|
if (image && !image.hasError() && !image.isLoaded() && !image.isLoading()) {
|
|
10660
10812
|
image.load(); /* Will eventually trigger the callback used in the useEffect */
|
|
10661
10813
|
}
|
|
10814
|
+
|
|
10662
10815
|
/* If the image is ready, we can show it in the component, store it in our ref, otherwise we keep the previous image to prevent flickering */
|
|
10663
10816
|
if (image !== null && image !== void 0 && image.isLoaded()) {
|
|
10664
10817
|
previousLegendImage.current = image;
|
|
10818
|
+
|
|
10665
10819
|
/* Set the canvas container to the same size as the image */
|
|
10666
10820
|
imageHeight = image.getHeight();
|
|
10667
10821
|
setCanvasContainerHeight(imageHeight);
|
|
10668
10822
|
imageWidth = image.getWidth();
|
|
10669
10823
|
setCanvasContainerWidth(imageWidth);
|
|
10824
|
+
|
|
10670
10825
|
/* Give the canvas a white background before adding the image */
|
|
10671
10826
|
ctx.fillStyle = '#fff';
|
|
10672
10827
|
ctx.rect(0, 0, width, height);
|
|
@@ -10682,6 +10837,24 @@ var Legend = function Legend(_ref) {
|
|
|
10682
10837
|
});
|
|
10683
10838
|
};
|
|
10684
10839
|
|
|
10840
|
+
/* *
|
|
10841
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10842
|
+
* you may not use this file except in compliance with the License.
|
|
10843
|
+
* You may obtain a copy of the License at
|
|
10844
|
+
*
|
|
10845
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10846
|
+
*
|
|
10847
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10848
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10849
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10850
|
+
* See the License for the specific language governing permissions and
|
|
10851
|
+
* limitations under the License.
|
|
10852
|
+
*
|
|
10853
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10854
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
10855
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
10856
|
+
* */
|
|
10857
|
+
|
|
10685
10858
|
var LegendDialog = function LegendDialog(_ref) {
|
|
10686
10859
|
var layers = _ref.layers,
|
|
10687
10860
|
isOpen = _ref.isOpen,
|
|
@@ -10694,11 +10867,12 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
10694
10867
|
_ref$order = _ref.order,
|
|
10695
10868
|
order = _ref$order === void 0 ? 0 : _ref$order,
|
|
10696
10869
|
_ref$source = _ref.source,
|
|
10697
|
-
source = _ref$source === void 0 ? 'app' : _ref$source
|
|
10870
|
+
source = _ref$source === void 0 ? 'app' : _ref$source,
|
|
10871
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
10698
10872
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
10699
10873
|
t = _useWebmapReactTransl.t;
|
|
10700
10874
|
var stopWheelEventPropagationRef = useWheelStopPropagation();
|
|
10701
|
-
return jsx(ToolContainerDraggable, {
|
|
10875
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
10702
10876
|
bounds: "parent",
|
|
10703
10877
|
"data-testid": "moveable-legend",
|
|
10704
10878
|
initialMaxHeight: 440,
|
|
@@ -10713,26 +10887,31 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
10713
10887
|
top: 50
|
|
10714
10888
|
},
|
|
10715
10889
|
title: showMapId ? "".concat(t('webmap-react-legend'), " ").concat(mapId) : t('webmap-react-legend'),
|
|
10716
|
-
children: jsx(Box, {
|
|
10890
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
10717
10891
|
sx: {
|
|
10718
10892
|
padding: 0.5
|
|
10719
10893
|
},
|
|
10720
|
-
children: layers && layers.length > 0 ? jsx(Box, {
|
|
10894
|
+
children: layers && layers.length > 0 ? /*#__PURE__*/jsx(Box, {
|
|
10721
10895
|
"data-testid": "LegendList",
|
|
10722
10896
|
ref: stopWheelEventPropagationRef,
|
|
10723
10897
|
sx: {
|
|
10724
10898
|
display: 'flex',
|
|
10725
10899
|
flexDirection: 'column',
|
|
10900
|
+
padding: '0 16px',
|
|
10726
10901
|
'&>div:last-child': {
|
|
10727
10902
|
marginBottom: 0
|
|
10903
|
+
},
|
|
10904
|
+
'&>div:first-of-type': {
|
|
10905
|
+
marginTop: '8px'
|
|
10728
10906
|
}
|
|
10729
10907
|
},
|
|
10730
10908
|
children: layers.map(function (layer) {
|
|
10731
|
-
return jsx(Legend, {
|
|
10732
|
-
layer: layer
|
|
10909
|
+
return /*#__PURE__*/jsx(Legend, {
|
|
10910
|
+
layer: layer,
|
|
10911
|
+
onToggleLayerLegendVisibility: onToggleLayerLegendVisibility
|
|
10733
10912
|
}, layer.id);
|
|
10734
10913
|
})
|
|
10735
|
-
}) : jsx(Typography, {
|
|
10914
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
10736
10915
|
"data-testid": "NoLayers",
|
|
10737
10916
|
style: {
|
|
10738
10917
|
fontWeight: 500,
|
|
@@ -10755,7 +10934,7 @@ var MapControlButton = function MapControlButton(_ref) {
|
|
|
10755
10934
|
_ref$isActive = _ref.isActive,
|
|
10756
10935
|
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
10757
10936
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
10758
|
-
return jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
10937
|
+
return /*#__PURE__*/jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
10759
10938
|
isSelected: isActive,
|
|
10760
10939
|
onClick: onClick,
|
|
10761
10940
|
tooltipProps: {
|
|
@@ -10768,28 +10947,46 @@ var MapControlButton = function MapControlButton(_ref) {
|
|
|
10768
10947
|
}));
|
|
10769
10948
|
};
|
|
10770
10949
|
|
|
10950
|
+
/* *
|
|
10951
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10952
|
+
* you may not use this file except in compliance with the License.
|
|
10953
|
+
* You may obtain a copy of the License at
|
|
10954
|
+
*
|
|
10955
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10956
|
+
*
|
|
10957
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10958
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10959
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10960
|
+
* See the License for the specific language governing permissions and
|
|
10961
|
+
* limitations under the License.
|
|
10962
|
+
*
|
|
10963
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10964
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
10965
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
10966
|
+
* */
|
|
10967
|
+
|
|
10771
10968
|
var ZoomControls = function ZoomControls(_ref) {
|
|
10772
10969
|
var onZoomIn = _ref.onZoomIn,
|
|
10773
10970
|
onZoomOut = _ref.onZoomOut,
|
|
10774
10971
|
onZoomReset = _ref.onZoomReset;
|
|
10775
10972
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
10776
10973
|
t = _useWebmapReactTransl.t;
|
|
10777
|
-
return jsxs(Fragment, {
|
|
10778
|
-
children: [jsx(MapControlButton, {
|
|
10974
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
10975
|
+
children: [/*#__PURE__*/jsx(MapControlButton, {
|
|
10779
10976
|
"data-testid": "zoom-reset",
|
|
10780
10977
|
onClick: onZoomReset,
|
|
10781
10978
|
title: t('webmap-react-zoom-reset'),
|
|
10782
|
-
children: jsx(Home, {})
|
|
10783
|
-
}), jsx(MapControlButton, {
|
|
10979
|
+
children: /*#__PURE__*/jsx(Home, {})
|
|
10980
|
+
}), /*#__PURE__*/jsx(MapControlButton, {
|
|
10784
10981
|
"data-testid": "zoom-in",
|
|
10785
10982
|
onClick: onZoomIn,
|
|
10786
10983
|
title: t('webmap-react-zoom-in'),
|
|
10787
|
-
children: jsx(Add, {})
|
|
10788
|
-
}), jsx(MapControlButton, {
|
|
10984
|
+
children: /*#__PURE__*/jsx(Add, {})
|
|
10985
|
+
}), /*#__PURE__*/jsx(MapControlButton, {
|
|
10789
10986
|
"data-testid": "zoom-out",
|
|
10790
10987
|
onClick: onZoomOut,
|
|
10791
10988
|
title: t('webmap-react-zoom-out'),
|
|
10792
|
-
children: jsx(Minus, {})
|
|
10989
|
+
children: /*#__PURE__*/jsx(Minus, {})
|
|
10793
10990
|
})]
|
|
10794
10991
|
});
|
|
10795
10992
|
};
|
|
@@ -10798,7 +10995,7 @@ var _excluded$1 = ["children"];
|
|
|
10798
10995
|
var MapControls = function MapControls(_ref) {
|
|
10799
10996
|
var children = _ref.children,
|
|
10800
10997
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
10801
|
-
return jsx(Box, _objectSpread2(_objectSpread2({
|
|
10998
|
+
return /*#__PURE__*/jsx(Box, _objectSpread2(_objectSpread2({
|
|
10802
10999
|
sx: {
|
|
10803
11000
|
position: 'absolute',
|
|
10804
11001
|
overflow: 'visible',
|
|
@@ -10810,7 +11007,7 @@ var MapControls = function MapControls(_ref) {
|
|
|
10810
11007
|
userSelect: 'none'
|
|
10811
11008
|
}
|
|
10812
11009
|
}, props), {}, {
|
|
10813
|
-
children: jsx(Grid, {
|
|
11010
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
10814
11011
|
container: true,
|
|
10815
11012
|
direction: "column",
|
|
10816
11013
|
sx: {
|
|
@@ -10823,6 +11020,24 @@ var MapControls = function MapControls(_ref) {
|
|
|
10823
11020
|
}));
|
|
10824
11021
|
};
|
|
10825
11022
|
|
|
11023
|
+
/* *
|
|
11024
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11025
|
+
* you may not use this file except in compliance with the License.
|
|
11026
|
+
* You may obtain a copy of the License at
|
|
11027
|
+
*
|
|
11028
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11029
|
+
*
|
|
11030
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11031
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11032
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11033
|
+
* See the License for the specific language governing permissions and
|
|
11034
|
+
* limitations under the License.
|
|
11035
|
+
*
|
|
11036
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11037
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
11038
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11039
|
+
* */
|
|
11040
|
+
|
|
10826
11041
|
var LegendButton = function LegendButton(_ref) {
|
|
10827
11042
|
var openLegendDialog = _ref.openLegendDialog,
|
|
10828
11043
|
isOpen = _ref.isOpen;
|
|
@@ -10831,15 +11046,33 @@ var LegendButton = function LegendButton(_ref) {
|
|
|
10831
11046
|
var onClickButton = function onClickButton() {
|
|
10832
11047
|
return openLegendDialog();
|
|
10833
11048
|
};
|
|
10834
|
-
return jsx(MapControlButton, {
|
|
11049
|
+
return /*#__PURE__*/jsx(MapControlButton, {
|
|
10835
11050
|
"data-testid": "open-Legend",
|
|
10836
11051
|
isActive: isOpen,
|
|
10837
11052
|
onClick: onClickButton,
|
|
10838
11053
|
title: t('webmap-react-legend'),
|
|
10839
|
-
children: jsx(List, {})
|
|
11054
|
+
children: /*#__PURE__*/jsx(List, {})
|
|
10840
11055
|
});
|
|
10841
11056
|
};
|
|
10842
11057
|
|
|
11058
|
+
/* *
|
|
11059
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11060
|
+
* you may not use this file except in compliance with the License.
|
|
11061
|
+
* You may obtain a copy of the License at
|
|
11062
|
+
*
|
|
11063
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11064
|
+
*
|
|
11065
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11066
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11067
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11068
|
+
* See the License for the specific language governing permissions and
|
|
11069
|
+
* limitations under the License.
|
|
11070
|
+
*
|
|
11071
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11072
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
11073
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11074
|
+
* */
|
|
11075
|
+
|
|
10843
11076
|
var getTimeDimension = function getTimeDimension(dimensions) {
|
|
10844
11077
|
return dimensions.find(function (dimension) {
|
|
10845
11078
|
return dimension.name === 'time' && dimension.currentValue !== undefined;
|
|
@@ -10858,7 +11091,7 @@ var MapTime = function MapTime(_ref) {
|
|
|
10858
11091
|
return null;
|
|
10859
11092
|
}
|
|
10860
11093
|
var mapTime = formatTime(timeDimension.currentValue, timeFormat);
|
|
10861
|
-
return jsx(Box, {
|
|
11094
|
+
return /*#__PURE__*/jsx(Box, {
|
|
10862
11095
|
"data-testid": "map-time",
|
|
10863
11096
|
sx: {
|
|
10864
11097
|
zIndex: 10,
|
|
@@ -10866,8 +11099,8 @@ var MapTime = function MapTime(_ref) {
|
|
|
10866
11099
|
bottom: '12px',
|
|
10867
11100
|
position: 'absolute'
|
|
10868
11101
|
},
|
|
10869
|
-
children: jsx(Box, {
|
|
10870
|
-
children: jsx(Typography, {
|
|
11102
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
11103
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
10871
11104
|
sx: {
|
|
10872
11105
|
fontWeight: 500
|
|
10873
11106
|
},
|
|
@@ -10878,6 +11111,23 @@ var MapTime = function MapTime(_ref) {
|
|
|
10878
11111
|
});
|
|
10879
11112
|
};
|
|
10880
11113
|
|
|
11114
|
+
/* *
|
|
11115
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11116
|
+
* you may not use this file except in compliance with the License.
|
|
11117
|
+
* You may obtain a copy of the License at
|
|
11118
|
+
*
|
|
11119
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11120
|
+
*
|
|
11121
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11122
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11123
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11124
|
+
* See the License for the specific language governing permissions and
|
|
11125
|
+
* limitations under the License.
|
|
11126
|
+
*
|
|
11127
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11128
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
11129
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11130
|
+
* */
|
|
10881
11131
|
var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
10882
11132
|
var _selectedFeaturePrope, _selectedFeaturePrope2, _selectedFeaturePrope3, _selectedFeaturePrope4, _selectedFeaturePrope5;
|
|
10883
11133
|
var selectedFeatureProperties = _ref.selectedFeatureProperties,
|
|
@@ -10887,7 +11137,7 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10887
11137
|
var newWidth = parentSize ? parentSize - 100 : 350;
|
|
10888
11138
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
10889
11139
|
t = _useWebmapReactTransl.t;
|
|
10890
|
-
return jsx("div", {
|
|
11140
|
+
return /*#__PURE__*/jsx("div", {
|
|
10891
11141
|
style: {
|
|
10892
11142
|
position: 'fixed',
|
|
10893
11143
|
width: "".concat(newWidth, "px"),
|
|
@@ -10898,7 +11148,7 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10898
11148
|
top: '70px',
|
|
10899
11149
|
zIndex: 10
|
|
10900
11150
|
},
|
|
10901
|
-
children: jsxs("div", {
|
|
11151
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
10902
11152
|
"data-testid": "map-warning-properties",
|
|
10903
11153
|
style: {
|
|
10904
11154
|
marginTop: '50px',
|
|
@@ -10909,22 +11159,22 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10909
11159
|
fontSize: '11px',
|
|
10910
11160
|
backgroundColor: '#CCCCCCC0'
|
|
10911
11161
|
},
|
|
10912
|
-
children: [jsx("h1", {
|
|
11162
|
+
children: [/*#__PURE__*/jsx("h1", {
|
|
10913
11163
|
"data-testid": "map-warning-properties-title",
|
|
10914
11164
|
children: (_selectedFeaturePrope = selectedFeatureProperties.languages) === null || _selectedFeaturePrope === void 0 ? void 0 : _selectedFeaturePrope[language].areaDesc
|
|
10915
|
-
}), !!((_selectedFeaturePrope2 = selectedFeatureProperties.languages) !== null && _selectedFeaturePrope2 !== void 0 && _selectedFeaturePrope2[language].areaDesc) && jsxs("pre", {
|
|
11165
|
+
}), !!((_selectedFeaturePrope2 = selectedFeatureProperties.languages) !== null && _selectedFeaturePrope2 !== void 0 && _selectedFeaturePrope2[language].areaDesc) && /*#__PURE__*/jsxs("pre", {
|
|
10916
11166
|
"data-testid": "map-warning-properties-row",
|
|
10917
11167
|
children: [t('webmap-react-event'), ' ', (_selectedFeaturePrope3 = selectedFeatureProperties.languages) === null || _selectedFeaturePrope3 === void 0 ? void 0 : _selectedFeaturePrope3[language].event]
|
|
10918
|
-
}), !!selectedFeatureProperties.onset && jsxs("pre", {
|
|
11168
|
+
}), !!selectedFeatureProperties.onset && /*#__PURE__*/jsxs("pre", {
|
|
10919
11169
|
"data-testid": "map-warning-properties-row",
|
|
10920
11170
|
children: [t('webmap-react-sent'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.onset), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc')]
|
|
10921
|
-
}), !!selectedFeatureProperties.expires && jsxs("pre", {
|
|
11171
|
+
}), !!selectedFeatureProperties.expires && /*#__PURE__*/jsxs("pre", {
|
|
10922
11172
|
"data-testid": "map-warning-properties-row",
|
|
10923
11173
|
children: [t('webmap-react-expires'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.expires), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc')]
|
|
10924
|
-
}), !!((_selectedFeaturePrope4 = selectedFeatureProperties.languages) !== null && _selectedFeaturePrope4 !== void 0 && _selectedFeaturePrope4[language].senderName) && jsxs("pre", {
|
|
11174
|
+
}), !!((_selectedFeaturePrope4 = selectedFeatureProperties.languages) !== null && _selectedFeaturePrope4 !== void 0 && _selectedFeaturePrope4[language].senderName) && /*#__PURE__*/jsxs("pre", {
|
|
10925
11175
|
"data-testid": "map-warning-properties-row",
|
|
10926
11176
|
children: [t('webmap-react-sender'), ' ', (_selectedFeaturePrope5 = selectedFeatureProperties.languages) === null || _selectedFeaturePrope5 === void 0 ? void 0 : _selectedFeaturePrope5[language].senderName]
|
|
10927
|
-
}), !!selectedFeatureProperties.identifier && jsxs("pre", {
|
|
11177
|
+
}), !!selectedFeatureProperties.identifier && /*#__PURE__*/jsxs("pre", {
|
|
10928
11178
|
"data-testid": "map-warning-properties-row",
|
|
10929
11179
|
children: [t('webmap-react-identifier'), ' ', selectedFeatureProperties.identifier]
|
|
10930
11180
|
})]
|
|
@@ -10932,6 +11182,24 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10932
11182
|
});
|
|
10933
11183
|
};
|
|
10934
11184
|
|
|
11185
|
+
/* *
|
|
11186
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11187
|
+
* you may not use this file except in compliance with the License.
|
|
11188
|
+
* You may obtain a copy of the License at
|
|
11189
|
+
*
|
|
11190
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11191
|
+
*
|
|
11192
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11193
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11194
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11195
|
+
* See the License for the specific language governing permissions and
|
|
11196
|
+
* limitations under the License.
|
|
11197
|
+
*
|
|
11198
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11199
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
11200
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11201
|
+
* */
|
|
11202
|
+
|
|
10935
11203
|
var dimensionConfig = function dimensionConfig(t) {
|
|
10936
11204
|
return [{
|
|
10937
11205
|
name: 'elevation',
|
|
@@ -10985,6 +11253,24 @@ var marksByDimension = function marksByDimension(t, dim) {
|
|
|
10985
11253
|
return marks;
|
|
10986
11254
|
};
|
|
10987
11255
|
|
|
11256
|
+
/* *
|
|
11257
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11258
|
+
* you may not use this file except in compliance with the License.
|
|
11259
|
+
* You may obtain a copy of the License at
|
|
11260
|
+
*
|
|
11261
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11262
|
+
*
|
|
11263
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11264
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11265
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11266
|
+
* See the License for the specific language governing permissions and
|
|
11267
|
+
* limitations under the License.
|
|
11268
|
+
*
|
|
11269
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11270
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11271
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11272
|
+
* */
|
|
11273
|
+
|
|
10988
11274
|
var DimensionSelectButton = function DimensionSelectButton(_ref) {
|
|
10989
11275
|
var dimension = _ref.dimension,
|
|
10990
11276
|
onClickDimensionButton = _ref.onClickDimensionButton,
|
|
@@ -10998,15 +11284,33 @@ var DimensionSelectButton = function DimensionSelectButton(_ref) {
|
|
|
10998
11284
|
});
|
|
10999
11285
|
var Icon = getDimensionIcon$1((dimConfig === null || dimConfig === void 0 ? void 0 : dimConfig.iconType) || 'IconLevels');
|
|
11000
11286
|
var title = "".concat(showPrefix, " ").concat(dimConfig ? dimConfig.label.toLowerCase() : dimension.toLowerCase());
|
|
11001
|
-
return jsx(MapControlButton, {
|
|
11287
|
+
return /*#__PURE__*/jsx(MapControlButton, {
|
|
11002
11288
|
"data-testid": "dimensionMapBtn-".concat(dimension),
|
|
11003
11289
|
isActive: isActive,
|
|
11004
11290
|
onClick: onClickDimensionButton,
|
|
11005
11291
|
title: title,
|
|
11006
|
-
children: jsx(Icon, {})
|
|
11292
|
+
children: /*#__PURE__*/jsx(Icon, {})
|
|
11007
11293
|
});
|
|
11008
11294
|
};
|
|
11009
11295
|
|
|
11296
|
+
/* *
|
|
11297
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11298
|
+
* you may not use this file except in compliance with the License.
|
|
11299
|
+
* You may obtain a copy of the License at
|
|
11300
|
+
*
|
|
11301
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11302
|
+
*
|
|
11303
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11304
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11305
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11306
|
+
* See the License for the specific language governing permissions and
|
|
11307
|
+
* limitations under the License.
|
|
11308
|
+
*
|
|
11309
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11310
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
11311
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11312
|
+
* */
|
|
11313
|
+
|
|
11010
11314
|
var DimensionSelectDialog = function DimensionSelectDialog(_ref) {
|
|
11011
11315
|
var isOpen = _ref.isOpen,
|
|
11012
11316
|
_ref$order = _ref.order,
|
|
@@ -11026,7 +11330,8 @@ var DimensionSelectDialog = function DimensionSelectDialog(_ref) {
|
|
|
11026
11330
|
});
|
|
11027
11331
|
var title = dimConfig ? dimConfig.label : dimensionName;
|
|
11028
11332
|
var topPos = index * 32 + 164; // index * btn height + offset top of window
|
|
11029
|
-
|
|
11333
|
+
|
|
11334
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
11030
11335
|
bounds: "parent",
|
|
11031
11336
|
"data-testid": "multidimensionContent-".concat(title),
|
|
11032
11337
|
isOpen: isOpen,
|
|
@@ -11040,11 +11345,11 @@ var DimensionSelectDialog = function DimensionSelectDialog(_ref) {
|
|
|
11040
11345
|
top: topPos
|
|
11041
11346
|
},
|
|
11042
11347
|
title: title,
|
|
11043
|
-
children: jsx("div", {
|
|
11348
|
+
children: /*#__PURE__*/jsx("div", {
|
|
11044
11349
|
style: {
|
|
11045
11350
|
padding: 4
|
|
11046
11351
|
},
|
|
11047
|
-
children: jsx(Grid, {
|
|
11352
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
11048
11353
|
container: true,
|
|
11049
11354
|
direction: "row",
|
|
11050
11355
|
children: children
|
|
@@ -11103,8 +11408,8 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11103
11408
|
event.preventDefault();
|
|
11104
11409
|
}
|
|
11105
11410
|
};
|
|
11106
|
-
return jsxs(Fragment, {
|
|
11107
|
-
children: [jsx(Box, {
|
|
11411
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11412
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
11108
11413
|
"data-testid": "slider-dimensionSelect",
|
|
11109
11414
|
sx: {
|
|
11110
11415
|
height: '320px',
|
|
@@ -11113,12 +11418,12 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11113
11418
|
minWidth: 120,
|
|
11114
11419
|
fontSize: '90%'
|
|
11115
11420
|
},
|
|
11116
|
-
children: jsx(Box, {
|
|
11421
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
11117
11422
|
component: "span",
|
|
11118
11423
|
sx: {
|
|
11119
11424
|
margin: 1
|
|
11120
11425
|
},
|
|
11121
|
-
children: jsx(SmallFontSlider, {
|
|
11426
|
+
children: /*#__PURE__*/jsx(SmallFontSlider, {
|
|
11122
11427
|
"aria-labelledby": "vertical-slider",
|
|
11123
11428
|
"data-testid": "verticalSlider",
|
|
11124
11429
|
disabled: isDisabled,
|
|
@@ -11142,9 +11447,9 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11142
11447
|
value: sliderValue
|
|
11143
11448
|
})
|
|
11144
11449
|
})
|
|
11145
|
-
}), jsx(CustomTooltip, {
|
|
11450
|
+
}), /*#__PURE__*/jsx(CustomTooltip, {
|
|
11146
11451
|
title: layerTitle,
|
|
11147
|
-
children: jsx(Typography, {
|
|
11452
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
11148
11453
|
sx: {
|
|
11149
11454
|
paddingLeft: '10px',
|
|
11150
11455
|
maxWidth: 130,
|
|
@@ -11160,9 +11465,9 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11160
11465
|
|
|
11161
11466
|
var Icon = function Icon(_ref) {
|
|
11162
11467
|
var isLayerDimensionSynced = _ref.isLayerDimensionSynced;
|
|
11163
|
-
return isLayerDimensionSynced ? jsx(Link, {
|
|
11468
|
+
return isLayerDimensionSynced ? /*#__PURE__*/jsx(Link, {
|
|
11164
11469
|
"data-testid": "syncIcon"
|
|
11165
|
-
}) : jsx(LinkOff, {
|
|
11470
|
+
}) : /*#__PURE__*/jsx(LinkOff, {
|
|
11166
11471
|
"data-testid": "syncDisIcon"
|
|
11167
11472
|
});
|
|
11168
11473
|
};
|
|
@@ -11218,11 +11523,11 @@ var MapDimensionSelect = function MapDimensionSelect(_ref2) {
|
|
|
11218
11523
|
var marks = marksByDimension(t, wmsDimension);
|
|
11219
11524
|
var isLayerDimensionSynced = layerDimension.synced !== undefined && layerDimension.synced;
|
|
11220
11525
|
var tooltipTitle = isLayerDimensionSynced ? t('webmap-react-click-disconnect') : t('webmap-react-click-connect');
|
|
11221
|
-
return jsxs(Grid, {
|
|
11526
|
+
return /*#__PURE__*/jsxs(Grid, {
|
|
11222
11527
|
size: {
|
|
11223
11528
|
xs: 'auto'
|
|
11224
11529
|
},
|
|
11225
|
-
children: [jsx(CustomIconButton, {
|
|
11530
|
+
children: [/*#__PURE__*/jsx(CustomIconButton, {
|
|
11226
11531
|
"data-testid": "syncButton",
|
|
11227
11532
|
onClick: function onClick() {
|
|
11228
11533
|
return handleSyncChanged(layerId, dimensionName, layerDimension.currentValue, !layerDimension.synced);
|
|
@@ -11231,10 +11536,10 @@ var MapDimensionSelect = function MapDimensionSelect(_ref2) {
|
|
|
11231
11536
|
margin: '5px'
|
|
11232
11537
|
},
|
|
11233
11538
|
tooltipTitle: tooltipTitle,
|
|
11234
|
-
children: jsx(Icon, {
|
|
11539
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
11235
11540
|
isLayerDimensionSynced: isLayerDimensionSynced
|
|
11236
11541
|
})
|
|
11237
|
-
}), jsx(DimensionSelectSlider, {
|
|
11542
|
+
}), /*#__PURE__*/jsx(DimensionSelectSlider, {
|
|
11238
11543
|
isDisabled: false,
|
|
11239
11544
|
layerTitle: layerTitle,
|
|
11240
11545
|
managedValue: Number(layerDimension.currentValue) || layerDimension.currentValue,
|
|
@@ -11253,7 +11558,7 @@ var LayerInfoButton = function LayerInfoButton(_ref) {
|
|
|
11253
11558
|
var isActive = _ref.isActive,
|
|
11254
11559
|
onClick = _ref.onClick,
|
|
11255
11560
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
11256
|
-
return jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
11561
|
+
return /*#__PURE__*/jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
11257
11562
|
"aria-label": "layer info",
|
|
11258
11563
|
className: "layerInfoButton",
|
|
11259
11564
|
"data-testid": "layerInfoButton",
|
|
@@ -11262,7 +11567,7 @@ var LayerInfoButton = function LayerInfoButton(_ref) {
|
|
|
11262
11567
|
onClick: onClick,
|
|
11263
11568
|
variant: "flat"
|
|
11264
11569
|
}, props), {}, {
|
|
11265
|
-
children: jsx(Info, {})
|
|
11570
|
+
children: /*#__PURE__*/jsx(Info, {})
|
|
11266
11571
|
}));
|
|
11267
11572
|
};
|
|
11268
11573
|
|
|
@@ -11277,12 +11582,12 @@ var textStyleWithMargin = _objectSpread2(_objectSpread2({}, textStyle), {}, {
|
|
|
11277
11582
|
var LayerInfoText = function LayerInfoText(_ref) {
|
|
11278
11583
|
var label = _ref.label,
|
|
11279
11584
|
value = _ref.value;
|
|
11280
|
-
return jsxs(Fragment, {
|
|
11281
|
-
children: [jsx(Typography$1, {
|
|
11585
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11586
|
+
children: [/*#__PURE__*/jsx(Typography$1, {
|
|
11282
11587
|
sx: textStyle,
|
|
11283
11588
|
variant: "subtitle2",
|
|
11284
11589
|
children: label
|
|
11285
|
-
}), jsx(Typography$1, {
|
|
11590
|
+
}), /*#__PURE__*/jsx(Typography$1, {
|
|
11286
11591
|
sx: textStyleWithMargin,
|
|
11287
11592
|
variant: "body2",
|
|
11288
11593
|
children: value
|
|
@@ -11290,26 +11595,61 @@ var LayerInfoText = function LayerInfoText(_ref) {
|
|
|
11290
11595
|
});
|
|
11291
11596
|
};
|
|
11292
11597
|
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11598
|
+
/* *
|
|
11599
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11600
|
+
* you may not use this file except in compliance with the License.
|
|
11601
|
+
* You may obtain a copy of the License at
|
|
11602
|
+
*
|
|
11603
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11604
|
+
*
|
|
11605
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11606
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11607
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11608
|
+
* See the License for the specific language governing permissions and
|
|
11609
|
+
* limitations under the License.
|
|
11610
|
+
*
|
|
11611
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11612
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
11613
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11614
|
+
* */
|
|
11615
|
+
|
|
11616
|
+
var LayerInfoLegend = function LayerInfoLegend(_ref) {
|
|
11617
|
+
var title = _ref.title,
|
|
11618
|
+
legendURL = _ref.legendURL,
|
|
11619
|
+
showLayerLegend = _ref.showLayerLegend,
|
|
11620
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
11621
|
+
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
11622
|
+
t = _useWebmapReactTransl.t;
|
|
11623
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11624
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
11625
|
+
sx: {
|
|
11626
|
+
display: 'flex',
|
|
11627
|
+
justifyContent: 'space-between',
|
|
11628
|
+
alignItems: 'center',
|
|
11629
|
+
width: '100%'
|
|
11630
|
+
},
|
|
11631
|
+
children: [/*#__PURE__*/jsx(Typography$1, {
|
|
11632
|
+
sx: textStyleWithMargin,
|
|
11633
|
+
variant: "subtitle2",
|
|
11634
|
+
children: t('webmap-react-legend')
|
|
11635
|
+
}), /*#__PURE__*/jsx(FormGroup, {
|
|
11636
|
+
children: /*#__PURE__*/jsx(FormControlLabel, {
|
|
11637
|
+
control: /*#__PURE__*/jsx(Checkbox, {
|
|
11638
|
+
checked: showLayerLegend,
|
|
11639
|
+
onChange: function onChange() {
|
|
11640
|
+
onToggleLayerLegendVisibility(!showLayerLegend);
|
|
11641
|
+
}
|
|
11642
|
+
}),
|
|
11643
|
+
label: t('webmap-react-show-layer-legend'),
|
|
11644
|
+
sx: textStyleWithMargin
|
|
11645
|
+
})
|
|
11646
|
+
})]
|
|
11647
|
+
}), /*#__PURE__*/jsx(LegendLayout, {
|
|
11648
|
+
title: title,
|
|
11649
|
+
children: legendURL ? /*#__PURE__*/jsx("img", {
|
|
11650
|
+
alt: title,
|
|
11651
|
+
src: legendURL
|
|
11652
|
+
}) : '-'
|
|
11313
11653
|
})]
|
|
11314
11654
|
});
|
|
11315
11655
|
};
|
|
@@ -11320,41 +11660,41 @@ var valueStyle = _objectSpread2(_objectSpread2({}, textStyle), {}, {
|
|
|
11320
11660
|
var LayerInfoList = function LayerInfoList(_ref) {
|
|
11321
11661
|
var label = _ref.label,
|
|
11322
11662
|
list = _ref.list;
|
|
11323
|
-
return jsxs(Fragment, {
|
|
11324
|
-
children: [jsx(Typography$1, {
|
|
11663
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11664
|
+
children: [/*#__PURE__*/jsx(Typography$1, {
|
|
11325
11665
|
sx: textStyle,
|
|
11326
11666
|
variant: "subtitle2",
|
|
11327
11667
|
children: label
|
|
11328
|
-
}), list.length === 0 ? jsx(Typography$1, {
|
|
11668
|
+
}), list.length === 0 ? /*#__PURE__*/jsx(Typography$1, {
|
|
11329
11669
|
sx: textStyleWithMargin,
|
|
11330
11670
|
variant: "body2",
|
|
11331
11671
|
children: "-"
|
|
11332
|
-
}) : jsx(Grid, {
|
|
11672
|
+
}) : /*#__PURE__*/jsx(Grid, {
|
|
11333
11673
|
container: true,
|
|
11334
11674
|
direction: "column",
|
|
11335
11675
|
children: list.map(function (item) {
|
|
11336
|
-
return jsxs("div", {
|
|
11337
|
-
children: [jsxs(Grid, {
|
|
11676
|
+
return /*#__PURE__*/jsxs("div", {
|
|
11677
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
11338
11678
|
container: true,
|
|
11339
11679
|
direction: "row",
|
|
11340
|
-
children: [item.icon, jsx(Grid, {
|
|
11680
|
+
children: [item.icon, /*#__PURE__*/jsx(Grid, {
|
|
11341
11681
|
sx: {
|
|
11342
11682
|
marginLeft: '10px'
|
|
11343
11683
|
},
|
|
11344
|
-
children: jsxs(Typography$1, {
|
|
11684
|
+
children: /*#__PURE__*/jsxs(Typography$1, {
|
|
11345
11685
|
sx: textStyle,
|
|
11346
11686
|
variant: "body2",
|
|
11347
11687
|
children: [item.label, ":"]
|
|
11348
11688
|
})
|
|
11349
11689
|
})]
|
|
11350
|
-
}), jsx(Grid, {
|
|
11690
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
11351
11691
|
container: true,
|
|
11352
11692
|
direction: "row",
|
|
11353
11693
|
sx: {
|
|
11354
11694
|
marginBottom: 1,
|
|
11355
11695
|
paddingLeft: '34px'
|
|
11356
11696
|
},
|
|
11357
|
-
children: jsx(Typography$1, {
|
|
11697
|
+
children: /*#__PURE__*/jsx(Typography$1, {
|
|
11358
11698
|
sx: valueStyle,
|
|
11359
11699
|
variant: "body2",
|
|
11360
11700
|
children: item.value
|
|
@@ -11366,6 +11706,24 @@ var LayerInfoList = function LayerInfoList(_ref) {
|
|
|
11366
11706
|
});
|
|
11367
11707
|
};
|
|
11368
11708
|
|
|
11709
|
+
/* *
|
|
11710
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11711
|
+
* you may not use this file except in compliance with the License.
|
|
11712
|
+
* You may obtain a copy of the License at
|
|
11713
|
+
*
|
|
11714
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11715
|
+
*
|
|
11716
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11717
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11718
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11719
|
+
* See the License for the specific language governing permissions and
|
|
11720
|
+
* limitations under the License.
|
|
11721
|
+
*
|
|
11722
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11723
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
11724
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11725
|
+
* */
|
|
11726
|
+
|
|
11369
11727
|
var getLayerStyles = function getLayerStyles(layer) {
|
|
11370
11728
|
if (!layer.styles) {
|
|
11371
11729
|
return '-';
|
|
@@ -11406,13 +11764,13 @@ var getDimensionIcon = function getDimensionIcon(name, dimensions) {
|
|
|
11406
11764
|
}
|
|
11407
11765
|
switch (dimension.name.toLowerCase()) {
|
|
11408
11766
|
case 'time':
|
|
11409
|
-
return jsx(DimensionsTime, {});
|
|
11767
|
+
return /*#__PURE__*/jsx(DimensionsTime, {});
|
|
11410
11768
|
case 'reference_time':
|
|
11411
|
-
return jsx(DimensionsRefTime, {});
|
|
11769
|
+
return /*#__PURE__*/jsx(DimensionsRefTime, {});
|
|
11412
11770
|
case 'elevation':
|
|
11413
|
-
return jsx(DimensionsElevation, {});
|
|
11771
|
+
return /*#__PURE__*/jsx(DimensionsElevation, {});
|
|
11414
11772
|
default:
|
|
11415
|
-
return jsx(DimensionsOther, {});
|
|
11773
|
+
return /*#__PURE__*/jsx(DimensionsOther, {});
|
|
11416
11774
|
}
|
|
11417
11775
|
};
|
|
11418
11776
|
var getDimensionLabel = function getDimensionLabel(name) {
|
|
@@ -11435,10 +11793,12 @@ var getDimensionsList = function getDimensionsList(dimensions) {
|
|
|
11435
11793
|
icon: icon
|
|
11436
11794
|
});
|
|
11437
11795
|
});
|
|
11796
|
+
|
|
11438
11797
|
// sort alphabetically so other dimensions are sorted
|
|
11439
11798
|
result.sort(function (compA, compB) {
|
|
11440
11799
|
return compA.label.localeCompare(compB.label);
|
|
11441
11800
|
});
|
|
11801
|
+
|
|
11442
11802
|
// sort by fixed order
|
|
11443
11803
|
var preferredOrder = ['Time', 'Reference time', 'Elevation'];
|
|
11444
11804
|
// using reverse ordering to make sure the other dimensions come last
|
|
@@ -11449,6 +11809,24 @@ var getDimensionsList = function getDimensionsList(dimensions) {
|
|
|
11449
11809
|
return result;
|
|
11450
11810
|
};
|
|
11451
11811
|
|
|
11812
|
+
/* *
|
|
11813
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11814
|
+
* you may not use this file except in compliance with the License.
|
|
11815
|
+
* You may obtain a copy of the License at
|
|
11816
|
+
*
|
|
11817
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11818
|
+
*
|
|
11819
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11820
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11821
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11822
|
+
* See the License for the specific language governing permissions and
|
|
11823
|
+
* limitations under the License.
|
|
11824
|
+
*
|
|
11825
|
+
* Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11826
|
+
* Copyright 2022 - Finnish Meteorological Institute (FMI)
|
|
11827
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11828
|
+
* */
|
|
11829
|
+
|
|
11452
11830
|
var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
11453
11831
|
var _layer$styles, _layer$styles2, _layer$path, _layer$keywords;
|
|
11454
11832
|
var onClose = _ref.onClose,
|
|
@@ -11468,7 +11846,9 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11468
11846
|
top: 150,
|
|
11469
11847
|
left: 900
|
|
11470
11848
|
} : _ref$startPosition,
|
|
11471
|
-
selectedStyle = _ref.selectedStyle
|
|
11849
|
+
selectedStyle = _ref.selectedStyle,
|
|
11850
|
+
showLayerLegend = _ref.showLayerLegend,
|
|
11851
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
11472
11852
|
var styles = getLayerStyles(layer);
|
|
11473
11853
|
var dimensions = getDimensionsList(layer.dimensions);
|
|
11474
11854
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
@@ -11476,10 +11856,10 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11476
11856
|
var bbox = getLayerBbox(t, layer);
|
|
11477
11857
|
var legendURL = ((_layer$styles = layer.styles) === null || _layer$styles === void 0 || (_layer$styles = _layer$styles.find(function (styleItem) {
|
|
11478
11858
|
return styleItem.name === selectedStyle;
|
|
11479
|
-
})) === null || _layer$styles === void 0 ? void 0 : _layer$styles.legendURL) || ((_layer$styles2 = layer.styles) === null || _layer$styles2 === void 0 ? void 0 : _layer$styles2
|
|
11859
|
+
})) === null || _layer$styles === void 0 ? void 0 : _layer$styles.legendURL) || ((_layer$styles2 = layer.styles) === null || _layer$styles2 === void 0 || (_layer$styles2 = _layer$styles2[0]) === null || _layer$styles2 === void 0 ? void 0 : _layer$styles2.legendURL) ||
|
|
11480
11860
|
// show first style if none selected
|
|
11481
11861
|
undefined;
|
|
11482
|
-
return jsx(ToolContainerDraggable, {
|
|
11862
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
11483
11863
|
isOpen: isOpen,
|
|
11484
11864
|
onClose: onClose,
|
|
11485
11865
|
onMouseDown: onMouseDown,
|
|
@@ -11491,44 +11871,44 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11491
11871
|
height: dialogHeight || 650
|
|
11492
11872
|
},
|
|
11493
11873
|
title: t('webmap-react-layer-info'),
|
|
11494
|
-
children: jsxs(Box$1, {
|
|
11874
|
+
children: /*#__PURE__*/jsxs(Box$1, {
|
|
11495
11875
|
sx: {
|
|
11496
11876
|
padding: 2
|
|
11497
11877
|
},
|
|
11498
|
-
children: [jsx(LayerInfoText, {
|
|
11878
|
+
children: [/*#__PURE__*/jsx(LayerInfoText, {
|
|
11499
11879
|
label: t('webmap-react-title'),
|
|
11500
11880
|
value: layer.title
|
|
11501
|
-
}), jsx(LayerInfoText, {
|
|
11881
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11502
11882
|
label: t('webmap-react-name'),
|
|
11503
11883
|
value: layer.name
|
|
11504
|
-
}), jsx(LayerInfoText, {
|
|
11884
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11505
11885
|
label: t('webmap-react-service'),
|
|
11506
11886
|
value: serviceName
|
|
11507
|
-
}), jsx(LayerInfoText, {
|
|
11887
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11508
11888
|
label: t('webmap-react-service-url'),
|
|
11509
11889
|
value: serviceUrl || '-'
|
|
11510
|
-
}), jsx(LayerInfoText, {
|
|
11890
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11511
11891
|
label: t('webmap-react-abstract'),
|
|
11512
11892
|
value: layer["abstract"] || '-'
|
|
11513
|
-
}), jsx(LayerInfoList, {
|
|
11893
|
+
}), /*#__PURE__*/jsx(LayerInfoList, {
|
|
11514
11894
|
label: t('webmap-react-dimensions'),
|
|
11515
11895
|
list: dimensions
|
|
11516
|
-
}), jsx(LayerInfoText, {
|
|
11896
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11517
11897
|
label: t('webmap-react-styles'),
|
|
11518
11898
|
value: styles
|
|
11519
|
-
}), jsx(LayerInfoText, {
|
|
11899
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11520
11900
|
label: t('webmap-react-bounding-box'),
|
|
11521
11901
|
value: bbox
|
|
11522
|
-
}), jsx(LayerInfoText, {
|
|
11902
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11523
11903
|
label: t('webmap-react-groups'),
|
|
11524
11904
|
value: ((_layer$path = layer.path) === null || _layer$path === void 0 ? void 0 : _layer$path.join('/')) || '-'
|
|
11525
|
-
}), jsx(LayerInfoText, {
|
|
11905
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11526
11906
|
label: t('webmap-react-keywords'),
|
|
11527
11907
|
value: ((_layer$keywords = layer.keywords) === null || _layer$keywords === void 0 ? void 0 : _layer$keywords.join(', ')) || '-'
|
|
11528
|
-
}), jsx(LayerInfoLegend, {
|
|
11529
|
-
dimensions: layer.dimensions,
|
|
11908
|
+
}), /*#__PURE__*/jsx(LayerInfoLegend, {
|
|
11530
11909
|
legendURL: legendURL,
|
|
11531
|
-
|
|
11910
|
+
onToggleLayerLegendVisibility: onToggleLayerLegendVisibility,
|
|
11911
|
+
showLayerLegend: showLayerLegend,
|
|
11532
11912
|
title: layer.title
|
|
11533
11913
|
})]
|
|
11534
11914
|
})
|
|
@@ -11552,6 +11932,7 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11552
11932
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
11553
11933
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11554
11934
|
* */
|
|
11935
|
+
|
|
11555
11936
|
var MapContext = /*#__PURE__*/createContext({});
|
|
11556
11937
|
|
|
11557
11938
|
var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
|
|
@@ -11577,7 +11958,7 @@ var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
|
|
|
11577
11958
|
window.removeEventListener('wheel', updateScroll);
|
|
11578
11959
|
};
|
|
11579
11960
|
}, [showMessage, setShowMessage, timerRef]);
|
|
11580
|
-
return jsx("div", {
|
|
11961
|
+
return /*#__PURE__*/jsx("div", {
|
|
11581
11962
|
style: {
|
|
11582
11963
|
position: 'absolute',
|
|
11583
11964
|
"float": 'left',
|
|
@@ -11588,7 +11969,7 @@ var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
|
|
|
11588
11969
|
padding: '0 40%',
|
|
11589
11970
|
color: 'white'
|
|
11590
11971
|
},
|
|
11591
|
-
children: !!showMessage && jsx("div", {
|
|
11972
|
+
children: !!showMessage && /*#__PURE__*/jsx("div", {
|
|
11592
11973
|
style: {
|
|
11593
11974
|
padding: '5px 20px',
|
|
11594
11975
|
display: 'block',
|
|
@@ -11655,16 +12036,16 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11655
12036
|
};
|
|
11656
12037
|
}, [map, projection]);
|
|
11657
12038
|
if (mousePosition) {
|
|
11658
|
-
return jsx(Box, {
|
|
12039
|
+
return /*#__PURE__*/jsx(Box, {
|
|
11659
12040
|
"data-testid": "map-mouse-position",
|
|
11660
12041
|
sx: {
|
|
11661
12042
|
zIndex: 10,
|
|
11662
12043
|
justifySelf: 'center',
|
|
11663
|
-
bottom: '
|
|
12044
|
+
bottom: '26px',
|
|
11664
12045
|
left: '6px',
|
|
11665
12046
|
position: 'absolute'
|
|
11666
12047
|
},
|
|
11667
|
-
children: jsxs(Typography, {
|
|
12048
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
11668
12049
|
"data-testid": "map-mouse-position-typography",
|
|
11669
12050
|
sx: {
|
|
11670
12051
|
fontSize: 9,
|
|
@@ -11674,7 +12055,7 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11674
12055
|
px: 0.5,
|
|
11675
12056
|
py: 0.25
|
|
11676
12057
|
},
|
|
11677
|
-
children: [mousePosition === null || mousePosition === void 0 ? void 0 : mousePosition.projection, ": ", mousePosition === null || mousePosition === void 0 ? void 0 : mousePosition.mousePosition, jsx("br", {}), "lonlat: ".concat(mousePosition === null || mousePosition === void 0 ? void 0 : mousePosition.mousePositionLatLon)]
|
|
12058
|
+
children: [mousePosition === null || mousePosition === void 0 ? void 0 : mousePosition.projection, ": ", mousePosition === null || mousePosition === void 0 ? void 0 : mousePosition.mousePosition, /*#__PURE__*/jsx("br", {}), "lonlat: ".concat(mousePosition === null || mousePosition === void 0 ? void 0 : mousePosition.mousePositionLatLon)]
|
|
11678
12059
|
})
|
|
11679
12060
|
});
|
|
11680
12061
|
}
|
|
@@ -11698,6 +12079,7 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11698
12079
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
11699
12080
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
11700
12081
|
* */
|
|
12082
|
+
|
|
11701
12083
|
var OPENLAYERS_MOUSEWHEEL_DURATION = 50;
|
|
11702
12084
|
var OPENLAYERS_MOUSEWHEEL_TIMEOUT = 50;
|
|
11703
12085
|
|
|
@@ -11747,6 +12129,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11747
12129
|
mapObject.setTarget(undefined);
|
|
11748
12130
|
};
|
|
11749
12131
|
}, [mapRef, passiveMap]);
|
|
12132
|
+
|
|
11750
12133
|
// Propagate key events to the DIV containing OpenLayers
|
|
11751
12134
|
React.useEffect(function () {
|
|
11752
12135
|
if (!isFocused) {
|
|
@@ -11800,9 +12183,9 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11800
12183
|
map: map
|
|
11801
12184
|
};
|
|
11802
12185
|
}, [map]);
|
|
11803
|
-
return jsx(MapContext.Provider, {
|
|
12186
|
+
return /*#__PURE__*/jsx(MapContext.Provider, {
|
|
11804
12187
|
value: memoizedMapContext,
|
|
11805
|
-
children: jsxs("div", {
|
|
12188
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
11806
12189
|
"aria-label": "map",
|
|
11807
12190
|
"data-testid": "openlayers-mapview",
|
|
11808
12191
|
id: "mapcontainer_".concat(mapId),
|
|
@@ -11813,7 +12196,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11813
12196
|
height: '100%',
|
|
11814
12197
|
position: 'relative'
|
|
11815
12198
|
},
|
|
11816
|
-
children: [children, jsx(MapMousePosition, {}), !!holdShiftToScroll && !!isMouseWheelZoomEnabled && jsx(HoldShiftToZoomMessage, {})]
|
|
12199
|
+
children: [children, /*#__PURE__*/jsx(MapMousePosition, {}), !!holdShiftToScroll && !!isMouseWheelZoomEnabled && /*#__PURE__*/jsx(HoldShiftToZoomMessage, {})]
|
|
11817
12200
|
})
|
|
11818
12201
|
});
|
|
11819
12202
|
};
|
|
@@ -11827,6 +12210,7 @@ var initializeOpenLayersProjections = function initializeOpenLayersProjections()
|
|
|
11827
12210
|
});
|
|
11828
12211
|
register(proj4);
|
|
11829
12212
|
};
|
|
12213
|
+
|
|
11830
12214
|
/**
|
|
11831
12215
|
* Returns a preferred projection to use with a particular layer. It will search the layer props for
|
|
11832
12216
|
* a supported srs that either matches the current view srs or an srs that geoweb has reprojection math
|
|
@@ -11898,6 +12282,7 @@ var useProjection = function useProjection() {
|
|
|
11898
12282
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
11899
12283
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
11900
12284
|
* */
|
|
12285
|
+
|
|
11901
12286
|
var setMapCenter = function setMapCenter(map, lon, lat, zoomLevel) {
|
|
11902
12287
|
var center = fromLonLat([lon, lat], map.getView().getProjection());
|
|
11903
12288
|
map.getView().setCenter(center);
|
|
@@ -11923,6 +12308,7 @@ var setMapCenter = function setMapCenter(map, lon, lat, zoomLevel) {
|
|
|
11923
12308
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
11924
12309
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
11925
12310
|
* */
|
|
12311
|
+
|
|
11926
12312
|
var FEATURE_DRAW_FILL_COLOR_TRANSPARENT = '#186DFF18';
|
|
11927
12313
|
var FEATURE_DRAW_FILL_COLOR = '#186DFF';
|
|
11928
12314
|
var FEATURE_DRAW_STROKE_COLOR = '#186DFF';
|
|
@@ -11946,6 +12332,7 @@ var FEATURE_DRAW_SECONDARY_STROKE_COLOR = '#6e1e91';
|
|
|
11946
12332
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
11947
12333
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11948
12334
|
* */
|
|
12335
|
+
|
|
11949
12336
|
var DEFAULT_GEOJSON_STYLE_FILL_OPACITY = 0.1;
|
|
11950
12337
|
var defaultGeoJSONStyleProperties = {
|
|
11951
12338
|
fill: FEATURE_DRAW_FILL_COLOR,
|
|
@@ -12016,8 +12403,10 @@ var lineStringCollection = {
|
|
|
12016
12403
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12017
12404
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
12018
12405
|
* */
|
|
12406
|
+
|
|
12019
12407
|
// Cache for for storing and reusing Proj4 instances
|
|
12020
12408
|
var projectorCache = {};
|
|
12409
|
+
|
|
12021
12410
|
// Ensure that you have a proj4 object, pulling from the cache if necessary
|
|
12022
12411
|
var getProj4 = function getProj4(projection) {
|
|
12023
12412
|
// Duck typing: check for the 'forward' and 'inverse' methods which are present on proj4 projection objects
|
|
@@ -12074,6 +12463,7 @@ var addFeatureProperties = function addFeatureProperties(geojson, featurePropert
|
|
|
12074
12463
|
}
|
|
12075
12464
|
});
|
|
12076
12465
|
};
|
|
12466
|
+
|
|
12077
12467
|
/**
|
|
12078
12468
|
* Checks if the geometry of the feature is empty as defined per GeoJSON spec.
|
|
12079
12469
|
* According to the specification, an empty geometry is type 'Polygon' and coordinates
|
|
@@ -12103,6 +12493,7 @@ var getGeoJSONPropertyValue = function getGeoJSONPropertyValue(property, propert
|
|
|
12103
12493
|
// otherwise get values from default properties
|
|
12104
12494
|
return defaultProperties === null || defaultProperties === void 0 ? void 0 : defaultProperties[property];
|
|
12105
12495
|
};
|
|
12496
|
+
|
|
12106
12497
|
/**
|
|
12107
12498
|
* moves geoJSON feature as new feature. Mutates newGeoJSON
|
|
12108
12499
|
* @constructor
|
|
@@ -12157,6 +12548,7 @@ var moveFeature = function moveFeature(currentGeoJSON, newGeoJSON, featureLayerI
|
|
|
12157
12548
|
}
|
|
12158
12549
|
return undefined;
|
|
12159
12550
|
};
|
|
12551
|
+
|
|
12160
12552
|
/**
|
|
12161
12553
|
* Returns the intersection of two point features. In case of a polygon, only the first feature is used.
|
|
12162
12554
|
* @param intersectA Feature A
|
|
@@ -12193,6 +12585,7 @@ var intersectPointGeoJSONS = function intersectPointGeoJSONS(intersectA, interse
|
|
|
12193
12585
|
}] : [featureA]
|
|
12194
12586
|
}, geoJSONProperties);
|
|
12195
12587
|
};
|
|
12588
|
+
|
|
12196
12589
|
// Helper functions for projection matching
|
|
12197
12590
|
function makeProjectorsFromCode(epsg) {
|
|
12198
12591
|
if (!epsg || epsg === 'EPSG:4326') {
|
|
@@ -12204,6 +12597,7 @@ function makeProjectorsFromCode(epsg) {
|
|
|
12204
12597
|
unproject: id
|
|
12205
12598
|
};
|
|
12206
12599
|
}
|
|
12600
|
+
|
|
12207
12601
|
// 3857-variants
|
|
12208
12602
|
if (['EPSG:3857', 'EPSG:3785', 'EPSG:900913', 'EPSG:102100'].includes(epsg)) {
|
|
12209
12603
|
return {
|
|
@@ -12216,6 +12610,7 @@ function makeProjectorsFromCode(epsg) {
|
|
|
12216
12610
|
};
|
|
12217
12611
|
}
|
|
12218
12612
|
var fwd = proj4('EPSG:4326', epsg); // WGS84 -> target SRS
|
|
12613
|
+
|
|
12219
12614
|
var project = function project(feat) {
|
|
12220
12615
|
var out = cloneDeep(feat);
|
|
12221
12616
|
coordEach(out, function (coords) {
|
|
@@ -12251,12 +12646,14 @@ function makeProjectorsFromCode(epsg) {
|
|
|
12251
12646
|
unproject: unproject
|
|
12252
12647
|
};
|
|
12253
12648
|
}
|
|
12649
|
+
|
|
12254
12650
|
/**
|
|
12255
12651
|
* Returns the intersection of two (multi) polygon features. In case of a polygon, only the first feature is used.
|
|
12256
12652
|
* @param intersectA Feature A
|
|
12257
12653
|
* @param intersectB Feature B
|
|
12258
12654
|
* @returns The intersection of the two features.
|
|
12259
12655
|
*/
|
|
12656
|
+
|
|
12260
12657
|
function intersectPolygonGeoJSONS(intersectA,
|
|
12261
12658
|
// drawn polygon (WGS84)
|
|
12262
12659
|
intersectB) {
|
|
@@ -12271,12 +12668,14 @@ intersectB) {
|
|
|
12271
12668
|
// Pull geometry
|
|
12272
12669
|
var drawnPolygon = intersectA.features[0];
|
|
12273
12670
|
var firPolygon = intersectB.features[0];
|
|
12671
|
+
|
|
12274
12672
|
// Projector based on active map projection
|
|
12275
12673
|
var _makeProjectorsFromCo = makeProjectorsFromCode(projectionCode),
|
|
12276
12674
|
project = _makeProjectorsFromCo.project,
|
|
12277
12675
|
unproject = _makeProjectorsFromCo.unproject;
|
|
12278
12676
|
var drawnInMap = project(drawnPolygon);
|
|
12279
12677
|
var firInMap = project(firPolygon);
|
|
12678
|
+
|
|
12280
12679
|
// Intersect in map projection
|
|
12281
12680
|
var pair = {
|
|
12282
12681
|
type: 'FeatureCollection',
|
|
@@ -12298,6 +12697,7 @@ intersectB) {
|
|
|
12298
12697
|
}]
|
|
12299
12698
|
}, geoJSONProperties);
|
|
12300
12699
|
}
|
|
12700
|
+
|
|
12301
12701
|
// Back to WGS84 for rendering
|
|
12302
12702
|
var intersectionWgs84 = unproject(intersectionInMapProj);
|
|
12303
12703
|
var intersectionWgs84Cleaned = cleanCoords(intersectionWgs84);
|
|
@@ -12309,11 +12709,13 @@ intersectB) {
|
|
|
12309
12709
|
var isPointFeatureCollection = function isPointFeatureCollection(geojson) {
|
|
12310
12710
|
return geojson.features[0].geometry.type === 'Point';
|
|
12311
12711
|
};
|
|
12712
|
+
|
|
12312
12713
|
/**
|
|
12313
12714
|
* Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
|
|
12314
12715
|
* @param geoJSONs
|
|
12315
12716
|
* @returns GeoJSONS extend with intersections
|
|
12316
12717
|
*/
|
|
12718
|
+
|
|
12317
12719
|
var createInterSections = function createInterSections(geojson, otherGeoJSON) {
|
|
12318
12720
|
var geoJSONproperties = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
12319
12721
|
stroke: '#f24a00',
|
|
@@ -12391,6 +12793,7 @@ var getFeatureCollection = function getFeatureCollection(geoJSONFeature, shouldA
|
|
|
12391
12793
|
features: [geoJSONFeature]
|
|
12392
12794
|
});
|
|
12393
12795
|
};
|
|
12796
|
+
|
|
12394
12797
|
// check if geoJSON has same selectionType in properties as passed selectionType
|
|
12395
12798
|
var isGeoJSONFeatureCreatedByTool = function isGeoJSONFeatureCreatedByTool(existingJSON, selectionType) {
|
|
12396
12799
|
var _existingJSON$feature;
|
|
@@ -12404,7 +12807,8 @@ var isGeoJSONFeatureCreatedByTool = function isGeoJSONFeatureCreatedByTool(exist
|
|
|
12404
12807
|
var rewindGeometry = function rewindGeometry(geoJSON) {
|
|
12405
12808
|
return produce(geoJSON, function (geoJSONDraft) {
|
|
12406
12809
|
if (geoJSONDraft && geoJSONDraft.features.length > 0 && geoJSONDraft.features[0].geometry.type === 'Polygon' && geoJSONDraft.features[0].geometry.coordinates[0].length > 1) {
|
|
12407
|
-
var
|
|
12810
|
+
var _ref = geoJSON.features[0],
|
|
12811
|
+
geometry = _ref.geometry;
|
|
12408
12812
|
var lineString = polygonToLine(geometry);
|
|
12409
12813
|
if (booleanClockwise(lineString.geometry.coordinates)) {
|
|
12410
12814
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -12466,6 +12870,7 @@ var getDrawModeIdFromSelectionType = function getDrawModeIdFromSelectionType(sel
|
|
|
12466
12870
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
12467
12871
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
12468
12872
|
* */
|
|
12873
|
+
|
|
12469
12874
|
initializeOpenLayersProjections();
|
|
12470
12875
|
var setViewFromExtent = function setViewFromExtent(view, bbox) {
|
|
12471
12876
|
if (!bbox || !Number(bbox.left) || !isFinite(bbox.left) || isNaN(bbox.left)) {
|
|
@@ -12511,6 +12916,7 @@ var privateWmsGetCapabilities = privateWebMapUtils.privateWmsGetCapabilities,
|
|
|
12511
12916
|
privateWmsFlattenLayerTree = privateWebMapUtils.privateWmsFlattenLayerTree,
|
|
12512
12917
|
privateWmtsGetCapabilities = privateWebMapUtils.privateWmtsGetCapabilities,
|
|
12513
12918
|
QUERYWMS_GETCAPABILITIES = privateWebMapUtils.QUERYWMS_GETCAPABILITIES;
|
|
12919
|
+
|
|
12514
12920
|
/**
|
|
12515
12921
|
* Queries the WMS GetCapabilities. This is the base TanStack hook for the other hooks in this file.
|
|
12516
12922
|
*
|
|
@@ -12540,6 +12946,7 @@ var useQueryGetWMSGetCapabilities = function useQueryGetWMSGetCapabilities(servi
|
|
|
12540
12946
|
}()
|
|
12541
12947
|
});
|
|
12542
12948
|
};
|
|
12949
|
+
|
|
12543
12950
|
/**
|
|
12544
12951
|
* Returns details about the WMS service
|
|
12545
12952
|
*
|
|
@@ -12562,6 +12969,7 @@ var useQueryGetWMSServiceInfo = function useQueryGetWMSServiceInfo(serviceUrl) {
|
|
|
12562
12969
|
}, [serviceUrl, getCapabilitiesJSON]);
|
|
12563
12970
|
return serviceInfo;
|
|
12564
12971
|
};
|
|
12972
|
+
|
|
12565
12973
|
/**
|
|
12566
12974
|
* Gets the layer tree in hierarchical order for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
12567
12975
|
*
|
|
@@ -12584,6 +12992,7 @@ var useQueryGetWMSLayersTree = function useQueryGetWMSLayersTree(serviceUrl) {
|
|
|
12584
12992
|
}, [serviceUrl, getCapabilitiesJSON]);
|
|
12585
12993
|
return layerTree;
|
|
12586
12994
|
};
|
|
12995
|
+
|
|
12587
12996
|
/**
|
|
12588
12997
|
* Gets the flat layer list (without hierarchy) for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
12589
12998
|
*
|
|
@@ -12611,6 +13020,7 @@ var useQueryGetWMSLayers = function useQueryGetWMSLayers(serviceUrl) {
|
|
|
12611
13020
|
}, [serviceUrl, getCapabilitiesJSON]);
|
|
12612
13021
|
return layers;
|
|
12613
13022
|
};
|
|
13023
|
+
|
|
12614
13024
|
/**
|
|
12615
13025
|
* Returns specific layer from the WMS service
|
|
12616
13026
|
*
|
|
@@ -12631,6 +13041,7 @@ var useQueryGetWMSLayer = function useQueryGetWMSLayer(serviceUrl, name) {
|
|
|
12631
13041
|
}, [layers, name]);
|
|
12632
13042
|
return layer;
|
|
12633
13043
|
};
|
|
13044
|
+
|
|
12634
13045
|
/**
|
|
12635
13046
|
* Returns a stylelist for given layer in a service
|
|
12636
13047
|
*
|
|
@@ -12642,6 +13053,7 @@ var useGetWMSLayerStyleList = function useGetWMSLayerStyleList(serviceUrl, name)
|
|
|
12642
13053
|
var _useQueryGetWMSLayer;
|
|
12643
13054
|
return ((_useQueryGetWMSLayer = useQueryGetWMSLayer(serviceUrl, name)) === null || _useQueryGetWMSLayer === void 0 ? void 0 : _useQueryGetWMSLayer.styles) || null;
|
|
12644
13055
|
};
|
|
13056
|
+
|
|
12645
13057
|
/**
|
|
12646
13058
|
* Returns a WMLayer instance. If the layerType is LayerType.mapLayer or LayerType.wmtsMapLayer, the layer will detect the right type and will contain the parsed dimensions and styles.
|
|
12647
13059
|
*
|
|
@@ -12665,6 +13077,7 @@ var useGetWMLayerInstance = function useGetWMLayerInstance(layerFoundation) {
|
|
|
12665
13077
|
var layerId = refId.current;
|
|
12666
13078
|
var _useContext = useContext(TimeContext),
|
|
12667
13079
|
refTimeDimensionModes = _useContext.refTimeDimensionModes;
|
|
13080
|
+
|
|
12668
13081
|
// Check if the layer is already registered
|
|
12669
13082
|
var tmpWMLayer = webmapUtils.getWMLayerById(layerId);
|
|
12670
13083
|
var layerIdChanged = id && id !== (tmpWMLayer === null || tmpWMLayer === void 0 ? void 0 : tmpWMLayer.id);
|
|
@@ -12703,6 +13116,7 @@ var useGetWMLayerInstance = function useGetWMLayerInstance(layerFoundation) {
|
|
|
12703
13116
|
errorMessage: errorMessage
|
|
12704
13117
|
};
|
|
12705
13118
|
};
|
|
13119
|
+
|
|
12706
13120
|
/**
|
|
12707
13121
|
* Used for querying WMTS GetCapabilities documents
|
|
12708
13122
|
* @param serviceUrl
|
|
@@ -12787,6 +13201,7 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12787
13201
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12788
13202
|
render = _useState2[0],
|
|
12789
13203
|
setRender = _useState2[1];
|
|
13204
|
+
|
|
12790
13205
|
// Sets a timer
|
|
12791
13206
|
useEffect(function () {
|
|
12792
13207
|
intervalIdRef.current = setInterval(function () {
|
|
@@ -12814,7 +13229,7 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12814
13229
|
var top = requestedStepIsOutsideRange ? '5px' : '2px';
|
|
12815
13230
|
var left = "calc(25% + ".concat(index * itemWidth, "px)");
|
|
12816
13231
|
var opacity = isSelectedStep ? 1 : 0.8;
|
|
12817
|
-
return jsx("span", {
|
|
13232
|
+
return /*#__PURE__*/jsx("span", {
|
|
12818
13233
|
style: {
|
|
12819
13234
|
background: isSelectedStep ? '#C0FF50' : colorLayerIsOutsideRange,
|
|
12820
13235
|
display: 'block',
|
|
@@ -12834,16 +13249,16 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12834
13249
|
var dimsInfo = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions.map(function (wmLayerDimension) {
|
|
12835
13250
|
return getDimensionInfo(wmLayerDimension);
|
|
12836
13251
|
});
|
|
12837
|
-
var tooltipText = jsxs("span", {
|
|
12838
|
-
children: [wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title, ": ", jsx("br", {}), wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions.map(function (dim, index) {
|
|
12839
|
-
return jsxs("span", {
|
|
12840
|
-
children: [dim.name, ": ", formatDimensionVal(dim.name, dim.currentValue), index < dimsInfo.length - 1 && jsx("br", {})]
|
|
13252
|
+
var tooltipText = /*#__PURE__*/jsxs("span", {
|
|
13253
|
+
children: [wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title, ": ", /*#__PURE__*/jsx("br", {}), wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions.map(function (dim, index) {
|
|
13254
|
+
return /*#__PURE__*/jsxs("span", {
|
|
13255
|
+
children: [dim.name, ": ", formatDimensionVal(dim.name, dim.currentValue), index < dimsInfo.length - 1 && /*#__PURE__*/jsx("br", {})]
|
|
12841
13256
|
}, "".concat(dim.name, "-").concat(dim.currentValue));
|
|
12842
13257
|
})]
|
|
12843
13258
|
});
|
|
12844
|
-
return jsx(CustomTooltip, {
|
|
13259
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
12845
13260
|
title: tooltipText,
|
|
12846
|
-
children: jsxs("div", {
|
|
13261
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
12847
13262
|
"data-testid": "debug-info",
|
|
12848
13263
|
style: {
|
|
12849
13264
|
position: 'relative',
|
|
@@ -12853,14 +13268,14 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12853
13268
|
marginTop: '12px',
|
|
12854
13269
|
marginBottom: '-10px'
|
|
12855
13270
|
},
|
|
12856
|
-
children: [jsx("div", {
|
|
13271
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
12857
13272
|
style: {
|
|
12858
13273
|
width: '100%'
|
|
12859
13274
|
},
|
|
12860
|
-
children: jsx("div", {
|
|
13275
|
+
children: /*#__PURE__*/jsx("div", {
|
|
12861
13276
|
children: items
|
|
12862
13277
|
})
|
|
12863
|
-
}), jsxs("div", {
|
|
13278
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
12864
13279
|
style: {
|
|
12865
13280
|
left: '10px',
|
|
12866
13281
|
paddingTop: '3px',
|
|
@@ -12869,7 +13284,7 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12869
13284
|
opacity: 0.85,
|
|
12870
13285
|
width: '100%'
|
|
12871
13286
|
},
|
|
12872
|
-
children: [jsx("span", {
|
|
13287
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
12873
13288
|
style: {
|
|
12874
13289
|
display: 'inline-block',
|
|
12875
13290
|
verticalAlign: 'top',
|
|
@@ -12885,14 +13300,14 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12885
13300
|
borderRadius: 2
|
|
12886
13301
|
},
|
|
12887
13302
|
children: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title
|
|
12888
|
-
}), jsx("span", {
|
|
13303
|
+
}), /*#__PURE__*/jsx("span", {
|
|
12889
13304
|
style: {
|
|
12890
13305
|
display: 'inline-block',
|
|
12891
13306
|
width: '75%',
|
|
12892
13307
|
opacity: '0.7'
|
|
12893
13308
|
},
|
|
12894
13309
|
children: dimsInfo.map(function (dimension) {
|
|
12895
|
-
return jsx("span", {
|
|
13310
|
+
return /*#__PURE__*/jsx("span", {
|
|
12896
13311
|
style: {
|
|
12897
13312
|
margin: '0 0 0 0px',
|
|
12898
13313
|
padding: '1px 5px',
|
|
@@ -12934,6 +13349,7 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
12934
13349
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12935
13350
|
layer = _useState2[0],
|
|
12936
13351
|
setLayer = _useState2[1];
|
|
13352
|
+
|
|
12937
13353
|
// get a wmLayer instance
|
|
12938
13354
|
var _useGetWMLayerInstanc = useGetWMLayerInstance({
|
|
12939
13355
|
service: getCapsURL,
|
|
@@ -12948,23 +13364,26 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
12948
13364
|
}
|
|
12949
13365
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests
|
|
12950
13366
|
var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
|
|
13367
|
+
|
|
12951
13368
|
// This string can be used safely in a useEffect or other React hook to check if the contents changed
|
|
12952
13369
|
var dimensionsValuesEffectCheck = dimensionsValues && Object.entries(dimensionsValues).map(function (dimensionNameAndCurrentValue) {
|
|
12953
13370
|
return "".concat(dimensionNameAndCurrentValue[0], ":").concat(dimensionNameAndCurrentValue[1]);
|
|
12954
13371
|
}).join(',');
|
|
12955
13372
|
var prefetchListEffectCheck = (prefetchList !== null && prefetchList !== void 0 ? prefetchList : []).join(',');
|
|
13373
|
+
|
|
12956
13374
|
// Make a TimeawareImageSource and add it to the map, add and remove should only be done when the map changes, layer id changes, visibility changes or dimensionsValues get defined.
|
|
12957
13375
|
useEffect(function () {
|
|
12958
13376
|
if (!map || !wmLayer || !visible || !dimensionsValues) {
|
|
12959
13377
|
return function () {};
|
|
12960
13378
|
}
|
|
13379
|
+
|
|
12961
13380
|
// When this component mounts, an ImageLayer is added to the map. Once it unmounts, this layer is removed from the map.
|
|
12962
13381
|
var olLayer = new ImageLayer({
|
|
12963
13382
|
source: new TimeawareImageSource({
|
|
12964
13383
|
wmsUrl: wmLayer.getmapURL,
|
|
12965
13384
|
layerName: wmLayer.name,
|
|
12966
13385
|
layerId: layerId || '',
|
|
12967
|
-
styleName: styleName,
|
|
13386
|
+
styleName: styleName && styleName !== 'default' ? styleName : '',
|
|
12968
13387
|
dimProps: dimensionsValues,
|
|
12969
13388
|
timeStampsToPrefetch: [],
|
|
12970
13389
|
visible: visible
|
|
@@ -12981,12 +13400,14 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
12981
13400
|
map.removeLayer(olLayer);
|
|
12982
13401
|
olLayer.dispose();
|
|
12983
13402
|
};
|
|
13403
|
+
|
|
12984
13404
|
// The dependency list should only contain the map, wmLayer, visible and dimensionValues. Other prop changes are handled by other effects.
|
|
12985
13405
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12986
13406
|
}, [map, wmLayer, visible, dimensionsValues === undefined]);
|
|
12987
13407
|
useEffect(function () {
|
|
12988
13408
|
onLayerReady && wmLayer && layerId && onLayerReady(layerId);
|
|
12989
13409
|
}, [layerId, wmLayer, onLayerReady]);
|
|
13410
|
+
|
|
12990
13411
|
// Initialize layer for GeoWeb, call onInitializeLayer
|
|
12991
13412
|
useEffect(function () {
|
|
12992
13413
|
var initializeLayer = /*#__PURE__*/function () {
|
|
@@ -13019,8 +13440,10 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13019
13440
|
firstRefTime = refTimeDim === null || refTimeDim === void 0 ? void 0 : refTimeDim.getClosestValue(refTimeToFind, true);
|
|
13020
13441
|
firstRefTime && refTimeDim && (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.setTimeValuesForReferenceTime(firstRefTime, refTimeDim));
|
|
13021
13442
|
}
|
|
13443
|
+
|
|
13022
13444
|
// Make sure style is set in wmLayer as well
|
|
13023
13445
|
styleName && wmLayer.setStyle(styleName);
|
|
13446
|
+
|
|
13024
13447
|
// Make sure we have the latest dimension values before initializing
|
|
13025
13448
|
_context.next = 10;
|
|
13026
13449
|
return wmLayer.parseLayer();
|
|
@@ -13055,9 +13478,11 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13055
13478
|
return window.console.error(e);
|
|
13056
13479
|
});
|
|
13057
13480
|
return function () {};
|
|
13481
|
+
|
|
13058
13482
|
// Effect array should only contain wmLayer and layerName
|
|
13059
13483
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13060
13484
|
}, [wmLayer, layerName]);
|
|
13485
|
+
|
|
13061
13486
|
// Layer opacity and zIndex useEffect
|
|
13062
13487
|
useEffect(function () {
|
|
13063
13488
|
if (!layerOptions || !layer) {
|
|
@@ -13071,33 +13496,38 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13071
13496
|
}
|
|
13072
13497
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13073
13498
|
}, [layer, layerOptions === null || layerOptions === void 0 ? void 0 : layerOptions.zIndex, layerOptions === null || layerOptions === void 0 ? void 0 : layerOptions.opacity]);
|
|
13499
|
+
|
|
13074
13500
|
// Layer visible useEffect
|
|
13075
13501
|
useEffect(function () {
|
|
13076
13502
|
layer === null || layer === void 0 || layer.setVisible(visible);
|
|
13077
13503
|
}, [layer, visible]);
|
|
13504
|
+
|
|
13078
13505
|
// Layer styleName properties useEffect
|
|
13079
13506
|
useEffect(function () {
|
|
13080
13507
|
if (wmLayer) {
|
|
13081
13508
|
var _styles$, _layer$getSource;
|
|
13082
13509
|
var styles = wmLayer.getStyles();
|
|
13083
|
-
var style = styleName && styles.some(function (style) {
|
|
13510
|
+
var style = styleName && styleName !== 'default' && styles.some(function (style) {
|
|
13084
13511
|
return style.name === styleName;
|
|
13085
|
-
}) ? styleName :
|
|
13086
|
-
wmLayer.setStyle(style);
|
|
13512
|
+
}) ? styleName : '';
|
|
13513
|
+
wmLayer.setStyle(style || ((_styles$ = styles[0]) === null || _styles$ === void 0 ? void 0 : _styles$.name) || '');
|
|
13087
13514
|
layer === null || layer === void 0 || (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 || _layer$getSource.setStyle(style);
|
|
13088
13515
|
}
|
|
13089
13516
|
}, [layer, styleName, wmLayer]);
|
|
13517
|
+
|
|
13090
13518
|
// layerName useEffect
|
|
13091
13519
|
useEffect(function () {
|
|
13092
13520
|
var _layer$getSource2;
|
|
13093
13521
|
layer === null || layer === void 0 || (_layer$getSource2 = layer.getSource()) === null || _layer$getSource2 === void 0 || _layer$getSource2.setLayerName(layerName);
|
|
13094
13522
|
}, [layer, layerName]);
|
|
13523
|
+
|
|
13095
13524
|
// Layer dim values useEffect,
|
|
13096
13525
|
useEffect(function () {
|
|
13097
13526
|
var _layer$getSource3;
|
|
13098
13527
|
dimensionsValues && (layer === null || layer === void 0 || (_layer$getSource3 = layer.getSource()) === null || _layer$getSource3 === void 0 ? void 0 : _layer$getSource3.setDimProps(dimensionsValues));
|
|
13099
13528
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13100
13529
|
}, [layer, dimensionsValuesEffectCheck]);
|
|
13530
|
+
|
|
13101
13531
|
// Prefetch useEffect
|
|
13102
13532
|
useEffect(function () {
|
|
13103
13533
|
var _wmLayer$dimensions3;
|
|
@@ -13125,11 +13555,12 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13125
13555
|
// - dimensionsValuesEffectCheck,
|
|
13126
13556
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13127
13557
|
}, [layer, wmLayer, prefetchListEffectCheck, layerName, styleName, dimensionsValuesEffectCheck]);
|
|
13558
|
+
|
|
13128
13559
|
// Only show debug info for data layers with time dimension
|
|
13129
13560
|
var hasTimeDim = (_wmLayer$dimensions$f = wmLayer === null || wmLayer === void 0 || (_wmLayer$dimensions4 = wmLayer.dimensions) === null || _wmLayer$dimensions4 === void 0 ? void 0 : _wmLayer$dimensions4.findIndex(function (dimension) {
|
|
13130
13561
|
return dimension.name === 'time';
|
|
13131
13562
|
})) !== null && _wmLayer$dimensions$f !== void 0 ? _wmLayer$dimensions$f : -1;
|
|
13132
|
-
return debugMode && hasTimeDim !== -1 ? jsx(ShowTimeAwareLayerInfo, {
|
|
13563
|
+
return debugMode && hasTimeDim !== -1 ? /*#__PURE__*/jsx(ShowTimeAwareLayerInfo, {
|
|
13133
13564
|
layer: layer,
|
|
13134
13565
|
stepsToCheck: prefetchList,
|
|
13135
13566
|
visible: visible,
|
|
@@ -13155,6 +13586,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13155
13586
|
setProjection = _useState4[1];
|
|
13156
13587
|
var layerInformation = useQueryGetWMSLayer(url, layerName);
|
|
13157
13588
|
var mapProjection = useProjection();
|
|
13589
|
+
|
|
13158
13590
|
// Listen to changes in the map projection
|
|
13159
13591
|
useEffect(function () {
|
|
13160
13592
|
var _map$getView;
|
|
@@ -13173,6 +13605,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13173
13605
|
unByKey(eventKey);
|
|
13174
13606
|
};
|
|
13175
13607
|
}, [map, layerInformation, mapProjection]);
|
|
13608
|
+
|
|
13176
13609
|
// Set up layer
|
|
13177
13610
|
useEffect(function () {
|
|
13178
13611
|
if (!map || !layerName || !projection) {
|
|
@@ -13199,6 +13632,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13199
13632
|
setLayer(undefined);
|
|
13200
13633
|
};
|
|
13201
13634
|
}, [map, url, projection, layerName, styleName]);
|
|
13635
|
+
|
|
13202
13636
|
// Update layer options
|
|
13203
13637
|
useEffect(function () {
|
|
13204
13638
|
if (!layerOptions || !layer) {
|
|
@@ -13216,6 +13650,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13216
13650
|
return;
|
|
13217
13651
|
}
|
|
13218
13652
|
layer.setVisible(!!layerProps.enabled);
|
|
13653
|
+
|
|
13219
13654
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13220
13655
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13221
13656
|
return null;
|
|
@@ -13238,6 +13673,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13238
13673
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
13239
13674
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
13240
13675
|
* */
|
|
13676
|
+
|
|
13241
13677
|
var WMTSDimensionsFromDimensions = function WMTSDimensionsFromDimensions(dimensions) {
|
|
13242
13678
|
return dimensions.map(function (item) {
|
|
13243
13679
|
return item.name ? _defineProperty({}, item.name[0].toUpperCase() + item.name.slice(1).toLowerCase(), item.currentValue) : {};
|
|
@@ -13318,6 +13754,7 @@ var WMTSLayer = function WMTSLayer(_ref) {
|
|
|
13318
13754
|
return;
|
|
13319
13755
|
}
|
|
13320
13756
|
layer.setVisible(!!layerProps.enabled);
|
|
13757
|
+
|
|
13321
13758
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13322
13759
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13323
13760
|
return null;
|
|
@@ -13370,6 +13807,7 @@ var XYZLayer = function XYZLayer(_ref) {
|
|
|
13370
13807
|
return;
|
|
13371
13808
|
}
|
|
13372
13809
|
layer.setVisible(!!layerProps.enabled);
|
|
13810
|
+
|
|
13373
13811
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13374
13812
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13375
13813
|
return null;
|
|
@@ -13392,6 +13830,7 @@ var XYZLayer = function XYZLayer(_ref) {
|
|
|
13392
13830
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
13393
13831
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
13394
13832
|
* */
|
|
13833
|
+
|
|
13395
13834
|
var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, refetchInterval) {
|
|
13396
13835
|
var shouldAutoFetch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
13397
13836
|
var intervalIdRef = useRef();
|
|
@@ -13409,6 +13848,7 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
|
|
|
13409
13848
|
refetch();
|
|
13410
13849
|
}
|
|
13411
13850
|
}, [refetch, refetchInterval]);
|
|
13851
|
+
|
|
13412
13852
|
// Triggers when document becomes visible
|
|
13413
13853
|
useLayoutEffect(function () {
|
|
13414
13854
|
var onVisibilityChange = function onVisibilityChange() {
|
|
@@ -13420,6 +13860,7 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
|
|
|
13420
13860
|
};
|
|
13421
13861
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13422
13862
|
}, [refetchInterval, shouldAutoFetch]);
|
|
13863
|
+
|
|
13423
13864
|
// Sets a timer
|
|
13424
13865
|
useEffect(function () {
|
|
13425
13866
|
intervalIdRef.current = setInterval(refetch, refetchInterval);
|
|
@@ -13447,6 +13888,7 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
|
|
|
13447
13888
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
13448
13889
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
13449
13890
|
* */
|
|
13891
|
+
|
|
13450
13892
|
initializeOpenLayersProjections();
|
|
13451
13893
|
var useViewFromLayer = function useViewFromLayer(layerProps) {
|
|
13452
13894
|
var baseView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
@@ -13639,11 +14081,30 @@ var TiledWMSLayer = function TiledWMSLayer(_ref) {
|
|
|
13639
14081
|
return;
|
|
13640
14082
|
}
|
|
13641
14083
|
layer.setVisible(!!layerProps.enabled);
|
|
14084
|
+
|
|
13642
14085
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13643
14086
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13644
14087
|
return null;
|
|
13645
14088
|
};
|
|
13646
14089
|
|
|
14090
|
+
/* *
|
|
14091
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14092
|
+
* you may not use this file except in compliance with the License.
|
|
14093
|
+
* You may obtain a copy of the License at
|
|
14094
|
+
*
|
|
14095
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14096
|
+
*
|
|
14097
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14098
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14099
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14100
|
+
* See the License for the specific language governing permissions and
|
|
14101
|
+
* limitations under the License.
|
|
14102
|
+
*
|
|
14103
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
14104
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
14105
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
14106
|
+
* */
|
|
14107
|
+
|
|
13647
14108
|
var layerOptions = {
|
|
13648
14109
|
zIndex: 1,
|
|
13649
14110
|
opacity: 1
|
|
@@ -13651,18 +14112,18 @@ var layerOptions = {
|
|
|
13651
14112
|
var layerProps = {
|
|
13652
14113
|
enabled: true
|
|
13653
14114
|
};
|
|
13654
|
-
var BaseLayerType
|
|
13655
|
-
(function (BaseLayerType) {
|
|
14115
|
+
var BaseLayerType = /*#__PURE__*/function (BaseLayerType) {
|
|
13656
14116
|
BaseLayerType[BaseLayerType["LIGHT_GREY_CANVAS"] = 0] = "LIGHT_GREY_CANVAS";
|
|
13657
14117
|
BaseLayerType[BaseLayerType["WORLD_TOPO"] = 1] = "WORLD_TOPO";
|
|
13658
|
-
|
|
14118
|
+
return BaseLayerType;
|
|
14119
|
+
}({});
|
|
13659
14120
|
var DefaultBaseLayers = function DefaultBaseLayers(_ref) {
|
|
13660
14121
|
var _ref$type = _ref.type,
|
|
13661
14122
|
type = _ref$type === void 0 ? BaseLayerType.LIGHT_GREY_CANVAS : _ref$type;
|
|
13662
14123
|
var getBase = function getBase() {
|
|
13663
14124
|
switch (type) {
|
|
13664
14125
|
case BaseLayerType.WORLD_TOPO:
|
|
13665
|
-
return jsx(WMTSLayer, {
|
|
14126
|
+
return /*#__PURE__*/jsx(WMTSLayer, {
|
|
13666
14127
|
getCapsURL: "https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/WMTS?SERVICE=WMTS&REQUEST=GetCapabilities",
|
|
13667
14128
|
layerName: "World_Topo_Map",
|
|
13668
14129
|
layerOptions: layerOptions,
|
|
@@ -13671,15 +14132,15 @@ var DefaultBaseLayers = function DefaultBaseLayers(_ref) {
|
|
|
13671
14132
|
});
|
|
13672
14133
|
case BaseLayerType.LIGHT_GREY_CANVAS:
|
|
13673
14134
|
default:
|
|
13674
|
-
return jsx(XYZLayer, {
|
|
14135
|
+
return /*#__PURE__*/jsx(XYZLayer, {
|
|
13675
14136
|
layerOptions: layerOptions,
|
|
13676
14137
|
layerProps: layerProps,
|
|
13677
14138
|
urlTemplate: "https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap_Light_Grey_Canvas/EPSG3857/{z}/{x}/{y}.png"
|
|
13678
14139
|
});
|
|
13679
14140
|
}
|
|
13680
14141
|
};
|
|
13681
|
-
return jsxs(Fragment, {
|
|
13682
|
-
children: [getBase(), jsx(TiledWMSLayer, {
|
|
14142
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
14143
|
+
children: [getBase(), /*#__PURE__*/jsx(TiledWMSLayer, {
|
|
13683
14144
|
layerName: "countryborders",
|
|
13684
14145
|
layerOptions: {
|
|
13685
14146
|
zIndex: 999,
|
|
@@ -13757,6 +14218,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
13757
14218
|
(_layerRef$current2 = layerRef.current) === null || _layerRef$current2 === void 0 || _layerRef$current2.setOpacity(opacity);
|
|
13758
14219
|
}
|
|
13759
14220
|
}, [opacity]);
|
|
14221
|
+
|
|
13760
14222
|
// Layer visible useEffect
|
|
13761
14223
|
useEffect(function () {
|
|
13762
14224
|
var _layerRef$current3;
|
|
@@ -13833,11 +14295,30 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
13833
14295
|
return null;
|
|
13834
14296
|
};
|
|
13835
14297
|
|
|
14298
|
+
/* *
|
|
14299
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14300
|
+
* you may not use this file except in compliance with the License.
|
|
14301
|
+
* You may obtain a copy of the License at
|
|
14302
|
+
*
|
|
14303
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14304
|
+
*
|
|
14305
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14306
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14307
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14308
|
+
* See the License for the specific language governing permissions and
|
|
14309
|
+
* limitations under the License.
|
|
14310
|
+
*
|
|
14311
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
14312
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
14313
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
14314
|
+
* */
|
|
14315
|
+
|
|
13836
14316
|
var defaultLegend = makeLegendFromColorMap({
|
|
13837
14317
|
colors: colorMaps.temperatureLegendColorsWoW,
|
|
13838
14318
|
min: -18,
|
|
13839
14319
|
max: 38
|
|
13840
14320
|
});
|
|
14321
|
+
|
|
13841
14322
|
// Style needs to be optional to match the other layers. Therefore a default style is made here once.
|
|
13842
14323
|
var defaultStyle = function defaultStyle(feature) {
|
|
13843
14324
|
return makeFeatureStyleDisc(feature, defaultLegend);
|
|
@@ -13870,11 +14351,12 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
13870
14351
|
features.current = formatter.readFeatures(featureCollection);
|
|
13871
14352
|
}
|
|
13872
14353
|
}
|
|
14354
|
+
|
|
13873
14355
|
// If no featureCollection is given, e.g. in edit mode of a polygon, the feature should not be displayed.
|
|
13874
14356
|
if (!featureCollection) {
|
|
13875
14357
|
return null;
|
|
13876
14358
|
}
|
|
13877
|
-
return jsx(FeatureLayer, {
|
|
14359
|
+
return /*#__PURE__*/jsx(FeatureLayer, {
|
|
13878
14360
|
clickOnFeature: clickOnFeature,
|
|
13879
14361
|
declutter: declutter,
|
|
13880
14362
|
features: features.current,
|
|
@@ -13887,6 +14369,24 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
13887
14369
|
});
|
|
13888
14370
|
};
|
|
13889
14371
|
|
|
14372
|
+
/* *
|
|
14373
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14374
|
+
* you may not use this file except in compliance with the License.
|
|
14375
|
+
* You may obtain a copy of the License at
|
|
14376
|
+
*
|
|
14377
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14378
|
+
*
|
|
14379
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14380
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14381
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14382
|
+
* See the License for the specific language governing permissions and
|
|
14383
|
+
* limitations under the License.
|
|
14384
|
+
*
|
|
14385
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
14386
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
14387
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
14388
|
+
* */
|
|
14389
|
+
|
|
13890
14390
|
var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
13891
14391
|
var _wmLayer$getDimension, _wmLayer$getDimension2;
|
|
13892
14392
|
var edrBaseUrl = _ref.edrBaseUrl,
|
|
@@ -13902,6 +14402,7 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
13902
14402
|
onInitializeLayer = _ref.onInitializeLayer;
|
|
13903
14403
|
// get a wmLayer instance
|
|
13904
14404
|
var wmLayer = useEDRWMLayer(edrBaseUrl, parameter, layerId, onInitializeLayer);
|
|
14405
|
+
|
|
13905
14406
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests. We re-use it here for EDR.
|
|
13906
14407
|
var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
|
|
13907
14408
|
var timeValue = dimensionsValues === null || dimensionsValues === void 0 ? void 0 : dimensionsValues['TIME'];
|
|
@@ -13910,14 +14411,16 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
13910
14411
|
featurePoints = _useEDRGetParameterDa.data,
|
|
13911
14412
|
isFetching = _useEDRGetParameterDa.isFetching;
|
|
13912
14413
|
var loadingStyle = parameter !== null && parameter !== void 0 && parameter.includes(',') ? makeFeatureStyleMultiParamLoading : makeFeatureStyleLoading;
|
|
14414
|
+
|
|
13913
14415
|
// Send empty collection if no API result yet
|
|
13914
14416
|
var featureCollection = featurePoints !== null && featurePoints !== void 0 ? featurePoints : {
|
|
13915
14417
|
features: [],
|
|
13916
14418
|
type: 'FeatureCollection'
|
|
13917
14419
|
};
|
|
14420
|
+
|
|
13918
14421
|
// Don't show anything if no parameter is selected
|
|
13919
14422
|
var isVisible = visible && parameter.length > 0;
|
|
13920
|
-
return jsx(OpenLayersFeatureLayer, {
|
|
14423
|
+
return /*#__PURE__*/jsx(OpenLayersFeatureLayer, {
|
|
13921
14424
|
declutter: true,
|
|
13922
14425
|
featureCollection: featureCollection,
|
|
13923
14426
|
opacity: opacity,
|
|
@@ -13944,6 +14447,7 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
13944
14447
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
13945
14448
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
13946
14449
|
* */
|
|
14450
|
+
|
|
13947
14451
|
var fetchStacCollection = /*#__PURE__*/function () {
|
|
13948
14452
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(stacBaseUrlWithCollection) {
|
|
13949
14453
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -14011,6 +14515,7 @@ var fetchStacItems = /*#__PURE__*/function () {
|
|
|
14011
14515
|
}();
|
|
14012
14516
|
|
|
14013
14517
|
var DEFAULT_STALE_TIME = 60000; // One minute
|
|
14518
|
+
|
|
14014
14519
|
var useStacCollection = function useStacCollection(stacBaseUrlWithCollection) {
|
|
14015
14520
|
var instanceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
14016
14521
|
var enabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -14116,6 +14621,7 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
14116
14621
|
var _useFetchGeoTIFFBlob = useFetchGeoTIFFBlob(url),
|
|
14117
14622
|
blob = _useFetchGeoTIFFBlob.data,
|
|
14118
14623
|
isSuccess = _useFetchGeoTIFFBlob.isSuccess;
|
|
14624
|
+
|
|
14119
14625
|
// Only create the layer once
|
|
14120
14626
|
useEffect(function () {
|
|
14121
14627
|
if (!map || !layerName || layerRef.current || !isSuccess || !blob || !shouldRender) {
|
|
@@ -14141,6 +14647,7 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
14141
14647
|
setInitialized(false);
|
|
14142
14648
|
};
|
|
14143
14649
|
}, [map, layerName, blob, isSuccess, projection, shouldRender]);
|
|
14650
|
+
|
|
14144
14651
|
// Update layer options
|
|
14145
14652
|
useEffect(function () {
|
|
14146
14653
|
var layer = layerRef.current;
|
|
@@ -14154,6 +14661,7 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
14154
14661
|
layer.setZIndex(layerOptions.zIndex);
|
|
14155
14662
|
}
|
|
14156
14663
|
}, [layerOptions, initialized]);
|
|
14664
|
+
|
|
14157
14665
|
// Update visibility
|
|
14158
14666
|
useEffect(function () {
|
|
14159
14667
|
var layer = layerRef.current;
|
|
@@ -14192,6 +14700,7 @@ var useGetStacGeoTIFFWMLayerInstance = function useGetStacGeoTIFFWMLayerInstance
|
|
|
14192
14700
|
});
|
|
14193
14701
|
webmapUtils.registerWMLayer(_wmLayer, layerId);
|
|
14194
14702
|
}
|
|
14703
|
+
|
|
14195
14704
|
// Set the name and parse the layer
|
|
14196
14705
|
var wmLayer = webmapUtils.getWMLayerById(layerId);
|
|
14197
14706
|
wmLayer.setName(name).then(function () {
|
|
@@ -14313,6 +14822,7 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14313
14822
|
var _useStacItems = useStacItems(stacCollectionUrl, startDate, endDate),
|
|
14314
14823
|
items = _useStacItems.data,
|
|
14315
14824
|
isLoading = _useStacItems.isLoading;
|
|
14825
|
+
|
|
14316
14826
|
// Find the closest item index for the selected time
|
|
14317
14827
|
var closestIndex = React.useMemo(function () {
|
|
14318
14828
|
if (!items || !timeValue) {
|
|
@@ -14334,6 +14844,7 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14334
14844
|
});
|
|
14335
14845
|
return idx;
|
|
14336
14846
|
}, [items, timeValue]);
|
|
14847
|
+
|
|
14337
14848
|
// Window of 101 images: 50 before, 50 after
|
|
14338
14849
|
// This allows animation to play without fetching each new frame
|
|
14339
14850
|
var _React$useMemo3 = React.useMemo(function () {
|
|
@@ -14350,13 +14861,13 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14350
14861
|
if (!items || isLoading) {
|
|
14351
14862
|
return null;
|
|
14352
14863
|
}
|
|
14353
|
-
return jsx(Fragment, {
|
|
14864
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
14354
14865
|
children: items.map(function (item, actualIdx) {
|
|
14355
14866
|
var isClosest = actualIdx === closestIndex;
|
|
14356
14867
|
// Draw 5 images before and after with 0 opacity for smoother animation
|
|
14357
14868
|
var isWithinRange = Math.abs(actualIdx - closestIndex) <= 5;
|
|
14358
14869
|
var inWindow = actualIdx >= startIdx && actualIdx < endIdx;
|
|
14359
|
-
return jsx(GeoTIFFLayer, {
|
|
14870
|
+
return /*#__PURE__*/jsx(GeoTIFFLayer, {
|
|
14360
14871
|
layerName: item.id,
|
|
14361
14872
|
layerOptions: {
|
|
14362
14873
|
opacity: isClosest ? opacity : 0,
|
|
@@ -14402,6 +14913,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14402
14913
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
14403
14914
|
source = _useState4[0],
|
|
14404
14915
|
setSource = _useState4[1];
|
|
14916
|
+
|
|
14405
14917
|
// get a wmLayer instance
|
|
14406
14918
|
var _useGetWMLayerInstanc = useGetWMLayerInstance({
|
|
14407
14919
|
service: getCapsURL,
|
|
@@ -14414,8 +14926,10 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14414
14926
|
if (errorMessage && onLayerError) {
|
|
14415
14927
|
onLayerError(layerId || '', errorMessage);
|
|
14416
14928
|
}
|
|
14929
|
+
|
|
14417
14930
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests
|
|
14418
14931
|
var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
|
|
14932
|
+
|
|
14419
14933
|
// This string can be used safely in a useEffect or other React hook to check if the contents changed
|
|
14420
14934
|
var dimensionsValuesEffectCheck = dimensionsValues && Object.entries(dimensionsValues).map(function (dimensionNameAndCurrentValue) {
|
|
14421
14935
|
return "".concat(dimensionNameAndCurrentValue[0], ":").concat(dimensionNameAndCurrentValue[1]);
|
|
@@ -14455,6 +14969,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14455
14969
|
firstRefTime = refTimeDim === null || refTimeDim === void 0 ? void 0 : refTimeDim.getClosestValue(refTimeToFind, true);
|
|
14456
14970
|
firstRefTime && refTimeDim && (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.setTimeValuesForReferenceTime(firstRefTime, refTimeDim));
|
|
14457
14971
|
}
|
|
14972
|
+
|
|
14458
14973
|
// Make sure we have the latest dimension values before initializing
|
|
14459
14974
|
_context.next = 9;
|
|
14460
14975
|
return wmLayer.parseLayer();
|
|
@@ -14489,6 +15004,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14489
15004
|
return onLayerError === null || onLayerError === void 0 ? void 0 : onLayerError(layerId, e.message);
|
|
14490
15005
|
});
|
|
14491
15006
|
return function () {};
|
|
15007
|
+
|
|
14492
15008
|
// Effect array should only contain wmLayer and layerName
|
|
14493
15009
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14494
15010
|
}, [wmLayer, layerName]);
|
|
@@ -14569,6 +15085,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14569
15085
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
14570
15086
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
14571
15087
|
* */
|
|
15088
|
+
|
|
14572
15089
|
var baseLayerGrey = {
|
|
14573
15090
|
id: webmapUtils.generateLayerId(),
|
|
14574
15091
|
name: 'WorldMap_Light_Grey_Canvas',
|
|
@@ -14610,6 +15127,7 @@ var defaultLayers = /*#__PURE__*/Object.freeze({
|
|
|
14610
15127
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
14611
15128
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
14612
15129
|
* */
|
|
15130
|
+
|
|
14613
15131
|
var DWD = {
|
|
14614
15132
|
name: 'DWD',
|
|
14615
15133
|
url: 'https://maps.dwd.de/geoserver/ows?',
|
|
@@ -14740,6 +15258,7 @@ var publicServices = /*#__PURE__*/Object.freeze({
|
|
|
14740
15258
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
14741
15259
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
14742
15260
|
* */
|
|
15261
|
+
|
|
14743
15262
|
var baseLayer = {
|
|
14744
15263
|
name: 'arcGisSat',
|
|
14745
15264
|
title: 'arcGisSat',
|
|
@@ -14748,7 +15267,9 @@ var baseLayer = {
|
|
|
14748
15267
|
enabled: true,
|
|
14749
15268
|
id: webmapUtils.generateLayerId()
|
|
14750
15269
|
};
|
|
15270
|
+
|
|
14751
15271
|
// Base Layers List
|
|
15272
|
+
|
|
14752
15273
|
var baseLayerOpenStreetMapNL = {
|
|
14753
15274
|
id: 'base-layer-2',
|
|
14754
15275
|
name: 'OpenStreetMap_NL',
|
|
@@ -14777,7 +15298,9 @@ var baseLayerHeiGit = {
|
|
|
14777
15298
|
name: 'osm_auto:all',
|
|
14778
15299
|
layerType: LayerType.baseLayer
|
|
14779
15300
|
};
|
|
15301
|
+
|
|
14780
15302
|
// KNMI msgcpp List
|
|
15303
|
+
|
|
14781
15304
|
var msgCppLayer = {
|
|
14782
15305
|
// doesn't work with https
|
|
14783
15306
|
service: KNMImsgcpp.url,
|
|
@@ -14788,7 +15311,9 @@ var msgCppLayer = {
|
|
|
14788
15311
|
id: webmapUtils.generateLayerId(),
|
|
14789
15312
|
layerType: LayerType.mapLayer
|
|
14790
15313
|
};
|
|
15314
|
+
|
|
14791
15315
|
// Nederlandse Nationaal Georegister Layers list
|
|
15316
|
+
|
|
14792
15317
|
var veiligheidsRegiosGebiedsIndelingenLabels = {
|
|
14793
15318
|
service: nationaalgeoregister.url,
|
|
14794
15319
|
name: 'cbsgebiedsindelingen:cbs_veiligheidsregio_2020_labelpoint',
|
|
@@ -14803,7 +15328,9 @@ var veiligheidsRegiosGebiedsIndelingen = {
|
|
|
14803
15328
|
enabled: false,
|
|
14804
15329
|
layerType: LayerType.mapLayer
|
|
14805
15330
|
};
|
|
15331
|
+
|
|
14806
15332
|
// KNMI Geoservices Layers List
|
|
15333
|
+
|
|
14807
15334
|
var radarLayer = {
|
|
14808
15335
|
service: KNMIgeoservicesRadar.url,
|
|
14809
15336
|
name: 'RAD_NL25_PCP_CM',
|
|
@@ -14907,7 +15434,9 @@ var klimaatAtlasTG3 = {
|
|
|
14907
15434
|
id: webmapUtils.generateLayerId(),
|
|
14908
15435
|
layerType: LayerType.mapLayer
|
|
14909
15436
|
};
|
|
15437
|
+
|
|
14910
15438
|
// DWD Layers List
|
|
15439
|
+
|
|
14911
15440
|
var dwdWarningLayer = {
|
|
14912
15441
|
service: DWDWarnings.url,
|
|
14913
15442
|
name: 'Warnungen_Gemeinden_vereinigt',
|
|
@@ -14925,6 +15454,7 @@ var dwdRadarLayer = {
|
|
|
14925
15454
|
id: webmapUtils.generateLayerId(),
|
|
14926
15455
|
layerType: LayerType.mapLayer
|
|
14927
15456
|
};
|
|
15457
|
+
|
|
14928
15458
|
// this needs authentication to work
|
|
14929
15459
|
var dwdObservationsWetterLayer = {
|
|
14930
15460
|
service: DWDObservations.url,
|
|
@@ -14949,6 +15479,7 @@ var dwdObservationsWetterLayerWithHeader = {
|
|
|
14949
15479
|
value: 'Basic aW50cmFuZXQtdXNlcjpDQnMjMTEh'
|
|
14950
15480
|
}]
|
|
14951
15481
|
};
|
|
15482
|
+
|
|
14952
15483
|
// this needs authentication to work
|
|
14953
15484
|
var dwdObservationsWindLayer = {
|
|
14954
15485
|
service: DWDObservations.url,
|
|
@@ -14959,7 +15490,9 @@ var dwdObservationsWindLayer = {
|
|
|
14959
15490
|
id: webmapUtils.generateLayerId(),
|
|
14960
15491
|
layerType: LayerType.mapLayer
|
|
14961
15492
|
};
|
|
15493
|
+
|
|
14962
15494
|
// FMI open wms Layers List
|
|
15495
|
+
|
|
14963
15496
|
var FMITemp = {
|
|
14964
15497
|
service: FMIopenwms.url,
|
|
14965
15498
|
name: 'temperature-forecast',
|
|
@@ -14968,7 +15501,9 @@ var FMITemp = {
|
|
|
14968
15501
|
id: webmapUtils.generateLayerId(),
|
|
14969
15502
|
layerType: LayerType.mapLayer
|
|
14970
15503
|
};
|
|
15504
|
+
|
|
14971
15505
|
// Met Norway Layers List
|
|
15506
|
+
|
|
14972
15507
|
var MetNoTemp = {
|
|
14973
15508
|
service: MetNorwayService.url,
|
|
14974
15509
|
name: 'thredds_meps_latest_wind',
|
|
@@ -15138,7 +15673,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15138
15673
|
if (!isOverlay && !isBaseLayer) {
|
|
15139
15674
|
switch (layerType) {
|
|
15140
15675
|
case LayerType.mapLayer:
|
|
15141
|
-
return jsx(TimeawareImageSourceWMSLayer, {
|
|
15676
|
+
return /*#__PURE__*/jsx(TimeawareImageSourceWMSLayer, {
|
|
15142
15677
|
debugMode: debugMode,
|
|
15143
15678
|
dimensions: dimensions,
|
|
15144
15679
|
getCapsURL: service,
|
|
@@ -15152,7 +15687,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15152
15687
|
visible: !!(enabled !== false)
|
|
15153
15688
|
});
|
|
15154
15689
|
case LayerType.wmtsMapLayer:
|
|
15155
|
-
return jsx(TimeAwareWMTSLayer, {
|
|
15690
|
+
return /*#__PURE__*/jsx(TimeAwareWMTSLayer, {
|
|
15156
15691
|
debugMode: debugMode,
|
|
15157
15692
|
dimensions: dimensions,
|
|
15158
15693
|
getCapsURL: service,
|
|
@@ -15170,7 +15705,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15170
15705
|
var parameterNames = (options === null || options === void 0 ? void 0 : options.parameterNames.join(',')) || '';
|
|
15171
15706
|
var multiParam = Array.isArray(options === null || options === void 0 ? void 0 : options.parameterNames) && options.parameterNames.length > 1;
|
|
15172
15707
|
var styleLike = style !== undefined ? styleNameToStyleLike(style, multiParam) : undefined;
|
|
15173
|
-
return jsx(TimeAwareEDRLocationLayer, {
|
|
15708
|
+
return /*#__PURE__*/jsx(TimeAwareEDRLocationLayer, {
|
|
15174
15709
|
dimensions: dimensions,
|
|
15175
15710
|
edrBaseUrl: service,
|
|
15176
15711
|
layerId: id,
|
|
@@ -15184,7 +15719,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15184
15719
|
}
|
|
15185
15720
|
case LayerType.stacGeoTIFFLayer:
|
|
15186
15721
|
{
|
|
15187
|
-
return jsx(TimeAwareGeoTIFFLayer, {
|
|
15722
|
+
return /*#__PURE__*/jsx(TimeAwareGeoTIFFLayer, {
|
|
15188
15723
|
dimensions: dimensions,
|
|
15189
15724
|
layerId: id,
|
|
15190
15725
|
layerName: id,
|
|
@@ -15199,6 +15734,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15199
15734
|
return null;
|
|
15200
15735
|
}
|
|
15201
15736
|
}
|
|
15737
|
+
|
|
15202
15738
|
// Check the other layers
|
|
15203
15739
|
if (isBaseLayer || isOverlay) {
|
|
15204
15740
|
var type = layerProps.type,
|
|
@@ -15235,7 +15771,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15235
15771
|
if (!urlTemplate) {
|
|
15236
15772
|
console.warn("Tile server type ".concat(tileServerType, " not supported"), tileServerSettings, tileServer);
|
|
15237
15773
|
}
|
|
15238
|
-
return jsx(XYZLayer, {
|
|
15774
|
+
return /*#__PURE__*/jsx(XYZLayer, {
|
|
15239
15775
|
layerOptions: _objectSpread2(_objectSpread2({}, layerOptions), {}, {
|
|
15240
15776
|
minZoom: tileSettingForCRS === null || tileSettingForCRS === void 0 ? void 0 : tileSettingForCRS.minLevel,
|
|
15241
15777
|
maxZoom: tileSettingForCRS === null || tileSettingForCRS === void 0 ? void 0 : tileSettingForCRS.maxLevel
|
|
@@ -15248,7 +15784,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15248
15784
|
});
|
|
15249
15785
|
}
|
|
15250
15786
|
} else if (_name && _service) {
|
|
15251
|
-
return jsx(WMSLayer, {
|
|
15787
|
+
return /*#__PURE__*/jsx(WMSLayer, {
|
|
15252
15788
|
layerName: _name,
|
|
15253
15789
|
layerOptions: layerOptions,
|
|
15254
15790
|
layerProps: layerProps,
|
|
@@ -15256,12 +15792,30 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15256
15792
|
url: _service
|
|
15257
15793
|
});
|
|
15258
15794
|
} else if (baseLayer) {
|
|
15259
|
-
return jsx(DefaultBaseLayers, {});
|
|
15795
|
+
return /*#__PURE__*/jsx(DefaultBaseLayers, {});
|
|
15260
15796
|
}
|
|
15261
15797
|
}
|
|
15262
|
-
return jsx("div", {});
|
|
15798
|
+
return /*#__PURE__*/jsx("div", {});
|
|
15263
15799
|
};
|
|
15264
15800
|
|
|
15801
|
+
/* *
|
|
15802
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15803
|
+
* you may not use this file except in compliance with the License.
|
|
15804
|
+
* You may obtain a copy of the License at
|
|
15805
|
+
*
|
|
15806
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15807
|
+
*
|
|
15808
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15809
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15810
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15811
|
+
* See the License for the specific language governing permissions and
|
|
15812
|
+
* limitations under the License.
|
|
15813
|
+
*
|
|
15814
|
+
* Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
15815
|
+
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
15816
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
15817
|
+
* */
|
|
15818
|
+
|
|
15265
15819
|
var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
15266
15820
|
var displayMapPin = _ref.displayMapPin,
|
|
15267
15821
|
disableMapPin = _ref.disableMapPin,
|
|
@@ -15290,7 +15844,7 @@ var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
|
15290
15844
|
return [new Feature(new Point(coords))];
|
|
15291
15845
|
}, [mapPinLocation, map]);
|
|
15292
15846
|
useEffect(function () {
|
|
15293
|
-
if (
|
|
15847
|
+
if (disableMapPin || !map) {
|
|
15294
15848
|
return function () {};
|
|
15295
15849
|
}
|
|
15296
15850
|
var key = map.on('click', function (e) {
|
|
@@ -15309,17 +15863,35 @@ var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
|
15309
15863
|
return function () {
|
|
15310
15864
|
unByKey(key);
|
|
15311
15865
|
};
|
|
15312
|
-
}, [map,
|
|
15866
|
+
}, [map, disableMapPin, selectLocation]);
|
|
15313
15867
|
if (!displayMapPin) {
|
|
15314
15868
|
return null;
|
|
15315
15869
|
}
|
|
15316
|
-
return jsx(FeatureLayer, {
|
|
15870
|
+
return /*#__PURE__*/jsx(FeatureLayer, {
|
|
15317
15871
|
features: features,
|
|
15318
15872
|
style: style,
|
|
15319
15873
|
zIndex: 9000
|
|
15320
15874
|
});
|
|
15321
15875
|
};
|
|
15322
15876
|
|
|
15877
|
+
/* *
|
|
15878
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15879
|
+
* you may not use this file except in compliance with the License.
|
|
15880
|
+
* You may obtain a copy of the License at
|
|
15881
|
+
*
|
|
15882
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
15883
|
+
*
|
|
15884
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15885
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15886
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15887
|
+
* See the License for the specific language governing permissions and
|
|
15888
|
+
* limitations under the License.
|
|
15889
|
+
*
|
|
15890
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
15891
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
15892
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
15893
|
+
* */
|
|
15894
|
+
|
|
15323
15895
|
var OpenLayersZoomControl = function OpenLayersZoomControl(_ref) {
|
|
15324
15896
|
var homeExtent = _ref.homeExtent;
|
|
15325
15897
|
var _useContext = useContext(MapContext),
|
|
@@ -15332,7 +15904,7 @@ var OpenLayersZoomControl = function OpenLayersZoomControl(_ref) {
|
|
|
15332
15904
|
return (map === null || map === void 0 || (_map$getView = map.getView()) === null || _map$getView === void 0 ? void 0 : _map$getView.getZoom()) !== undefined ? map.getView() : undefined;
|
|
15333
15905
|
};
|
|
15334
15906
|
var duration = OPENLAYERS_MOUSEWHEEL_DURATION;
|
|
15335
|
-
return jsx(ZoomControls, {
|
|
15907
|
+
return /*#__PURE__*/jsx(ZoomControls, {
|
|
15336
15908
|
onZoomIn: function onZoomIn() {
|
|
15337
15909
|
var view = getView();
|
|
15338
15910
|
view === null || view === void 0 || view.animate({
|
|
@@ -15363,15 +15935,15 @@ var OpenLayersZoomControl = function OpenLayersZoomControl(_ref) {
|
|
|
15363
15935
|
});
|
|
15364
15936
|
};
|
|
15365
15937
|
|
|
15366
|
-
var MapFeatureClass
|
|
15367
|
-
(function (MapFeatureClass) {
|
|
15938
|
+
var MapFeatureClass = /*#__PURE__*/function (MapFeatureClass) {
|
|
15368
15939
|
MapFeatureClass["MyLocation"] = "MyLocation";
|
|
15369
15940
|
MapFeatureClass["GenericMarker"] = "GenericMarker";
|
|
15370
15941
|
MapFeatureClass["ObservationStation"] = "ObservationStation";
|
|
15371
15942
|
MapFeatureClass["EDRFeature"] = "EDRFeature";
|
|
15372
15943
|
MapFeatureClass["EDRMultiPolygon"] = "EDRMultiPolygon";
|
|
15373
15944
|
MapFeatureClass["default"] = "default";
|
|
15374
|
-
|
|
15945
|
+
return MapFeatureClass;
|
|
15946
|
+
}({});
|
|
15375
15947
|
var FEATURE_FILL = new Fill({
|
|
15376
15948
|
color: FEATURE_DRAW_FILL_COLOR_TRANSPARENT
|
|
15377
15949
|
});
|
|
@@ -15438,6 +16010,7 @@ var ICON_LOCATIONMARKER_MODIFY = createIconStyle(locationPath, {
|
|
|
15438
16010
|
anchor: [0.5, 1]
|
|
15439
16011
|
}
|
|
15440
16012
|
});
|
|
16013
|
+
|
|
15441
16014
|
// Pre-rendered canvas for the rotate icon so we can create
|
|
15442
16015
|
// dynamically rotated instances that follow the box orientation.
|
|
15443
16016
|
var ROTATE_ICON_SIZE = [24, 24];
|
|
@@ -15452,10 +16025,12 @@ var ROTATE_ICON_CANVAS = typeof document !== 'undefined' ? function () {
|
|
|
15452
16025
|
return undefined;
|
|
15453
16026
|
}
|
|
15454
16027
|
var path = new Path2D(rotatePath);
|
|
16028
|
+
|
|
15455
16029
|
// Draw a white outline behind the rotate icon for better contrast
|
|
15456
16030
|
ctx.lineWidth = 1.5;
|
|
15457
16031
|
ctx.strokeStyle = 'rgba(255, 255, 255, 1)';
|
|
15458
16032
|
ctx.stroke(path);
|
|
16033
|
+
|
|
15459
16034
|
// Fill the actual rotate icon
|
|
15460
16035
|
ctx.fillStyle = '#051039';
|
|
15461
16036
|
ctx.fill(path);
|
|
@@ -15589,6 +16164,7 @@ var FEATURE_MY_LOCATION = new Style$1({
|
|
|
15589
16164
|
pixelRatio = state.pixelRatio;
|
|
15590
16165
|
var coord = pixelCoordinates;
|
|
15591
16166
|
ctx.save();
|
|
16167
|
+
|
|
15592
16168
|
// Draw outer circle with shadow
|
|
15593
16169
|
ctx.strokeStyle = '#fff';
|
|
15594
16170
|
ctx.fillStyle = '#fff';
|
|
@@ -15598,11 +16174,13 @@ var FEATURE_MY_LOCATION = new Style$1({
|
|
|
15598
16174
|
ctx.arc(coord[0], coord[1], 12 * pixelRatio, 0, 2 * Math.PI);
|
|
15599
16175
|
ctx.fill();
|
|
15600
16176
|
ctx.shadowBlur = 0;
|
|
16177
|
+
|
|
15601
16178
|
// Draw inner circle
|
|
15602
16179
|
ctx.fillStyle = '#186dff';
|
|
15603
16180
|
ctx.beginPath();
|
|
15604
16181
|
ctx.arc(coord[0], coord[1], 9 * pixelRatio, 0, 2 * Math.PI);
|
|
15605
16182
|
ctx.fill();
|
|
16183
|
+
|
|
15606
16184
|
// Reset transformations
|
|
15607
16185
|
ctx.restore();
|
|
15608
16186
|
}
|
|
@@ -15614,6 +16192,7 @@ var getFeaturePointStyle = function getFeaturePointStyle(fillColor, fillOpacity)
|
|
|
15614
16192
|
pixelRatio = state.pixelRatio;
|
|
15615
16193
|
var coord = pixelCoordinates;
|
|
15616
16194
|
ctx.save();
|
|
16195
|
+
|
|
15617
16196
|
// Use provided fillColor and fillOpacity, or fallback to default
|
|
15618
16197
|
ctx.fillStyle = fillColor ? geowebColorToOpenLayersColor(fillColor, fillOpacity || 1) : FEATURE_DRAW_FILL_COLOR;
|
|
15619
16198
|
ctx.shadowColor = '#fff';
|
|
@@ -15668,6 +16247,7 @@ var labelOptions = {
|
|
|
15668
16247
|
var labelBaseStyle = new Style$1({
|
|
15669
16248
|
text: new Text(labelOptions)
|
|
15670
16249
|
});
|
|
16250
|
+
|
|
15671
16251
|
// Multi-polygons need separate handling to only draw single label
|
|
15672
16252
|
var multiPolygonLabelBaseStyle = new Style$1({
|
|
15673
16253
|
text: new Text(labelOptions),
|
|
@@ -15679,6 +16259,7 @@ var multiPolygonLabelBaseStyle = new Style$1({
|
|
|
15679
16259
|
return largestPolygon.getInteriorPoint();
|
|
15680
16260
|
}
|
|
15681
16261
|
});
|
|
16262
|
+
|
|
15682
16263
|
// MultiLineStrings need separate handling to only draw single label
|
|
15683
16264
|
var multiLineStringLabelBaseStyle = new Style$1({
|
|
15684
16265
|
text: new Text(labelOptions),
|
|
@@ -15857,6 +16438,7 @@ var geowebColorToOpenLayersColor = function geowebColorToOpenLayersColor(color,
|
|
|
15857
16438
|
var opacityNumber = Math.min(Math.max(0, Number.parseFloat("".concat(opacity))), 255 / 256);
|
|
15858
16439
|
var bitsPerColor = color.length - 1 >= 6 ? 8 : 4;
|
|
15859
16440
|
var resultingColor = color.split('');
|
|
16441
|
+
|
|
15860
16442
|
// Remove existing opacity bits if set
|
|
15861
16443
|
if (bitsPerColor === 8 && resultingColor.length > 6 + 1) {
|
|
15862
16444
|
resultingColor.splice(6 + 1);
|
|
@@ -15916,6 +16498,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
15916
16498
|
if (geom instanceof LineString) {
|
|
15917
16499
|
var coords = geom.getCoordinates();
|
|
15918
16500
|
var smoothed = catmullRomSpline(coords, 16);
|
|
16501
|
+
|
|
15919
16502
|
// Smoothed line
|
|
15920
16503
|
return new Style$1({
|
|
15921
16504
|
geometry: new LineString(smoothed),
|
|
@@ -15928,6 +16511,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
15928
16511
|
return undefined;
|
|
15929
16512
|
}
|
|
15930
16513
|
var shouldHighlight = geometry && geometry.getType() !== 'Point' && mapFeatureClass !== MapFeatureClass.ObservationStation && !showNameOnHover && selectionType !== 'fir';
|
|
16514
|
+
|
|
15931
16515
|
// Highlight map polygons on hover
|
|
15932
16516
|
if (hover && shouldHighlight) {
|
|
15933
16517
|
return new Style$1({
|
|
@@ -15961,6 +16545,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
15961
16545
|
var styleOrFunction = stylesByMapFeatureClass[mapFeatureClass || MapFeatureClass["default"]];
|
|
15962
16546
|
return typeof styleOrFunction === 'function' ? styleOrFunction(feature, resolution) : styleOrFunction;
|
|
15963
16547
|
};
|
|
16548
|
+
|
|
15964
16549
|
// Used for polygons, boxes and linestrings
|
|
15965
16550
|
var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature) {
|
|
15966
16551
|
var _feature$getGeometry;
|
|
@@ -15969,6 +16554,7 @@ var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature)
|
|
|
15969
16554
|
fill: FEATURE_FILL
|
|
15970
16555
|
})];
|
|
15971
16556
|
}
|
|
16557
|
+
|
|
15972
16558
|
// LineStrings, this includes Polygons being drawn (OL Draw has them as LineStrings until the Polygon is ready)
|
|
15973
16559
|
return [
|
|
15974
16560
|
// Style for the line
|
|
@@ -15988,6 +16574,7 @@ var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature)
|
|
|
15988
16574
|
}
|
|
15989
16575
|
})];
|
|
15990
16576
|
};
|
|
16577
|
+
|
|
15991
16578
|
// Simple Catmull-Rom spline smoothing
|
|
15992
16579
|
var catmullRomSpline = function catmullRomSpline(points) {
|
|
15993
16580
|
var numPoints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
|
|
@@ -16001,6 +16588,7 @@ var catmullRomSpline = function catmullRomSpline(points) {
|
|
|
16001
16588
|
var p1 = points[i];
|
|
16002
16589
|
var p2 = points[i + 1];
|
|
16003
16590
|
var p3 = (_points2 = points[i + 2]) !== null && _points2 !== void 0 ? _points2 : p2;
|
|
16591
|
+
|
|
16004
16592
|
// always include the control point
|
|
16005
16593
|
result.push(p1);
|
|
16006
16594
|
for (var pointIndex = 1; pointIndex < numPoints; pointIndex += 1) {
|
|
@@ -16012,6 +16600,7 @@ var catmullRomSpline = function catmullRomSpline(points) {
|
|
|
16012
16600
|
result.push([x, y]);
|
|
16013
16601
|
}
|
|
16014
16602
|
}
|
|
16603
|
+
|
|
16015
16604
|
// include the very last control point
|
|
16016
16605
|
result.push(points[points.length - 1]);
|
|
16017
16606
|
return result;
|
|
@@ -16053,6 +16642,7 @@ new Style$1({
|
|
|
16053
16642
|
}),
|
|
16054
16643
|
// Vertices
|
|
16055
16644
|
FEATURE_VERTICES_EDIT_HANDLES];
|
|
16645
|
+
|
|
16056
16646
|
// This function creates a box out of a modified polygon. It detects which corner was moved by comparing vertices between the two geometries. Then it draws a new box based on the moved vertice and the opposing vertice.
|
|
16057
16647
|
// For squares the box scales uniformly around the fixed center.
|
|
16058
16648
|
// For rectangles the diagonal opposite corner does not change, the other two corners are recomputed.
|
|
@@ -16065,6 +16655,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16065
16655
|
if (!originalRing || !modifiedRing || originalRing.length < 4) {
|
|
16066
16656
|
return originalGeometry;
|
|
16067
16657
|
}
|
|
16658
|
+
|
|
16068
16659
|
// Strip closing coordinate if present so we only work with the four corners.
|
|
16069
16660
|
var stripClose = function stripClose(ring) {
|
|
16070
16661
|
if (ring.length > 4 && ring[0][0] === ring[ring.length - 1][0] && ring[0][1] === ring[ring.length - 1][1]) {
|
|
@@ -16077,6 +16668,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16077
16668
|
if (originalCorners.length < 4 || modifiedCorners.length < 4) {
|
|
16078
16669
|
return originalGeometry;
|
|
16079
16670
|
}
|
|
16671
|
+
|
|
16080
16672
|
// Detect which corner was dragged by comparing original vs modified
|
|
16081
16673
|
var draggedCornerIndex = originalCorners.findIndex(function (orig, idx) {
|
|
16082
16674
|
var mod = modifiedCorners[idx];
|
|
@@ -16087,6 +16679,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16087
16679
|
return originalGeometry;
|
|
16088
16680
|
}
|
|
16089
16681
|
var dragged = modifiedCorners[draggedCornerIndex];
|
|
16682
|
+
|
|
16090
16683
|
// Compute center of the original box
|
|
16091
16684
|
var centerX = originalCorners.reduce(function (sum, _ref) {
|
|
16092
16685
|
var _ref2 = _slicedToArray(_ref, 1),
|
|
@@ -16098,6 +16691,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16098
16691
|
y = _ref4[1];
|
|
16099
16692
|
return sum + y;
|
|
16100
16693
|
}, 0) / originalCorners.length;
|
|
16694
|
+
|
|
16101
16695
|
// Derive local axes from the original box so we can preserve its
|
|
16102
16696
|
// rotation. Use the edges from corner 0 to its two neighbours.
|
|
16103
16697
|
var p0 = originalCorners[0];
|
|
@@ -16117,6 +16711,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16117
16711
|
var uy = edgeUy / edgeUlength;
|
|
16118
16712
|
var vx = edgeVx / edgeVlenght;
|
|
16119
16713
|
var vy = edgeVy / edgeVlenght;
|
|
16714
|
+
|
|
16120
16715
|
// Remember which corner is which
|
|
16121
16716
|
var cornerSigns = [{
|
|
16122
16717
|
sx: -1,
|
|
@@ -16132,6 +16727,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16132
16727
|
sy: 1
|
|
16133
16728
|
}];
|
|
16134
16729
|
var minSize = 1e-6;
|
|
16730
|
+
|
|
16135
16731
|
// Squares keep their center fixed and scale uniformly from the
|
|
16136
16732
|
// dragged corner.
|
|
16137
16733
|
if (keepSquare) {
|
|
@@ -16158,32 +16754,40 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16158
16754
|
newCorners.push(newCorners[0]);
|
|
16159
16755
|
return new Polygon([newCorners]);
|
|
16160
16756
|
}
|
|
16757
|
+
|
|
16161
16758
|
// Rectangles (non-squares) should resize using the dragged
|
|
16162
16759
|
// corner while keeping the diagonal opposite anchored. The two remaining
|
|
16163
16760
|
// corners adjust accordingly, and the overall rotation is kept. When the
|
|
16164
16761
|
// dragged corner crosses past the center, the rectangle is allowed to
|
|
16165
16762
|
// "flip" instead of bouncing back.
|
|
16763
|
+
|
|
16166
16764
|
// Diagonal corner relative to the dragged one in the 4-corner ring
|
|
16167
16765
|
var anchorIndex = (draggedCornerIndex + 2) % originalCorners.length;
|
|
16168
16766
|
var anchor = originalCorners[anchorIndex];
|
|
16767
|
+
|
|
16169
16768
|
// Vector from anchored corner to dragged corner, in world space
|
|
16170
16769
|
var deltaWx = dragged[0] - anchor[0];
|
|
16171
16770
|
var deltaWy = dragged[1] - anchor[1];
|
|
16771
|
+
|
|
16172
16772
|
// Express that vector in the local (u, v) frame
|
|
16173
16773
|
var deltaLocalX = deltaWx * ux + deltaWy * uy;
|
|
16174
16774
|
var deltaLocalY = deltaWx * vx + deltaWy * vy;
|
|
16775
|
+
|
|
16175
16776
|
// Half-sizes in local coordinates. We keep the sign so that when the
|
|
16176
16777
|
// dragged corner crosses past the anchor along either axis, the
|
|
16177
16778
|
// rectangle flips instead of being clamped.
|
|
16178
16779
|
var halfWidth = deltaLocalX / 2;
|
|
16179
16780
|
var halfHeight = deltaLocalY / 2;
|
|
16781
|
+
|
|
16180
16782
|
// Center in local coordinates is halfway between anchor (0,0) and
|
|
16181
16783
|
// dragged (deltaLocalX, deltaLocalY).
|
|
16182
16784
|
var centerLocalX = halfWidth;
|
|
16183
16785
|
var centerLocalY = halfHeight;
|
|
16786
|
+
|
|
16184
16787
|
// Convert center back to world coordinates.
|
|
16185
16788
|
var centerXNew = anchor[0] + centerLocalX * ux + centerLocalY * vx;
|
|
16186
16789
|
var centerYNew = anchor[1] + centerLocalX * uy + centerLocalY * vy;
|
|
16790
|
+
|
|
16187
16791
|
// Rebuild the four corners in local coordinates around the new center.
|
|
16188
16792
|
var localCorners = [[-halfWidth, -halfHeight], [halfWidth, -halfHeight], [halfWidth, halfHeight], [-halfWidth, halfHeight]];
|
|
16189
16793
|
var newCornersWorld = localCorners.map(function (_ref5) {
|
|
@@ -16194,6 +16798,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16194
16798
|
var worldY = centerYNew + lx * uy + ly * vy;
|
|
16195
16799
|
return [worldX, worldY];
|
|
16196
16800
|
});
|
|
16801
|
+
|
|
16197
16802
|
// Normalise corner order so index 0..3 always correspond to
|
|
16198
16803
|
// bottom-left, bottom-right, top-right, top-left in the box's
|
|
16199
16804
|
// local frame. This keeps rotate-handle orientation and
|
|
@@ -16226,6 +16831,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16226
16831
|
return corner.qx === -1 && corner.qy === 1;
|
|
16227
16832
|
})) === null || _classified$find4 === void 0 ? void 0 : _classified$find4.corner;
|
|
16228
16833
|
var orderedCorners = bl && br && tr && tl ? [bl, br, tr, tl] : newCornersWorld;
|
|
16834
|
+
|
|
16229
16835
|
// Close the ring
|
|
16230
16836
|
orderedCorners.push(orderedCorners[0]);
|
|
16231
16837
|
return new Polygon([orderedCorners]);
|
|
@@ -16240,8 +16846,10 @@ var getBoxRotateHandlePoints = function getBoxRotateHandlePoints(feature, resolu
|
|
|
16240
16846
|
if (ring.length < 4) {
|
|
16241
16847
|
return undefined;
|
|
16242
16848
|
}
|
|
16849
|
+
|
|
16243
16850
|
// First four coordinates are the corners of the box (possibly rotated)
|
|
16244
16851
|
var corners = ring.slice(0, 4);
|
|
16852
|
+
|
|
16245
16853
|
// Compute box center as the average of the corners
|
|
16246
16854
|
var centerX = corners.reduce(function (sum, _ref7) {
|
|
16247
16855
|
var _ref8 = _slicedToArray(_ref7, 1),
|
|
@@ -16253,6 +16861,7 @@ var getBoxRotateHandlePoints = function getBoxRotateHandlePoints(feature, resolu
|
|
|
16253
16861
|
y = _ref0[1];
|
|
16254
16862
|
return sum + y;
|
|
16255
16863
|
}, 0) / corners.length;
|
|
16864
|
+
|
|
16256
16865
|
// Place the rotate handle at a nearly constant distance from the
|
|
16257
16866
|
// corner in screen space, independent of how large the box is.
|
|
16258
16867
|
// We move a fixed number of pixels along the outward diagonal
|
|
@@ -16295,6 +16904,7 @@ var boxModificationStyle = function boxModificationStyle(feature, resolution) {
|
|
|
16295
16904
|
var handlePoints = getBoxRotateHandlePoints(feature, resolution);
|
|
16296
16905
|
var activeIndexRaw = feature.get('activeRotateHandleIndex');
|
|
16297
16906
|
var activeIndex = typeof activeIndexRaw === 'number' && activeIndexRaw >= 0 && activeIndexRaw < 4 ? activeIndexRaw : undefined;
|
|
16907
|
+
|
|
16298
16908
|
// While the box is being modified (corner drag), hide the rotate
|
|
16299
16909
|
// handle so only sizing handles are visible.
|
|
16300
16910
|
var suppressRotateHandle = feature.get('suppressRotateHandle');
|
|
@@ -16304,8 +16914,10 @@ var boxModificationStyle = function boxModificationStyle(feature, resolution) {
|
|
|
16304
16914
|
h1 = _handlePoints[1],
|
|
16305
16915
|
h2 = _handlePoints[2],
|
|
16306
16916
|
h3 = _handlePoints[3];
|
|
16917
|
+
|
|
16307
16918
|
// Base angle: along the edge between first two corner handles.
|
|
16308
16919
|
var baseAngle = Math.atan2(h1[1] - h0[1], h1[0] - h0[0]);
|
|
16920
|
+
|
|
16309
16921
|
// Assign per-corner offsets.
|
|
16310
16922
|
var handleConfigs = [{
|
|
16311
16923
|
point: h0,
|
|
@@ -16344,6 +16956,7 @@ var boxModificationStyle = function boxModificationStyle(feature, resolution) {
|
|
|
16344
16956
|
var circleFeatureStyle = function circleFeatureStyle(feature, resolution) {
|
|
16345
16957
|
// use OL default styles to keep circle edge tracking
|
|
16346
16958
|
var styles = createDefaultStyle(feature, resolution);
|
|
16959
|
+
|
|
16347
16960
|
// modify stroke + fill
|
|
16348
16961
|
styles.forEach(function (style) {
|
|
16349
16962
|
if (style.getStroke()) {
|
|
@@ -16355,6 +16968,7 @@ var circleFeatureStyle = function circleFeatureStyle(feature, resolution) {
|
|
|
16355
16968
|
});
|
|
16356
16969
|
return styles;
|
|
16357
16970
|
};
|
|
16971
|
+
|
|
16358
16972
|
// Create an ellipse geometry from center + two drag points
|
|
16359
16973
|
var createEllipsePolygon = function createEllipsePolygon(center, last) {
|
|
16360
16974
|
// Radii along x and y
|
|
@@ -16362,10 +16976,12 @@ var createEllipsePolygon = function createEllipsePolygon(center, last) {
|
|
|
16362
16976
|
var ry = Math.abs(last[1] - center[1]);
|
|
16363
16977
|
var points = [];
|
|
16364
16978
|
var steps = 64; // smoothness
|
|
16979
|
+
|
|
16365
16980
|
for (var i = 0; i < steps; i += 1) {
|
|
16366
16981
|
var theta = i / steps * 2 * Math.PI;
|
|
16367
16982
|
points.push([center[0] + rx * Math.cos(theta), center[1] + ry * Math.sin(theta)]);
|
|
16368
16983
|
}
|
|
16984
|
+
|
|
16369
16985
|
// Ensure the ring is closed
|
|
16370
16986
|
if (points.length > 0) {
|
|
16371
16987
|
points.push(points[0]);
|
|
@@ -16431,8 +17047,8 @@ var modifyStyles = {
|
|
|
16431
17047
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
16432
17048
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
16433
17049
|
* */
|
|
16434
|
-
|
|
16435
|
-
|
|
17050
|
+
|
|
17051
|
+
var DRAWMODE = /*#__PURE__*/function (DRAWMODE) {
|
|
16436
17052
|
DRAWMODE["POLYGON"] = "POLYGON";
|
|
16437
17053
|
DRAWMODE["BOX"] = "BOX";
|
|
16438
17054
|
DRAWMODE["MULTIPOINT"] = "MULTIPOINT";
|
|
@@ -16445,7 +17061,10 @@ var DRAWMODE;
|
|
|
16445
17061
|
DRAWMODE["LOCATION"] = "LOCATION";
|
|
16446
17062
|
DRAWMODE["FREEHANDLINE"] = "FREEHANDLINE";
|
|
16447
17063
|
DRAWMODE["ROTATABLEBOX"] = "ROTATABLEBOX";
|
|
16448
|
-
|
|
17064
|
+
return DRAWMODE;
|
|
17065
|
+
}({});
|
|
17066
|
+
|
|
17067
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
16449
17068
|
|
|
16450
17069
|
var createDrawOperation = function createDrawOperation(type) {
|
|
16451
17070
|
switch (type) {
|
|
@@ -16533,6 +17152,7 @@ var selectionTypeToDrawModeValue = function selectionTypeToDrawModeValue(selecti
|
|
|
16533
17152
|
return DRAWMODE.POLYGON;
|
|
16534
17153
|
}
|
|
16535
17154
|
};
|
|
17155
|
+
|
|
16536
17156
|
/**
|
|
16537
17157
|
* Integrates with OpenLayers Draw and Modify (+Snap) interactions, to implement feature drawing
|
|
16538
17158
|
* and modification behaviour.
|
|
@@ -16628,6 +17248,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16628
17248
|
if (obj.geometry && 'coordinates' in obj.geometry) {
|
|
16629
17249
|
obj.geometry.coordinates = roundCoordinates(obj.geometry.coordinates);
|
|
16630
17250
|
}
|
|
17251
|
+
|
|
16631
17252
|
// copy properties
|
|
16632
17253
|
obj.properties = _objectSpread2({}, selectedFeature === null || selectedFeature === void 0 ? void 0 : selectedFeature.properties);
|
|
16633
17254
|
var newGeoJson = _objectSpread2(_objectSpread2({}, geojson), {}, {
|
|
@@ -16635,12 +17256,14 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16635
17256
|
});
|
|
16636
17257
|
updateGeojson === null || updateGeojson === void 0 || updateGeojson(newGeoJson, NEW_FEATURE_CREATED);
|
|
16637
17258
|
};
|
|
17259
|
+
|
|
16638
17260
|
// Draw functionality, for drawing new polygons/linestrings/boxes/markers
|
|
16639
17261
|
var draw = new Draw(_objectSpread2({
|
|
16640
17262
|
source: source,
|
|
16641
17263
|
style: drawStyle
|
|
16642
17264
|
}, drawOperation));
|
|
16643
17265
|
var drawingFinishedBy = 'escaped'; // default
|
|
17266
|
+
|
|
16644
17267
|
draw.on('drawabort', function () {
|
|
16645
17268
|
exitDrawModeCallback === null || exitDrawModeCallback === void 0 || exitDrawModeCallback('escaped');
|
|
16646
17269
|
});
|
|
@@ -16674,6 +17297,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16674
17297
|
draw.on('drawstart', function () {
|
|
16675
17298
|
map.getViewport().addEventListener('click', handleClickNearPolygonStartPoint);
|
|
16676
17299
|
});
|
|
17300
|
+
|
|
16677
17301
|
// Handle doubleClick instead of shiftClick
|
|
16678
17302
|
var handleDoubleClickToClosePolygon = function handleDoubleClickToClosePolygon(event) {
|
|
16679
17303
|
if (event.detail === 2 && event.button === 0) {
|
|
@@ -16709,6 +17333,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16709
17333
|
});
|
|
16710
17334
|
map.getViewport().style.cursor = hasViewOnlyHit ? 'pointer' : '';
|
|
16711
17335
|
}
|
|
17336
|
+
|
|
16712
17337
|
// Update which rotate handle is "active" so only that
|
|
16713
17338
|
// icon is rendered near the mouse when editing boxes/squares.
|
|
16714
17339
|
// While rotating, keep the originally clicked handle active.
|
|
@@ -16726,6 +17351,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16726
17351
|
} else {
|
|
16727
17352
|
var coord = map.getEventCoordinate(event);
|
|
16728
17353
|
var threshold = 18 * resolution; // enlarge hover hit area for rotate handle
|
|
17354
|
+
|
|
16729
17355
|
var closestIndex = -1;
|
|
16730
17356
|
var closestDist = Infinity;
|
|
16731
17357
|
handlePoints.forEach(function (_ref2, idx) {
|
|
@@ -16766,6 +17392,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16766
17392
|
var isSquare = actualDrawMode === DRAWMODE.SQUARE;
|
|
16767
17393
|
var isBoxOrSquareRotatable = actualDrawMode === DRAWMODE.ROTATABLEBOX || isSquare;
|
|
16768
17394
|
var isBoxOrSquare = actualDrawMode === DRAWMODE.BOX || isBoxOrSquareRotatable;
|
|
17395
|
+
|
|
16769
17396
|
// Modifying is a combination of Modify and Translate interactions
|
|
16770
17397
|
var modify = new Modify({
|
|
16771
17398
|
features: editFeatureCollection,
|
|
@@ -16776,6 +17403,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16776
17403
|
// Box is a special case:
|
|
16777
17404
|
// - Use a custom style to present the user with a box when dragging (even though the temp polygon is changing against box conditions)
|
|
16778
17405
|
// - When modification is done, define the box using the dragged corner and its opposite corner
|
|
17406
|
+
|
|
16779
17407
|
modify.on('modifystart', function (evt) {
|
|
16780
17408
|
var _feature$getGeometry2;
|
|
16781
17409
|
var feature = evt.features.getArray()[0];
|
|
@@ -16792,6 +17420,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16792
17420
|
var feature = evt.features.getArray()[0];
|
|
16793
17421
|
var boxPolygon = createBoxBasedOnModifiedVertex(feature.getGeometry(), feature.get('originalGeometry'), isSquare);
|
|
16794
17422
|
feature.setGeometry(boxPolygon);
|
|
17423
|
+
|
|
16795
17424
|
// Re-enable rotate handle visibility after modifying.
|
|
16796
17425
|
feature.unset('suppressRotateHandle', true);
|
|
16797
17426
|
var viewport = map.getViewport();
|
|
@@ -16821,12 +17450,14 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16821
17450
|
translate.on('translateend', function (evt) {
|
|
16822
17451
|
updateFeature(evt.features.getArray()[0]);
|
|
16823
17452
|
});
|
|
17453
|
+
|
|
16824
17454
|
// Rotation handling for boxes and squares using the visual rotate handles
|
|
16825
17455
|
var isRotating = false;
|
|
16826
17456
|
var rotationCenter = null;
|
|
16827
17457
|
var rotationStartAngle = 0;
|
|
16828
17458
|
var originalRing = null;
|
|
16829
17459
|
var disabledDragPans = [];
|
|
17460
|
+
|
|
16830
17461
|
// Track when the user has pressed down near a resize corner so we can
|
|
16831
17462
|
// immediately show a grabbing cursor on mousedown (before any movement).
|
|
16832
17463
|
var isPointerDownNearCorner = false;
|
|
@@ -16894,6 +17525,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16894
17525
|
if (!ring || ring.length < 4) {
|
|
16895
17526
|
return;
|
|
16896
17527
|
}
|
|
17528
|
+
|
|
16897
17529
|
// Exclude possible closing coordinate
|
|
16898
17530
|
var ringWithoutClose = ring.length > 4 && ring[0][0] === ring[ring.length - 1][0] && ring[0][1] === ring[ring.length - 1][1] ? ring.slice(0, ring.length - 1) : ring;
|
|
16899
17531
|
var clickCoord = map.getEventCoordinate(event);
|
|
@@ -16901,6 +17533,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16901
17533
|
if (!resolution) {
|
|
16902
17534
|
return;
|
|
16903
17535
|
}
|
|
17536
|
+
|
|
16904
17537
|
// Use the same helper for handle locations as the style code,
|
|
16905
17538
|
// so visual position and click area are consistent.
|
|
16906
17539
|
var handlePoints = getBoxRotateHandlePoints(featureToRotate, resolution);
|
|
@@ -16908,6 +17541,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16908
17541
|
return;
|
|
16909
17542
|
}
|
|
16910
17543
|
var threshold = 12 * resolution; // enlarge click hit area for rotate handle
|
|
17544
|
+
|
|
16911
17545
|
// Determine which handle was clicked (nearest within threshold)
|
|
16912
17546
|
var closestIndex = -1;
|
|
16913
17547
|
var closestDist = Infinity;
|
|
@@ -16926,6 +17560,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16926
17560
|
if (closestIndex === -1 || closestDist > threshold) {
|
|
16927
17561
|
return;
|
|
16928
17562
|
}
|
|
17563
|
+
|
|
16929
17564
|
// Lock the active rotate handle index so its icon stays visible
|
|
16930
17565
|
var handleFeature = editFeatureCollection.item(0);
|
|
16931
17566
|
if (handleFeature) {
|
|
@@ -16933,6 +17568,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16933
17568
|
layer.changed();
|
|
16934
17569
|
}
|
|
16935
17570
|
isRotating = true;
|
|
17571
|
+
|
|
16936
17572
|
// Temporarily disable map panning while rotating so the
|
|
16937
17573
|
// underlying map does not move when dragging the rotate handle.
|
|
16938
17574
|
disabledDragPans = [];
|
|
@@ -16974,11 +17610,13 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16974
17610
|
y = _ref1[1];
|
|
16975
17611
|
return [x, y];
|
|
16976
17612
|
});
|
|
17613
|
+
|
|
16977
17614
|
// While rotating, show a grabbing cursor on the map viewport
|
|
16978
17615
|
var viewport = map.getViewport();
|
|
16979
17616
|
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16980
17617
|
viewport.style.cursor = 'grabbing';
|
|
16981
17618
|
}
|
|
17619
|
+
|
|
16982
17620
|
// While rotating, disable modify/translate to avoid conflicts
|
|
16983
17621
|
modify.setActive(false);
|
|
16984
17622
|
translate.setActive(false);
|
|
@@ -17030,12 +17668,14 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17030
17668
|
rotationCenter = null;
|
|
17031
17669
|
rotationStartAngle = 0;
|
|
17032
17670
|
originalRing = null;
|
|
17671
|
+
|
|
17033
17672
|
// Re-enable any drag-pan interactions we disabled when rotation
|
|
17034
17673
|
// started so normal map panning works again.
|
|
17035
17674
|
disabledDragPans.forEach(function (interaction) {
|
|
17036
17675
|
return interaction.setActive(true);
|
|
17037
17676
|
});
|
|
17038
17677
|
disabledDragPans = [];
|
|
17678
|
+
|
|
17039
17679
|
// Restore the default cursor when rotation stops
|
|
17040
17680
|
var viewport = map.getViewport();
|
|
17041
17681
|
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
@@ -17080,6 +17720,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17080
17720
|
viewport.addEventListener('pointerdown', startRotateIfOnHandle);
|
|
17081
17721
|
viewport.addEventListener('pointermove', rotateOnPointerMove);
|
|
17082
17722
|
viewport.addEventListener('pointerup', endRotate);
|
|
17723
|
+
|
|
17083
17724
|
// Ensure the grabbing cursor appears immediately when pressing on a
|
|
17084
17725
|
// resize corner, not only after the pointer starts moving.
|
|
17085
17726
|
viewport.addEventListener('pointerdown', handlePointerDownNearCorner);
|
|
@@ -17131,6 +17772,7 @@ var emptyPoint = _objectSpread2(_objectSpread2({}, featurePoint), {}, {
|
|
|
17131
17772
|
var emptyPolygon = _objectSpread2(_objectSpread2({}, featurePolygon), {}, {
|
|
17132
17773
|
properties: defaultGeoJSONStyleProperties
|
|
17133
17774
|
});
|
|
17775
|
+
|
|
17134
17776
|
// TODO: improve this: without a feature, the custom shape does not work on first click
|
|
17135
17777
|
var emptyIntersectionShape = _objectSpread2(_objectSpread2({}, emptyGeoJSON), {}, {
|
|
17136
17778
|
features: [featurePolygon]
|
|
@@ -17138,28 +17780,28 @@ var emptyIntersectionShape = _objectSpread2(_objectSpread2({}, emptyGeoJSON), {}
|
|
|
17138
17780
|
var getIcon = function getIcon(selectionType) {
|
|
17139
17781
|
switch (selectionType) {
|
|
17140
17782
|
case 'point':
|
|
17141
|
-
return jsx(DrawToolPoint, {});
|
|
17783
|
+
return /*#__PURE__*/jsx(DrawToolPoint, {});
|
|
17142
17784
|
case 'poly':
|
|
17143
|
-
return jsx(DrawToolPolygon, {});
|
|
17785
|
+
return /*#__PURE__*/jsx(DrawToolPolygon, {});
|
|
17144
17786
|
case 'box':
|
|
17145
17787
|
case 'rotatable-box':
|
|
17146
|
-
return jsx(DrawToolRectangle, {});
|
|
17788
|
+
return /*#__PURE__*/jsx(DrawToolRectangle, {});
|
|
17147
17789
|
case 'linestring':
|
|
17148
|
-
return jsx(DrawToolLineString, {});
|
|
17790
|
+
return /*#__PURE__*/jsx(DrawToolLineString, {});
|
|
17149
17791
|
case 'delete':
|
|
17150
|
-
return jsx(Delete, {});
|
|
17792
|
+
return /*#__PURE__*/jsx(Delete, {});
|
|
17151
17793
|
case 'square':
|
|
17152
|
-
return jsx(DrawToolSquare, {});
|
|
17794
|
+
return /*#__PURE__*/jsx(DrawToolSquare, {});
|
|
17153
17795
|
case 'circle':
|
|
17154
|
-
return jsx(DrawToolCircle, {});
|
|
17796
|
+
return /*#__PURE__*/jsx(DrawToolCircle, {});
|
|
17155
17797
|
case 'oval':
|
|
17156
|
-
return jsx(DrawToolOval, {});
|
|
17798
|
+
return /*#__PURE__*/jsx(DrawToolOval, {});
|
|
17157
17799
|
case 'freehand-line':
|
|
17158
|
-
return jsx(DrawToolFreehand, {});
|
|
17800
|
+
return /*#__PURE__*/jsx(DrawToolFreehand, {});
|
|
17159
17801
|
case 'smooth-line':
|
|
17160
|
-
return jsx(DrawToolSmoothLine, {});
|
|
17802
|
+
return /*#__PURE__*/jsx(DrawToolSmoothLine, {});
|
|
17161
17803
|
case 'location':
|
|
17162
|
-
return jsx(Location, {});
|
|
17804
|
+
return /*#__PURE__*/jsx(Location, {});
|
|
17163
17805
|
default:
|
|
17164
17806
|
return null;
|
|
17165
17807
|
}
|
|
@@ -17289,6 +17931,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17289
17931
|
return mode.value === 'DELETE';
|
|
17290
17932
|
}) || defaultDelete;
|
|
17291
17933
|
drawModesWithDeleteLast.push(deleteOption);
|
|
17934
|
+
|
|
17292
17935
|
// geoJSON feature collections
|
|
17293
17936
|
var _React$useState = React.useState(defaultGeoJSON),
|
|
17294
17937
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -17349,6 +17992,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17349
17992
|
return;
|
|
17350
17993
|
}
|
|
17351
17994
|
setActiveTool(newMode.isSelectable ? newMode.drawModeId : '');
|
|
17995
|
+
|
|
17352
17996
|
// add shape and update feature layer index
|
|
17353
17997
|
var isNewSelectedTool = !isGeoJSONFeatureCreatedByTool(geoJSON, newMode.selectionType, featureLayerIndex);
|
|
17354
17998
|
var shouldAddNewShape = !geoJSON.features.length || isNewSelectedTool || !newMode.isSelectable || shouldAllowMultipleShapes;
|
|
@@ -17356,6 +18000,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17356
18000
|
var updatedGeoJSON = changeGeoJSON(addSelectionTypeToGeoJSON(newMode.shape, newMode.selectionType))[0];
|
|
17357
18001
|
setFeatureLayerIndex(updatedGeoJSON.features.length - 1);
|
|
17358
18002
|
}
|
|
18003
|
+
|
|
17359
18004
|
// handle modes
|
|
17360
18005
|
setDrawMode(newMode.value);
|
|
17361
18006
|
setIsInEditMode(!!newMode.value && newMode.isSelectable);
|
|
@@ -17439,6 +18084,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17439
18084
|
selectedFeatureIndex: featureLayerIndex
|
|
17440
18085
|
};
|
|
17441
18086
|
}
|
|
18087
|
+
|
|
17442
18088
|
// intersections
|
|
17443
18089
|
return {
|
|
17444
18090
|
id: layerId,
|
|
@@ -17492,12 +18138,12 @@ var GeoJSONTextField = function GeoJSONTextField(_ref) {
|
|
|
17492
18138
|
setIsValid(false);
|
|
17493
18139
|
}
|
|
17494
18140
|
};
|
|
17495
|
-
return jsx(Grid, {
|
|
18141
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
17496
18142
|
size: {
|
|
17497
18143
|
xs: 12
|
|
17498
18144
|
},
|
|
17499
18145
|
sx: sx,
|
|
17500
|
-
children: jsx(TextField, {
|
|
18146
|
+
children: /*#__PURE__*/jsx(TextField, {
|
|
17501
18147
|
disabled: !onChangeGeoJSON,
|
|
17502
18148
|
error: !isValid,
|
|
17503
18149
|
label: !isValid ? 'GeoJSON not valid' : title,
|
|
@@ -17521,6 +18167,24 @@ var GeoJSONTextField = function GeoJSONTextField(_ref) {
|
|
|
17521
18167
|
});
|
|
17522
18168
|
};
|
|
17523
18169
|
|
|
18170
|
+
/* *
|
|
18171
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18172
|
+
* you may not use this file except in compliance with the License.
|
|
18173
|
+
* You may obtain a copy of the License at
|
|
18174
|
+
*
|
|
18175
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18176
|
+
*
|
|
18177
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18178
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18179
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18180
|
+
* See the License for the specific language governing permissions and
|
|
18181
|
+
* limitations under the License.
|
|
18182
|
+
*
|
|
18183
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
18184
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
18185
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
18186
|
+
* */
|
|
18187
|
+
|
|
17524
18188
|
var FeatureLayers = function FeatureLayers(_ref) {
|
|
17525
18189
|
var geojson = _ref.geojson,
|
|
17526
18190
|
onChangeLayerIndex = _ref.onChangeLayerIndex,
|
|
@@ -17534,20 +18198,20 @@ var FeatureLayers = function FeatureLayers(_ref) {
|
|
|
17534
18198
|
label: "".concat(index + 1, ": ").concat(geojson.features[index].geometry.type)
|
|
17535
18199
|
};
|
|
17536
18200
|
}) : [];
|
|
17537
|
-
return jsx(Grid, {
|
|
18201
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
17538
18202
|
size: {
|
|
17539
18203
|
sm: 12
|
|
17540
18204
|
},
|
|
17541
|
-
children: jsxs(FormControl, {
|
|
18205
|
+
children: /*#__PURE__*/jsxs(FormControl, {
|
|
17542
18206
|
disabled: !featureLayerList.length,
|
|
17543
18207
|
sx: {
|
|
17544
18208
|
width: '100%'
|
|
17545
18209
|
},
|
|
17546
18210
|
variant: "filled",
|
|
17547
|
-
children: [jsx(InputLabel, {
|
|
18211
|
+
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
17548
18212
|
id: "demo-feature-number",
|
|
17549
18213
|
children: "Features"
|
|
17550
|
-
}), jsx(Select, {
|
|
18214
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
17551
18215
|
labelId: "demo-feature-type",
|
|
17552
18216
|
onChange: function onChange(event) {
|
|
17553
18217
|
var featureNr = parseInt(event.target.value, 10);
|
|
@@ -17560,9 +18224,9 @@ var FeatureLayers = function FeatureLayers(_ref) {
|
|
|
17560
18224
|
},
|
|
17561
18225
|
value: (featureLayerList.length ? activeFeatureLayerIndex : '').toString(),
|
|
17562
18226
|
children: featureLayerList.map(function (listItem) {
|
|
17563
|
-
return jsxs(MenuItem, {
|
|
18227
|
+
return /*#__PURE__*/jsxs(MenuItem, {
|
|
17564
18228
|
value: listItem.index,
|
|
17565
|
-
children: [jsx(Icon$2, {
|
|
18229
|
+
children: [/*#__PURE__*/jsx(Icon$2, {
|
|
17566
18230
|
sx: {
|
|
17567
18231
|
transform: 'scale(0.9)'
|
|
17568
18232
|
},
|
|
@@ -17575,28 +18239,46 @@ var FeatureLayers = function FeatureLayers(_ref) {
|
|
|
17575
18239
|
});
|
|
17576
18240
|
};
|
|
17577
18241
|
|
|
18242
|
+
/* *
|
|
18243
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18244
|
+
* you may not use this file except in compliance with the License.
|
|
18245
|
+
* You may obtain a copy of the License at
|
|
18246
|
+
*
|
|
18247
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18248
|
+
*
|
|
18249
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18250
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18251
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18252
|
+
* See the License for the specific language governing permissions and
|
|
18253
|
+
* limitations under the License.
|
|
18254
|
+
*
|
|
18255
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
18256
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
18257
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
18258
|
+
* */
|
|
18259
|
+
|
|
17578
18260
|
var EditModeButton = function EditModeButton(_ref) {
|
|
17579
18261
|
var isInEditMode = _ref.isInEditMode,
|
|
17580
18262
|
drawMode = _ref.drawMode,
|
|
17581
18263
|
onToggleEditMode = _ref.onToggleEditMode;
|
|
17582
|
-
return jsx(Grid, {
|
|
18264
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
17583
18265
|
size: {
|
|
17584
18266
|
xs: 12
|
|
17585
18267
|
},
|
|
17586
|
-
children: jsx(CustomTooltip, {
|
|
18268
|
+
children: /*#__PURE__*/jsx(CustomTooltip, {
|
|
17587
18269
|
title: "Switch mode",
|
|
17588
|
-
children: jsxs("span", {
|
|
17589
|
-
children: [jsx(FormLabel, {
|
|
18270
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
18271
|
+
children: [/*#__PURE__*/jsx(FormLabel, {
|
|
17590
18272
|
children: "View"
|
|
17591
|
-
}), jsx(Switch, {
|
|
18273
|
+
}), /*#__PURE__*/jsx(Switch, {
|
|
17592
18274
|
checked: isInEditMode,
|
|
17593
18275
|
"data-testid": "switchMode",
|
|
17594
18276
|
onClick: function onClick() {
|
|
17595
18277
|
return onToggleEditMode(!isInEditMode);
|
|
17596
18278
|
}
|
|
17597
|
-
}), jsx(FormLabel, {
|
|
18279
|
+
}), /*#__PURE__*/jsx(FormLabel, {
|
|
17598
18280
|
children: "Edit"
|
|
17599
|
-
}), !!drawMode && jsx(Typography, {
|
|
18281
|
+
}), !!drawMode && /*#__PURE__*/jsx(Typography, {
|
|
17600
18282
|
component: "span",
|
|
17601
18283
|
sx: {
|
|
17602
18284
|
display: 'inline-block',
|
|
@@ -17629,6 +18311,7 @@ var EditModeButton = function EditModeButton(_ref) {
|
|
|
17629
18311
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
17630
18312
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
17631
18313
|
* */
|
|
18314
|
+
|
|
17632
18315
|
var simplePolygonGeoJSON = {
|
|
17633
18316
|
type: 'FeatureCollection',
|
|
17634
18317
|
features: [{
|
|
@@ -18100,11 +18783,29 @@ var useGeoJSON = function useGeoJSON() {
|
|
|
18100
18783
|
};
|
|
18101
18784
|
};
|
|
18102
18785
|
|
|
18786
|
+
/* *
|
|
18787
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18788
|
+
* you may not use this file except in compliance with the License.
|
|
18789
|
+
* You may obtain a copy of the License at
|
|
18790
|
+
*
|
|
18791
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18792
|
+
*
|
|
18793
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18794
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18795
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18796
|
+
* See the License for the specific language governing permissions and
|
|
18797
|
+
* limitations under the License.
|
|
18798
|
+
*
|
|
18799
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
18800
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
18801
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
18802
|
+
* */
|
|
18803
|
+
|
|
18103
18804
|
var StoryLayoutGrid = function StoryLayoutGrid(_ref) {
|
|
18104
18805
|
var mapComponent = _ref.mapComponent,
|
|
18105
18806
|
children = _ref.children;
|
|
18106
|
-
return jsx(Paper, {
|
|
18107
|
-
children: jsxs(Box, {
|
|
18807
|
+
return /*#__PURE__*/jsx(Paper, {
|
|
18808
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
18108
18809
|
sx: {
|
|
18109
18810
|
display: 'grid',
|
|
18110
18811
|
gridTemplateColumns: '70% 30%',
|
|
@@ -18113,21 +18814,21 @@ var StoryLayoutGrid = function StoryLayoutGrid(_ref) {
|
|
|
18113
18814
|
width: '100%',
|
|
18114
18815
|
height: '100vh'
|
|
18115
18816
|
},
|
|
18116
|
-
children: [jsx(Box, {
|
|
18817
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
18117
18818
|
sx: {
|
|
18118
18819
|
gridArea: 'map',
|
|
18119
18820
|
width: '100%',
|
|
18120
18821
|
height: '100%'
|
|
18121
18822
|
},
|
|
18122
18823
|
children: mapComponent
|
|
18123
|
-
}), jsx(Box, {
|
|
18824
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
18124
18825
|
sx: {
|
|
18125
18826
|
gridArea: 'controls',
|
|
18126
18827
|
width: '100%',
|
|
18127
18828
|
height: '100%',
|
|
18128
18829
|
padding: 2
|
|
18129
18830
|
},
|
|
18130
|
-
children: jsx(Grid, {
|
|
18831
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
18131
18832
|
container: true,
|
|
18132
18833
|
spacing: 2,
|
|
18133
18834
|
children: children
|
|
@@ -18137,6 +18838,24 @@ var StoryLayoutGrid = function StoryLayoutGrid(_ref) {
|
|
|
18137
18838
|
});
|
|
18138
18839
|
};
|
|
18139
18840
|
|
|
18841
|
+
/* *
|
|
18842
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18843
|
+
* you may not use this file except in compliance with the License.
|
|
18844
|
+
* You may obtain a copy of the License at
|
|
18845
|
+
*
|
|
18846
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18847
|
+
*
|
|
18848
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18849
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
18850
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18851
|
+
* See the License for the specific language governing permissions and
|
|
18852
|
+
* limitations under the License.
|
|
18853
|
+
*
|
|
18854
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
18855
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
18856
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
18857
|
+
* */
|
|
18858
|
+
|
|
18140
18859
|
var SelectField = function SelectField(_ref) {
|
|
18141
18860
|
var label = _ref.label,
|
|
18142
18861
|
value = _ref.value,
|
|
@@ -18156,20 +18875,20 @@ var SelectField = function SelectField(_ref) {
|
|
|
18156
18875
|
var getLabel = function getLabel(currentValue) {
|
|
18157
18876
|
return "".concat(currentValue).concat(labelSuffix);
|
|
18158
18877
|
};
|
|
18159
|
-
return jsxs(FormControl, {
|
|
18878
|
+
return /*#__PURE__*/jsxs(FormControl, {
|
|
18160
18879
|
sx: {
|
|
18161
18880
|
width: width
|
|
18162
18881
|
},
|
|
18163
18882
|
variant: "filled",
|
|
18164
|
-
children: [jsx(InputLabel, {
|
|
18883
|
+
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
18165
18884
|
children: label
|
|
18166
|
-
}), jsx(Select, {
|
|
18885
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
18167
18886
|
onChange: onChange,
|
|
18168
18887
|
value: value,
|
|
18169
18888
|
children: options.map(function (value) {
|
|
18170
|
-
return jsx(MenuItem, {
|
|
18889
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
18171
18890
|
value: value,
|
|
18172
|
-
children: showValueAsColor ? jsx(Box, {
|
|
18891
|
+
children: showValueAsColor ? /*#__PURE__*/jsx(Box, {
|
|
18173
18892
|
sx: {
|
|
18174
18893
|
backgroundColor: value,
|
|
18175
18894
|
width: 20,
|
|
@@ -18191,19 +18910,19 @@ var IntersectionSelect = function IntersectionSelect(_ref) {
|
|
|
18191
18910
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
18192
18911
|
activeIntersection = _React$useState2[0],
|
|
18193
18912
|
setActiveIntersection = _React$useState2[1];
|
|
18194
|
-
return jsx(Grid, {
|
|
18913
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
18195
18914
|
size: {
|
|
18196
18915
|
sm: 12
|
|
18197
18916
|
},
|
|
18198
|
-
children: jsxs(FormControl, {
|
|
18917
|
+
children: /*#__PURE__*/jsxs(FormControl, {
|
|
18199
18918
|
sx: {
|
|
18200
18919
|
width: '100%'
|
|
18201
18920
|
},
|
|
18202
18921
|
variant: "filled",
|
|
18203
|
-
children: [jsx(InputLabel, {
|
|
18922
|
+
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
18204
18923
|
id: "demo-intersection",
|
|
18205
18924
|
children: "Intersection shapes"
|
|
18206
|
-
}), jsx(Select, {
|
|
18925
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
18207
18926
|
disabled: isDisabled,
|
|
18208
18927
|
labelId: "demo-intersection",
|
|
18209
18928
|
onChange: function onChange(event) {
|
|
@@ -18216,7 +18935,7 @@ var IntersectionSelect = function IntersectionSelect(_ref) {
|
|
|
18216
18935
|
},
|
|
18217
18936
|
value: activeIntersection.toString(),
|
|
18218
18937
|
children: intersections.map(function (listItem, index) {
|
|
18219
|
-
return jsx(MenuItem, {
|
|
18938
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
18220
18939
|
value: index,
|
|
18221
18940
|
children: listItem.title
|
|
18222
18941
|
}, listItem.title);
|
|
@@ -18235,13 +18954,14 @@ var getToolIcon = function getToolIcon(selectionType) {
|
|
|
18235
18954
|
return defaultIcon;
|
|
18236
18955
|
}
|
|
18237
18956
|
if (selectionType === shapeButtonNL$2.selectionType) {
|
|
18238
|
-
return jsx(DrawFIRLand, {});
|
|
18957
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18239
18958
|
}
|
|
18240
18959
|
if (selectionType === customLineButton.selectionType) {
|
|
18241
|
-
return jsx(ArrowUp, {});
|
|
18960
|
+
return /*#__PURE__*/jsx(ArrowUp, {});
|
|
18242
18961
|
}
|
|
18243
|
-
return jsx("div", {});
|
|
18962
|
+
return /*#__PURE__*/jsx("div", {});
|
|
18244
18963
|
};
|
|
18964
|
+
|
|
18245
18965
|
// custom buttons
|
|
18246
18966
|
var shapeButtonNL$2 = {
|
|
18247
18967
|
drawModeId: 'tool-fir',
|
|
@@ -18441,17 +19161,18 @@ var getIntersectionToolIcon = function getIntersectionToolIcon(selectionType) {
|
|
|
18441
19161
|
return defaultIcon;
|
|
18442
19162
|
}
|
|
18443
19163
|
if (selectionType === shapeButtonNL$1.selectionType) {
|
|
18444
|
-
return jsx(DrawFIRLand, {});
|
|
19164
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18445
19165
|
}
|
|
18446
19166
|
if (selectionType === shapeButtonBE$1.selectionType) {
|
|
18447
|
-
return jsx(DrawFIRLand, {
|
|
19167
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {
|
|
18448
19168
|
sx: {
|
|
18449
19169
|
transform: "scaleY(-1)"
|
|
18450
19170
|
}
|
|
18451
19171
|
});
|
|
18452
19172
|
}
|
|
18453
|
-
return jsx(DrawFIRLand, {});
|
|
19173
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18454
19174
|
};
|
|
19175
|
+
|
|
18455
19176
|
// custom buttons
|
|
18456
19177
|
var shapeButtonNL$1 = {
|
|
18457
19178
|
drawModeId: 'tool-fir',
|
|
@@ -18559,6 +19280,7 @@ var exampleIntersectionWithShapeOptions = {
|
|
|
18559
19280
|
};
|
|
18560
19281
|
|
|
18561
19282
|
var firSelectionType = 'fir';
|
|
19283
|
+
|
|
18562
19284
|
// styles and shapes
|
|
18563
19285
|
var featurePropertiesStart = defaultGeoJSONStyleProperties;
|
|
18564
19286
|
var featurePropertiesEnd = {
|
|
@@ -18587,6 +19309,7 @@ var intersectionShapeBE = {
|
|
|
18587
19309
|
properties: _objectSpread2({}, geoJSONIntersectionBoundsStyle)
|
|
18588
19310
|
})]
|
|
18589
19311
|
};
|
|
19312
|
+
|
|
18590
19313
|
// custom buttons
|
|
18591
19314
|
var shapeButtonNL = {
|
|
18592
19315
|
drawModeId: 'fir-tool-NL',
|
|
@@ -18614,13 +19337,13 @@ var getDoubleControlToolIcon = function getDoubleControlToolIcon(drawMode) {
|
|
|
18614
19337
|
return defaultIcon;
|
|
18615
19338
|
}
|
|
18616
19339
|
if (selectionType === firSelectionType) {
|
|
18617
|
-
return jsx(DrawFIRLand, {
|
|
19340
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {
|
|
18618
19341
|
sx: _objectSpread2({}, drawMode.title === shapeButtonBE.title && {
|
|
18619
19342
|
transform: "scaleY(-1)"
|
|
18620
19343
|
})
|
|
18621
19344
|
});
|
|
18622
19345
|
}
|
|
18623
|
-
return jsx(DrawFIRLand, {});
|
|
19346
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18624
19347
|
};
|
|
18625
19348
|
var getEditModes = function getEditModes(geoJSONProperties) {
|
|
18626
19349
|
return [_objectSpread2(_objectSpread2({}, defaultPoint), {}, {
|
|
@@ -18661,6 +19384,7 @@ var updateEditModeButtonsWithFir = function updateEditModeButtonsWithFir(drawMod
|
|
|
18661
19384
|
return mode;
|
|
18662
19385
|
});
|
|
18663
19386
|
};
|
|
19387
|
+
|
|
18664
19388
|
// example configs
|
|
18665
19389
|
var startToolExampleConfig = {
|
|
18666
19390
|
defaultGeoJSONIntersectionBounds: intersectionShapeNL,
|
|
@@ -18751,7 +19475,7 @@ var ClickOnMapTool = function ClickOnMapTool(_ref) {
|
|
|
18751
19475
|
map.removeEventListener('click', clickHandler);
|
|
18752
19476
|
};
|
|
18753
19477
|
}, [map, isActive, pointSelected]);
|
|
18754
|
-
return jsx(FeatureLayer, {
|
|
19478
|
+
return /*#__PURE__*/jsx(FeatureLayer, {
|
|
18755
19479
|
features: features,
|
|
18756
19480
|
style: isVisible ? pointStyle : [],
|
|
18757
19481
|
zIndex: layerZIndex
|
|
@@ -18770,6 +19494,7 @@ var metersToNauticalMiles = function metersToNauticalMiles(meters) {
|
|
|
18770
19494
|
}
|
|
18771
19495
|
return meters / METERS_PER_NAUTICAL_MILE;
|
|
18772
19496
|
};
|
|
19497
|
+
|
|
18773
19498
|
/**
|
|
18774
19499
|
* Converts two points to a bearing in degrees, relative to geographic north.
|
|
18775
19500
|
* The input coordinates are in the map projection.
|
|
@@ -18780,6 +19505,7 @@ var metersToNauticalMiles = function metersToNauticalMiles(meters) {
|
|
|
18780
19505
|
*/
|
|
18781
19506
|
var getBearingDegrees = function getBearingDegrees(p1, p2, projection) {
|
|
18782
19507
|
var sourceProjection = projection !== null && projection !== void 0 ? projection : 'EPSG:4326';
|
|
19508
|
+
|
|
18783
19509
|
// Transform from the map projection to geographic lon/lat
|
|
18784
19510
|
try {
|
|
18785
19511
|
var _transform = transform(p1, sourceProjection, 'EPSG:4326'),
|
|
@@ -18808,6 +19534,7 @@ var getBearingDegrees = function getBearingDegrees(p1, p2, projection) {
|
|
|
18808
19534
|
return NaN;
|
|
18809
19535
|
}
|
|
18810
19536
|
};
|
|
19537
|
+
|
|
18811
19538
|
/**
|
|
18812
19539
|
* Format measurements output.
|
|
18813
19540
|
* @param {LineString} line The line.
|
|
@@ -18859,6 +19586,7 @@ var makeToolTipOverlay = function makeToolTipOverlay() {
|
|
|
18859
19586
|
measureTooltipElement.style.position = 'relative';
|
|
18860
19587
|
measureTooltipElement.style.overflow = 'visible';
|
|
18861
19588
|
measureTooltipElement.style.pointerEvents = 'none';
|
|
19589
|
+
|
|
18862
19590
|
// Arrow pointing at the overlay position
|
|
18863
19591
|
var arrowElement = document.createElement('div');
|
|
18864
19592
|
arrowElement.style.position = 'absolute';
|
|
@@ -18901,6 +19629,7 @@ var makeHelpTooltip = function makeHelpTooltip(tooltipMsg) {
|
|
|
18901
19629
|
});
|
|
18902
19630
|
return overlay;
|
|
18903
19631
|
};
|
|
19632
|
+
|
|
18904
19633
|
/**
|
|
18905
19634
|
* Adds the measure line interaction to the map.
|
|
18906
19635
|
* @param map
|
|
@@ -19062,8 +19791,7 @@ var MapMeasure = function MapMeasure(_ref) {
|
|
|
19062
19791
|
// NOVEMBER = 'timeslider-november',
|
|
19063
19792
|
// DECEMBER = 'timeslider-december',
|
|
19064
19793
|
// }
|
|
19065
|
-
var DaysOfWeek
|
|
19066
|
-
(function (DaysOfWeek) {
|
|
19794
|
+
var DaysOfWeek = /*#__PURE__*/function (DaysOfWeek) {
|
|
19067
19795
|
DaysOfWeek["SUNDAY"] = "Sun";
|
|
19068
19796
|
DaysOfWeek["MONDAY"] = "Mon";
|
|
19069
19797
|
DaysOfWeek["TUESDAY"] = "Tue";
|
|
@@ -19071,9 +19799,9 @@ var DaysOfWeek;
|
|
|
19071
19799
|
DaysOfWeek["THURSDAY"] = "Thu";
|
|
19072
19800
|
DaysOfWeek["FRIDAY"] = "Fri";
|
|
19073
19801
|
DaysOfWeek["SATURDAY"] = "Sat";
|
|
19074
|
-
|
|
19075
|
-
|
|
19076
|
-
|
|
19802
|
+
return DaysOfWeek;
|
|
19803
|
+
}(DaysOfWeek || {});
|
|
19804
|
+
var MonthsOfTheYear = /*#__PURE__*/function (MonthsOfTheYear) {
|
|
19077
19805
|
MonthsOfTheYear["JANUARY"] = "Jan";
|
|
19078
19806
|
MonthsOfTheYear["FEBRUARY"] = "Feb";
|
|
19079
19807
|
MonthsOfTheYear["MARCH"] = "Mar";
|
|
@@ -19086,7 +19814,8 @@ var MonthsOfTheYear;
|
|
|
19086
19814
|
MonthsOfTheYear["OCTOBER"] = "Oct";
|
|
19087
19815
|
MonthsOfTheYear["NOVEMBER"] = "Nov";
|
|
19088
19816
|
MonthsOfTheYear["DECEMBER"] = "Dec";
|
|
19089
|
-
|
|
19817
|
+
return MonthsOfTheYear;
|
|
19818
|
+
}(MonthsOfTheYear || {});
|
|
19090
19819
|
var dateToManualFormatString = function dateToManualFormatString(inDate) {
|
|
19091
19820
|
if (!inDate) {
|
|
19092
19821
|
return 'Date not available';
|
|
@@ -19099,84 +19828,142 @@ var dateToManualFormatString = function dateToManualFormatString(inDate) {
|
|
|
19099
19828
|
return "".concat(EEE, " ").concat(dd, " ").concat(MMM, " ").concat(HH, ":").concat(mm, " UTC");
|
|
19100
19829
|
};
|
|
19101
19830
|
|
|
19102
|
-
|
|
19103
|
-
*
|
|
19831
|
+
/* *
|
|
19832
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
19833
|
+
* you may not use this file except in compliance with the License.
|
|
19834
|
+
* You may obtain a copy of the License at
|
|
19104
19835
|
*
|
|
19105
|
-
*
|
|
19106
|
-
* @param {Date} inDate - date to be formatted
|
|
19836
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19107
19837
|
*
|
|
19108
|
-
|
|
19838
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19839
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19840
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19841
|
+
* See the License for the specific language governing permissions and
|
|
19842
|
+
* limitations under the License.
|
|
19843
|
+
*
|
|
19844
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
19845
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
19846
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
19847
|
+
* */
|
|
19848
|
+
|
|
19849
|
+
var getButtonSizes = function getButtonSizes(fontSize) {
|
|
19850
|
+
if (fontSize > 40) {
|
|
19851
|
+
return {
|
|
19852
|
+
buttonSize: 'large',
|
|
19853
|
+
iconSize: 40
|
|
19854
|
+
};
|
|
19855
|
+
}
|
|
19856
|
+
if (fontSize > 24) {
|
|
19857
|
+
return {
|
|
19858
|
+
buttonSize: 'medium',
|
|
19859
|
+
iconSize: 32
|
|
19860
|
+
};
|
|
19861
|
+
}
|
|
19862
|
+
return {
|
|
19863
|
+
buttonSize: 'small',
|
|
19864
|
+
iconSize: 24
|
|
19865
|
+
};
|
|
19866
|
+
};
|
|
19109
19867
|
var ClockContainer = function ClockContainer(_ref) {
|
|
19110
|
-
var
|
|
19111
|
-
|
|
19112
|
-
|
|
19868
|
+
var _ref$isOptionsMenuVis = _ref.isOptionsMenuVisible,
|
|
19869
|
+
isOptionsMenuVisible = _ref$isOptionsMenuVis === void 0 ? false : _ref$isOptionsMenuVis,
|
|
19870
|
+
fontSize = _ref.fontSize,
|
|
19871
|
+
onToggleClock = _ref.onToggleClock,
|
|
19872
|
+
time = _ref.time,
|
|
19873
|
+
onToggleOptions = _ref.onToggleOptions,
|
|
19874
|
+
optionsElement = _ref.optionsElement;
|
|
19113
19875
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
19114
19876
|
t = _useWebmapReactTransl.t;
|
|
19115
19877
|
var title = t('clock-hide');
|
|
19878
|
+
var optionsTitle = t('clock-animation-options');
|
|
19116
19879
|
var currentDateString = dateToManualFormatString(dateUtils.fromUnix(time));
|
|
19117
|
-
|
|
19118
|
-
|
|
19119
|
-
|
|
19120
|
-
|
|
19121
|
-
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
width: '100%',
|
|
19125
|
-
backgroundColor: 'geowebColors.timeSlider.playerTimeMarkers.fill',
|
|
19126
|
-
borderRadius: '5px'
|
|
19127
|
-
},
|
|
19128
|
-
wrap: "nowrap",
|
|
19129
|
-
children: [jsx(Grid, {
|
|
19880
|
+
var _getButtonSizes = getButtonSizes(fontSize),
|
|
19881
|
+
buttonSize = _getButtonSizes.buttonSize,
|
|
19882
|
+
iconSize = _getButtonSizes.iconSize;
|
|
19883
|
+
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
19884
|
+
theme: darkTheme,
|
|
19885
|
+
children: /*#__PURE__*/jsxs(Grid, {
|
|
19886
|
+
container: true,
|
|
19130
19887
|
sx: {
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19888
|
+
justifyContent: 'space-evenly',
|
|
19889
|
+
alignItems: 'center',
|
|
19890
|
+
cursor: 'move',
|
|
19891
|
+
height: '100%',
|
|
19892
|
+
width: '100%',
|
|
19893
|
+
backgroundColor: 'geowebColors.timeSlider.playerTimeMarkers.fill',
|
|
19894
|
+
borderRadius: '5px'
|
|
19895
|
+
},
|
|
19896
|
+
wrap: "nowrap",
|
|
19897
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
19136
19898
|
sx: {
|
|
19137
|
-
|
|
19899
|
+
marginLeft: '12px',
|
|
19900
|
+
marginRight: '12px'
|
|
19138
19901
|
},
|
|
19139
|
-
children: jsx(
|
|
19140
|
-
|
|
19141
|
-
|
|
19142
|
-
|
|
19143
|
-
|
|
19144
|
-
|
|
19145
|
-
|
|
19902
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
19903
|
+
"aria-label": title,
|
|
19904
|
+
onClick: onToggleClock,
|
|
19905
|
+
size: buttonSize,
|
|
19906
|
+
tooltipTitle: title,
|
|
19907
|
+
variant: "boxed",
|
|
19908
|
+
children: /*#__PURE__*/jsx(ChevronRight, {
|
|
19909
|
+
sx: {
|
|
19910
|
+
width: iconSize,
|
|
19911
|
+
height: iconSize
|
|
19912
|
+
}
|
|
19146
19913
|
})
|
|
19147
19914
|
})
|
|
19148
|
-
})
|
|
19149
|
-
|
|
19150
|
-
|
|
19915
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
19916
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
19917
|
+
sx: {
|
|
19918
|
+
whiteSpace: 'nowrap',
|
|
19919
|
+
fontSize: fontSize,
|
|
19920
|
+
color: 'geowebColors.timeSlider.playerTimeText.color'
|
|
19921
|
+
},
|
|
19922
|
+
variant: "subtitle2",
|
|
19923
|
+
children: currentDateString
|
|
19924
|
+
})
|
|
19925
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
19151
19926
|
sx: {
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
color: '#fff'
|
|
19927
|
+
marginLeft: '12px',
|
|
19928
|
+
marginRight: '12px'
|
|
19155
19929
|
},
|
|
19156
|
-
|
|
19157
|
-
|
|
19158
|
-
|
|
19159
|
-
|
|
19930
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
19931
|
+
"aria-label": optionsTitle,
|
|
19932
|
+
isSelected: isOptionsMenuVisible,
|
|
19933
|
+
onClick: onToggleOptions,
|
|
19934
|
+
ref: optionsElement,
|
|
19935
|
+
size: buttonSize,
|
|
19936
|
+
tooltipTitle: optionsTitle,
|
|
19937
|
+
variant: "boxed",
|
|
19938
|
+
children: /*#__PURE__*/jsx(Options, {
|
|
19939
|
+
sx: {
|
|
19940
|
+
width: iconSize,
|
|
19941
|
+
height: iconSize
|
|
19942
|
+
}
|
|
19943
|
+
})
|
|
19944
|
+
})
|
|
19945
|
+
})]
|
|
19946
|
+
})
|
|
19160
19947
|
});
|
|
19161
19948
|
};
|
|
19162
19949
|
|
|
19163
|
-
var MIN_WIDTH =
|
|
19950
|
+
var MIN_WIDTH = 240;
|
|
19164
19951
|
var MIN_HEIGHT = 32;
|
|
19165
19952
|
var MIN_FONT_SIZE = 14; // bigger font size will cause render delay in LCP
|
|
19166
19953
|
var FONT_SIZE_WIDTH_RATIO = MIN_FONT_SIZE / MIN_WIDTH;
|
|
19167
|
-
var BUTTON_WIDTH = 40;
|
|
19168
19954
|
var resizeHandlePlacement = {
|
|
19169
19955
|
top: false,
|
|
19170
19956
|
right: false,
|
|
19171
19957
|
bottom: false,
|
|
19172
19958
|
left: false,
|
|
19173
|
-
topRight:
|
|
19174
|
-
bottomRight:
|
|
19959
|
+
topRight: true,
|
|
19960
|
+
bottomRight: true,
|
|
19175
19961
|
bottomLeft: true,
|
|
19176
|
-
topLeft:
|
|
19962
|
+
topLeft: true
|
|
19177
19963
|
};
|
|
19178
19964
|
var Clock = function Clock(_ref2) {
|
|
19179
|
-
var
|
|
19965
|
+
var optionsElement = _ref2.optionsElement,
|
|
19966
|
+
time = _ref2.time,
|
|
19180
19967
|
_ref2$isVisible = _ref2.isVisible,
|
|
19181
19968
|
isClockVisible = _ref2$isVisible === void 0 ? true : _ref2$isVisible,
|
|
19182
19969
|
onToggleClock = _ref2.onToggleClock,
|
|
@@ -19191,7 +19978,10 @@ var Clock = function Clock(_ref2) {
|
|
|
19191
19978
|
width: MIN_WIDTH,
|
|
19192
19979
|
height: MIN_HEIGHT
|
|
19193
19980
|
} : _ref2$size,
|
|
19194
|
-
onSetSize = _ref2.onSetSize
|
|
19981
|
+
onSetSize = _ref2.onSetSize,
|
|
19982
|
+
onToggleOptions = _ref2.onToggleOptions,
|
|
19983
|
+
_ref2$isOptionsMenuVi = _ref2.isOptionsMenuVisible,
|
|
19984
|
+
isOptionsMenuVisible = _ref2$isOptionsMenuVi === void 0 ? false : _ref2$isOptionsMenuVi;
|
|
19195
19985
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
19196
19986
|
t = _useWebmapReactTransl.t;
|
|
19197
19987
|
var clockElement = useRef(null);
|
|
@@ -19204,6 +19994,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19204
19994
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
19205
19995
|
isResizing = _useState4[0],
|
|
19206
19996
|
setIsResizing = _useState4[1];
|
|
19997
|
+
|
|
19207
19998
|
// While resizing, use the local font size. Once you finish and the width has been updated, revert back to the size as determined from width
|
|
19208
19999
|
var fontSize = isResizing ? resizeFontSize : FONT_SIZE_WIDTH_RATIO * size.width;
|
|
19209
20000
|
var toggleClock = function toggleClock(isClockVisible) {
|
|
@@ -19215,8 +20006,11 @@ var Clock = function Clock(_ref2) {
|
|
|
19215
20006
|
var setSize = function setSize(size) {
|
|
19216
20007
|
onSetSize === null || onSetSize === void 0 || onSetSize(size);
|
|
19217
20008
|
};
|
|
19218
|
-
|
|
19219
|
-
|
|
20009
|
+
var toggleOptions = function toggleOptions() {
|
|
20010
|
+
onToggleOptions === null || onToggleOptions === void 0 || onToggleOptions();
|
|
20011
|
+
};
|
|
20012
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
20013
|
+
children: !isClockVisible ? /*#__PURE__*/jsx(CustomIconButton, {
|
|
19220
20014
|
"aria-label": t('clock-show'),
|
|
19221
20015
|
onClick: function onClick() {
|
|
19222
20016
|
toggleClock(true);
|
|
@@ -19229,8 +20023,8 @@ var Clock = function Clock(_ref2) {
|
|
|
19229
20023
|
},
|
|
19230
20024
|
tooltipTitle: t('clock-show'),
|
|
19231
20025
|
variant: "boxed",
|
|
19232
|
-
children: jsx(Clock$1, {})
|
|
19233
|
-
}) : jsx(Draggable, {
|
|
20026
|
+
children: /*#__PURE__*/jsx(Clock$1, {})
|
|
20027
|
+
}) : /*#__PURE__*/jsx(Draggable, {
|
|
19234
20028
|
bounds: "parent",
|
|
19235
20029
|
cancel: ".MuiButtonBase-root",
|
|
19236
20030
|
nodeRef: clockElement,
|
|
@@ -19241,29 +20035,19 @@ var Clock = function Clock(_ref2) {
|
|
|
19241
20035
|
});
|
|
19242
20036
|
},
|
|
19243
20037
|
position: position,
|
|
19244
|
-
children: jsx("div", {
|
|
19245
|
-
ref:
|
|
19246
|
-
clockElement.current = _ref3;
|
|
19247
|
-
},
|
|
20038
|
+
children: /*#__PURE__*/jsx("div", {
|
|
20039
|
+
ref: clockElement,
|
|
19248
20040
|
style: {
|
|
19249
20041
|
position: 'absolute',
|
|
19250
20042
|
zIndex: 1001,
|
|
19251
20043
|
top: '10px',
|
|
19252
20044
|
right: '10px'
|
|
19253
20045
|
},
|
|
19254
|
-
children: jsx(Resizable, {
|
|
20046
|
+
children: /*#__PURE__*/jsx(Resizable, {
|
|
19255
20047
|
enable: resizeHandlePlacement,
|
|
19256
|
-
handleComponent: {
|
|
19257
|
-
bottomLeft: jsx(Resize, {
|
|
19258
|
-
isRightAligned: true,
|
|
19259
|
-
style: {
|
|
19260
|
-
fill: '#FFFFFF'
|
|
19261
|
-
}
|
|
19262
|
-
})
|
|
19263
|
-
},
|
|
19264
20048
|
lockAspectRatio: true,
|
|
19265
20049
|
minHeight: MIN_HEIGHT,
|
|
19266
|
-
minWidth: MIN_WIDTH
|
|
20050
|
+
minWidth: MIN_WIDTH,
|
|
19267
20051
|
nodeRef: clockElement,
|
|
19268
20052
|
onResize: function onResize(_event, _direction, _ref, delta) {
|
|
19269
20053
|
var width = size.width + delta.width;
|
|
@@ -19285,11 +20069,14 @@ var Clock = function Clock(_ref2) {
|
|
|
19285
20069
|
});
|
|
19286
20070
|
},
|
|
19287
20071
|
size: size,
|
|
19288
|
-
children: jsx(ClockContainer, {
|
|
20072
|
+
children: /*#__PURE__*/jsx(ClockContainer, {
|
|
19289
20073
|
fontSize: fontSize,
|
|
19290
|
-
|
|
20074
|
+
isOptionsMenuVisible: isOptionsMenuVisible,
|
|
20075
|
+
onToggleClock: function onToggleClock() {
|
|
19291
20076
|
toggleClock(false);
|
|
19292
20077
|
},
|
|
20078
|
+
onToggleOptions: toggleOptions,
|
|
20079
|
+
optionsElement: optionsElement,
|
|
19293
20080
|
time: time
|
|
19294
20081
|
})
|
|
19295
20082
|
})
|
|
@@ -19315,6 +20102,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19315
20102
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
19316
20103
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
19317
20104
|
* */
|
|
20105
|
+
|
|
19318
20106
|
function getIsInsideAcceptanceTime(acceptanceTimeInMinutes, mapDimensions, layerDimensions) {
|
|
19319
20107
|
var _mapDimensions$find, _layerDimensions$find;
|
|
19320
20108
|
var mapCurrentTime = mapDimensions === null || mapDimensions === void 0 || (_mapDimensions$find = mapDimensions.find(function (dimension) {
|