@opengeoweb/webmap-react 16.0.0 → 17.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +891 -232
- package/package.json +5 -5
- package/src/index.d.ts +0 -11
- package/src/lib/components/Clock/Clock.d.ts +0 -23
- 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 -9
- 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 -18
- 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 -7
- 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 -8
- 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 -16
- package/src/lib/components/Legend/LegendDialog.spec.d.ts +0 -1
- package/src/lib/components/Legend/LegendLayout.d.ts +0 -10
- 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,14 +9,14 @@ 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
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';
|
|
15
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';
|
|
16
15
|
import 'i18next';
|
|
17
16
|
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
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
20
|
import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
|
|
21
21
|
import { http, HttpResponse } from 'msw';
|
|
22
22
|
import Box$1 from '@mui/material/Box';
|
|
@@ -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';
|
|
@@ -300,6 +300,7 @@ var webmapReactTranslations = {
|
|
|
300
300
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
301
301
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
302
302
|
* */
|
|
303
|
+
|
|
303
304
|
var TimeContext = /*#__PURE__*/createContext({});
|
|
304
305
|
|
|
305
306
|
function _OverloadYield(e, d) {
|
|
@@ -827,12 +828,14 @@ function _regeneratorRuntime() {
|
|
|
827
828
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
828
829
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
829
830
|
* */
|
|
831
|
+
|
|
830
832
|
var MAX_NUMBER_TO_PREFETCH = 200;
|
|
831
833
|
var MAX_NUMBER_STEPS_IN_TIME_SLIDER_TO_PREFETCH = 10000;
|
|
832
834
|
var NUMBER_PREFETCH_WORKERS = 4;
|
|
833
835
|
var NUM_IMAGES_TO_CACHE = 10000;
|
|
834
836
|
var WMS_EXTENT_RATIO_TO_VIEWPORT = 1.2;
|
|
835
837
|
var TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = 'Image did not load succesfully';
|
|
838
|
+
|
|
836
839
|
// // To debug what dimensions are actually being used in the map, use:
|
|
837
840
|
// export const ADD_SHOW_DIMS_OPTION = true;
|
|
838
841
|
// export const WMS_EXTENT_RATIO_TO_VIEWPORT = 1.0;
|
|
@@ -867,6 +870,7 @@ var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsT
|
|
|
867
870
|
var pastPrefetchValues = timePrefetchValuesArray.filter(function (timeStepAsTime) {
|
|
868
871
|
return timeStepAsTime < currentTimeOfLayer;
|
|
869
872
|
});
|
|
873
|
+
|
|
870
874
|
// eslint-disable-next-line @typescript-eslint/require-array-sort-compare
|
|
871
875
|
futurePrefetchValues.sort();
|
|
872
876
|
isAnimating ?
|
|
@@ -883,6 +887,7 @@ var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsT
|
|
|
883
887
|
}
|
|
884
888
|
return [];
|
|
885
889
|
};
|
|
890
|
+
|
|
886
891
|
/**
|
|
887
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.
|
|
888
893
|
* The input time is descretized to the closest value which is available in the WMS layer.
|
|
@@ -898,6 +903,7 @@ var getDimensionParamsForWMS = function getDimensionParamsForWMS(dimensions, wmL
|
|
|
898
903
|
}
|
|
899
904
|
var dimProps = {};
|
|
900
905
|
var wmLayerDims = wmLayer.getDimensions();
|
|
906
|
+
|
|
901
907
|
// Loop without forEach so we can exit and return.
|
|
902
908
|
var _iterator = _createForOfIteratorHelper(wmLayerDims),
|
|
903
909
|
_step;
|
|
@@ -936,6 +942,7 @@ var getDimensionParamsForWMS = function getDimensionParamsForWMS(dimensions, wmL
|
|
|
936
942
|
}
|
|
937
943
|
return dimProps;
|
|
938
944
|
};
|
|
945
|
+
|
|
939
946
|
/**
|
|
940
947
|
* Calculates number of timesteps for given timespan
|
|
941
948
|
* @param timespan Object of Timespan, with start/stop/end in milliseconds
|
|
@@ -966,6 +973,7 @@ var timeSpanToTimeList = function timeSpanToTimeList(timespan) {
|
|
|
966
973
|
}
|
|
967
974
|
return [];
|
|
968
975
|
};
|
|
976
|
+
|
|
969
977
|
/**
|
|
970
978
|
* Calculates number of timesteps for given timespan
|
|
971
979
|
* @param timespan Object of Timespan, with start/stop/end in milliseconds
|
|
@@ -984,6 +992,9 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
984
992
|
var _this;
|
|
985
993
|
_classCallCheck(this, TimeAwareImageWrapper);
|
|
986
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;
|
|
987
998
|
_this._paramsToLoad = {};
|
|
988
999
|
_this._dimPropsToLoad = {};
|
|
989
1000
|
_this._getMapUrl = null;
|
|
@@ -1024,6 +1035,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1024
1035
|
var resolution = resolutionToLoad;
|
|
1025
1036
|
var requestResolution = Array.isArray(resolution) ? resolution[0] : resolution || 1;
|
|
1026
1037
|
var newPixelRatio = pixelRatio;
|
|
1038
|
+
|
|
1027
1039
|
// Load 1.2^2 % larger WMS extents than the current view
|
|
1028
1040
|
var ratio = WMS_EXTENT_RATIO_TO_VIEWPORT;
|
|
1029
1041
|
var extent = extentToLoad;
|
|
@@ -1191,6 +1203,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1191
1203
|
var WorkerQueue = /*#__PURE__*/function () {
|
|
1192
1204
|
function WorkerQueue(concurrency) {
|
|
1193
1205
|
_classCallCheck(this, WorkerQueue);
|
|
1206
|
+
this.maxConcurrency = void 0;
|
|
1194
1207
|
this.tasksInProcess = [];
|
|
1195
1208
|
this.taskQueue = [];
|
|
1196
1209
|
this.disposed = false;
|
|
@@ -1261,6 +1274,7 @@ var WorkerQueue = /*#__PURE__*/function () {
|
|
|
1261
1274
|
|
|
1262
1275
|
var initImageWrapper = function initImageWrapper() {
|
|
1263
1276
|
var emptyButLoading = new TimeAwareImageWrapper([0, 0, 0, 0], 1, 1);
|
|
1277
|
+
|
|
1264
1278
|
// Set to loaded to indicate to ol that it can be displayed immediately
|
|
1265
1279
|
emptyButLoading.setState(ImageState.LOADED);
|
|
1266
1280
|
emptyButLoading.setImage(document.createElement('img'));
|
|
@@ -1279,6 +1293,29 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1279
1293
|
visible = _ref.visible;
|
|
1280
1294
|
_classCallCheck(this, TimeawareImageSource);
|
|
1281
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;
|
|
1282
1319
|
_this._wmsUrl = wmsUrl;
|
|
1283
1320
|
_this._extraWMSParams = _objectSpread2({}, params);
|
|
1284
1321
|
_this._layerName = layerName;
|
|
@@ -1367,6 +1404,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1367
1404
|
value: function prefetch(extent, resolution, pixelRatio, projection) {
|
|
1368
1405
|
var _this3 = this;
|
|
1369
1406
|
var dimensionsToPrefetchUnFiltered = this._timeStampsToPrefetch;
|
|
1407
|
+
|
|
1370
1408
|
// Only work on imagery that still needs to be loaded.
|
|
1371
1409
|
var dimensionsToPrefetch = dimensionsToPrefetchUnFiltered.filter(function (dimValue) {
|
|
1372
1410
|
var hasExactImage = _this3._imWrapperForOlSource.hasImage(extent, resolution, pixelRatio, projection, _this3._wmsUrl, _this3._extraWMSParams, _this3._layerName, _this3._styleName, _objectSpread2(_objectSpread2({}, _this3._dimProperties), {}, {
|
|
@@ -1441,6 +1479,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1441
1479
|
this._lastRequestedPixelRatio = pixelRatio;
|
|
1442
1480
|
this._lastRequestedProjection = projection;
|
|
1443
1481
|
this.throttledImageLoad();
|
|
1482
|
+
|
|
1444
1483
|
// While we are loading, check if there is an alternative image available
|
|
1445
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);
|
|
1446
1485
|
if (altImage && altImage.isLoaded) {
|
|
@@ -1448,6 +1487,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1448
1487
|
this._imWrapperForAltImage.setGeoReferencedImage(altImage);
|
|
1449
1488
|
return this._imWrapperForAltImage;
|
|
1450
1489
|
}
|
|
1490
|
+
|
|
1451
1491
|
// This thing is has nothing to show yet.
|
|
1452
1492
|
return this._imWrapperEmptyButLoading;
|
|
1453
1493
|
}
|
|
@@ -1460,6 +1500,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1460
1500
|
this._dimProperties = _objectSpread2({}, params);
|
|
1461
1501
|
this.changed();
|
|
1462
1502
|
}
|
|
1503
|
+
|
|
1463
1504
|
/**
|
|
1464
1505
|
* Check if an image is available and loaded for requested date. Used for showlayerinfo to proceed.
|
|
1465
1506
|
* @param isoTime
|
|
@@ -1531,6 +1572,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1531
1572
|
}
|
|
1532
1573
|
var dimPropWithRequestedDate = _objectSpread2({}, this._dimProperties);
|
|
1533
1574
|
dimPropWithRequestedDate['TIME'] = timeStampsToPrefetch;
|
|
1575
|
+
|
|
1534
1576
|
// While we are loading, check if there is an alternative image available
|
|
1535
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);
|
|
1536
1578
|
if (altImage && altImage.isLoaded) {
|
|
@@ -1571,6 +1613,24 @@ var useWebmapReactTranslation = function useWebmapReactTranslation() {
|
|
|
1571
1613
|
return useTranslation(ns);
|
|
1572
1614
|
};
|
|
1573
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
|
+
|
|
1574
1634
|
var LegendLayout = function LegendLayout(_ref) {
|
|
1575
1635
|
var title = _ref.title,
|
|
1576
1636
|
children = _ref.children,
|
|
@@ -1582,7 +1642,7 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1582
1642
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
1583
1643
|
t = _useWebmapReactTransl.t;
|
|
1584
1644
|
var theme = useTheme();
|
|
1585
|
-
return jsxs(Card, {
|
|
1645
|
+
return /*#__PURE__*/jsxs(Card, {
|
|
1586
1646
|
"data-testid": "legend",
|
|
1587
1647
|
sx: {
|
|
1588
1648
|
border: 'none',
|
|
@@ -1594,11 +1654,11 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1594
1654
|
borderRadius: '3px',
|
|
1595
1655
|
padding: toggleLayerLegendVisibility ? 'none' : '10px'
|
|
1596
1656
|
},
|
|
1597
|
-
children: [toggleLayerLegendVisibility ? jsx(Box, {
|
|
1657
|
+
children: [toggleLayerLegendVisibility ? /*#__PURE__*/jsx(Box, {
|
|
1598
1658
|
"data-testid": "legend-title",
|
|
1599
|
-
children: jsx(CustomTooltip, {
|
|
1659
|
+
children: /*#__PURE__*/jsx(CustomTooltip, {
|
|
1600
1660
|
title: showLayerLegend ? t('webmap-react-hide-layer') : t('webmap-react-show-layer'),
|
|
1601
|
-
children: jsxs(Typography, {
|
|
1661
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
1602
1662
|
alignItems: "center",
|
|
1603
1663
|
component: "button",
|
|
1604
1664
|
display: "flex",
|
|
@@ -1627,17 +1687,17 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1627
1687
|
}
|
|
1628
1688
|
},
|
|
1629
1689
|
variant: "subtitle2",
|
|
1630
|
-
children: [showLayerLegend ? jsx(Visibility, {
|
|
1690
|
+
children: [showLayerLegend ? /*#__PURE__*/jsx(Visibility, {
|
|
1631
1691
|
fontSize: "medium",
|
|
1632
1692
|
sx: {
|
|
1633
1693
|
margin: 'auto 0px'
|
|
1634
1694
|
}
|
|
1635
|
-
}) : jsx(VisibilityOff, {
|
|
1695
|
+
}) : /*#__PURE__*/jsx(VisibilityOff, {
|
|
1636
1696
|
fontSize: "medium",
|
|
1637
1697
|
sx: {
|
|
1638
1698
|
margin: 'auto 0px'
|
|
1639
1699
|
}
|
|
1640
|
-
}), jsx("span", {
|
|
1700
|
+
}), /*#__PURE__*/jsx("span", {
|
|
1641
1701
|
style: {
|
|
1642
1702
|
overflow: 'hidden',
|
|
1643
1703
|
textOverflow: 'ellipsis'
|
|
@@ -1646,12 +1706,12 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1646
1706
|
})]
|
|
1647
1707
|
})
|
|
1648
1708
|
})
|
|
1649
|
-
}) : jsx(Box, {
|
|
1709
|
+
}) : /*#__PURE__*/jsx(Box, {
|
|
1650
1710
|
"data-testid": "legend-title",
|
|
1651
1711
|
sx: {
|
|
1652
1712
|
backgroundColor: '#FFF'
|
|
1653
1713
|
},
|
|
1654
|
-
children: jsx(Typography, {
|
|
1714
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1655
1715
|
sx: {
|
|
1656
1716
|
fontFamily: 'Roboto, Helvetica, Arial',
|
|
1657
1717
|
fontSize: '10px',
|
|
@@ -1663,10 +1723,10 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1663
1723
|
variant: "h3",
|
|
1664
1724
|
children: title
|
|
1665
1725
|
})
|
|
1666
|
-
}), !!showLayerLegend && jsx(CustomTooltip, {
|
|
1726
|
+
}), !!showLayerLegend && /*#__PURE__*/jsx(CustomTooltip, {
|
|
1667
1727
|
placement: "top",
|
|
1668
1728
|
title: title || 'loading',
|
|
1669
|
-
children: jsx(Box, {
|
|
1729
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
1670
1730
|
sx: {
|
|
1671
1731
|
margin: toggleLayerLegendVisibility ? '2px 0 8px 12px' : '10px 0px 10px 0px',
|
|
1672
1732
|
height: "".concat(height, "px"),
|
|
@@ -1697,6 +1757,7 @@ var LegendLayout = function LegendLayout(_ref) {
|
|
|
1697
1757
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
1698
1758
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
1699
1759
|
* */
|
|
1760
|
+
|
|
1700
1761
|
// This function is a copy of /libs/api/src/utils.ts which cannot be used here due to circular dependency
|
|
1701
1762
|
var handleResponse = /*#__PURE__*/function () {
|
|
1702
1763
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(response) {
|
|
@@ -1758,6 +1819,7 @@ var joinUrlParams = function joinUrlParams(params) {
|
|
|
1758
1819
|
return x !== undefined && x.length > 0;
|
|
1759
1820
|
}).join('/');
|
|
1760
1821
|
};
|
|
1822
|
+
|
|
1761
1823
|
// This is a copy from libs/api/src/utils.ts due to circular dependency
|
|
1762
1824
|
var withJsonFormat = function withJsonFormat(url) {
|
|
1763
1825
|
var urlObj = new URL(url);
|
|
@@ -1901,6 +1963,7 @@ var fetchEDRParameter = /*#__PURE__*/function () {
|
|
|
1901
1963
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
1902
1964
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
1903
1965
|
* */
|
|
1966
|
+
|
|
1904
1967
|
var coverageCollectionToFeatureCollection = function coverageCollectionToFeatureCollection(cov, parameterNames) {
|
|
1905
1968
|
if (cov === undefined) {
|
|
1906
1969
|
return {
|
|
@@ -1908,6 +1971,7 @@ var coverageCollectionToFeatureCollection = function coverageCollectionToFeature
|
|
|
1908
1971
|
type: 'FeatureCollection'
|
|
1909
1972
|
};
|
|
1910
1973
|
}
|
|
1974
|
+
|
|
1911
1975
|
// For coverage collection
|
|
1912
1976
|
if (cov && _typeof(cov) === 'object' && 'coverages' in cov) {
|
|
1913
1977
|
var _cov$coverages$reduce, _cov$coverages;
|
|
@@ -1952,7 +2016,9 @@ var coverageCollectionToFeatureCollection = function coverageCollectionToFeature
|
|
|
1952
2016
|
};
|
|
1953
2017
|
return _featurePoint;
|
|
1954
2018
|
}
|
|
2019
|
+
|
|
1955
2020
|
// For Coverage
|
|
2021
|
+
|
|
1956
2022
|
var paramVals = {};
|
|
1957
2023
|
parameterNames.split(',').forEach(function (parameterName) {
|
|
1958
2024
|
var _cov$ranges$parameter;
|
|
@@ -1975,6 +2041,7 @@ var coverageCollectionToFeatureCollection = function coverageCollectionToFeature
|
|
|
1975
2041
|
};
|
|
1976
2042
|
|
|
1977
2043
|
var DEFAULT_STALE_TIME$1 = 60000; // One minute
|
|
2044
|
+
|
|
1978
2045
|
// Ensures every webmap-react query starts with the same query key
|
|
1979
2046
|
var generateWebmapQueryKeys = function generateWebmapQueryKeys(queryKeys) {
|
|
1980
2047
|
return ['webmap-react'].concat(queryKeys);
|
|
@@ -2062,6 +2129,7 @@ var useEDRGetParameterData = function useEDRGetParameterData(edrBaseUrlWithColle
|
|
|
2062
2129
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
2063
2130
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
2064
2131
|
* */
|
|
2132
|
+
|
|
2065
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'];
|
|
2066
2134
|
var precipitationMMLegendColorsWoW = ['#BACDCB', '#A3C3C9', '#8BBCC8', '#6AAEC1', '#42A1C0', '#377EAF', '#46669C', '#56528D', '#86008D', '#610066'];
|
|
2067
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'];
|
|
@@ -2194,6 +2262,7 @@ var generateImageFromLegend = function generateImageFromLegend(edrColorLegend, c
|
|
|
2194
2262
|
var gap = 10; // gap between box and text
|
|
2195
2263
|
var rowSpacing = 2; // vertical spacing between rows
|
|
2196
2264
|
var font = '11px Arial';
|
|
2265
|
+
|
|
2197
2266
|
// Compute required canvas height
|
|
2198
2267
|
var legendCount = edrColorLegend.legend.length;
|
|
2199
2268
|
var requiredHeight = yStart + legendCount * (rowSpacing + boxSize);
|
|
@@ -2206,6 +2275,7 @@ var generateImageFromLegend = function generateImageFromLegend(edrColorLegend, c
|
|
|
2206
2275
|
ctx.textBaseline = 'middle';
|
|
2207
2276
|
// eslint-disable-next-line no-param-reassign
|
|
2208
2277
|
ctx.fillStyle = '#111';
|
|
2278
|
+
|
|
2209
2279
|
// sort the legend based on highest value first
|
|
2210
2280
|
var sortedLegend = _toConsumableArray(edrColorLegend.legend).sort(function (itemA, itemB) {
|
|
2211
2281
|
return itemB.max - itemA.max;
|
|
@@ -2216,12 +2286,14 @@ var generateImageFromLegend = function generateImageFromLegend(edrColorLegend, c
|
|
|
2216
2286
|
color = item.color;
|
|
2217
2287
|
var text = "".concat(formatNumber(min), " : ").concat(formatNumber(max));
|
|
2218
2288
|
var y = yStart + index * (rowSpacing + boxSize);
|
|
2289
|
+
|
|
2219
2290
|
// Draw colored box
|
|
2220
2291
|
// eslint-disable-next-line no-param-reassign
|
|
2221
2292
|
ctx.globalAlpha = opacity || 1;
|
|
2222
2293
|
// eslint-disable-next-line no-param-reassign
|
|
2223
2294
|
ctx.fillStyle = color;
|
|
2224
2295
|
ctx.fillRect(x, y, boxSize, boxSize);
|
|
2296
|
+
|
|
2225
2297
|
// Draw text
|
|
2226
2298
|
// eslint-disable-next-line no-param-reassign
|
|
2227
2299
|
ctx.globalAlpha = 1;
|
|
@@ -2309,6 +2381,7 @@ var makeFeatureStyleWind = function makeFeatureStyleWind(feature) {
|
|
|
2309
2381
|
lineWidth: 1
|
|
2310
2382
|
}
|
|
2311
2383
|
});
|
|
2384
|
+
|
|
2312
2385
|
// speed label
|
|
2313
2386
|
var speedStyle = new Style({
|
|
2314
2387
|
text: new Text({
|
|
@@ -2332,12 +2405,14 @@ var makeFeatureStyleMultiParam = function makeFeatureStyleMultiParam(feature) {
|
|
|
2332
2405
|
var _feature$getPropertie2 = feature.getProperties(),
|
|
2333
2406
|
values = _feature$getPropertie2.values;
|
|
2334
2407
|
var paramValues = Object.values(values);
|
|
2408
|
+
|
|
2335
2409
|
// Determine offset between columns (long strings need more space)
|
|
2336
2410
|
var maxLength = Math.max.apply(Math, _toConsumableArray(paramValues.map(function (el) {
|
|
2337
2411
|
return el ? el.toString().length : 1;
|
|
2338
2412
|
})));
|
|
2339
2413
|
var factor = maxLength > 5 ? 1.4 : 1;
|
|
2340
2414
|
var offsetValues = getOffsetValues(factor);
|
|
2415
|
+
|
|
2341
2416
|
// Don't allow showing more than 15 params
|
|
2342
2417
|
var params = paramValues.slice(0, 15);
|
|
2343
2418
|
return params.map(function (paramVal, index) {
|
|
@@ -2422,6 +2497,7 @@ var defaultLegend$1 = makeLegendFromColorMap({
|
|
|
2422
2497
|
min: -18,
|
|
2423
2498
|
max: 38
|
|
2424
2499
|
});
|
|
2500
|
+
|
|
2425
2501
|
/**
|
|
2426
2502
|
* Converts a stylename to openlayers style for features
|
|
2427
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.
|
|
@@ -2508,6 +2584,7 @@ var useCreateEDRWMLayer = function useCreateEDRWMLayer(serviceUrl, name, id, onL
|
|
|
2508
2584
|
});
|
|
2509
2585
|
webmapUtils.registerWMLayer(_wmLayer, layerId);
|
|
2510
2586
|
}
|
|
2587
|
+
|
|
2511
2588
|
// Set the name and parse the layer
|
|
2512
2589
|
var wmLayer = webmapUtils.getWMLayerById(layerId);
|
|
2513
2590
|
wmLayer.setName(name).then(function () {
|
|
@@ -10558,6 +10635,7 @@ var knmi_kdp_edr_collections_10_minute_in_situ_meteorological_observations_updat
|
|
|
10558
10635
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
10559
10636
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
10560
10637
|
* */
|
|
10638
|
+
|
|
10561
10639
|
var fakeEdrLayerApiHandlers = [http.get('https://gw-edr.pub.knmi.cloud/edr/collections/10-minute-in-situ-meteorological-observations', function () {
|
|
10562
10640
|
return HttpResponse.json(knmi_kdp_edr_collections_10_minute_in_situ_meteorological_observations);
|
|
10563
10641
|
}), http.get('https://gw-edr.pub.knmi.cloud/edr/collections/10-minute-in-situ-meteorological-observations-update', function () {
|
|
@@ -10596,6 +10674,7 @@ var fakeEdrLayerApiHandlers = [http.get('https://gw-edr.pub.knmi.cloud/edr/colle
|
|
|
10596
10674
|
|
|
10597
10675
|
var defaultCanvasWidth = 150;
|
|
10598
10676
|
var defaultCanvasHeight = 30;
|
|
10677
|
+
|
|
10599
10678
|
/**
|
|
10600
10679
|
* Renders a legendgraphic image based on a WMImage.
|
|
10601
10680
|
*
|
|
@@ -10620,6 +10699,7 @@ var renderLegendGraphic = function renderLegendGraphic(wmImage, ctx, width, heig
|
|
|
10620
10699
|
ctx.fillText('error :(', 10, 10);
|
|
10621
10700
|
} else {
|
|
10622
10701
|
/* All OK, just draw the legend image */
|
|
10702
|
+
|
|
10623
10703
|
ctx.drawImage(wmImage.getElement(), 0, 0, Math.min(wmImage.getElement().width, width), Math.min(wmImage.getElement().height, height));
|
|
10624
10704
|
}
|
|
10625
10705
|
}
|
|
@@ -10630,12 +10710,14 @@ var Legend = function Legend(_ref) {
|
|
|
10630
10710
|
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
10631
10711
|
/* Variable to remember the previous image */
|
|
10632
10712
|
var previousLegendImage = useRef(null);
|
|
10713
|
+
|
|
10633
10714
|
/* Function to force rerender of this component when legend image loads */
|
|
10634
10715
|
// eslint-disable-next-line react/hook-use-state
|
|
10635
10716
|
var _useState = useState(),
|
|
10636
10717
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10637
10718
|
setState = _useState2[1];
|
|
10638
10719
|
var layerId = layer === null || layer === void 0 ? void 0 : layer.id;
|
|
10720
|
+
|
|
10639
10721
|
/* The canvas listens to the size of its container. We will update it according to the image size. */
|
|
10640
10722
|
var _useState3 = useState(defaultCanvasWidth),
|
|
10641
10723
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -10651,6 +10733,7 @@ var Legend = function Legend(_ref) {
|
|
|
10651
10733
|
t = _useWebmapReactTransl.t;
|
|
10652
10734
|
var legendPrefix = t('webmap-react-legend');
|
|
10653
10735
|
var legendNoImageText = t('webmap-react-legend-no-image');
|
|
10736
|
+
|
|
10654
10737
|
/* Register callback to legendImagestore to trigger rerender when image is loaded. */
|
|
10655
10738
|
useEffect(function () {
|
|
10656
10739
|
legendImageStore.addImageEventCallback(function (image, id, imageEventType) {
|
|
@@ -10662,6 +10745,7 @@ var Legend = function Legend(_ref) {
|
|
|
10662
10745
|
legendImageStore.removeEventCallback("".concat(legendPrefix, "_").concat(layerId));
|
|
10663
10746
|
};
|
|
10664
10747
|
}, [layerId, legendPrefix]);
|
|
10748
|
+
|
|
10665
10749
|
/* Should not do anything if no layer is given */
|
|
10666
10750
|
if (!layer) {
|
|
10667
10751
|
return null;
|
|
@@ -10671,30 +10755,33 @@ var Legend = function Legend(_ref) {
|
|
|
10671
10755
|
return null;
|
|
10672
10756
|
}
|
|
10673
10757
|
var layerOpacity = layer.opacity ? layer.opacity : 1;
|
|
10674
|
-
|
|
10758
|
+
|
|
10759
|
+
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
10675
10760
|
like a title and the WMS legendgraphic url */
|
|
10676
10761
|
var wmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
10677
10762
|
var isEdrLayer = layer.layerType === LayerType.edrFeatureLayer;
|
|
10678
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;
|
|
10764
|
+
|
|
10679
10765
|
/* Custom legend toggle for layer */
|
|
10680
10766
|
var toggleLayerLegendVisibility = function toggleLayerLegendVisibility(showLegend) {
|
|
10681
10767
|
return onToggleLayerLegendVisibility(layerId, showLegend);
|
|
10682
10768
|
};
|
|
10683
|
-
return jsx(LegendLayout, {
|
|
10769
|
+
return /*#__PURE__*/jsx(LegendLayout, {
|
|
10684
10770
|
height: canvasContainerHeight,
|
|
10685
10771
|
showLayerLegend: layer === null || layer === void 0 ? void 0 : layer.showLayerLegend,
|
|
10686
10772
|
title: title,
|
|
10687
10773
|
toggleLayerLegendVisibility: toggleLayerLegendVisibility,
|
|
10688
10774
|
width: canvasContainerWidth,
|
|
10689
|
-
children: jsx(CanvasComponent, {
|
|
10775
|
+
children: /*#__PURE__*/jsx(CanvasComponent, {
|
|
10690
10776
|
onRenderCanvas: function onRenderCanvas(ctx, width, height) {
|
|
10691
|
-
/*
|
|
10777
|
+
/*
|
|
10692
10778
|
Check if the wmLayer is available, this happens when the WMS GetCapabilities is loaded and parsed.
|
|
10693
10779
|
Note that we cannot use the wmLayer variable above, as this one could contain a non initialized WMJSLayer.
|
|
10694
10780
|
*/
|
|
10695
10781
|
var legendWmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
10696
10782
|
var legendUrl = getLegendGraphicURLForLayer(legendWmLayer);
|
|
10697
10783
|
var image = legendImageStore.getImage(legendUrl);
|
|
10784
|
+
|
|
10698
10785
|
// for edr a legend is generated based on chosen style
|
|
10699
10786
|
if (layer.style && isEdrLayer) {
|
|
10700
10787
|
var style = layer.style,
|
|
@@ -10724,14 +10811,17 @@ var Legend = function Legend(_ref) {
|
|
|
10724
10811
|
if (image && !image.hasError() && !image.isLoaded() && !image.isLoading()) {
|
|
10725
10812
|
image.load(); /* Will eventually trigger the callback used in the useEffect */
|
|
10726
10813
|
}
|
|
10814
|
+
|
|
10727
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 */
|
|
10728
10816
|
if (image !== null && image !== void 0 && image.isLoaded()) {
|
|
10729
10817
|
previousLegendImage.current = image;
|
|
10818
|
+
|
|
10730
10819
|
/* Set the canvas container to the same size as the image */
|
|
10731
10820
|
imageHeight = image.getHeight();
|
|
10732
10821
|
setCanvasContainerHeight(imageHeight);
|
|
10733
10822
|
imageWidth = image.getWidth();
|
|
10734
10823
|
setCanvasContainerWidth(imageWidth);
|
|
10824
|
+
|
|
10735
10825
|
/* Give the canvas a white background before adding the image */
|
|
10736
10826
|
ctx.fillStyle = '#fff';
|
|
10737
10827
|
ctx.rect(0, 0, width, height);
|
|
@@ -10747,6 +10837,24 @@ var Legend = function Legend(_ref) {
|
|
|
10747
10837
|
});
|
|
10748
10838
|
};
|
|
10749
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
|
+
|
|
10750
10858
|
var LegendDialog = function LegendDialog(_ref) {
|
|
10751
10859
|
var layers = _ref.layers,
|
|
10752
10860
|
isOpen = _ref.isOpen,
|
|
@@ -10764,7 +10872,7 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
10764
10872
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
10765
10873
|
t = _useWebmapReactTransl.t;
|
|
10766
10874
|
var stopWheelEventPropagationRef = useWheelStopPropagation();
|
|
10767
|
-
return jsx(ToolContainerDraggable, {
|
|
10875
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
10768
10876
|
bounds: "parent",
|
|
10769
10877
|
"data-testid": "moveable-legend",
|
|
10770
10878
|
initialMaxHeight: 440,
|
|
@@ -10779,11 +10887,11 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
10779
10887
|
top: 50
|
|
10780
10888
|
},
|
|
10781
10889
|
title: showMapId ? "".concat(t('webmap-react-legend'), " ").concat(mapId) : t('webmap-react-legend'),
|
|
10782
|
-
children: jsx(Box, {
|
|
10890
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
10783
10891
|
sx: {
|
|
10784
10892
|
padding: 0.5
|
|
10785
10893
|
},
|
|
10786
|
-
children: layers && layers.length > 0 ? jsx(Box, {
|
|
10894
|
+
children: layers && layers.length > 0 ? /*#__PURE__*/jsx(Box, {
|
|
10787
10895
|
"data-testid": "LegendList",
|
|
10788
10896
|
ref: stopWheelEventPropagationRef,
|
|
10789
10897
|
sx: {
|
|
@@ -10793,17 +10901,17 @@ var LegendDialog = function LegendDialog(_ref) {
|
|
|
10793
10901
|
'&>div:last-child': {
|
|
10794
10902
|
marginBottom: 0
|
|
10795
10903
|
},
|
|
10796
|
-
'&>div:first-
|
|
10904
|
+
'&>div:first-of-type': {
|
|
10797
10905
|
marginTop: '8px'
|
|
10798
10906
|
}
|
|
10799
10907
|
},
|
|
10800
10908
|
children: layers.map(function (layer) {
|
|
10801
|
-
return jsx(Legend, {
|
|
10909
|
+
return /*#__PURE__*/jsx(Legend, {
|
|
10802
10910
|
layer: layer,
|
|
10803
10911
|
onToggleLayerLegendVisibility: onToggleLayerLegendVisibility
|
|
10804
10912
|
}, layer.id);
|
|
10805
10913
|
})
|
|
10806
|
-
}) : jsx(Typography, {
|
|
10914
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
10807
10915
|
"data-testid": "NoLayers",
|
|
10808
10916
|
style: {
|
|
10809
10917
|
fontWeight: 500,
|
|
@@ -10826,7 +10934,7 @@ var MapControlButton = function MapControlButton(_ref) {
|
|
|
10826
10934
|
_ref$isActive = _ref.isActive,
|
|
10827
10935
|
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
10828
10936
|
props = _objectWithoutProperties(_ref, _excluded$2);
|
|
10829
|
-
return jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
10937
|
+
return /*#__PURE__*/jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
10830
10938
|
isSelected: isActive,
|
|
10831
10939
|
onClick: onClick,
|
|
10832
10940
|
tooltipProps: {
|
|
@@ -10839,28 +10947,46 @@ var MapControlButton = function MapControlButton(_ref) {
|
|
|
10839
10947
|
}));
|
|
10840
10948
|
};
|
|
10841
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
|
+
|
|
10842
10968
|
var ZoomControls = function ZoomControls(_ref) {
|
|
10843
10969
|
var onZoomIn = _ref.onZoomIn,
|
|
10844
10970
|
onZoomOut = _ref.onZoomOut,
|
|
10845
10971
|
onZoomReset = _ref.onZoomReset;
|
|
10846
10972
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
10847
10973
|
t = _useWebmapReactTransl.t;
|
|
10848
|
-
return jsxs(Fragment, {
|
|
10849
|
-
children: [jsx(MapControlButton, {
|
|
10974
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
10975
|
+
children: [/*#__PURE__*/jsx(MapControlButton, {
|
|
10850
10976
|
"data-testid": "zoom-reset",
|
|
10851
10977
|
onClick: onZoomReset,
|
|
10852
10978
|
title: t('webmap-react-zoom-reset'),
|
|
10853
|
-
children: jsx(Home, {})
|
|
10854
|
-
}), jsx(MapControlButton, {
|
|
10979
|
+
children: /*#__PURE__*/jsx(Home, {})
|
|
10980
|
+
}), /*#__PURE__*/jsx(MapControlButton, {
|
|
10855
10981
|
"data-testid": "zoom-in",
|
|
10856
10982
|
onClick: onZoomIn,
|
|
10857
10983
|
title: t('webmap-react-zoom-in'),
|
|
10858
|
-
children: jsx(Add, {})
|
|
10859
|
-
}), jsx(MapControlButton, {
|
|
10984
|
+
children: /*#__PURE__*/jsx(Add, {})
|
|
10985
|
+
}), /*#__PURE__*/jsx(MapControlButton, {
|
|
10860
10986
|
"data-testid": "zoom-out",
|
|
10861
10987
|
onClick: onZoomOut,
|
|
10862
10988
|
title: t('webmap-react-zoom-out'),
|
|
10863
|
-
children: jsx(Minus, {})
|
|
10989
|
+
children: /*#__PURE__*/jsx(Minus, {})
|
|
10864
10990
|
})]
|
|
10865
10991
|
});
|
|
10866
10992
|
};
|
|
@@ -10869,7 +10995,7 @@ var _excluded$1 = ["children"];
|
|
|
10869
10995
|
var MapControls = function MapControls(_ref) {
|
|
10870
10996
|
var children = _ref.children,
|
|
10871
10997
|
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
10872
|
-
return jsx(Box, _objectSpread2(_objectSpread2({
|
|
10998
|
+
return /*#__PURE__*/jsx(Box, _objectSpread2(_objectSpread2({
|
|
10873
10999
|
sx: {
|
|
10874
11000
|
position: 'absolute',
|
|
10875
11001
|
overflow: 'visible',
|
|
@@ -10881,7 +11007,7 @@ var MapControls = function MapControls(_ref) {
|
|
|
10881
11007
|
userSelect: 'none'
|
|
10882
11008
|
}
|
|
10883
11009
|
}, props), {}, {
|
|
10884
|
-
children: jsx(Grid, {
|
|
11010
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
10885
11011
|
container: true,
|
|
10886
11012
|
direction: "column",
|
|
10887
11013
|
sx: {
|
|
@@ -10894,6 +11020,24 @@ var MapControls = function MapControls(_ref) {
|
|
|
10894
11020
|
}));
|
|
10895
11021
|
};
|
|
10896
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
|
+
|
|
10897
11041
|
var LegendButton = function LegendButton(_ref) {
|
|
10898
11042
|
var openLegendDialog = _ref.openLegendDialog,
|
|
10899
11043
|
isOpen = _ref.isOpen;
|
|
@@ -10902,15 +11046,33 @@ var LegendButton = function LegendButton(_ref) {
|
|
|
10902
11046
|
var onClickButton = function onClickButton() {
|
|
10903
11047
|
return openLegendDialog();
|
|
10904
11048
|
};
|
|
10905
|
-
return jsx(MapControlButton, {
|
|
11049
|
+
return /*#__PURE__*/jsx(MapControlButton, {
|
|
10906
11050
|
"data-testid": "open-Legend",
|
|
10907
11051
|
isActive: isOpen,
|
|
10908
11052
|
onClick: onClickButton,
|
|
10909
11053
|
title: t('webmap-react-legend'),
|
|
10910
|
-
children: jsx(List, {})
|
|
11054
|
+
children: /*#__PURE__*/jsx(List, {})
|
|
10911
11055
|
});
|
|
10912
11056
|
};
|
|
10913
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
|
+
|
|
10914
11076
|
var getTimeDimension = function getTimeDimension(dimensions) {
|
|
10915
11077
|
return dimensions.find(function (dimension) {
|
|
10916
11078
|
return dimension.name === 'time' && dimension.currentValue !== undefined;
|
|
@@ -10929,7 +11091,7 @@ var MapTime = function MapTime(_ref) {
|
|
|
10929
11091
|
return null;
|
|
10930
11092
|
}
|
|
10931
11093
|
var mapTime = formatTime(timeDimension.currentValue, timeFormat);
|
|
10932
|
-
return jsx(Box, {
|
|
11094
|
+
return /*#__PURE__*/jsx(Box, {
|
|
10933
11095
|
"data-testid": "map-time",
|
|
10934
11096
|
sx: {
|
|
10935
11097
|
zIndex: 10,
|
|
@@ -10937,8 +11099,8 @@ var MapTime = function MapTime(_ref) {
|
|
|
10937
11099
|
bottom: '12px',
|
|
10938
11100
|
position: 'absolute'
|
|
10939
11101
|
},
|
|
10940
|
-
children: jsx(Box, {
|
|
10941
|
-
children: jsx(Typography, {
|
|
11102
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
11103
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
10942
11104
|
sx: {
|
|
10943
11105
|
fontWeight: 500
|
|
10944
11106
|
},
|
|
@@ -10949,6 +11111,23 @@ var MapTime = function MapTime(_ref) {
|
|
|
10949
11111
|
});
|
|
10950
11112
|
};
|
|
10951
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
|
+
* */
|
|
10952
11131
|
var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
10953
11132
|
var _selectedFeaturePrope, _selectedFeaturePrope2, _selectedFeaturePrope3, _selectedFeaturePrope4, _selectedFeaturePrope5;
|
|
10954
11133
|
var selectedFeatureProperties = _ref.selectedFeatureProperties,
|
|
@@ -10958,7 +11137,7 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10958
11137
|
var newWidth = parentSize ? parentSize - 100 : 350;
|
|
10959
11138
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
10960
11139
|
t = _useWebmapReactTransl.t;
|
|
10961
|
-
return jsx("div", {
|
|
11140
|
+
return /*#__PURE__*/jsx("div", {
|
|
10962
11141
|
style: {
|
|
10963
11142
|
position: 'fixed',
|
|
10964
11143
|
width: "".concat(newWidth, "px"),
|
|
@@ -10969,7 +11148,7 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10969
11148
|
top: '70px',
|
|
10970
11149
|
zIndex: 10
|
|
10971
11150
|
},
|
|
10972
|
-
children: jsxs("div", {
|
|
11151
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
10973
11152
|
"data-testid": "map-warning-properties",
|
|
10974
11153
|
style: {
|
|
10975
11154
|
marginTop: '50px',
|
|
@@ -10980,22 +11159,22 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10980
11159
|
fontSize: '11px',
|
|
10981
11160
|
backgroundColor: '#CCCCCCC0'
|
|
10982
11161
|
},
|
|
10983
|
-
children: [jsx("h1", {
|
|
11162
|
+
children: [/*#__PURE__*/jsx("h1", {
|
|
10984
11163
|
"data-testid": "map-warning-properties-title",
|
|
10985
11164
|
children: (_selectedFeaturePrope = selectedFeatureProperties.languages) === null || _selectedFeaturePrope === void 0 ? void 0 : _selectedFeaturePrope[language].areaDesc
|
|
10986
|
-
}), !!((_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", {
|
|
10987
11166
|
"data-testid": "map-warning-properties-row",
|
|
10988
11167
|
children: [t('webmap-react-event'), ' ', (_selectedFeaturePrope3 = selectedFeatureProperties.languages) === null || _selectedFeaturePrope3 === void 0 ? void 0 : _selectedFeaturePrope3[language].event]
|
|
10989
|
-
}), !!selectedFeatureProperties.onset && jsxs("pre", {
|
|
11168
|
+
}), !!selectedFeatureProperties.onset && /*#__PURE__*/jsxs("pre", {
|
|
10990
11169
|
"data-testid": "map-warning-properties-row",
|
|
10991
11170
|
children: [t('webmap-react-sent'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.onset), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc')]
|
|
10992
|
-
}), !!selectedFeatureProperties.expires && jsxs("pre", {
|
|
11171
|
+
}), !!selectedFeatureProperties.expires && /*#__PURE__*/jsxs("pre", {
|
|
10993
11172
|
"data-testid": "map-warning-properties-row",
|
|
10994
11173
|
children: [t('webmap-react-expires'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.expires), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc')]
|
|
10995
|
-
}), !!((_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", {
|
|
10996
11175
|
"data-testid": "map-warning-properties-row",
|
|
10997
11176
|
children: [t('webmap-react-sender'), ' ', (_selectedFeaturePrope5 = selectedFeatureProperties.languages) === null || _selectedFeaturePrope5 === void 0 ? void 0 : _selectedFeaturePrope5[language].senderName]
|
|
10998
|
-
}), !!selectedFeatureProperties.identifier && jsxs("pre", {
|
|
11177
|
+
}), !!selectedFeatureProperties.identifier && /*#__PURE__*/jsxs("pre", {
|
|
10999
11178
|
"data-testid": "map-warning-properties-row",
|
|
11000
11179
|
children: [t('webmap-react-identifier'), ' ', selectedFeatureProperties.identifier]
|
|
11001
11180
|
})]
|
|
@@ -11003,6 +11182,24 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
11003
11182
|
});
|
|
11004
11183
|
};
|
|
11005
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
|
+
|
|
11006
11203
|
var dimensionConfig = function dimensionConfig(t) {
|
|
11007
11204
|
return [{
|
|
11008
11205
|
name: 'elevation',
|
|
@@ -11056,6 +11253,24 @@ var marksByDimension = function marksByDimension(t, dim) {
|
|
|
11056
11253
|
return marks;
|
|
11057
11254
|
};
|
|
11058
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
|
+
|
|
11059
11274
|
var DimensionSelectButton = function DimensionSelectButton(_ref) {
|
|
11060
11275
|
var dimension = _ref.dimension,
|
|
11061
11276
|
onClickDimensionButton = _ref.onClickDimensionButton,
|
|
@@ -11069,15 +11284,33 @@ var DimensionSelectButton = function DimensionSelectButton(_ref) {
|
|
|
11069
11284
|
});
|
|
11070
11285
|
var Icon = getDimensionIcon$1((dimConfig === null || dimConfig === void 0 ? void 0 : dimConfig.iconType) || 'IconLevels');
|
|
11071
11286
|
var title = "".concat(showPrefix, " ").concat(dimConfig ? dimConfig.label.toLowerCase() : dimension.toLowerCase());
|
|
11072
|
-
return jsx(MapControlButton, {
|
|
11287
|
+
return /*#__PURE__*/jsx(MapControlButton, {
|
|
11073
11288
|
"data-testid": "dimensionMapBtn-".concat(dimension),
|
|
11074
11289
|
isActive: isActive,
|
|
11075
11290
|
onClick: onClickDimensionButton,
|
|
11076
11291
|
title: title,
|
|
11077
|
-
children: jsx(Icon, {})
|
|
11292
|
+
children: /*#__PURE__*/jsx(Icon, {})
|
|
11078
11293
|
});
|
|
11079
11294
|
};
|
|
11080
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
|
+
|
|
11081
11314
|
var DimensionSelectDialog = function DimensionSelectDialog(_ref) {
|
|
11082
11315
|
var isOpen = _ref.isOpen,
|
|
11083
11316
|
_ref$order = _ref.order,
|
|
@@ -11097,7 +11330,8 @@ var DimensionSelectDialog = function DimensionSelectDialog(_ref) {
|
|
|
11097
11330
|
});
|
|
11098
11331
|
var title = dimConfig ? dimConfig.label : dimensionName;
|
|
11099
11332
|
var topPos = index * 32 + 164; // index * btn height + offset top of window
|
|
11100
|
-
|
|
11333
|
+
|
|
11334
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
11101
11335
|
bounds: "parent",
|
|
11102
11336
|
"data-testid": "multidimensionContent-".concat(title),
|
|
11103
11337
|
isOpen: isOpen,
|
|
@@ -11111,11 +11345,11 @@ var DimensionSelectDialog = function DimensionSelectDialog(_ref) {
|
|
|
11111
11345
|
top: topPos
|
|
11112
11346
|
},
|
|
11113
11347
|
title: title,
|
|
11114
|
-
children: jsx("div", {
|
|
11348
|
+
children: /*#__PURE__*/jsx("div", {
|
|
11115
11349
|
style: {
|
|
11116
11350
|
padding: 4
|
|
11117
11351
|
},
|
|
11118
|
-
children: jsx(Grid, {
|
|
11352
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
11119
11353
|
container: true,
|
|
11120
11354
|
direction: "row",
|
|
11121
11355
|
children: children
|
|
@@ -11174,8 +11408,8 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11174
11408
|
event.preventDefault();
|
|
11175
11409
|
}
|
|
11176
11410
|
};
|
|
11177
|
-
return jsxs(Fragment, {
|
|
11178
|
-
children: [jsx(Box, {
|
|
11411
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11412
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
11179
11413
|
"data-testid": "slider-dimensionSelect",
|
|
11180
11414
|
sx: {
|
|
11181
11415
|
height: '320px',
|
|
@@ -11184,12 +11418,12 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11184
11418
|
minWidth: 120,
|
|
11185
11419
|
fontSize: '90%'
|
|
11186
11420
|
},
|
|
11187
|
-
children: jsx(Box, {
|
|
11421
|
+
children: /*#__PURE__*/jsx(Box, {
|
|
11188
11422
|
component: "span",
|
|
11189
11423
|
sx: {
|
|
11190
11424
|
margin: 1
|
|
11191
11425
|
},
|
|
11192
|
-
children: jsx(SmallFontSlider, {
|
|
11426
|
+
children: /*#__PURE__*/jsx(SmallFontSlider, {
|
|
11193
11427
|
"aria-labelledby": "vertical-slider",
|
|
11194
11428
|
"data-testid": "verticalSlider",
|
|
11195
11429
|
disabled: isDisabled,
|
|
@@ -11213,9 +11447,9 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11213
11447
|
value: sliderValue
|
|
11214
11448
|
})
|
|
11215
11449
|
})
|
|
11216
|
-
}), jsx(CustomTooltip, {
|
|
11450
|
+
}), /*#__PURE__*/jsx(CustomTooltip, {
|
|
11217
11451
|
title: layerTitle,
|
|
11218
|
-
children: jsx(Typography, {
|
|
11452
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
11219
11453
|
sx: {
|
|
11220
11454
|
paddingLeft: '10px',
|
|
11221
11455
|
maxWidth: 130,
|
|
@@ -11231,9 +11465,9 @@ var DimensionSelectSlider = function DimensionSelectSlider(_ref) {
|
|
|
11231
11465
|
|
|
11232
11466
|
var Icon = function Icon(_ref) {
|
|
11233
11467
|
var isLayerDimensionSynced = _ref.isLayerDimensionSynced;
|
|
11234
|
-
return isLayerDimensionSynced ? jsx(Link, {
|
|
11468
|
+
return isLayerDimensionSynced ? /*#__PURE__*/jsx(Link, {
|
|
11235
11469
|
"data-testid": "syncIcon"
|
|
11236
|
-
}) : jsx(LinkOff, {
|
|
11470
|
+
}) : /*#__PURE__*/jsx(LinkOff, {
|
|
11237
11471
|
"data-testid": "syncDisIcon"
|
|
11238
11472
|
});
|
|
11239
11473
|
};
|
|
@@ -11289,11 +11523,11 @@ var MapDimensionSelect = function MapDimensionSelect(_ref2) {
|
|
|
11289
11523
|
var marks = marksByDimension(t, wmsDimension);
|
|
11290
11524
|
var isLayerDimensionSynced = layerDimension.synced !== undefined && layerDimension.synced;
|
|
11291
11525
|
var tooltipTitle = isLayerDimensionSynced ? t('webmap-react-click-disconnect') : t('webmap-react-click-connect');
|
|
11292
|
-
return jsxs(Grid, {
|
|
11526
|
+
return /*#__PURE__*/jsxs(Grid, {
|
|
11293
11527
|
size: {
|
|
11294
11528
|
xs: 'auto'
|
|
11295
11529
|
},
|
|
11296
|
-
children: [jsx(CustomIconButton, {
|
|
11530
|
+
children: [/*#__PURE__*/jsx(CustomIconButton, {
|
|
11297
11531
|
"data-testid": "syncButton",
|
|
11298
11532
|
onClick: function onClick() {
|
|
11299
11533
|
return handleSyncChanged(layerId, dimensionName, layerDimension.currentValue, !layerDimension.synced);
|
|
@@ -11302,10 +11536,10 @@ var MapDimensionSelect = function MapDimensionSelect(_ref2) {
|
|
|
11302
11536
|
margin: '5px'
|
|
11303
11537
|
},
|
|
11304
11538
|
tooltipTitle: tooltipTitle,
|
|
11305
|
-
children: jsx(Icon, {
|
|
11539
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
11306
11540
|
isLayerDimensionSynced: isLayerDimensionSynced
|
|
11307
11541
|
})
|
|
11308
|
-
}), jsx(DimensionSelectSlider, {
|
|
11542
|
+
}), /*#__PURE__*/jsx(DimensionSelectSlider, {
|
|
11309
11543
|
isDisabled: false,
|
|
11310
11544
|
layerTitle: layerTitle,
|
|
11311
11545
|
managedValue: Number(layerDimension.currentValue) || layerDimension.currentValue,
|
|
@@ -11324,7 +11558,7 @@ var LayerInfoButton = function LayerInfoButton(_ref) {
|
|
|
11324
11558
|
var isActive = _ref.isActive,
|
|
11325
11559
|
onClick = _ref.onClick,
|
|
11326
11560
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
11327
|
-
return jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
11561
|
+
return /*#__PURE__*/jsx(CustomIconButton, _objectSpread2(_objectSpread2({
|
|
11328
11562
|
"aria-label": "layer info",
|
|
11329
11563
|
className: "layerInfoButton",
|
|
11330
11564
|
"data-testid": "layerInfoButton",
|
|
@@ -11333,7 +11567,7 @@ var LayerInfoButton = function LayerInfoButton(_ref) {
|
|
|
11333
11567
|
onClick: onClick,
|
|
11334
11568
|
variant: "flat"
|
|
11335
11569
|
}, props), {}, {
|
|
11336
|
-
children: jsx(Info, {})
|
|
11570
|
+
children: /*#__PURE__*/jsx(Info, {})
|
|
11337
11571
|
}));
|
|
11338
11572
|
};
|
|
11339
11573
|
|
|
@@ -11348,12 +11582,12 @@ var textStyleWithMargin = _objectSpread2(_objectSpread2({}, textStyle), {}, {
|
|
|
11348
11582
|
var LayerInfoText = function LayerInfoText(_ref) {
|
|
11349
11583
|
var label = _ref.label,
|
|
11350
11584
|
value = _ref.value;
|
|
11351
|
-
return jsxs(Fragment, {
|
|
11352
|
-
children: [jsx(Typography$1, {
|
|
11585
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11586
|
+
children: [/*#__PURE__*/jsx(Typography$1, {
|
|
11353
11587
|
sx: textStyle,
|
|
11354
11588
|
variant: "subtitle2",
|
|
11355
11589
|
children: label
|
|
11356
|
-
}), jsx(Typography$1, {
|
|
11590
|
+
}), /*#__PURE__*/jsx(Typography$1, {
|
|
11357
11591
|
sx: textStyleWithMargin,
|
|
11358
11592
|
variant: "body2",
|
|
11359
11593
|
children: value
|
|
@@ -11361,6 +11595,24 @@ var LayerInfoText = function LayerInfoText(_ref) {
|
|
|
11361
11595
|
});
|
|
11362
11596
|
};
|
|
11363
11597
|
|
|
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
|
+
|
|
11364
11616
|
var LayerInfoLegend = function LayerInfoLegend(_ref) {
|
|
11365
11617
|
var title = _ref.title,
|
|
11366
11618
|
legendURL = _ref.legendURL,
|
|
@@ -11368,21 +11620,21 @@ var LayerInfoLegend = function LayerInfoLegend(_ref) {
|
|
|
11368
11620
|
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
11369
11621
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
11370
11622
|
t = _useWebmapReactTransl.t;
|
|
11371
|
-
return jsxs(Fragment, {
|
|
11372
|
-
children: [jsxs(Box, {
|
|
11623
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11624
|
+
children: [/*#__PURE__*/jsxs(Box, {
|
|
11373
11625
|
sx: {
|
|
11374
11626
|
display: 'flex',
|
|
11375
11627
|
justifyContent: 'space-between',
|
|
11376
11628
|
alignItems: 'center',
|
|
11377
11629
|
width: '100%'
|
|
11378
11630
|
},
|
|
11379
|
-
children: [jsx(Typography$1, {
|
|
11631
|
+
children: [/*#__PURE__*/jsx(Typography$1, {
|
|
11380
11632
|
sx: textStyleWithMargin,
|
|
11381
11633
|
variant: "subtitle2",
|
|
11382
11634
|
children: t('webmap-react-legend')
|
|
11383
|
-
}), jsx(FormGroup, {
|
|
11384
|
-
children: jsx(FormControlLabel, {
|
|
11385
|
-
control: jsx(Checkbox, {
|
|
11635
|
+
}), /*#__PURE__*/jsx(FormGroup, {
|
|
11636
|
+
children: /*#__PURE__*/jsx(FormControlLabel, {
|
|
11637
|
+
control: /*#__PURE__*/jsx(Checkbox, {
|
|
11386
11638
|
checked: showLayerLegend,
|
|
11387
11639
|
onChange: function onChange() {
|
|
11388
11640
|
onToggleLayerLegendVisibility(!showLayerLegend);
|
|
@@ -11392,9 +11644,9 @@ var LayerInfoLegend = function LayerInfoLegend(_ref) {
|
|
|
11392
11644
|
sx: textStyleWithMargin
|
|
11393
11645
|
})
|
|
11394
11646
|
})]
|
|
11395
|
-
}), jsx(LegendLayout, {
|
|
11647
|
+
}), /*#__PURE__*/jsx(LegendLayout, {
|
|
11396
11648
|
title: title,
|
|
11397
|
-
children: legendURL ? jsx("img", {
|
|
11649
|
+
children: legendURL ? /*#__PURE__*/jsx("img", {
|
|
11398
11650
|
alt: title,
|
|
11399
11651
|
src: legendURL
|
|
11400
11652
|
}) : '-'
|
|
@@ -11408,41 +11660,41 @@ var valueStyle = _objectSpread2(_objectSpread2({}, textStyle), {}, {
|
|
|
11408
11660
|
var LayerInfoList = function LayerInfoList(_ref) {
|
|
11409
11661
|
var label = _ref.label,
|
|
11410
11662
|
list = _ref.list;
|
|
11411
|
-
return jsxs(Fragment, {
|
|
11412
|
-
children: [jsx(Typography$1, {
|
|
11663
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
11664
|
+
children: [/*#__PURE__*/jsx(Typography$1, {
|
|
11413
11665
|
sx: textStyle,
|
|
11414
11666
|
variant: "subtitle2",
|
|
11415
11667
|
children: label
|
|
11416
|
-
}), list.length === 0 ? jsx(Typography$1, {
|
|
11668
|
+
}), list.length === 0 ? /*#__PURE__*/jsx(Typography$1, {
|
|
11417
11669
|
sx: textStyleWithMargin,
|
|
11418
11670
|
variant: "body2",
|
|
11419
11671
|
children: "-"
|
|
11420
|
-
}) : jsx(Grid, {
|
|
11672
|
+
}) : /*#__PURE__*/jsx(Grid, {
|
|
11421
11673
|
container: true,
|
|
11422
11674
|
direction: "column",
|
|
11423
11675
|
children: list.map(function (item) {
|
|
11424
|
-
return jsxs("div", {
|
|
11425
|
-
children: [jsxs(Grid, {
|
|
11676
|
+
return /*#__PURE__*/jsxs("div", {
|
|
11677
|
+
children: [/*#__PURE__*/jsxs(Grid, {
|
|
11426
11678
|
container: true,
|
|
11427
11679
|
direction: "row",
|
|
11428
|
-
children: [item.icon, jsx(Grid, {
|
|
11680
|
+
children: [item.icon, /*#__PURE__*/jsx(Grid, {
|
|
11429
11681
|
sx: {
|
|
11430
11682
|
marginLeft: '10px'
|
|
11431
11683
|
},
|
|
11432
|
-
children: jsxs(Typography$1, {
|
|
11684
|
+
children: /*#__PURE__*/jsxs(Typography$1, {
|
|
11433
11685
|
sx: textStyle,
|
|
11434
11686
|
variant: "body2",
|
|
11435
11687
|
children: [item.label, ":"]
|
|
11436
11688
|
})
|
|
11437
11689
|
})]
|
|
11438
|
-
}), jsx(Grid, {
|
|
11690
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
11439
11691
|
container: true,
|
|
11440
11692
|
direction: "row",
|
|
11441
11693
|
sx: {
|
|
11442
11694
|
marginBottom: 1,
|
|
11443
11695
|
paddingLeft: '34px'
|
|
11444
11696
|
},
|
|
11445
|
-
children: jsx(Typography$1, {
|
|
11697
|
+
children: /*#__PURE__*/jsx(Typography$1, {
|
|
11446
11698
|
sx: valueStyle,
|
|
11447
11699
|
variant: "body2",
|
|
11448
11700
|
children: item.value
|
|
@@ -11454,6 +11706,24 @@ var LayerInfoList = function LayerInfoList(_ref) {
|
|
|
11454
11706
|
});
|
|
11455
11707
|
};
|
|
11456
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
|
+
|
|
11457
11727
|
var getLayerStyles = function getLayerStyles(layer) {
|
|
11458
11728
|
if (!layer.styles) {
|
|
11459
11729
|
return '-';
|
|
@@ -11494,13 +11764,13 @@ var getDimensionIcon = function getDimensionIcon(name, dimensions) {
|
|
|
11494
11764
|
}
|
|
11495
11765
|
switch (dimension.name.toLowerCase()) {
|
|
11496
11766
|
case 'time':
|
|
11497
|
-
return jsx(DimensionsTime, {});
|
|
11767
|
+
return /*#__PURE__*/jsx(DimensionsTime, {});
|
|
11498
11768
|
case 'reference_time':
|
|
11499
|
-
return jsx(DimensionsRefTime, {});
|
|
11769
|
+
return /*#__PURE__*/jsx(DimensionsRefTime, {});
|
|
11500
11770
|
case 'elevation':
|
|
11501
|
-
return jsx(DimensionsElevation, {});
|
|
11771
|
+
return /*#__PURE__*/jsx(DimensionsElevation, {});
|
|
11502
11772
|
default:
|
|
11503
|
-
return jsx(DimensionsOther, {});
|
|
11773
|
+
return /*#__PURE__*/jsx(DimensionsOther, {});
|
|
11504
11774
|
}
|
|
11505
11775
|
};
|
|
11506
11776
|
var getDimensionLabel = function getDimensionLabel(name) {
|
|
@@ -11523,10 +11793,12 @@ var getDimensionsList = function getDimensionsList(dimensions) {
|
|
|
11523
11793
|
icon: icon
|
|
11524
11794
|
});
|
|
11525
11795
|
});
|
|
11796
|
+
|
|
11526
11797
|
// sort alphabetically so other dimensions are sorted
|
|
11527
11798
|
result.sort(function (compA, compB) {
|
|
11528
11799
|
return compA.label.localeCompare(compB.label);
|
|
11529
11800
|
});
|
|
11801
|
+
|
|
11530
11802
|
// sort by fixed order
|
|
11531
11803
|
var preferredOrder = ['Time', 'Reference time', 'Elevation'];
|
|
11532
11804
|
// using reverse ordering to make sure the other dimensions come last
|
|
@@ -11537,6 +11809,24 @@ var getDimensionsList = function getDimensionsList(dimensions) {
|
|
|
11537
11809
|
return result;
|
|
11538
11810
|
};
|
|
11539
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
|
+
|
|
11540
11830
|
var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
11541
11831
|
var _layer$styles, _layer$styles2, _layer$path, _layer$keywords;
|
|
11542
11832
|
var onClose = _ref.onClose,
|
|
@@ -11569,7 +11859,7 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11569
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) ||
|
|
11570
11860
|
// show first style if none selected
|
|
11571
11861
|
undefined;
|
|
11572
|
-
return jsx(ToolContainerDraggable, {
|
|
11862
|
+
return /*#__PURE__*/jsx(ToolContainerDraggable, {
|
|
11573
11863
|
isOpen: isOpen,
|
|
11574
11864
|
onClose: onClose,
|
|
11575
11865
|
onMouseDown: onMouseDown,
|
|
@@ -11581,41 +11871,41 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11581
11871
|
height: dialogHeight || 650
|
|
11582
11872
|
},
|
|
11583
11873
|
title: t('webmap-react-layer-info'),
|
|
11584
|
-
children: jsxs(Box$1, {
|
|
11874
|
+
children: /*#__PURE__*/jsxs(Box$1, {
|
|
11585
11875
|
sx: {
|
|
11586
11876
|
padding: 2
|
|
11587
11877
|
},
|
|
11588
|
-
children: [jsx(LayerInfoText, {
|
|
11878
|
+
children: [/*#__PURE__*/jsx(LayerInfoText, {
|
|
11589
11879
|
label: t('webmap-react-title'),
|
|
11590
11880
|
value: layer.title
|
|
11591
|
-
}), jsx(LayerInfoText, {
|
|
11881
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11592
11882
|
label: t('webmap-react-name'),
|
|
11593
11883
|
value: layer.name
|
|
11594
|
-
}), jsx(LayerInfoText, {
|
|
11884
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11595
11885
|
label: t('webmap-react-service'),
|
|
11596
11886
|
value: serviceName
|
|
11597
|
-
}), jsx(LayerInfoText, {
|
|
11887
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11598
11888
|
label: t('webmap-react-service-url'),
|
|
11599
11889
|
value: serviceUrl || '-'
|
|
11600
|
-
}), jsx(LayerInfoText, {
|
|
11890
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11601
11891
|
label: t('webmap-react-abstract'),
|
|
11602
11892
|
value: layer["abstract"] || '-'
|
|
11603
|
-
}), jsx(LayerInfoList, {
|
|
11893
|
+
}), /*#__PURE__*/jsx(LayerInfoList, {
|
|
11604
11894
|
label: t('webmap-react-dimensions'),
|
|
11605
11895
|
list: dimensions
|
|
11606
|
-
}), jsx(LayerInfoText, {
|
|
11896
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11607
11897
|
label: t('webmap-react-styles'),
|
|
11608
11898
|
value: styles
|
|
11609
|
-
}), jsx(LayerInfoText, {
|
|
11899
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11610
11900
|
label: t('webmap-react-bounding-box'),
|
|
11611
11901
|
value: bbox
|
|
11612
|
-
}), jsx(LayerInfoText, {
|
|
11902
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11613
11903
|
label: t('webmap-react-groups'),
|
|
11614
11904
|
value: ((_layer$path = layer.path) === null || _layer$path === void 0 ? void 0 : _layer$path.join('/')) || '-'
|
|
11615
|
-
}), jsx(LayerInfoText, {
|
|
11905
|
+
}), /*#__PURE__*/jsx(LayerInfoText, {
|
|
11616
11906
|
label: t('webmap-react-keywords'),
|
|
11617
11907
|
value: ((_layer$keywords = layer.keywords) === null || _layer$keywords === void 0 ? void 0 : _layer$keywords.join(', ')) || '-'
|
|
11618
|
-
}), jsx(LayerInfoLegend, {
|
|
11908
|
+
}), /*#__PURE__*/jsx(LayerInfoLegend, {
|
|
11619
11909
|
legendURL: legendURL,
|
|
11620
11910
|
onToggleLayerLegendVisibility: onToggleLayerLegendVisibility,
|
|
11621
11911
|
showLayerLegend: showLayerLegend,
|
|
@@ -11642,6 +11932,7 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11642
11932
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
11643
11933
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11644
11934
|
* */
|
|
11935
|
+
|
|
11645
11936
|
var MapContext = /*#__PURE__*/createContext({});
|
|
11646
11937
|
|
|
11647
11938
|
var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
|
|
@@ -11667,7 +11958,7 @@ var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
|
|
|
11667
11958
|
window.removeEventListener('wheel', updateScroll);
|
|
11668
11959
|
};
|
|
11669
11960
|
}, [showMessage, setShowMessage, timerRef]);
|
|
11670
|
-
return jsx("div", {
|
|
11961
|
+
return /*#__PURE__*/jsx("div", {
|
|
11671
11962
|
style: {
|
|
11672
11963
|
position: 'absolute',
|
|
11673
11964
|
"float": 'left',
|
|
@@ -11678,7 +11969,7 @@ var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
|
|
|
11678
11969
|
padding: '0 40%',
|
|
11679
11970
|
color: 'white'
|
|
11680
11971
|
},
|
|
11681
|
-
children: !!showMessage && jsx("div", {
|
|
11972
|
+
children: !!showMessage && /*#__PURE__*/jsx("div", {
|
|
11682
11973
|
style: {
|
|
11683
11974
|
padding: '5px 20px',
|
|
11684
11975
|
display: 'block',
|
|
@@ -11745,7 +12036,7 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11745
12036
|
};
|
|
11746
12037
|
}, [map, projection]);
|
|
11747
12038
|
if (mousePosition) {
|
|
11748
|
-
return jsx(Box, {
|
|
12039
|
+
return /*#__PURE__*/jsx(Box, {
|
|
11749
12040
|
"data-testid": "map-mouse-position",
|
|
11750
12041
|
sx: {
|
|
11751
12042
|
zIndex: 10,
|
|
@@ -11754,7 +12045,7 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11754
12045
|
left: '6px',
|
|
11755
12046
|
position: 'absolute'
|
|
11756
12047
|
},
|
|
11757
|
-
children: jsxs(Typography, {
|
|
12048
|
+
children: /*#__PURE__*/jsxs(Typography, {
|
|
11758
12049
|
"data-testid": "map-mouse-position-typography",
|
|
11759
12050
|
sx: {
|
|
11760
12051
|
fontSize: 9,
|
|
@@ -11764,7 +12055,7 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11764
12055
|
px: 0.5,
|
|
11765
12056
|
py: 0.25
|
|
11766
12057
|
},
|
|
11767
|
-
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)]
|
|
11768
12059
|
})
|
|
11769
12060
|
});
|
|
11770
12061
|
}
|
|
@@ -11788,6 +12079,7 @@ var MapMousePosition = function MapMousePosition() {
|
|
|
11788
12079
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
11789
12080
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
11790
12081
|
* */
|
|
12082
|
+
|
|
11791
12083
|
var OPENLAYERS_MOUSEWHEEL_DURATION = 50;
|
|
11792
12084
|
var OPENLAYERS_MOUSEWHEEL_TIMEOUT = 50;
|
|
11793
12085
|
|
|
@@ -11837,6 +12129,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11837
12129
|
mapObject.setTarget(undefined);
|
|
11838
12130
|
};
|
|
11839
12131
|
}, [mapRef, passiveMap]);
|
|
12132
|
+
|
|
11840
12133
|
// Propagate key events to the DIV containing OpenLayers
|
|
11841
12134
|
React.useEffect(function () {
|
|
11842
12135
|
if (!isFocused) {
|
|
@@ -11890,9 +12183,9 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11890
12183
|
map: map
|
|
11891
12184
|
};
|
|
11892
12185
|
}, [map]);
|
|
11893
|
-
return jsx(MapContext.Provider, {
|
|
12186
|
+
return /*#__PURE__*/jsx(MapContext.Provider, {
|
|
11894
12187
|
value: memoizedMapContext,
|
|
11895
|
-
children: jsxs("div", {
|
|
12188
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
11896
12189
|
"aria-label": "map",
|
|
11897
12190
|
"data-testid": "openlayers-mapview",
|
|
11898
12191
|
id: "mapcontainer_".concat(mapId),
|
|
@@ -11903,7 +12196,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11903
12196
|
height: '100%',
|
|
11904
12197
|
position: 'relative'
|
|
11905
12198
|
},
|
|
11906
|
-
children: [children, jsx(MapMousePosition, {}), !!holdShiftToScroll && !!isMouseWheelZoomEnabled && jsx(HoldShiftToZoomMessage, {})]
|
|
12199
|
+
children: [children, /*#__PURE__*/jsx(MapMousePosition, {}), !!holdShiftToScroll && !!isMouseWheelZoomEnabled && /*#__PURE__*/jsx(HoldShiftToZoomMessage, {})]
|
|
11907
12200
|
})
|
|
11908
12201
|
});
|
|
11909
12202
|
};
|
|
@@ -11917,6 +12210,7 @@ var initializeOpenLayersProjections = function initializeOpenLayersProjections()
|
|
|
11917
12210
|
});
|
|
11918
12211
|
register(proj4);
|
|
11919
12212
|
};
|
|
12213
|
+
|
|
11920
12214
|
/**
|
|
11921
12215
|
* Returns a preferred projection to use with a particular layer. It will search the layer props for
|
|
11922
12216
|
* a supported srs that either matches the current view srs or an srs that geoweb has reprojection math
|
|
@@ -11988,6 +12282,7 @@ var useProjection = function useProjection() {
|
|
|
11988
12282
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
11989
12283
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
11990
12284
|
* */
|
|
12285
|
+
|
|
11991
12286
|
var setMapCenter = function setMapCenter(map, lon, lat, zoomLevel) {
|
|
11992
12287
|
var center = fromLonLat([lon, lat], map.getView().getProjection());
|
|
11993
12288
|
map.getView().setCenter(center);
|
|
@@ -12013,6 +12308,7 @@ var setMapCenter = function setMapCenter(map, lon, lat, zoomLevel) {
|
|
|
12013
12308
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
12014
12309
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
12015
12310
|
* */
|
|
12311
|
+
|
|
12016
12312
|
var FEATURE_DRAW_FILL_COLOR_TRANSPARENT = '#186DFF18';
|
|
12017
12313
|
var FEATURE_DRAW_FILL_COLOR = '#186DFF';
|
|
12018
12314
|
var FEATURE_DRAW_STROKE_COLOR = '#186DFF';
|
|
@@ -12036,6 +12332,7 @@ var FEATURE_DRAW_SECONDARY_STROKE_COLOR = '#6e1e91';
|
|
|
12036
12332
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12037
12333
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
12038
12334
|
* */
|
|
12335
|
+
|
|
12039
12336
|
var DEFAULT_GEOJSON_STYLE_FILL_OPACITY = 0.1;
|
|
12040
12337
|
var defaultGeoJSONStyleProperties = {
|
|
12041
12338
|
fill: FEATURE_DRAW_FILL_COLOR,
|
|
@@ -12106,8 +12403,10 @@ var lineStringCollection = {
|
|
|
12106
12403
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
12107
12404
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
12108
12405
|
* */
|
|
12406
|
+
|
|
12109
12407
|
// Cache for for storing and reusing Proj4 instances
|
|
12110
12408
|
var projectorCache = {};
|
|
12409
|
+
|
|
12111
12410
|
// Ensure that you have a proj4 object, pulling from the cache if necessary
|
|
12112
12411
|
var getProj4 = function getProj4(projection) {
|
|
12113
12412
|
// Duck typing: check for the 'forward' and 'inverse' methods which are present on proj4 projection objects
|
|
@@ -12164,6 +12463,7 @@ var addFeatureProperties = function addFeatureProperties(geojson, featurePropert
|
|
|
12164
12463
|
}
|
|
12165
12464
|
});
|
|
12166
12465
|
};
|
|
12466
|
+
|
|
12167
12467
|
/**
|
|
12168
12468
|
* Checks if the geometry of the feature is empty as defined per GeoJSON spec.
|
|
12169
12469
|
* According to the specification, an empty geometry is type 'Polygon' and coordinates
|
|
@@ -12193,6 +12493,7 @@ var getGeoJSONPropertyValue = function getGeoJSONPropertyValue(property, propert
|
|
|
12193
12493
|
// otherwise get values from default properties
|
|
12194
12494
|
return defaultProperties === null || defaultProperties === void 0 ? void 0 : defaultProperties[property];
|
|
12195
12495
|
};
|
|
12496
|
+
|
|
12196
12497
|
/**
|
|
12197
12498
|
* moves geoJSON feature as new feature. Mutates newGeoJSON
|
|
12198
12499
|
* @constructor
|
|
@@ -12247,6 +12548,7 @@ var moveFeature = function moveFeature(currentGeoJSON, newGeoJSON, featureLayerI
|
|
|
12247
12548
|
}
|
|
12248
12549
|
return undefined;
|
|
12249
12550
|
};
|
|
12551
|
+
|
|
12250
12552
|
/**
|
|
12251
12553
|
* Returns the intersection of two point features. In case of a polygon, only the first feature is used.
|
|
12252
12554
|
* @param intersectA Feature A
|
|
@@ -12283,6 +12585,7 @@ var intersectPointGeoJSONS = function intersectPointGeoJSONS(intersectA, interse
|
|
|
12283
12585
|
}] : [featureA]
|
|
12284
12586
|
}, geoJSONProperties);
|
|
12285
12587
|
};
|
|
12588
|
+
|
|
12286
12589
|
// Helper functions for projection matching
|
|
12287
12590
|
function makeProjectorsFromCode(epsg) {
|
|
12288
12591
|
if (!epsg || epsg === 'EPSG:4326') {
|
|
@@ -12294,6 +12597,7 @@ function makeProjectorsFromCode(epsg) {
|
|
|
12294
12597
|
unproject: id
|
|
12295
12598
|
};
|
|
12296
12599
|
}
|
|
12600
|
+
|
|
12297
12601
|
// 3857-variants
|
|
12298
12602
|
if (['EPSG:3857', 'EPSG:3785', 'EPSG:900913', 'EPSG:102100'].includes(epsg)) {
|
|
12299
12603
|
return {
|
|
@@ -12306,6 +12610,7 @@ function makeProjectorsFromCode(epsg) {
|
|
|
12306
12610
|
};
|
|
12307
12611
|
}
|
|
12308
12612
|
var fwd = proj4('EPSG:4326', epsg); // WGS84 -> target SRS
|
|
12613
|
+
|
|
12309
12614
|
var project = function project(feat) {
|
|
12310
12615
|
var out = cloneDeep(feat);
|
|
12311
12616
|
coordEach(out, function (coords) {
|
|
@@ -12341,12 +12646,14 @@ function makeProjectorsFromCode(epsg) {
|
|
|
12341
12646
|
unproject: unproject
|
|
12342
12647
|
};
|
|
12343
12648
|
}
|
|
12649
|
+
|
|
12344
12650
|
/**
|
|
12345
12651
|
* Returns the intersection of two (multi) polygon features. In case of a polygon, only the first feature is used.
|
|
12346
12652
|
* @param intersectA Feature A
|
|
12347
12653
|
* @param intersectB Feature B
|
|
12348
12654
|
* @returns The intersection of the two features.
|
|
12349
12655
|
*/
|
|
12656
|
+
|
|
12350
12657
|
function intersectPolygonGeoJSONS(intersectA,
|
|
12351
12658
|
// drawn polygon (WGS84)
|
|
12352
12659
|
intersectB) {
|
|
@@ -12361,12 +12668,14 @@ intersectB) {
|
|
|
12361
12668
|
// Pull geometry
|
|
12362
12669
|
var drawnPolygon = intersectA.features[0];
|
|
12363
12670
|
var firPolygon = intersectB.features[0];
|
|
12671
|
+
|
|
12364
12672
|
// Projector based on active map projection
|
|
12365
12673
|
var _makeProjectorsFromCo = makeProjectorsFromCode(projectionCode),
|
|
12366
12674
|
project = _makeProjectorsFromCo.project,
|
|
12367
12675
|
unproject = _makeProjectorsFromCo.unproject;
|
|
12368
12676
|
var drawnInMap = project(drawnPolygon);
|
|
12369
12677
|
var firInMap = project(firPolygon);
|
|
12678
|
+
|
|
12370
12679
|
// Intersect in map projection
|
|
12371
12680
|
var pair = {
|
|
12372
12681
|
type: 'FeatureCollection',
|
|
@@ -12388,6 +12697,7 @@ intersectB) {
|
|
|
12388
12697
|
}]
|
|
12389
12698
|
}, geoJSONProperties);
|
|
12390
12699
|
}
|
|
12700
|
+
|
|
12391
12701
|
// Back to WGS84 for rendering
|
|
12392
12702
|
var intersectionWgs84 = unproject(intersectionInMapProj);
|
|
12393
12703
|
var intersectionWgs84Cleaned = cleanCoords(intersectionWgs84);
|
|
@@ -12399,11 +12709,13 @@ intersectB) {
|
|
|
12399
12709
|
var isPointFeatureCollection = function isPointFeatureCollection(geojson) {
|
|
12400
12710
|
return geojson.features[0].geometry.type === 'Point';
|
|
12401
12711
|
};
|
|
12712
|
+
|
|
12402
12713
|
/**
|
|
12403
12714
|
* Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
|
|
12404
12715
|
* @param geoJSONs
|
|
12405
12716
|
* @returns GeoJSONS extend with intersections
|
|
12406
12717
|
*/
|
|
12718
|
+
|
|
12407
12719
|
var createInterSections = function createInterSections(geojson, otherGeoJSON) {
|
|
12408
12720
|
var geoJSONproperties = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
12409
12721
|
stroke: '#f24a00',
|
|
@@ -12481,6 +12793,7 @@ var getFeatureCollection = function getFeatureCollection(geoJSONFeature, shouldA
|
|
|
12481
12793
|
features: [geoJSONFeature]
|
|
12482
12794
|
});
|
|
12483
12795
|
};
|
|
12796
|
+
|
|
12484
12797
|
// check if geoJSON has same selectionType in properties as passed selectionType
|
|
12485
12798
|
var isGeoJSONFeatureCreatedByTool = function isGeoJSONFeatureCreatedByTool(existingJSON, selectionType) {
|
|
12486
12799
|
var _existingJSON$feature;
|
|
@@ -12494,7 +12807,8 @@ var isGeoJSONFeatureCreatedByTool = function isGeoJSONFeatureCreatedByTool(exist
|
|
|
12494
12807
|
var rewindGeometry = function rewindGeometry(geoJSON) {
|
|
12495
12808
|
return produce(geoJSON, function (geoJSONDraft) {
|
|
12496
12809
|
if (geoJSONDraft && geoJSONDraft.features.length > 0 && geoJSONDraft.features[0].geometry.type === 'Polygon' && geoJSONDraft.features[0].geometry.coordinates[0].length > 1) {
|
|
12497
|
-
var
|
|
12810
|
+
var _ref = geoJSON.features[0],
|
|
12811
|
+
geometry = _ref.geometry;
|
|
12498
12812
|
var lineString = polygonToLine(geometry);
|
|
12499
12813
|
if (booleanClockwise(lineString.geometry.coordinates)) {
|
|
12500
12814
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -12556,6 +12870,7 @@ var getDrawModeIdFromSelectionType = function getDrawModeIdFromSelectionType(sel
|
|
|
12556
12870
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
12557
12871
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
12558
12872
|
* */
|
|
12873
|
+
|
|
12559
12874
|
initializeOpenLayersProjections();
|
|
12560
12875
|
var setViewFromExtent = function setViewFromExtent(view, bbox) {
|
|
12561
12876
|
if (!bbox || !Number(bbox.left) || !isFinite(bbox.left) || isNaN(bbox.left)) {
|
|
@@ -12601,6 +12916,7 @@ var privateWmsGetCapabilities = privateWebMapUtils.privateWmsGetCapabilities,
|
|
|
12601
12916
|
privateWmsFlattenLayerTree = privateWebMapUtils.privateWmsFlattenLayerTree,
|
|
12602
12917
|
privateWmtsGetCapabilities = privateWebMapUtils.privateWmtsGetCapabilities,
|
|
12603
12918
|
QUERYWMS_GETCAPABILITIES = privateWebMapUtils.QUERYWMS_GETCAPABILITIES;
|
|
12919
|
+
|
|
12604
12920
|
/**
|
|
12605
12921
|
* Queries the WMS GetCapabilities. This is the base TanStack hook for the other hooks in this file.
|
|
12606
12922
|
*
|
|
@@ -12630,6 +12946,7 @@ var useQueryGetWMSGetCapabilities = function useQueryGetWMSGetCapabilities(servi
|
|
|
12630
12946
|
}()
|
|
12631
12947
|
});
|
|
12632
12948
|
};
|
|
12949
|
+
|
|
12633
12950
|
/**
|
|
12634
12951
|
* Returns details about the WMS service
|
|
12635
12952
|
*
|
|
@@ -12652,6 +12969,7 @@ var useQueryGetWMSServiceInfo = function useQueryGetWMSServiceInfo(serviceUrl) {
|
|
|
12652
12969
|
}, [serviceUrl, getCapabilitiesJSON]);
|
|
12653
12970
|
return serviceInfo;
|
|
12654
12971
|
};
|
|
12972
|
+
|
|
12655
12973
|
/**
|
|
12656
12974
|
* Gets the layer tree in hierarchical order for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
12657
12975
|
*
|
|
@@ -12674,6 +12992,7 @@ var useQueryGetWMSLayersTree = function useQueryGetWMSLayersTree(serviceUrl) {
|
|
|
12674
12992
|
}, [serviceUrl, getCapabilitiesJSON]);
|
|
12675
12993
|
return layerTree;
|
|
12676
12994
|
};
|
|
12995
|
+
|
|
12677
12996
|
/**
|
|
12678
12997
|
* Gets the flat layer list (without hierarchy) for a WMS service. Cached by TanStack. Uses the same store as in queryWMSGetCapabilities.
|
|
12679
12998
|
*
|
|
@@ -12701,6 +13020,7 @@ var useQueryGetWMSLayers = function useQueryGetWMSLayers(serviceUrl) {
|
|
|
12701
13020
|
}, [serviceUrl, getCapabilitiesJSON]);
|
|
12702
13021
|
return layers;
|
|
12703
13022
|
};
|
|
13023
|
+
|
|
12704
13024
|
/**
|
|
12705
13025
|
* Returns specific layer from the WMS service
|
|
12706
13026
|
*
|
|
@@ -12721,6 +13041,7 @@ var useQueryGetWMSLayer = function useQueryGetWMSLayer(serviceUrl, name) {
|
|
|
12721
13041
|
}, [layers, name]);
|
|
12722
13042
|
return layer;
|
|
12723
13043
|
};
|
|
13044
|
+
|
|
12724
13045
|
/**
|
|
12725
13046
|
* Returns a stylelist for given layer in a service
|
|
12726
13047
|
*
|
|
@@ -12732,6 +13053,7 @@ var useGetWMSLayerStyleList = function useGetWMSLayerStyleList(serviceUrl, name)
|
|
|
12732
13053
|
var _useQueryGetWMSLayer;
|
|
12733
13054
|
return ((_useQueryGetWMSLayer = useQueryGetWMSLayer(serviceUrl, name)) === null || _useQueryGetWMSLayer === void 0 ? void 0 : _useQueryGetWMSLayer.styles) || null;
|
|
12734
13055
|
};
|
|
13056
|
+
|
|
12735
13057
|
/**
|
|
12736
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.
|
|
12737
13059
|
*
|
|
@@ -12755,6 +13077,7 @@ var useGetWMLayerInstance = function useGetWMLayerInstance(layerFoundation) {
|
|
|
12755
13077
|
var layerId = refId.current;
|
|
12756
13078
|
var _useContext = useContext(TimeContext),
|
|
12757
13079
|
refTimeDimensionModes = _useContext.refTimeDimensionModes;
|
|
13080
|
+
|
|
12758
13081
|
// Check if the layer is already registered
|
|
12759
13082
|
var tmpWMLayer = webmapUtils.getWMLayerById(layerId);
|
|
12760
13083
|
var layerIdChanged = id && id !== (tmpWMLayer === null || tmpWMLayer === void 0 ? void 0 : tmpWMLayer.id);
|
|
@@ -12793,6 +13116,7 @@ var useGetWMLayerInstance = function useGetWMLayerInstance(layerFoundation) {
|
|
|
12793
13116
|
errorMessage: errorMessage
|
|
12794
13117
|
};
|
|
12795
13118
|
};
|
|
13119
|
+
|
|
12796
13120
|
/**
|
|
12797
13121
|
* Used for querying WMTS GetCapabilities documents
|
|
12798
13122
|
* @param serviceUrl
|
|
@@ -12877,6 +13201,7 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12877
13201
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12878
13202
|
render = _useState2[0],
|
|
12879
13203
|
setRender = _useState2[1];
|
|
13204
|
+
|
|
12880
13205
|
// Sets a timer
|
|
12881
13206
|
useEffect(function () {
|
|
12882
13207
|
intervalIdRef.current = setInterval(function () {
|
|
@@ -12904,7 +13229,7 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12904
13229
|
var top = requestedStepIsOutsideRange ? '5px' : '2px';
|
|
12905
13230
|
var left = "calc(25% + ".concat(index * itemWidth, "px)");
|
|
12906
13231
|
var opacity = isSelectedStep ? 1 : 0.8;
|
|
12907
|
-
return jsx("span", {
|
|
13232
|
+
return /*#__PURE__*/jsx("span", {
|
|
12908
13233
|
style: {
|
|
12909
13234
|
background: isSelectedStep ? '#C0FF50' : colorLayerIsOutsideRange,
|
|
12910
13235
|
display: 'block',
|
|
@@ -12924,16 +13249,16 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12924
13249
|
var dimsInfo = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions.map(function (wmLayerDimension) {
|
|
12925
13250
|
return getDimensionInfo(wmLayerDimension);
|
|
12926
13251
|
});
|
|
12927
|
-
var tooltipText = jsxs("span", {
|
|
12928
|
-
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) {
|
|
12929
|
-
return jsxs("span", {
|
|
12930
|
-
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", {})]
|
|
12931
13256
|
}, "".concat(dim.name, "-").concat(dim.currentValue));
|
|
12932
13257
|
})]
|
|
12933
13258
|
});
|
|
12934
|
-
return jsx(CustomTooltip, {
|
|
13259
|
+
return /*#__PURE__*/jsx(CustomTooltip, {
|
|
12935
13260
|
title: tooltipText,
|
|
12936
|
-
children: jsxs("div", {
|
|
13261
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
12937
13262
|
"data-testid": "debug-info",
|
|
12938
13263
|
style: {
|
|
12939
13264
|
position: 'relative',
|
|
@@ -12943,14 +13268,14 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12943
13268
|
marginTop: '12px',
|
|
12944
13269
|
marginBottom: '-10px'
|
|
12945
13270
|
},
|
|
12946
|
-
children: [jsx("div", {
|
|
13271
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
12947
13272
|
style: {
|
|
12948
13273
|
width: '100%'
|
|
12949
13274
|
},
|
|
12950
|
-
children: jsx("div", {
|
|
13275
|
+
children: /*#__PURE__*/jsx("div", {
|
|
12951
13276
|
children: items
|
|
12952
13277
|
})
|
|
12953
|
-
}), jsxs("div", {
|
|
13278
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
12954
13279
|
style: {
|
|
12955
13280
|
left: '10px',
|
|
12956
13281
|
paddingTop: '3px',
|
|
@@ -12959,7 +13284,7 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12959
13284
|
opacity: 0.85,
|
|
12960
13285
|
width: '100%'
|
|
12961
13286
|
},
|
|
12962
|
-
children: [jsx("span", {
|
|
13287
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
12963
13288
|
style: {
|
|
12964
13289
|
display: 'inline-block',
|
|
12965
13290
|
verticalAlign: 'top',
|
|
@@ -12975,14 +13300,14 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12975
13300
|
borderRadius: 2
|
|
12976
13301
|
},
|
|
12977
13302
|
children: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title
|
|
12978
|
-
}), jsx("span", {
|
|
13303
|
+
}), /*#__PURE__*/jsx("span", {
|
|
12979
13304
|
style: {
|
|
12980
13305
|
display: 'inline-block',
|
|
12981
13306
|
width: '75%',
|
|
12982
13307
|
opacity: '0.7'
|
|
12983
13308
|
},
|
|
12984
13309
|
children: dimsInfo.map(function (dimension) {
|
|
12985
|
-
return jsx("span", {
|
|
13310
|
+
return /*#__PURE__*/jsx("span", {
|
|
12986
13311
|
style: {
|
|
12987
13312
|
margin: '0 0 0 0px',
|
|
12988
13313
|
padding: '1px 5px',
|
|
@@ -13024,6 +13349,7 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13024
13349
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13025
13350
|
layer = _useState2[0],
|
|
13026
13351
|
setLayer = _useState2[1];
|
|
13352
|
+
|
|
13027
13353
|
// get a wmLayer instance
|
|
13028
13354
|
var _useGetWMLayerInstanc = useGetWMLayerInstance({
|
|
13029
13355
|
service: getCapsURL,
|
|
@@ -13038,23 +13364,26 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13038
13364
|
}
|
|
13039
13365
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests
|
|
13040
13366
|
var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
|
|
13367
|
+
|
|
13041
13368
|
// This string can be used safely in a useEffect or other React hook to check if the contents changed
|
|
13042
13369
|
var dimensionsValuesEffectCheck = dimensionsValues && Object.entries(dimensionsValues).map(function (dimensionNameAndCurrentValue) {
|
|
13043
13370
|
return "".concat(dimensionNameAndCurrentValue[0], ":").concat(dimensionNameAndCurrentValue[1]);
|
|
13044
13371
|
}).join(',');
|
|
13045
13372
|
var prefetchListEffectCheck = (prefetchList !== null && prefetchList !== void 0 ? prefetchList : []).join(',');
|
|
13373
|
+
|
|
13046
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.
|
|
13047
13375
|
useEffect(function () {
|
|
13048
13376
|
if (!map || !wmLayer || !visible || !dimensionsValues) {
|
|
13049
13377
|
return function () {};
|
|
13050
13378
|
}
|
|
13379
|
+
|
|
13051
13380
|
// When this component mounts, an ImageLayer is added to the map. Once it unmounts, this layer is removed from the map.
|
|
13052
13381
|
var olLayer = new ImageLayer({
|
|
13053
13382
|
source: new TimeawareImageSource({
|
|
13054
13383
|
wmsUrl: wmLayer.getmapURL,
|
|
13055
13384
|
layerName: wmLayer.name,
|
|
13056
13385
|
layerId: layerId || '',
|
|
13057
|
-
styleName: styleName,
|
|
13386
|
+
styleName: styleName && styleName !== 'default' ? styleName : '',
|
|
13058
13387
|
dimProps: dimensionsValues,
|
|
13059
13388
|
timeStampsToPrefetch: [],
|
|
13060
13389
|
visible: visible
|
|
@@ -13071,12 +13400,14 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13071
13400
|
map.removeLayer(olLayer);
|
|
13072
13401
|
olLayer.dispose();
|
|
13073
13402
|
};
|
|
13403
|
+
|
|
13074
13404
|
// The dependency list should only contain the map, wmLayer, visible and dimensionValues. Other prop changes are handled by other effects.
|
|
13075
13405
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13076
13406
|
}, [map, wmLayer, visible, dimensionsValues === undefined]);
|
|
13077
13407
|
useEffect(function () {
|
|
13078
13408
|
onLayerReady && wmLayer && layerId && onLayerReady(layerId);
|
|
13079
13409
|
}, [layerId, wmLayer, onLayerReady]);
|
|
13410
|
+
|
|
13080
13411
|
// Initialize layer for GeoWeb, call onInitializeLayer
|
|
13081
13412
|
useEffect(function () {
|
|
13082
13413
|
var initializeLayer = /*#__PURE__*/function () {
|
|
@@ -13109,8 +13440,10 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13109
13440
|
firstRefTime = refTimeDim === null || refTimeDim === void 0 ? void 0 : refTimeDim.getClosestValue(refTimeToFind, true);
|
|
13110
13441
|
firstRefTime && refTimeDim && (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.setTimeValuesForReferenceTime(firstRefTime, refTimeDim));
|
|
13111
13442
|
}
|
|
13443
|
+
|
|
13112
13444
|
// Make sure style is set in wmLayer as well
|
|
13113
13445
|
styleName && wmLayer.setStyle(styleName);
|
|
13446
|
+
|
|
13114
13447
|
// Make sure we have the latest dimension values before initializing
|
|
13115
13448
|
_context.next = 10;
|
|
13116
13449
|
return wmLayer.parseLayer();
|
|
@@ -13145,9 +13478,11 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13145
13478
|
return window.console.error(e);
|
|
13146
13479
|
});
|
|
13147
13480
|
return function () {};
|
|
13481
|
+
|
|
13148
13482
|
// Effect array should only contain wmLayer and layerName
|
|
13149
13483
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13150
13484
|
}, [wmLayer, layerName]);
|
|
13485
|
+
|
|
13151
13486
|
// Layer opacity and zIndex useEffect
|
|
13152
13487
|
useEffect(function () {
|
|
13153
13488
|
if (!layerOptions || !layer) {
|
|
@@ -13161,33 +13496,38 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13161
13496
|
}
|
|
13162
13497
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13163
13498
|
}, [layer, layerOptions === null || layerOptions === void 0 ? void 0 : layerOptions.zIndex, layerOptions === null || layerOptions === void 0 ? void 0 : layerOptions.opacity]);
|
|
13499
|
+
|
|
13164
13500
|
// Layer visible useEffect
|
|
13165
13501
|
useEffect(function () {
|
|
13166
13502
|
layer === null || layer === void 0 || layer.setVisible(visible);
|
|
13167
13503
|
}, [layer, visible]);
|
|
13504
|
+
|
|
13168
13505
|
// Layer styleName properties useEffect
|
|
13169
13506
|
useEffect(function () {
|
|
13170
13507
|
if (wmLayer) {
|
|
13171
13508
|
var _styles$, _layer$getSource;
|
|
13172
13509
|
var styles = wmLayer.getStyles();
|
|
13173
|
-
var style = styleName && styles.some(function (style) {
|
|
13510
|
+
var style = styleName && styleName !== 'default' && styles.some(function (style) {
|
|
13174
13511
|
return style.name === styleName;
|
|
13175
|
-
}) ? styleName :
|
|
13176
|
-
wmLayer.setStyle(style);
|
|
13512
|
+
}) ? styleName : '';
|
|
13513
|
+
wmLayer.setStyle(style || ((_styles$ = styles[0]) === null || _styles$ === void 0 ? void 0 : _styles$.name) || '');
|
|
13177
13514
|
layer === null || layer === void 0 || (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 || _layer$getSource.setStyle(style);
|
|
13178
13515
|
}
|
|
13179
13516
|
}, [layer, styleName, wmLayer]);
|
|
13517
|
+
|
|
13180
13518
|
// layerName useEffect
|
|
13181
13519
|
useEffect(function () {
|
|
13182
13520
|
var _layer$getSource2;
|
|
13183
13521
|
layer === null || layer === void 0 || (_layer$getSource2 = layer.getSource()) === null || _layer$getSource2 === void 0 || _layer$getSource2.setLayerName(layerName);
|
|
13184
13522
|
}, [layer, layerName]);
|
|
13523
|
+
|
|
13185
13524
|
// Layer dim values useEffect,
|
|
13186
13525
|
useEffect(function () {
|
|
13187
13526
|
var _layer$getSource3;
|
|
13188
13527
|
dimensionsValues && (layer === null || layer === void 0 || (_layer$getSource3 = layer.getSource()) === null || _layer$getSource3 === void 0 ? void 0 : _layer$getSource3.setDimProps(dimensionsValues));
|
|
13189
13528
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13190
13529
|
}, [layer, dimensionsValuesEffectCheck]);
|
|
13530
|
+
|
|
13191
13531
|
// Prefetch useEffect
|
|
13192
13532
|
useEffect(function () {
|
|
13193
13533
|
var _wmLayer$dimensions3;
|
|
@@ -13215,11 +13555,12 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13215
13555
|
// - dimensionsValuesEffectCheck,
|
|
13216
13556
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13217
13557
|
}, [layer, wmLayer, prefetchListEffectCheck, layerName, styleName, dimensionsValuesEffectCheck]);
|
|
13558
|
+
|
|
13218
13559
|
// Only show debug info for data layers with time dimension
|
|
13219
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) {
|
|
13220
13561
|
return dimension.name === 'time';
|
|
13221
13562
|
})) !== null && _wmLayer$dimensions$f !== void 0 ? _wmLayer$dimensions$f : -1;
|
|
13222
|
-
return debugMode && hasTimeDim !== -1 ? jsx(ShowTimeAwareLayerInfo, {
|
|
13563
|
+
return debugMode && hasTimeDim !== -1 ? /*#__PURE__*/jsx(ShowTimeAwareLayerInfo, {
|
|
13223
13564
|
layer: layer,
|
|
13224
13565
|
stepsToCheck: prefetchList,
|
|
13225
13566
|
visible: visible,
|
|
@@ -13245,6 +13586,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13245
13586
|
setProjection = _useState4[1];
|
|
13246
13587
|
var layerInformation = useQueryGetWMSLayer(url, layerName);
|
|
13247
13588
|
var mapProjection = useProjection();
|
|
13589
|
+
|
|
13248
13590
|
// Listen to changes in the map projection
|
|
13249
13591
|
useEffect(function () {
|
|
13250
13592
|
var _map$getView;
|
|
@@ -13263,6 +13605,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13263
13605
|
unByKey(eventKey);
|
|
13264
13606
|
};
|
|
13265
13607
|
}, [map, layerInformation, mapProjection]);
|
|
13608
|
+
|
|
13266
13609
|
// Set up layer
|
|
13267
13610
|
useEffect(function () {
|
|
13268
13611
|
if (!map || !layerName || !projection) {
|
|
@@ -13289,6 +13632,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13289
13632
|
setLayer(undefined);
|
|
13290
13633
|
};
|
|
13291
13634
|
}, [map, url, projection, layerName, styleName]);
|
|
13635
|
+
|
|
13292
13636
|
// Update layer options
|
|
13293
13637
|
useEffect(function () {
|
|
13294
13638
|
if (!layerOptions || !layer) {
|
|
@@ -13306,6 +13650,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13306
13650
|
return;
|
|
13307
13651
|
}
|
|
13308
13652
|
layer.setVisible(!!layerProps.enabled);
|
|
13653
|
+
|
|
13309
13654
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13310
13655
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13311
13656
|
return null;
|
|
@@ -13328,6 +13673,7 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
13328
13673
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
13329
13674
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
13330
13675
|
* */
|
|
13676
|
+
|
|
13331
13677
|
var WMTSDimensionsFromDimensions = function WMTSDimensionsFromDimensions(dimensions) {
|
|
13332
13678
|
return dimensions.map(function (item) {
|
|
13333
13679
|
return item.name ? _defineProperty({}, item.name[0].toUpperCase() + item.name.slice(1).toLowerCase(), item.currentValue) : {};
|
|
@@ -13408,6 +13754,7 @@ var WMTSLayer = function WMTSLayer(_ref) {
|
|
|
13408
13754
|
return;
|
|
13409
13755
|
}
|
|
13410
13756
|
layer.setVisible(!!layerProps.enabled);
|
|
13757
|
+
|
|
13411
13758
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13412
13759
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13413
13760
|
return null;
|
|
@@ -13460,6 +13807,7 @@ var XYZLayer = function XYZLayer(_ref) {
|
|
|
13460
13807
|
return;
|
|
13461
13808
|
}
|
|
13462
13809
|
layer.setVisible(!!layerProps.enabled);
|
|
13810
|
+
|
|
13463
13811
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13464
13812
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13465
13813
|
return null;
|
|
@@ -13482,6 +13830,7 @@ var XYZLayer = function XYZLayer(_ref) {
|
|
|
13482
13830
|
* Copyright 2024 - Finnish Meteorological Institute (FMI)
|
|
13483
13831
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
13484
13832
|
* */
|
|
13833
|
+
|
|
13485
13834
|
var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, refetchInterval) {
|
|
13486
13835
|
var shouldAutoFetch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
13487
13836
|
var intervalIdRef = useRef();
|
|
@@ -13499,6 +13848,7 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
|
|
|
13499
13848
|
refetch();
|
|
13500
13849
|
}
|
|
13501
13850
|
}, [refetch, refetchInterval]);
|
|
13851
|
+
|
|
13502
13852
|
// Triggers when document becomes visible
|
|
13503
13853
|
useLayoutEffect(function () {
|
|
13504
13854
|
var onVisibilityChange = function onVisibilityChange() {
|
|
@@ -13510,6 +13860,7 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
|
|
|
13510
13860
|
};
|
|
13511
13861
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13512
13862
|
}, [refetchInterval, shouldAutoFetch]);
|
|
13863
|
+
|
|
13513
13864
|
// Sets a timer
|
|
13514
13865
|
useEffect(function () {
|
|
13515
13866
|
intervalIdRef.current = setInterval(refetch, refetchInterval);
|
|
@@ -13537,6 +13888,7 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
|
|
|
13537
13888
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
13538
13889
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
13539
13890
|
* */
|
|
13891
|
+
|
|
13540
13892
|
initializeOpenLayersProjections();
|
|
13541
13893
|
var useViewFromLayer = function useViewFromLayer(layerProps) {
|
|
13542
13894
|
var baseView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
@@ -13729,11 +14081,30 @@ var TiledWMSLayer = function TiledWMSLayer(_ref) {
|
|
|
13729
14081
|
return;
|
|
13730
14082
|
}
|
|
13731
14083
|
layer.setVisible(!!layerProps.enabled);
|
|
14084
|
+
|
|
13732
14085
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13733
14086
|
}, [layer, layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled]);
|
|
13734
14087
|
return null;
|
|
13735
14088
|
};
|
|
13736
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
|
+
|
|
13737
14108
|
var layerOptions = {
|
|
13738
14109
|
zIndex: 1,
|
|
13739
14110
|
opacity: 1
|
|
@@ -13741,18 +14112,18 @@ var layerOptions = {
|
|
|
13741
14112
|
var layerProps = {
|
|
13742
14113
|
enabled: true
|
|
13743
14114
|
};
|
|
13744
|
-
var BaseLayerType
|
|
13745
|
-
(function (BaseLayerType) {
|
|
14115
|
+
var BaseLayerType = /*#__PURE__*/function (BaseLayerType) {
|
|
13746
14116
|
BaseLayerType[BaseLayerType["LIGHT_GREY_CANVAS"] = 0] = "LIGHT_GREY_CANVAS";
|
|
13747
14117
|
BaseLayerType[BaseLayerType["WORLD_TOPO"] = 1] = "WORLD_TOPO";
|
|
13748
|
-
|
|
14118
|
+
return BaseLayerType;
|
|
14119
|
+
}({});
|
|
13749
14120
|
var DefaultBaseLayers = function DefaultBaseLayers(_ref) {
|
|
13750
14121
|
var _ref$type = _ref.type,
|
|
13751
14122
|
type = _ref$type === void 0 ? BaseLayerType.LIGHT_GREY_CANVAS : _ref$type;
|
|
13752
14123
|
var getBase = function getBase() {
|
|
13753
14124
|
switch (type) {
|
|
13754
14125
|
case BaseLayerType.WORLD_TOPO:
|
|
13755
|
-
return jsx(WMTSLayer, {
|
|
14126
|
+
return /*#__PURE__*/jsx(WMTSLayer, {
|
|
13756
14127
|
getCapsURL: "https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/WMTS?SERVICE=WMTS&REQUEST=GetCapabilities",
|
|
13757
14128
|
layerName: "World_Topo_Map",
|
|
13758
14129
|
layerOptions: layerOptions,
|
|
@@ -13761,15 +14132,15 @@ var DefaultBaseLayers = function DefaultBaseLayers(_ref) {
|
|
|
13761
14132
|
});
|
|
13762
14133
|
case BaseLayerType.LIGHT_GREY_CANVAS:
|
|
13763
14134
|
default:
|
|
13764
|
-
return jsx(XYZLayer, {
|
|
14135
|
+
return /*#__PURE__*/jsx(XYZLayer, {
|
|
13765
14136
|
layerOptions: layerOptions,
|
|
13766
14137
|
layerProps: layerProps,
|
|
13767
14138
|
urlTemplate: "https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap_Light_Grey_Canvas/EPSG3857/{z}/{x}/{y}.png"
|
|
13768
14139
|
});
|
|
13769
14140
|
}
|
|
13770
14141
|
};
|
|
13771
|
-
return jsxs(Fragment, {
|
|
13772
|
-
children: [getBase(), jsx(TiledWMSLayer, {
|
|
14142
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
14143
|
+
children: [getBase(), /*#__PURE__*/jsx(TiledWMSLayer, {
|
|
13773
14144
|
layerName: "countryborders",
|
|
13774
14145
|
layerOptions: {
|
|
13775
14146
|
zIndex: 999,
|
|
@@ -13847,6 +14218,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
13847
14218
|
(_layerRef$current2 = layerRef.current) === null || _layerRef$current2 === void 0 || _layerRef$current2.setOpacity(opacity);
|
|
13848
14219
|
}
|
|
13849
14220
|
}, [opacity]);
|
|
14221
|
+
|
|
13850
14222
|
// Layer visible useEffect
|
|
13851
14223
|
useEffect(function () {
|
|
13852
14224
|
var _layerRef$current3;
|
|
@@ -13923,11 +14295,30 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
13923
14295
|
return null;
|
|
13924
14296
|
};
|
|
13925
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
|
+
|
|
13926
14316
|
var defaultLegend = makeLegendFromColorMap({
|
|
13927
14317
|
colors: colorMaps.temperatureLegendColorsWoW,
|
|
13928
14318
|
min: -18,
|
|
13929
14319
|
max: 38
|
|
13930
14320
|
});
|
|
14321
|
+
|
|
13931
14322
|
// Style needs to be optional to match the other layers. Therefore a default style is made here once.
|
|
13932
14323
|
var defaultStyle = function defaultStyle(feature) {
|
|
13933
14324
|
return makeFeatureStyleDisc(feature, defaultLegend);
|
|
@@ -13960,11 +14351,12 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
13960
14351
|
features.current = formatter.readFeatures(featureCollection);
|
|
13961
14352
|
}
|
|
13962
14353
|
}
|
|
14354
|
+
|
|
13963
14355
|
// If no featureCollection is given, e.g. in edit mode of a polygon, the feature should not be displayed.
|
|
13964
14356
|
if (!featureCollection) {
|
|
13965
14357
|
return null;
|
|
13966
14358
|
}
|
|
13967
|
-
return jsx(FeatureLayer, {
|
|
14359
|
+
return /*#__PURE__*/jsx(FeatureLayer, {
|
|
13968
14360
|
clickOnFeature: clickOnFeature,
|
|
13969
14361
|
declutter: declutter,
|
|
13970
14362
|
features: features.current,
|
|
@@ -13977,6 +14369,24 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
13977
14369
|
});
|
|
13978
14370
|
};
|
|
13979
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
|
+
|
|
13980
14390
|
var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
13981
14391
|
var _wmLayer$getDimension, _wmLayer$getDimension2;
|
|
13982
14392
|
var edrBaseUrl = _ref.edrBaseUrl,
|
|
@@ -13992,6 +14402,7 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
13992
14402
|
onInitializeLayer = _ref.onInitializeLayer;
|
|
13993
14403
|
// get a wmLayer instance
|
|
13994
14404
|
var wmLayer = useEDRWMLayer(edrBaseUrl, parameter, layerId, onInitializeLayer);
|
|
14405
|
+
|
|
13995
14406
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests. We re-use it here for EDR.
|
|
13996
14407
|
var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
|
|
13997
14408
|
var timeValue = dimensionsValues === null || dimensionsValues === void 0 ? void 0 : dimensionsValues['TIME'];
|
|
@@ -14000,14 +14411,16 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
14000
14411
|
featurePoints = _useEDRGetParameterDa.data,
|
|
14001
14412
|
isFetching = _useEDRGetParameterDa.isFetching;
|
|
14002
14413
|
var loadingStyle = parameter !== null && parameter !== void 0 && parameter.includes(',') ? makeFeatureStyleMultiParamLoading : makeFeatureStyleLoading;
|
|
14414
|
+
|
|
14003
14415
|
// Send empty collection if no API result yet
|
|
14004
14416
|
var featureCollection = featurePoints !== null && featurePoints !== void 0 ? featurePoints : {
|
|
14005
14417
|
features: [],
|
|
14006
14418
|
type: 'FeatureCollection'
|
|
14007
14419
|
};
|
|
14420
|
+
|
|
14008
14421
|
// Don't show anything if no parameter is selected
|
|
14009
14422
|
var isVisible = visible && parameter.length > 0;
|
|
14010
|
-
return jsx(OpenLayersFeatureLayer, {
|
|
14423
|
+
return /*#__PURE__*/jsx(OpenLayersFeatureLayer, {
|
|
14011
14424
|
declutter: true,
|
|
14012
14425
|
featureCollection: featureCollection,
|
|
14013
14426
|
opacity: opacity,
|
|
@@ -14034,6 +14447,7 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
14034
14447
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
14035
14448
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
14036
14449
|
* */
|
|
14450
|
+
|
|
14037
14451
|
var fetchStacCollection = /*#__PURE__*/function () {
|
|
14038
14452
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(stacBaseUrlWithCollection) {
|
|
14039
14453
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -14101,6 +14515,7 @@ var fetchStacItems = /*#__PURE__*/function () {
|
|
|
14101
14515
|
}();
|
|
14102
14516
|
|
|
14103
14517
|
var DEFAULT_STALE_TIME = 60000; // One minute
|
|
14518
|
+
|
|
14104
14519
|
var useStacCollection = function useStacCollection(stacBaseUrlWithCollection) {
|
|
14105
14520
|
var instanceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
14106
14521
|
var enabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
@@ -14206,6 +14621,7 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
14206
14621
|
var _useFetchGeoTIFFBlob = useFetchGeoTIFFBlob(url),
|
|
14207
14622
|
blob = _useFetchGeoTIFFBlob.data,
|
|
14208
14623
|
isSuccess = _useFetchGeoTIFFBlob.isSuccess;
|
|
14624
|
+
|
|
14209
14625
|
// Only create the layer once
|
|
14210
14626
|
useEffect(function () {
|
|
14211
14627
|
if (!map || !layerName || layerRef.current || !isSuccess || !blob || !shouldRender) {
|
|
@@ -14231,6 +14647,7 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
14231
14647
|
setInitialized(false);
|
|
14232
14648
|
};
|
|
14233
14649
|
}, [map, layerName, blob, isSuccess, projection, shouldRender]);
|
|
14650
|
+
|
|
14234
14651
|
// Update layer options
|
|
14235
14652
|
useEffect(function () {
|
|
14236
14653
|
var layer = layerRef.current;
|
|
@@ -14244,6 +14661,7 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
14244
14661
|
layer.setZIndex(layerOptions.zIndex);
|
|
14245
14662
|
}
|
|
14246
14663
|
}, [layerOptions, initialized]);
|
|
14664
|
+
|
|
14247
14665
|
// Update visibility
|
|
14248
14666
|
useEffect(function () {
|
|
14249
14667
|
var layer = layerRef.current;
|
|
@@ -14282,6 +14700,7 @@ var useGetStacGeoTIFFWMLayerInstance = function useGetStacGeoTIFFWMLayerInstance
|
|
|
14282
14700
|
});
|
|
14283
14701
|
webmapUtils.registerWMLayer(_wmLayer, layerId);
|
|
14284
14702
|
}
|
|
14703
|
+
|
|
14285
14704
|
// Set the name and parse the layer
|
|
14286
14705
|
var wmLayer = webmapUtils.getWMLayerById(layerId);
|
|
14287
14706
|
wmLayer.setName(name).then(function () {
|
|
@@ -14403,6 +14822,7 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14403
14822
|
var _useStacItems = useStacItems(stacCollectionUrl, startDate, endDate),
|
|
14404
14823
|
items = _useStacItems.data,
|
|
14405
14824
|
isLoading = _useStacItems.isLoading;
|
|
14825
|
+
|
|
14406
14826
|
// Find the closest item index for the selected time
|
|
14407
14827
|
var closestIndex = React.useMemo(function () {
|
|
14408
14828
|
if (!items || !timeValue) {
|
|
@@ -14424,6 +14844,7 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14424
14844
|
});
|
|
14425
14845
|
return idx;
|
|
14426
14846
|
}, [items, timeValue]);
|
|
14847
|
+
|
|
14427
14848
|
// Window of 101 images: 50 before, 50 after
|
|
14428
14849
|
// This allows animation to play without fetching each new frame
|
|
14429
14850
|
var _React$useMemo3 = React.useMemo(function () {
|
|
@@ -14440,13 +14861,13 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14440
14861
|
if (!items || isLoading) {
|
|
14441
14862
|
return null;
|
|
14442
14863
|
}
|
|
14443
|
-
return jsx(Fragment, {
|
|
14864
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
14444
14865
|
children: items.map(function (item, actualIdx) {
|
|
14445
14866
|
var isClosest = actualIdx === closestIndex;
|
|
14446
14867
|
// Draw 5 images before and after with 0 opacity for smoother animation
|
|
14447
14868
|
var isWithinRange = Math.abs(actualIdx - closestIndex) <= 5;
|
|
14448
14869
|
var inWindow = actualIdx >= startIdx && actualIdx < endIdx;
|
|
14449
|
-
return jsx(GeoTIFFLayer, {
|
|
14870
|
+
return /*#__PURE__*/jsx(GeoTIFFLayer, {
|
|
14450
14871
|
layerName: item.id,
|
|
14451
14872
|
layerOptions: {
|
|
14452
14873
|
opacity: isClosest ? opacity : 0,
|
|
@@ -14492,6 +14913,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14492
14913
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
14493
14914
|
source = _useState4[0],
|
|
14494
14915
|
setSource = _useState4[1];
|
|
14916
|
+
|
|
14495
14917
|
// get a wmLayer instance
|
|
14496
14918
|
var _useGetWMLayerInstanc = useGetWMLayerInstance({
|
|
14497
14919
|
service: getCapsURL,
|
|
@@ -14504,8 +14926,10 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14504
14926
|
if (errorMessage && onLayerError) {
|
|
14505
14927
|
onLayerError(layerId || '', errorMessage);
|
|
14506
14928
|
}
|
|
14929
|
+
|
|
14507
14930
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests
|
|
14508
14931
|
var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
|
|
14932
|
+
|
|
14509
14933
|
// This string can be used safely in a useEffect or other React hook to check if the contents changed
|
|
14510
14934
|
var dimensionsValuesEffectCheck = dimensionsValues && Object.entries(dimensionsValues).map(function (dimensionNameAndCurrentValue) {
|
|
14511
14935
|
return "".concat(dimensionNameAndCurrentValue[0], ":").concat(dimensionNameAndCurrentValue[1]);
|
|
@@ -14545,6 +14969,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14545
14969
|
firstRefTime = refTimeDim === null || refTimeDim === void 0 ? void 0 : refTimeDim.getClosestValue(refTimeToFind, true);
|
|
14546
14970
|
firstRefTime && refTimeDim && (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.setTimeValuesForReferenceTime(firstRefTime, refTimeDim));
|
|
14547
14971
|
}
|
|
14972
|
+
|
|
14548
14973
|
// Make sure we have the latest dimension values before initializing
|
|
14549
14974
|
_context.next = 9;
|
|
14550
14975
|
return wmLayer.parseLayer();
|
|
@@ -14579,6 +15004,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14579
15004
|
return onLayerError === null || onLayerError === void 0 ? void 0 : onLayerError(layerId, e.message);
|
|
14580
15005
|
});
|
|
14581
15006
|
return function () {};
|
|
15007
|
+
|
|
14582
15008
|
// Effect array should only contain wmLayer and layerName
|
|
14583
15009
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14584
15010
|
}, [wmLayer, layerName]);
|
|
@@ -14659,6 +15085,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
|
14659
15085
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
14660
15086
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
14661
15087
|
* */
|
|
15088
|
+
|
|
14662
15089
|
var baseLayerGrey = {
|
|
14663
15090
|
id: webmapUtils.generateLayerId(),
|
|
14664
15091
|
name: 'WorldMap_Light_Grey_Canvas',
|
|
@@ -14700,6 +15127,7 @@ var defaultLayers = /*#__PURE__*/Object.freeze({
|
|
|
14700
15127
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
14701
15128
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
14702
15129
|
* */
|
|
15130
|
+
|
|
14703
15131
|
var DWD = {
|
|
14704
15132
|
name: 'DWD',
|
|
14705
15133
|
url: 'https://maps.dwd.de/geoserver/ows?',
|
|
@@ -14830,6 +15258,7 @@ var publicServices = /*#__PURE__*/Object.freeze({
|
|
|
14830
15258
|
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
14831
15259
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
14832
15260
|
* */
|
|
15261
|
+
|
|
14833
15262
|
var baseLayer = {
|
|
14834
15263
|
name: 'arcGisSat',
|
|
14835
15264
|
title: 'arcGisSat',
|
|
@@ -14838,7 +15267,9 @@ var baseLayer = {
|
|
|
14838
15267
|
enabled: true,
|
|
14839
15268
|
id: webmapUtils.generateLayerId()
|
|
14840
15269
|
};
|
|
15270
|
+
|
|
14841
15271
|
// Base Layers List
|
|
15272
|
+
|
|
14842
15273
|
var baseLayerOpenStreetMapNL = {
|
|
14843
15274
|
id: 'base-layer-2',
|
|
14844
15275
|
name: 'OpenStreetMap_NL',
|
|
@@ -14867,7 +15298,9 @@ var baseLayerHeiGit = {
|
|
|
14867
15298
|
name: 'osm_auto:all',
|
|
14868
15299
|
layerType: LayerType.baseLayer
|
|
14869
15300
|
};
|
|
15301
|
+
|
|
14870
15302
|
// KNMI msgcpp List
|
|
15303
|
+
|
|
14871
15304
|
var msgCppLayer = {
|
|
14872
15305
|
// doesn't work with https
|
|
14873
15306
|
service: KNMImsgcpp.url,
|
|
@@ -14878,7 +15311,9 @@ var msgCppLayer = {
|
|
|
14878
15311
|
id: webmapUtils.generateLayerId(),
|
|
14879
15312
|
layerType: LayerType.mapLayer
|
|
14880
15313
|
};
|
|
15314
|
+
|
|
14881
15315
|
// Nederlandse Nationaal Georegister Layers list
|
|
15316
|
+
|
|
14882
15317
|
var veiligheidsRegiosGebiedsIndelingenLabels = {
|
|
14883
15318
|
service: nationaalgeoregister.url,
|
|
14884
15319
|
name: 'cbsgebiedsindelingen:cbs_veiligheidsregio_2020_labelpoint',
|
|
@@ -14893,7 +15328,9 @@ var veiligheidsRegiosGebiedsIndelingen = {
|
|
|
14893
15328
|
enabled: false,
|
|
14894
15329
|
layerType: LayerType.mapLayer
|
|
14895
15330
|
};
|
|
15331
|
+
|
|
14896
15332
|
// KNMI Geoservices Layers List
|
|
15333
|
+
|
|
14897
15334
|
var radarLayer = {
|
|
14898
15335
|
service: KNMIgeoservicesRadar.url,
|
|
14899
15336
|
name: 'RAD_NL25_PCP_CM',
|
|
@@ -14997,7 +15434,9 @@ var klimaatAtlasTG3 = {
|
|
|
14997
15434
|
id: webmapUtils.generateLayerId(),
|
|
14998
15435
|
layerType: LayerType.mapLayer
|
|
14999
15436
|
};
|
|
15437
|
+
|
|
15000
15438
|
// DWD Layers List
|
|
15439
|
+
|
|
15001
15440
|
var dwdWarningLayer = {
|
|
15002
15441
|
service: DWDWarnings.url,
|
|
15003
15442
|
name: 'Warnungen_Gemeinden_vereinigt',
|
|
@@ -15015,6 +15454,7 @@ var dwdRadarLayer = {
|
|
|
15015
15454
|
id: webmapUtils.generateLayerId(),
|
|
15016
15455
|
layerType: LayerType.mapLayer
|
|
15017
15456
|
};
|
|
15457
|
+
|
|
15018
15458
|
// this needs authentication to work
|
|
15019
15459
|
var dwdObservationsWetterLayer = {
|
|
15020
15460
|
service: DWDObservations.url,
|
|
@@ -15039,6 +15479,7 @@ var dwdObservationsWetterLayerWithHeader = {
|
|
|
15039
15479
|
value: 'Basic aW50cmFuZXQtdXNlcjpDQnMjMTEh'
|
|
15040
15480
|
}]
|
|
15041
15481
|
};
|
|
15482
|
+
|
|
15042
15483
|
// this needs authentication to work
|
|
15043
15484
|
var dwdObservationsWindLayer = {
|
|
15044
15485
|
service: DWDObservations.url,
|
|
@@ -15049,7 +15490,9 @@ var dwdObservationsWindLayer = {
|
|
|
15049
15490
|
id: webmapUtils.generateLayerId(),
|
|
15050
15491
|
layerType: LayerType.mapLayer
|
|
15051
15492
|
};
|
|
15493
|
+
|
|
15052
15494
|
// FMI open wms Layers List
|
|
15495
|
+
|
|
15053
15496
|
var FMITemp = {
|
|
15054
15497
|
service: FMIopenwms.url,
|
|
15055
15498
|
name: 'temperature-forecast',
|
|
@@ -15058,7 +15501,9 @@ var FMITemp = {
|
|
|
15058
15501
|
id: webmapUtils.generateLayerId(),
|
|
15059
15502
|
layerType: LayerType.mapLayer
|
|
15060
15503
|
};
|
|
15504
|
+
|
|
15061
15505
|
// Met Norway Layers List
|
|
15506
|
+
|
|
15062
15507
|
var MetNoTemp = {
|
|
15063
15508
|
service: MetNorwayService.url,
|
|
15064
15509
|
name: 'thredds_meps_latest_wind',
|
|
@@ -15228,7 +15673,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15228
15673
|
if (!isOverlay && !isBaseLayer) {
|
|
15229
15674
|
switch (layerType) {
|
|
15230
15675
|
case LayerType.mapLayer:
|
|
15231
|
-
return jsx(TimeawareImageSourceWMSLayer, {
|
|
15676
|
+
return /*#__PURE__*/jsx(TimeawareImageSourceWMSLayer, {
|
|
15232
15677
|
debugMode: debugMode,
|
|
15233
15678
|
dimensions: dimensions,
|
|
15234
15679
|
getCapsURL: service,
|
|
@@ -15242,7 +15687,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15242
15687
|
visible: !!(enabled !== false)
|
|
15243
15688
|
});
|
|
15244
15689
|
case LayerType.wmtsMapLayer:
|
|
15245
|
-
return jsx(TimeAwareWMTSLayer, {
|
|
15690
|
+
return /*#__PURE__*/jsx(TimeAwareWMTSLayer, {
|
|
15246
15691
|
debugMode: debugMode,
|
|
15247
15692
|
dimensions: dimensions,
|
|
15248
15693
|
getCapsURL: service,
|
|
@@ -15260,7 +15705,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15260
15705
|
var parameterNames = (options === null || options === void 0 ? void 0 : options.parameterNames.join(',')) || '';
|
|
15261
15706
|
var multiParam = Array.isArray(options === null || options === void 0 ? void 0 : options.parameterNames) && options.parameterNames.length > 1;
|
|
15262
15707
|
var styleLike = style !== undefined ? styleNameToStyleLike(style, multiParam) : undefined;
|
|
15263
|
-
return jsx(TimeAwareEDRLocationLayer, {
|
|
15708
|
+
return /*#__PURE__*/jsx(TimeAwareEDRLocationLayer, {
|
|
15264
15709
|
dimensions: dimensions,
|
|
15265
15710
|
edrBaseUrl: service,
|
|
15266
15711
|
layerId: id,
|
|
@@ -15274,7 +15719,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15274
15719
|
}
|
|
15275
15720
|
case LayerType.stacGeoTIFFLayer:
|
|
15276
15721
|
{
|
|
15277
|
-
return jsx(TimeAwareGeoTIFFLayer, {
|
|
15722
|
+
return /*#__PURE__*/jsx(TimeAwareGeoTIFFLayer, {
|
|
15278
15723
|
dimensions: dimensions,
|
|
15279
15724
|
layerId: id,
|
|
15280
15725
|
layerName: id,
|
|
@@ -15289,6 +15734,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15289
15734
|
return null;
|
|
15290
15735
|
}
|
|
15291
15736
|
}
|
|
15737
|
+
|
|
15292
15738
|
// Check the other layers
|
|
15293
15739
|
if (isBaseLayer || isOverlay) {
|
|
15294
15740
|
var type = layerProps.type,
|
|
@@ -15325,7 +15771,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15325
15771
|
if (!urlTemplate) {
|
|
15326
15772
|
console.warn("Tile server type ".concat(tileServerType, " not supported"), tileServerSettings, tileServer);
|
|
15327
15773
|
}
|
|
15328
|
-
return jsx(XYZLayer, {
|
|
15774
|
+
return /*#__PURE__*/jsx(XYZLayer, {
|
|
15329
15775
|
layerOptions: _objectSpread2(_objectSpread2({}, layerOptions), {}, {
|
|
15330
15776
|
minZoom: tileSettingForCRS === null || tileSettingForCRS === void 0 ? void 0 : tileSettingForCRS.minLevel,
|
|
15331
15777
|
maxZoom: tileSettingForCRS === null || tileSettingForCRS === void 0 ? void 0 : tileSettingForCRS.maxLevel
|
|
@@ -15338,7 +15784,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15338
15784
|
});
|
|
15339
15785
|
}
|
|
15340
15786
|
} else if (_name && _service) {
|
|
15341
|
-
return jsx(WMSLayer, {
|
|
15787
|
+
return /*#__PURE__*/jsx(WMSLayer, {
|
|
15342
15788
|
layerName: _name,
|
|
15343
15789
|
layerOptions: layerOptions,
|
|
15344
15790
|
layerProps: layerProps,
|
|
@@ -15346,12 +15792,30 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
15346
15792
|
url: _service
|
|
15347
15793
|
});
|
|
15348
15794
|
} else if (baseLayer) {
|
|
15349
|
-
return jsx(DefaultBaseLayers, {});
|
|
15795
|
+
return /*#__PURE__*/jsx(DefaultBaseLayers, {});
|
|
15350
15796
|
}
|
|
15351
15797
|
}
|
|
15352
|
-
return jsx("div", {});
|
|
15798
|
+
return /*#__PURE__*/jsx("div", {});
|
|
15353
15799
|
};
|
|
15354
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
|
+
|
|
15355
15819
|
var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
15356
15820
|
var displayMapPin = _ref.displayMapPin,
|
|
15357
15821
|
disableMapPin = _ref.disableMapPin,
|
|
@@ -15403,13 +15867,31 @@ var OpenLayersGetFeatureInfo = function OpenLayersGetFeatureInfo(_ref) {
|
|
|
15403
15867
|
if (!displayMapPin) {
|
|
15404
15868
|
return null;
|
|
15405
15869
|
}
|
|
15406
|
-
return jsx(FeatureLayer, {
|
|
15870
|
+
return /*#__PURE__*/jsx(FeatureLayer, {
|
|
15407
15871
|
features: features,
|
|
15408
15872
|
style: style,
|
|
15409
15873
|
zIndex: 9000
|
|
15410
15874
|
});
|
|
15411
15875
|
};
|
|
15412
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
|
+
|
|
15413
15895
|
var OpenLayersZoomControl = function OpenLayersZoomControl(_ref) {
|
|
15414
15896
|
var homeExtent = _ref.homeExtent;
|
|
15415
15897
|
var _useContext = useContext(MapContext),
|
|
@@ -15422,7 +15904,7 @@ var OpenLayersZoomControl = function OpenLayersZoomControl(_ref) {
|
|
|
15422
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;
|
|
15423
15905
|
};
|
|
15424
15906
|
var duration = OPENLAYERS_MOUSEWHEEL_DURATION;
|
|
15425
|
-
return jsx(ZoomControls, {
|
|
15907
|
+
return /*#__PURE__*/jsx(ZoomControls, {
|
|
15426
15908
|
onZoomIn: function onZoomIn() {
|
|
15427
15909
|
var view = getView();
|
|
15428
15910
|
view === null || view === void 0 || view.animate({
|
|
@@ -15453,15 +15935,15 @@ var OpenLayersZoomControl = function OpenLayersZoomControl(_ref) {
|
|
|
15453
15935
|
});
|
|
15454
15936
|
};
|
|
15455
15937
|
|
|
15456
|
-
var MapFeatureClass
|
|
15457
|
-
(function (MapFeatureClass) {
|
|
15938
|
+
var MapFeatureClass = /*#__PURE__*/function (MapFeatureClass) {
|
|
15458
15939
|
MapFeatureClass["MyLocation"] = "MyLocation";
|
|
15459
15940
|
MapFeatureClass["GenericMarker"] = "GenericMarker";
|
|
15460
15941
|
MapFeatureClass["ObservationStation"] = "ObservationStation";
|
|
15461
15942
|
MapFeatureClass["EDRFeature"] = "EDRFeature";
|
|
15462
15943
|
MapFeatureClass["EDRMultiPolygon"] = "EDRMultiPolygon";
|
|
15463
15944
|
MapFeatureClass["default"] = "default";
|
|
15464
|
-
|
|
15945
|
+
return MapFeatureClass;
|
|
15946
|
+
}({});
|
|
15465
15947
|
var FEATURE_FILL = new Fill({
|
|
15466
15948
|
color: FEATURE_DRAW_FILL_COLOR_TRANSPARENT
|
|
15467
15949
|
});
|
|
@@ -15528,6 +16010,7 @@ var ICON_LOCATIONMARKER_MODIFY = createIconStyle(locationPath, {
|
|
|
15528
16010
|
anchor: [0.5, 1]
|
|
15529
16011
|
}
|
|
15530
16012
|
});
|
|
16013
|
+
|
|
15531
16014
|
// Pre-rendered canvas for the rotate icon so we can create
|
|
15532
16015
|
// dynamically rotated instances that follow the box orientation.
|
|
15533
16016
|
var ROTATE_ICON_SIZE = [24, 24];
|
|
@@ -15542,10 +16025,12 @@ var ROTATE_ICON_CANVAS = typeof document !== 'undefined' ? function () {
|
|
|
15542
16025
|
return undefined;
|
|
15543
16026
|
}
|
|
15544
16027
|
var path = new Path2D(rotatePath);
|
|
16028
|
+
|
|
15545
16029
|
// Draw a white outline behind the rotate icon for better contrast
|
|
15546
16030
|
ctx.lineWidth = 1.5;
|
|
15547
16031
|
ctx.strokeStyle = 'rgba(255, 255, 255, 1)';
|
|
15548
16032
|
ctx.stroke(path);
|
|
16033
|
+
|
|
15549
16034
|
// Fill the actual rotate icon
|
|
15550
16035
|
ctx.fillStyle = '#051039';
|
|
15551
16036
|
ctx.fill(path);
|
|
@@ -15679,6 +16164,7 @@ var FEATURE_MY_LOCATION = new Style$1({
|
|
|
15679
16164
|
pixelRatio = state.pixelRatio;
|
|
15680
16165
|
var coord = pixelCoordinates;
|
|
15681
16166
|
ctx.save();
|
|
16167
|
+
|
|
15682
16168
|
// Draw outer circle with shadow
|
|
15683
16169
|
ctx.strokeStyle = '#fff';
|
|
15684
16170
|
ctx.fillStyle = '#fff';
|
|
@@ -15688,11 +16174,13 @@ var FEATURE_MY_LOCATION = new Style$1({
|
|
|
15688
16174
|
ctx.arc(coord[0], coord[1], 12 * pixelRatio, 0, 2 * Math.PI);
|
|
15689
16175
|
ctx.fill();
|
|
15690
16176
|
ctx.shadowBlur = 0;
|
|
16177
|
+
|
|
15691
16178
|
// Draw inner circle
|
|
15692
16179
|
ctx.fillStyle = '#186dff';
|
|
15693
16180
|
ctx.beginPath();
|
|
15694
16181
|
ctx.arc(coord[0], coord[1], 9 * pixelRatio, 0, 2 * Math.PI);
|
|
15695
16182
|
ctx.fill();
|
|
16183
|
+
|
|
15696
16184
|
// Reset transformations
|
|
15697
16185
|
ctx.restore();
|
|
15698
16186
|
}
|
|
@@ -15704,6 +16192,7 @@ var getFeaturePointStyle = function getFeaturePointStyle(fillColor, fillOpacity)
|
|
|
15704
16192
|
pixelRatio = state.pixelRatio;
|
|
15705
16193
|
var coord = pixelCoordinates;
|
|
15706
16194
|
ctx.save();
|
|
16195
|
+
|
|
15707
16196
|
// Use provided fillColor and fillOpacity, or fallback to default
|
|
15708
16197
|
ctx.fillStyle = fillColor ? geowebColorToOpenLayersColor(fillColor, fillOpacity || 1) : FEATURE_DRAW_FILL_COLOR;
|
|
15709
16198
|
ctx.shadowColor = '#fff';
|
|
@@ -15758,6 +16247,7 @@ var labelOptions = {
|
|
|
15758
16247
|
var labelBaseStyle = new Style$1({
|
|
15759
16248
|
text: new Text(labelOptions)
|
|
15760
16249
|
});
|
|
16250
|
+
|
|
15761
16251
|
// Multi-polygons need separate handling to only draw single label
|
|
15762
16252
|
var multiPolygonLabelBaseStyle = new Style$1({
|
|
15763
16253
|
text: new Text(labelOptions),
|
|
@@ -15769,6 +16259,7 @@ var multiPolygonLabelBaseStyle = new Style$1({
|
|
|
15769
16259
|
return largestPolygon.getInteriorPoint();
|
|
15770
16260
|
}
|
|
15771
16261
|
});
|
|
16262
|
+
|
|
15772
16263
|
// MultiLineStrings need separate handling to only draw single label
|
|
15773
16264
|
var multiLineStringLabelBaseStyle = new Style$1({
|
|
15774
16265
|
text: new Text(labelOptions),
|
|
@@ -15947,6 +16438,7 @@ var geowebColorToOpenLayersColor = function geowebColorToOpenLayersColor(color,
|
|
|
15947
16438
|
var opacityNumber = Math.min(Math.max(0, Number.parseFloat("".concat(opacity))), 255 / 256);
|
|
15948
16439
|
var bitsPerColor = color.length - 1 >= 6 ? 8 : 4;
|
|
15949
16440
|
var resultingColor = color.split('');
|
|
16441
|
+
|
|
15950
16442
|
// Remove existing opacity bits if set
|
|
15951
16443
|
if (bitsPerColor === 8 && resultingColor.length > 6 + 1) {
|
|
15952
16444
|
resultingColor.splice(6 + 1);
|
|
@@ -16006,6 +16498,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
16006
16498
|
if (geom instanceof LineString) {
|
|
16007
16499
|
var coords = geom.getCoordinates();
|
|
16008
16500
|
var smoothed = catmullRomSpline(coords, 16);
|
|
16501
|
+
|
|
16009
16502
|
// Smoothed line
|
|
16010
16503
|
return new Style$1({
|
|
16011
16504
|
geometry: new LineString(smoothed),
|
|
@@ -16018,6 +16511,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
16018
16511
|
return undefined;
|
|
16019
16512
|
}
|
|
16020
16513
|
var shouldHighlight = geometry && geometry.getType() !== 'Point' && mapFeatureClass !== MapFeatureClass.ObservationStation && !showNameOnHover && selectionType !== 'fir';
|
|
16514
|
+
|
|
16021
16515
|
// Highlight map polygons on hover
|
|
16022
16516
|
if (hover && shouldHighlight) {
|
|
16023
16517
|
return new Style$1({
|
|
@@ -16051,6 +16545,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
16051
16545
|
var styleOrFunction = stylesByMapFeatureClass[mapFeatureClass || MapFeatureClass["default"]];
|
|
16052
16546
|
return typeof styleOrFunction === 'function' ? styleOrFunction(feature, resolution) : styleOrFunction;
|
|
16053
16547
|
};
|
|
16548
|
+
|
|
16054
16549
|
// Used for polygons, boxes and linestrings
|
|
16055
16550
|
var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature) {
|
|
16056
16551
|
var _feature$getGeometry;
|
|
@@ -16059,6 +16554,7 @@ var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature)
|
|
|
16059
16554
|
fill: FEATURE_FILL
|
|
16060
16555
|
})];
|
|
16061
16556
|
}
|
|
16557
|
+
|
|
16062
16558
|
// LineStrings, this includes Polygons being drawn (OL Draw has them as LineStrings until the Polygon is ready)
|
|
16063
16559
|
return [
|
|
16064
16560
|
// Style for the line
|
|
@@ -16078,6 +16574,7 @@ var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature)
|
|
|
16078
16574
|
}
|
|
16079
16575
|
})];
|
|
16080
16576
|
};
|
|
16577
|
+
|
|
16081
16578
|
// Simple Catmull-Rom spline smoothing
|
|
16082
16579
|
var catmullRomSpline = function catmullRomSpline(points) {
|
|
16083
16580
|
var numPoints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
|
|
@@ -16091,6 +16588,7 @@ var catmullRomSpline = function catmullRomSpline(points) {
|
|
|
16091
16588
|
var p1 = points[i];
|
|
16092
16589
|
var p2 = points[i + 1];
|
|
16093
16590
|
var p3 = (_points2 = points[i + 2]) !== null && _points2 !== void 0 ? _points2 : p2;
|
|
16591
|
+
|
|
16094
16592
|
// always include the control point
|
|
16095
16593
|
result.push(p1);
|
|
16096
16594
|
for (var pointIndex = 1; pointIndex < numPoints; pointIndex += 1) {
|
|
@@ -16102,6 +16600,7 @@ var catmullRomSpline = function catmullRomSpline(points) {
|
|
|
16102
16600
|
result.push([x, y]);
|
|
16103
16601
|
}
|
|
16104
16602
|
}
|
|
16603
|
+
|
|
16105
16604
|
// include the very last control point
|
|
16106
16605
|
result.push(points[points.length - 1]);
|
|
16107
16606
|
return result;
|
|
@@ -16143,6 +16642,7 @@ new Style$1({
|
|
|
16143
16642
|
}),
|
|
16144
16643
|
// Vertices
|
|
16145
16644
|
FEATURE_VERTICES_EDIT_HANDLES];
|
|
16645
|
+
|
|
16146
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.
|
|
16147
16647
|
// For squares the box scales uniformly around the fixed center.
|
|
16148
16648
|
// For rectangles the diagonal opposite corner does not change, the other two corners are recomputed.
|
|
@@ -16155,6 +16655,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16155
16655
|
if (!originalRing || !modifiedRing || originalRing.length < 4) {
|
|
16156
16656
|
return originalGeometry;
|
|
16157
16657
|
}
|
|
16658
|
+
|
|
16158
16659
|
// Strip closing coordinate if present so we only work with the four corners.
|
|
16159
16660
|
var stripClose = function stripClose(ring) {
|
|
16160
16661
|
if (ring.length > 4 && ring[0][0] === ring[ring.length - 1][0] && ring[0][1] === ring[ring.length - 1][1]) {
|
|
@@ -16167,6 +16668,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16167
16668
|
if (originalCorners.length < 4 || modifiedCorners.length < 4) {
|
|
16168
16669
|
return originalGeometry;
|
|
16169
16670
|
}
|
|
16671
|
+
|
|
16170
16672
|
// Detect which corner was dragged by comparing original vs modified
|
|
16171
16673
|
var draggedCornerIndex = originalCorners.findIndex(function (orig, idx) {
|
|
16172
16674
|
var mod = modifiedCorners[idx];
|
|
@@ -16177,6 +16679,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16177
16679
|
return originalGeometry;
|
|
16178
16680
|
}
|
|
16179
16681
|
var dragged = modifiedCorners[draggedCornerIndex];
|
|
16682
|
+
|
|
16180
16683
|
// Compute center of the original box
|
|
16181
16684
|
var centerX = originalCorners.reduce(function (sum, _ref) {
|
|
16182
16685
|
var _ref2 = _slicedToArray(_ref, 1),
|
|
@@ -16188,6 +16691,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16188
16691
|
y = _ref4[1];
|
|
16189
16692
|
return sum + y;
|
|
16190
16693
|
}, 0) / originalCorners.length;
|
|
16694
|
+
|
|
16191
16695
|
// Derive local axes from the original box so we can preserve its
|
|
16192
16696
|
// rotation. Use the edges from corner 0 to its two neighbours.
|
|
16193
16697
|
var p0 = originalCorners[0];
|
|
@@ -16207,6 +16711,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16207
16711
|
var uy = edgeUy / edgeUlength;
|
|
16208
16712
|
var vx = edgeVx / edgeVlenght;
|
|
16209
16713
|
var vy = edgeVy / edgeVlenght;
|
|
16714
|
+
|
|
16210
16715
|
// Remember which corner is which
|
|
16211
16716
|
var cornerSigns = [{
|
|
16212
16717
|
sx: -1,
|
|
@@ -16222,6 +16727,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16222
16727
|
sy: 1
|
|
16223
16728
|
}];
|
|
16224
16729
|
var minSize = 1e-6;
|
|
16730
|
+
|
|
16225
16731
|
// Squares keep their center fixed and scale uniformly from the
|
|
16226
16732
|
// dragged corner.
|
|
16227
16733
|
if (keepSquare) {
|
|
@@ -16248,32 +16754,40 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16248
16754
|
newCorners.push(newCorners[0]);
|
|
16249
16755
|
return new Polygon([newCorners]);
|
|
16250
16756
|
}
|
|
16757
|
+
|
|
16251
16758
|
// Rectangles (non-squares) should resize using the dragged
|
|
16252
16759
|
// corner while keeping the diagonal opposite anchored. The two remaining
|
|
16253
16760
|
// corners adjust accordingly, and the overall rotation is kept. When the
|
|
16254
16761
|
// dragged corner crosses past the center, the rectangle is allowed to
|
|
16255
16762
|
// "flip" instead of bouncing back.
|
|
16763
|
+
|
|
16256
16764
|
// Diagonal corner relative to the dragged one in the 4-corner ring
|
|
16257
16765
|
var anchorIndex = (draggedCornerIndex + 2) % originalCorners.length;
|
|
16258
16766
|
var anchor = originalCorners[anchorIndex];
|
|
16767
|
+
|
|
16259
16768
|
// Vector from anchored corner to dragged corner, in world space
|
|
16260
16769
|
var deltaWx = dragged[0] - anchor[0];
|
|
16261
16770
|
var deltaWy = dragged[1] - anchor[1];
|
|
16771
|
+
|
|
16262
16772
|
// Express that vector in the local (u, v) frame
|
|
16263
16773
|
var deltaLocalX = deltaWx * ux + deltaWy * uy;
|
|
16264
16774
|
var deltaLocalY = deltaWx * vx + deltaWy * vy;
|
|
16775
|
+
|
|
16265
16776
|
// Half-sizes in local coordinates. We keep the sign so that when the
|
|
16266
16777
|
// dragged corner crosses past the anchor along either axis, the
|
|
16267
16778
|
// rectangle flips instead of being clamped.
|
|
16268
16779
|
var halfWidth = deltaLocalX / 2;
|
|
16269
16780
|
var halfHeight = deltaLocalY / 2;
|
|
16781
|
+
|
|
16270
16782
|
// Center in local coordinates is halfway between anchor (0,0) and
|
|
16271
16783
|
// dragged (deltaLocalX, deltaLocalY).
|
|
16272
16784
|
var centerLocalX = halfWidth;
|
|
16273
16785
|
var centerLocalY = halfHeight;
|
|
16786
|
+
|
|
16274
16787
|
// Convert center back to world coordinates.
|
|
16275
16788
|
var centerXNew = anchor[0] + centerLocalX * ux + centerLocalY * vx;
|
|
16276
16789
|
var centerYNew = anchor[1] + centerLocalX * uy + centerLocalY * vy;
|
|
16790
|
+
|
|
16277
16791
|
// Rebuild the four corners in local coordinates around the new center.
|
|
16278
16792
|
var localCorners = [[-halfWidth, -halfHeight], [halfWidth, -halfHeight], [halfWidth, halfHeight], [-halfWidth, halfHeight]];
|
|
16279
16793
|
var newCornersWorld = localCorners.map(function (_ref5) {
|
|
@@ -16284,6 +16798,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16284
16798
|
var worldY = centerYNew + lx * uy + ly * vy;
|
|
16285
16799
|
return [worldX, worldY];
|
|
16286
16800
|
});
|
|
16801
|
+
|
|
16287
16802
|
// Normalise corner order so index 0..3 always correspond to
|
|
16288
16803
|
// bottom-left, bottom-right, top-right, top-left in the box's
|
|
16289
16804
|
// local frame. This keeps rotate-handle orientation and
|
|
@@ -16316,6 +16831,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16316
16831
|
return corner.qx === -1 && corner.qy === 1;
|
|
16317
16832
|
})) === null || _classified$find4 === void 0 ? void 0 : _classified$find4.corner;
|
|
16318
16833
|
var orderedCorners = bl && br && tr && tl ? [bl, br, tr, tl] : newCornersWorld;
|
|
16834
|
+
|
|
16319
16835
|
// Close the ring
|
|
16320
16836
|
orderedCorners.push(orderedCorners[0]);
|
|
16321
16837
|
return new Polygon([orderedCorners]);
|
|
@@ -16330,8 +16846,10 @@ var getBoxRotateHandlePoints = function getBoxRotateHandlePoints(feature, resolu
|
|
|
16330
16846
|
if (ring.length < 4) {
|
|
16331
16847
|
return undefined;
|
|
16332
16848
|
}
|
|
16849
|
+
|
|
16333
16850
|
// First four coordinates are the corners of the box (possibly rotated)
|
|
16334
16851
|
var corners = ring.slice(0, 4);
|
|
16852
|
+
|
|
16335
16853
|
// Compute box center as the average of the corners
|
|
16336
16854
|
var centerX = corners.reduce(function (sum, _ref7) {
|
|
16337
16855
|
var _ref8 = _slicedToArray(_ref7, 1),
|
|
@@ -16343,6 +16861,7 @@ var getBoxRotateHandlePoints = function getBoxRotateHandlePoints(feature, resolu
|
|
|
16343
16861
|
y = _ref0[1];
|
|
16344
16862
|
return sum + y;
|
|
16345
16863
|
}, 0) / corners.length;
|
|
16864
|
+
|
|
16346
16865
|
// Place the rotate handle at a nearly constant distance from the
|
|
16347
16866
|
// corner in screen space, independent of how large the box is.
|
|
16348
16867
|
// We move a fixed number of pixels along the outward diagonal
|
|
@@ -16385,6 +16904,7 @@ var boxModificationStyle = function boxModificationStyle(feature, resolution) {
|
|
|
16385
16904
|
var handlePoints = getBoxRotateHandlePoints(feature, resolution);
|
|
16386
16905
|
var activeIndexRaw = feature.get('activeRotateHandleIndex');
|
|
16387
16906
|
var activeIndex = typeof activeIndexRaw === 'number' && activeIndexRaw >= 0 && activeIndexRaw < 4 ? activeIndexRaw : undefined;
|
|
16907
|
+
|
|
16388
16908
|
// While the box is being modified (corner drag), hide the rotate
|
|
16389
16909
|
// handle so only sizing handles are visible.
|
|
16390
16910
|
var suppressRotateHandle = feature.get('suppressRotateHandle');
|
|
@@ -16394,8 +16914,10 @@ var boxModificationStyle = function boxModificationStyle(feature, resolution) {
|
|
|
16394
16914
|
h1 = _handlePoints[1],
|
|
16395
16915
|
h2 = _handlePoints[2],
|
|
16396
16916
|
h3 = _handlePoints[3];
|
|
16917
|
+
|
|
16397
16918
|
// Base angle: along the edge between first two corner handles.
|
|
16398
16919
|
var baseAngle = Math.atan2(h1[1] - h0[1], h1[0] - h0[0]);
|
|
16920
|
+
|
|
16399
16921
|
// Assign per-corner offsets.
|
|
16400
16922
|
var handleConfigs = [{
|
|
16401
16923
|
point: h0,
|
|
@@ -16434,6 +16956,7 @@ var boxModificationStyle = function boxModificationStyle(feature, resolution) {
|
|
|
16434
16956
|
var circleFeatureStyle = function circleFeatureStyle(feature, resolution) {
|
|
16435
16957
|
// use OL default styles to keep circle edge tracking
|
|
16436
16958
|
var styles = createDefaultStyle(feature, resolution);
|
|
16959
|
+
|
|
16437
16960
|
// modify stroke + fill
|
|
16438
16961
|
styles.forEach(function (style) {
|
|
16439
16962
|
if (style.getStroke()) {
|
|
@@ -16445,6 +16968,7 @@ var circleFeatureStyle = function circleFeatureStyle(feature, resolution) {
|
|
|
16445
16968
|
});
|
|
16446
16969
|
return styles;
|
|
16447
16970
|
};
|
|
16971
|
+
|
|
16448
16972
|
// Create an ellipse geometry from center + two drag points
|
|
16449
16973
|
var createEllipsePolygon = function createEllipsePolygon(center, last) {
|
|
16450
16974
|
// Radii along x and y
|
|
@@ -16452,10 +16976,12 @@ var createEllipsePolygon = function createEllipsePolygon(center, last) {
|
|
|
16452
16976
|
var ry = Math.abs(last[1] - center[1]);
|
|
16453
16977
|
var points = [];
|
|
16454
16978
|
var steps = 64; // smoothness
|
|
16979
|
+
|
|
16455
16980
|
for (var i = 0; i < steps; i += 1) {
|
|
16456
16981
|
var theta = i / steps * 2 * Math.PI;
|
|
16457
16982
|
points.push([center[0] + rx * Math.cos(theta), center[1] + ry * Math.sin(theta)]);
|
|
16458
16983
|
}
|
|
16984
|
+
|
|
16459
16985
|
// Ensure the ring is closed
|
|
16460
16986
|
if (points.length > 0) {
|
|
16461
16987
|
points.push(points[0]);
|
|
@@ -16521,8 +17047,8 @@ var modifyStyles = {
|
|
|
16521
17047
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
16522
17048
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
16523
17049
|
* */
|
|
16524
|
-
|
|
16525
|
-
|
|
17050
|
+
|
|
17051
|
+
var DRAWMODE = /*#__PURE__*/function (DRAWMODE) {
|
|
16526
17052
|
DRAWMODE["POLYGON"] = "POLYGON";
|
|
16527
17053
|
DRAWMODE["BOX"] = "BOX";
|
|
16528
17054
|
DRAWMODE["MULTIPOINT"] = "MULTIPOINT";
|
|
@@ -16535,7 +17061,10 @@ var DRAWMODE;
|
|
|
16535
17061
|
DRAWMODE["LOCATION"] = "LOCATION";
|
|
16536
17062
|
DRAWMODE["FREEHANDLINE"] = "FREEHANDLINE";
|
|
16537
17063
|
DRAWMODE["ROTATABLEBOX"] = "ROTATABLEBOX";
|
|
16538
|
-
|
|
17064
|
+
return DRAWMODE;
|
|
17065
|
+
}({});
|
|
17066
|
+
|
|
17067
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
16539
17068
|
|
|
16540
17069
|
var createDrawOperation = function createDrawOperation(type) {
|
|
16541
17070
|
switch (type) {
|
|
@@ -16623,6 +17152,7 @@ var selectionTypeToDrawModeValue = function selectionTypeToDrawModeValue(selecti
|
|
|
16623
17152
|
return DRAWMODE.POLYGON;
|
|
16624
17153
|
}
|
|
16625
17154
|
};
|
|
17155
|
+
|
|
16626
17156
|
/**
|
|
16627
17157
|
* Integrates with OpenLayers Draw and Modify (+Snap) interactions, to implement feature drawing
|
|
16628
17158
|
* and modification behaviour.
|
|
@@ -16718,6 +17248,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16718
17248
|
if (obj.geometry && 'coordinates' in obj.geometry) {
|
|
16719
17249
|
obj.geometry.coordinates = roundCoordinates(obj.geometry.coordinates);
|
|
16720
17250
|
}
|
|
17251
|
+
|
|
16721
17252
|
// copy properties
|
|
16722
17253
|
obj.properties = _objectSpread2({}, selectedFeature === null || selectedFeature === void 0 ? void 0 : selectedFeature.properties);
|
|
16723
17254
|
var newGeoJson = _objectSpread2(_objectSpread2({}, geojson), {}, {
|
|
@@ -16725,12 +17256,14 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16725
17256
|
});
|
|
16726
17257
|
updateGeojson === null || updateGeojson === void 0 || updateGeojson(newGeoJson, NEW_FEATURE_CREATED);
|
|
16727
17258
|
};
|
|
17259
|
+
|
|
16728
17260
|
// Draw functionality, for drawing new polygons/linestrings/boxes/markers
|
|
16729
17261
|
var draw = new Draw(_objectSpread2({
|
|
16730
17262
|
source: source,
|
|
16731
17263
|
style: drawStyle
|
|
16732
17264
|
}, drawOperation));
|
|
16733
17265
|
var drawingFinishedBy = 'escaped'; // default
|
|
17266
|
+
|
|
16734
17267
|
draw.on('drawabort', function () {
|
|
16735
17268
|
exitDrawModeCallback === null || exitDrawModeCallback === void 0 || exitDrawModeCallback('escaped');
|
|
16736
17269
|
});
|
|
@@ -16764,6 +17297,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16764
17297
|
draw.on('drawstart', function () {
|
|
16765
17298
|
map.getViewport().addEventListener('click', handleClickNearPolygonStartPoint);
|
|
16766
17299
|
});
|
|
17300
|
+
|
|
16767
17301
|
// Handle doubleClick instead of shiftClick
|
|
16768
17302
|
var handleDoubleClickToClosePolygon = function handleDoubleClickToClosePolygon(event) {
|
|
16769
17303
|
if (event.detail === 2 && event.button === 0) {
|
|
@@ -16799,6 +17333,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16799
17333
|
});
|
|
16800
17334
|
map.getViewport().style.cursor = hasViewOnlyHit ? 'pointer' : '';
|
|
16801
17335
|
}
|
|
17336
|
+
|
|
16802
17337
|
// Update which rotate handle is "active" so only that
|
|
16803
17338
|
// icon is rendered near the mouse when editing boxes/squares.
|
|
16804
17339
|
// While rotating, keep the originally clicked handle active.
|
|
@@ -16816,6 +17351,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16816
17351
|
} else {
|
|
16817
17352
|
var coord = map.getEventCoordinate(event);
|
|
16818
17353
|
var threshold = 18 * resolution; // enlarge hover hit area for rotate handle
|
|
17354
|
+
|
|
16819
17355
|
var closestIndex = -1;
|
|
16820
17356
|
var closestDist = Infinity;
|
|
16821
17357
|
handlePoints.forEach(function (_ref2, idx) {
|
|
@@ -16856,6 +17392,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16856
17392
|
var isSquare = actualDrawMode === DRAWMODE.SQUARE;
|
|
16857
17393
|
var isBoxOrSquareRotatable = actualDrawMode === DRAWMODE.ROTATABLEBOX || isSquare;
|
|
16858
17394
|
var isBoxOrSquare = actualDrawMode === DRAWMODE.BOX || isBoxOrSquareRotatable;
|
|
17395
|
+
|
|
16859
17396
|
// Modifying is a combination of Modify and Translate interactions
|
|
16860
17397
|
var modify = new Modify({
|
|
16861
17398
|
features: editFeatureCollection,
|
|
@@ -16866,6 +17403,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16866
17403
|
// Box is a special case:
|
|
16867
17404
|
// - Use a custom style to present the user with a box when dragging (even though the temp polygon is changing against box conditions)
|
|
16868
17405
|
// - When modification is done, define the box using the dragged corner and its opposite corner
|
|
17406
|
+
|
|
16869
17407
|
modify.on('modifystart', function (evt) {
|
|
16870
17408
|
var _feature$getGeometry2;
|
|
16871
17409
|
var feature = evt.features.getArray()[0];
|
|
@@ -16882,6 +17420,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16882
17420
|
var feature = evt.features.getArray()[0];
|
|
16883
17421
|
var boxPolygon = createBoxBasedOnModifiedVertex(feature.getGeometry(), feature.get('originalGeometry'), isSquare);
|
|
16884
17422
|
feature.setGeometry(boxPolygon);
|
|
17423
|
+
|
|
16885
17424
|
// Re-enable rotate handle visibility after modifying.
|
|
16886
17425
|
feature.unset('suppressRotateHandle', true);
|
|
16887
17426
|
var viewport = map.getViewport();
|
|
@@ -16911,12 +17450,14 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16911
17450
|
translate.on('translateend', function (evt) {
|
|
16912
17451
|
updateFeature(evt.features.getArray()[0]);
|
|
16913
17452
|
});
|
|
17453
|
+
|
|
16914
17454
|
// Rotation handling for boxes and squares using the visual rotate handles
|
|
16915
17455
|
var isRotating = false;
|
|
16916
17456
|
var rotationCenter = null;
|
|
16917
17457
|
var rotationStartAngle = 0;
|
|
16918
17458
|
var originalRing = null;
|
|
16919
17459
|
var disabledDragPans = [];
|
|
17460
|
+
|
|
16920
17461
|
// Track when the user has pressed down near a resize corner so we can
|
|
16921
17462
|
// immediately show a grabbing cursor on mousedown (before any movement).
|
|
16922
17463
|
var isPointerDownNearCorner = false;
|
|
@@ -16984,6 +17525,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16984
17525
|
if (!ring || ring.length < 4) {
|
|
16985
17526
|
return;
|
|
16986
17527
|
}
|
|
17528
|
+
|
|
16987
17529
|
// Exclude possible closing coordinate
|
|
16988
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;
|
|
16989
17531
|
var clickCoord = map.getEventCoordinate(event);
|
|
@@ -16991,6 +17533,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16991
17533
|
if (!resolution) {
|
|
16992
17534
|
return;
|
|
16993
17535
|
}
|
|
17536
|
+
|
|
16994
17537
|
// Use the same helper for handle locations as the style code,
|
|
16995
17538
|
// so visual position and click area are consistent.
|
|
16996
17539
|
var handlePoints = getBoxRotateHandlePoints(featureToRotate, resolution);
|
|
@@ -16998,6 +17541,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16998
17541
|
return;
|
|
16999
17542
|
}
|
|
17000
17543
|
var threshold = 12 * resolution; // enlarge click hit area for rotate handle
|
|
17544
|
+
|
|
17001
17545
|
// Determine which handle was clicked (nearest within threshold)
|
|
17002
17546
|
var closestIndex = -1;
|
|
17003
17547
|
var closestDist = Infinity;
|
|
@@ -17016,6 +17560,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17016
17560
|
if (closestIndex === -1 || closestDist > threshold) {
|
|
17017
17561
|
return;
|
|
17018
17562
|
}
|
|
17563
|
+
|
|
17019
17564
|
// Lock the active rotate handle index so its icon stays visible
|
|
17020
17565
|
var handleFeature = editFeatureCollection.item(0);
|
|
17021
17566
|
if (handleFeature) {
|
|
@@ -17023,6 +17568,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17023
17568
|
layer.changed();
|
|
17024
17569
|
}
|
|
17025
17570
|
isRotating = true;
|
|
17571
|
+
|
|
17026
17572
|
// Temporarily disable map panning while rotating so the
|
|
17027
17573
|
// underlying map does not move when dragging the rotate handle.
|
|
17028
17574
|
disabledDragPans = [];
|
|
@@ -17064,11 +17610,13 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17064
17610
|
y = _ref1[1];
|
|
17065
17611
|
return [x, y];
|
|
17066
17612
|
});
|
|
17613
|
+
|
|
17067
17614
|
// While rotating, show a grabbing cursor on the map viewport
|
|
17068
17615
|
var viewport = map.getViewport();
|
|
17069
17616
|
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
17070
17617
|
viewport.style.cursor = 'grabbing';
|
|
17071
17618
|
}
|
|
17619
|
+
|
|
17072
17620
|
// While rotating, disable modify/translate to avoid conflicts
|
|
17073
17621
|
modify.setActive(false);
|
|
17074
17622
|
translate.setActive(false);
|
|
@@ -17120,12 +17668,14 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17120
17668
|
rotationCenter = null;
|
|
17121
17669
|
rotationStartAngle = 0;
|
|
17122
17670
|
originalRing = null;
|
|
17671
|
+
|
|
17123
17672
|
// Re-enable any drag-pan interactions we disabled when rotation
|
|
17124
17673
|
// started so normal map panning works again.
|
|
17125
17674
|
disabledDragPans.forEach(function (interaction) {
|
|
17126
17675
|
return interaction.setActive(true);
|
|
17127
17676
|
});
|
|
17128
17677
|
disabledDragPans = [];
|
|
17678
|
+
|
|
17129
17679
|
// Restore the default cursor when rotation stops
|
|
17130
17680
|
var viewport = map.getViewport();
|
|
17131
17681
|
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
@@ -17170,6 +17720,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17170
17720
|
viewport.addEventListener('pointerdown', startRotateIfOnHandle);
|
|
17171
17721
|
viewport.addEventListener('pointermove', rotateOnPointerMove);
|
|
17172
17722
|
viewport.addEventListener('pointerup', endRotate);
|
|
17723
|
+
|
|
17173
17724
|
// Ensure the grabbing cursor appears immediately when pressing on a
|
|
17174
17725
|
// resize corner, not only after the pointer starts moving.
|
|
17175
17726
|
viewport.addEventListener('pointerdown', handlePointerDownNearCorner);
|
|
@@ -17221,6 +17772,7 @@ var emptyPoint = _objectSpread2(_objectSpread2({}, featurePoint), {}, {
|
|
|
17221
17772
|
var emptyPolygon = _objectSpread2(_objectSpread2({}, featurePolygon), {}, {
|
|
17222
17773
|
properties: defaultGeoJSONStyleProperties
|
|
17223
17774
|
});
|
|
17775
|
+
|
|
17224
17776
|
// TODO: improve this: without a feature, the custom shape does not work on first click
|
|
17225
17777
|
var emptyIntersectionShape = _objectSpread2(_objectSpread2({}, emptyGeoJSON), {}, {
|
|
17226
17778
|
features: [featurePolygon]
|
|
@@ -17228,28 +17780,28 @@ var emptyIntersectionShape = _objectSpread2(_objectSpread2({}, emptyGeoJSON), {}
|
|
|
17228
17780
|
var getIcon = function getIcon(selectionType) {
|
|
17229
17781
|
switch (selectionType) {
|
|
17230
17782
|
case 'point':
|
|
17231
|
-
return jsx(DrawToolPoint, {});
|
|
17783
|
+
return /*#__PURE__*/jsx(DrawToolPoint, {});
|
|
17232
17784
|
case 'poly':
|
|
17233
|
-
return jsx(DrawToolPolygon, {});
|
|
17785
|
+
return /*#__PURE__*/jsx(DrawToolPolygon, {});
|
|
17234
17786
|
case 'box':
|
|
17235
17787
|
case 'rotatable-box':
|
|
17236
|
-
return jsx(DrawToolRectangle, {});
|
|
17788
|
+
return /*#__PURE__*/jsx(DrawToolRectangle, {});
|
|
17237
17789
|
case 'linestring':
|
|
17238
|
-
return jsx(DrawToolLineString, {});
|
|
17790
|
+
return /*#__PURE__*/jsx(DrawToolLineString, {});
|
|
17239
17791
|
case 'delete':
|
|
17240
|
-
return jsx(Delete, {});
|
|
17792
|
+
return /*#__PURE__*/jsx(Delete, {});
|
|
17241
17793
|
case 'square':
|
|
17242
|
-
return jsx(DrawToolSquare, {});
|
|
17794
|
+
return /*#__PURE__*/jsx(DrawToolSquare, {});
|
|
17243
17795
|
case 'circle':
|
|
17244
|
-
return jsx(DrawToolCircle, {});
|
|
17796
|
+
return /*#__PURE__*/jsx(DrawToolCircle, {});
|
|
17245
17797
|
case 'oval':
|
|
17246
|
-
return jsx(DrawToolOval, {});
|
|
17798
|
+
return /*#__PURE__*/jsx(DrawToolOval, {});
|
|
17247
17799
|
case 'freehand-line':
|
|
17248
|
-
return jsx(DrawToolFreehand, {});
|
|
17800
|
+
return /*#__PURE__*/jsx(DrawToolFreehand, {});
|
|
17249
17801
|
case 'smooth-line':
|
|
17250
|
-
return jsx(DrawToolSmoothLine, {});
|
|
17802
|
+
return /*#__PURE__*/jsx(DrawToolSmoothLine, {});
|
|
17251
17803
|
case 'location':
|
|
17252
|
-
return jsx(Location, {});
|
|
17804
|
+
return /*#__PURE__*/jsx(Location, {});
|
|
17253
17805
|
default:
|
|
17254
17806
|
return null;
|
|
17255
17807
|
}
|
|
@@ -17379,6 +17931,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17379
17931
|
return mode.value === 'DELETE';
|
|
17380
17932
|
}) || defaultDelete;
|
|
17381
17933
|
drawModesWithDeleteLast.push(deleteOption);
|
|
17934
|
+
|
|
17382
17935
|
// geoJSON feature collections
|
|
17383
17936
|
var _React$useState = React.useState(defaultGeoJSON),
|
|
17384
17937
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -17439,6 +17992,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17439
17992
|
return;
|
|
17440
17993
|
}
|
|
17441
17994
|
setActiveTool(newMode.isSelectable ? newMode.drawModeId : '');
|
|
17995
|
+
|
|
17442
17996
|
// add shape and update feature layer index
|
|
17443
17997
|
var isNewSelectedTool = !isGeoJSONFeatureCreatedByTool(geoJSON, newMode.selectionType, featureLayerIndex);
|
|
17444
17998
|
var shouldAddNewShape = !geoJSON.features.length || isNewSelectedTool || !newMode.isSelectable || shouldAllowMultipleShapes;
|
|
@@ -17446,6 +18000,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17446
18000
|
var updatedGeoJSON = changeGeoJSON(addSelectionTypeToGeoJSON(newMode.shape, newMode.selectionType))[0];
|
|
17447
18001
|
setFeatureLayerIndex(updatedGeoJSON.features.length - 1);
|
|
17448
18002
|
}
|
|
18003
|
+
|
|
17449
18004
|
// handle modes
|
|
17450
18005
|
setDrawMode(newMode.value);
|
|
17451
18006
|
setIsInEditMode(!!newMode.value && newMode.isSelectable);
|
|
@@ -17529,6 +18084,7 @@ var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
|
17529
18084
|
selectedFeatureIndex: featureLayerIndex
|
|
17530
18085
|
};
|
|
17531
18086
|
}
|
|
18087
|
+
|
|
17532
18088
|
// intersections
|
|
17533
18089
|
return {
|
|
17534
18090
|
id: layerId,
|
|
@@ -17582,12 +18138,12 @@ var GeoJSONTextField = function GeoJSONTextField(_ref) {
|
|
|
17582
18138
|
setIsValid(false);
|
|
17583
18139
|
}
|
|
17584
18140
|
};
|
|
17585
|
-
return jsx(Grid, {
|
|
18141
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
17586
18142
|
size: {
|
|
17587
18143
|
xs: 12
|
|
17588
18144
|
},
|
|
17589
18145
|
sx: sx,
|
|
17590
|
-
children: jsx(TextField, {
|
|
18146
|
+
children: /*#__PURE__*/jsx(TextField, {
|
|
17591
18147
|
disabled: !onChangeGeoJSON,
|
|
17592
18148
|
error: !isValid,
|
|
17593
18149
|
label: !isValid ? 'GeoJSON not valid' : title,
|
|
@@ -17611,6 +18167,24 @@ var GeoJSONTextField = function GeoJSONTextField(_ref) {
|
|
|
17611
18167
|
});
|
|
17612
18168
|
};
|
|
17613
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
|
+
|
|
17614
18188
|
var FeatureLayers = function FeatureLayers(_ref) {
|
|
17615
18189
|
var geojson = _ref.geojson,
|
|
17616
18190
|
onChangeLayerIndex = _ref.onChangeLayerIndex,
|
|
@@ -17624,20 +18198,20 @@ var FeatureLayers = function FeatureLayers(_ref) {
|
|
|
17624
18198
|
label: "".concat(index + 1, ": ").concat(geojson.features[index].geometry.type)
|
|
17625
18199
|
};
|
|
17626
18200
|
}) : [];
|
|
17627
|
-
return jsx(Grid, {
|
|
18201
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
17628
18202
|
size: {
|
|
17629
18203
|
sm: 12
|
|
17630
18204
|
},
|
|
17631
|
-
children: jsxs(FormControl, {
|
|
18205
|
+
children: /*#__PURE__*/jsxs(FormControl, {
|
|
17632
18206
|
disabled: !featureLayerList.length,
|
|
17633
18207
|
sx: {
|
|
17634
18208
|
width: '100%'
|
|
17635
18209
|
},
|
|
17636
18210
|
variant: "filled",
|
|
17637
|
-
children: [jsx(InputLabel, {
|
|
18211
|
+
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
17638
18212
|
id: "demo-feature-number",
|
|
17639
18213
|
children: "Features"
|
|
17640
|
-
}), jsx(Select, {
|
|
18214
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
17641
18215
|
labelId: "demo-feature-type",
|
|
17642
18216
|
onChange: function onChange(event) {
|
|
17643
18217
|
var featureNr = parseInt(event.target.value, 10);
|
|
@@ -17650,9 +18224,9 @@ var FeatureLayers = function FeatureLayers(_ref) {
|
|
|
17650
18224
|
},
|
|
17651
18225
|
value: (featureLayerList.length ? activeFeatureLayerIndex : '').toString(),
|
|
17652
18226
|
children: featureLayerList.map(function (listItem) {
|
|
17653
|
-
return jsxs(MenuItem, {
|
|
18227
|
+
return /*#__PURE__*/jsxs(MenuItem, {
|
|
17654
18228
|
value: listItem.index,
|
|
17655
|
-
children: [jsx(Icon$2, {
|
|
18229
|
+
children: [/*#__PURE__*/jsx(Icon$2, {
|
|
17656
18230
|
sx: {
|
|
17657
18231
|
transform: 'scale(0.9)'
|
|
17658
18232
|
},
|
|
@@ -17665,28 +18239,46 @@ var FeatureLayers = function FeatureLayers(_ref) {
|
|
|
17665
18239
|
});
|
|
17666
18240
|
};
|
|
17667
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
|
+
|
|
17668
18260
|
var EditModeButton = function EditModeButton(_ref) {
|
|
17669
18261
|
var isInEditMode = _ref.isInEditMode,
|
|
17670
18262
|
drawMode = _ref.drawMode,
|
|
17671
18263
|
onToggleEditMode = _ref.onToggleEditMode;
|
|
17672
|
-
return jsx(Grid, {
|
|
18264
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
17673
18265
|
size: {
|
|
17674
18266
|
xs: 12
|
|
17675
18267
|
},
|
|
17676
|
-
children: jsx(CustomTooltip, {
|
|
18268
|
+
children: /*#__PURE__*/jsx(CustomTooltip, {
|
|
17677
18269
|
title: "Switch mode",
|
|
17678
|
-
children: jsxs("span", {
|
|
17679
|
-
children: [jsx(FormLabel, {
|
|
18270
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
18271
|
+
children: [/*#__PURE__*/jsx(FormLabel, {
|
|
17680
18272
|
children: "View"
|
|
17681
|
-
}), jsx(Switch, {
|
|
18273
|
+
}), /*#__PURE__*/jsx(Switch, {
|
|
17682
18274
|
checked: isInEditMode,
|
|
17683
18275
|
"data-testid": "switchMode",
|
|
17684
18276
|
onClick: function onClick() {
|
|
17685
18277
|
return onToggleEditMode(!isInEditMode);
|
|
17686
18278
|
}
|
|
17687
|
-
}), jsx(FormLabel, {
|
|
18279
|
+
}), /*#__PURE__*/jsx(FormLabel, {
|
|
17688
18280
|
children: "Edit"
|
|
17689
|
-
}), !!drawMode && jsx(Typography, {
|
|
18281
|
+
}), !!drawMode && /*#__PURE__*/jsx(Typography, {
|
|
17690
18282
|
component: "span",
|
|
17691
18283
|
sx: {
|
|
17692
18284
|
display: 'inline-block',
|
|
@@ -17719,6 +18311,7 @@ var EditModeButton = function EditModeButton(_ref) {
|
|
|
17719
18311
|
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
17720
18312
|
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
17721
18313
|
* */
|
|
18314
|
+
|
|
17722
18315
|
var simplePolygonGeoJSON = {
|
|
17723
18316
|
type: 'FeatureCollection',
|
|
17724
18317
|
features: [{
|
|
@@ -18190,11 +18783,29 @@ var useGeoJSON = function useGeoJSON() {
|
|
|
18190
18783
|
};
|
|
18191
18784
|
};
|
|
18192
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
|
+
|
|
18193
18804
|
var StoryLayoutGrid = function StoryLayoutGrid(_ref) {
|
|
18194
18805
|
var mapComponent = _ref.mapComponent,
|
|
18195
18806
|
children = _ref.children;
|
|
18196
|
-
return jsx(Paper, {
|
|
18197
|
-
children: jsxs(Box, {
|
|
18807
|
+
return /*#__PURE__*/jsx(Paper, {
|
|
18808
|
+
children: /*#__PURE__*/jsxs(Box, {
|
|
18198
18809
|
sx: {
|
|
18199
18810
|
display: 'grid',
|
|
18200
18811
|
gridTemplateColumns: '70% 30%',
|
|
@@ -18203,21 +18814,21 @@ var StoryLayoutGrid = function StoryLayoutGrid(_ref) {
|
|
|
18203
18814
|
width: '100%',
|
|
18204
18815
|
height: '100vh'
|
|
18205
18816
|
},
|
|
18206
|
-
children: [jsx(Box, {
|
|
18817
|
+
children: [/*#__PURE__*/jsx(Box, {
|
|
18207
18818
|
sx: {
|
|
18208
18819
|
gridArea: 'map',
|
|
18209
18820
|
width: '100%',
|
|
18210
18821
|
height: '100%'
|
|
18211
18822
|
},
|
|
18212
18823
|
children: mapComponent
|
|
18213
|
-
}), jsx(Box, {
|
|
18824
|
+
}), /*#__PURE__*/jsx(Box, {
|
|
18214
18825
|
sx: {
|
|
18215
18826
|
gridArea: 'controls',
|
|
18216
18827
|
width: '100%',
|
|
18217
18828
|
height: '100%',
|
|
18218
18829
|
padding: 2
|
|
18219
18830
|
},
|
|
18220
|
-
children: jsx(Grid, {
|
|
18831
|
+
children: /*#__PURE__*/jsx(Grid, {
|
|
18221
18832
|
container: true,
|
|
18222
18833
|
spacing: 2,
|
|
18223
18834
|
children: children
|
|
@@ -18227,6 +18838,24 @@ var StoryLayoutGrid = function StoryLayoutGrid(_ref) {
|
|
|
18227
18838
|
});
|
|
18228
18839
|
};
|
|
18229
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
|
+
|
|
18230
18859
|
var SelectField = function SelectField(_ref) {
|
|
18231
18860
|
var label = _ref.label,
|
|
18232
18861
|
value = _ref.value,
|
|
@@ -18246,20 +18875,20 @@ var SelectField = function SelectField(_ref) {
|
|
|
18246
18875
|
var getLabel = function getLabel(currentValue) {
|
|
18247
18876
|
return "".concat(currentValue).concat(labelSuffix);
|
|
18248
18877
|
};
|
|
18249
|
-
return jsxs(FormControl, {
|
|
18878
|
+
return /*#__PURE__*/jsxs(FormControl, {
|
|
18250
18879
|
sx: {
|
|
18251
18880
|
width: width
|
|
18252
18881
|
},
|
|
18253
18882
|
variant: "filled",
|
|
18254
|
-
children: [jsx(InputLabel, {
|
|
18883
|
+
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
18255
18884
|
children: label
|
|
18256
|
-
}), jsx(Select, {
|
|
18885
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
18257
18886
|
onChange: onChange,
|
|
18258
18887
|
value: value,
|
|
18259
18888
|
children: options.map(function (value) {
|
|
18260
|
-
return jsx(MenuItem, {
|
|
18889
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
18261
18890
|
value: value,
|
|
18262
|
-
children: showValueAsColor ? jsx(Box, {
|
|
18891
|
+
children: showValueAsColor ? /*#__PURE__*/jsx(Box, {
|
|
18263
18892
|
sx: {
|
|
18264
18893
|
backgroundColor: value,
|
|
18265
18894
|
width: 20,
|
|
@@ -18281,19 +18910,19 @@ var IntersectionSelect = function IntersectionSelect(_ref) {
|
|
|
18281
18910
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
18282
18911
|
activeIntersection = _React$useState2[0],
|
|
18283
18912
|
setActiveIntersection = _React$useState2[1];
|
|
18284
|
-
return jsx(Grid, {
|
|
18913
|
+
return /*#__PURE__*/jsx(Grid, {
|
|
18285
18914
|
size: {
|
|
18286
18915
|
sm: 12
|
|
18287
18916
|
},
|
|
18288
|
-
children: jsxs(FormControl, {
|
|
18917
|
+
children: /*#__PURE__*/jsxs(FormControl, {
|
|
18289
18918
|
sx: {
|
|
18290
18919
|
width: '100%'
|
|
18291
18920
|
},
|
|
18292
18921
|
variant: "filled",
|
|
18293
|
-
children: [jsx(InputLabel, {
|
|
18922
|
+
children: [/*#__PURE__*/jsx(InputLabel, {
|
|
18294
18923
|
id: "demo-intersection",
|
|
18295
18924
|
children: "Intersection shapes"
|
|
18296
|
-
}), jsx(Select, {
|
|
18925
|
+
}), /*#__PURE__*/jsx(Select, {
|
|
18297
18926
|
disabled: isDisabled,
|
|
18298
18927
|
labelId: "demo-intersection",
|
|
18299
18928
|
onChange: function onChange(event) {
|
|
@@ -18306,7 +18935,7 @@ var IntersectionSelect = function IntersectionSelect(_ref) {
|
|
|
18306
18935
|
},
|
|
18307
18936
|
value: activeIntersection.toString(),
|
|
18308
18937
|
children: intersections.map(function (listItem, index) {
|
|
18309
|
-
return jsx(MenuItem, {
|
|
18938
|
+
return /*#__PURE__*/jsx(MenuItem, {
|
|
18310
18939
|
value: index,
|
|
18311
18940
|
children: listItem.title
|
|
18312
18941
|
}, listItem.title);
|
|
@@ -18325,13 +18954,14 @@ var getToolIcon = function getToolIcon(selectionType) {
|
|
|
18325
18954
|
return defaultIcon;
|
|
18326
18955
|
}
|
|
18327
18956
|
if (selectionType === shapeButtonNL$2.selectionType) {
|
|
18328
|
-
return jsx(DrawFIRLand, {});
|
|
18957
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18329
18958
|
}
|
|
18330
18959
|
if (selectionType === customLineButton.selectionType) {
|
|
18331
|
-
return jsx(ArrowUp, {});
|
|
18960
|
+
return /*#__PURE__*/jsx(ArrowUp, {});
|
|
18332
18961
|
}
|
|
18333
|
-
return jsx("div", {});
|
|
18962
|
+
return /*#__PURE__*/jsx("div", {});
|
|
18334
18963
|
};
|
|
18964
|
+
|
|
18335
18965
|
// custom buttons
|
|
18336
18966
|
var shapeButtonNL$2 = {
|
|
18337
18967
|
drawModeId: 'tool-fir',
|
|
@@ -18531,17 +19161,18 @@ var getIntersectionToolIcon = function getIntersectionToolIcon(selectionType) {
|
|
|
18531
19161
|
return defaultIcon;
|
|
18532
19162
|
}
|
|
18533
19163
|
if (selectionType === shapeButtonNL$1.selectionType) {
|
|
18534
|
-
return jsx(DrawFIRLand, {});
|
|
19164
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18535
19165
|
}
|
|
18536
19166
|
if (selectionType === shapeButtonBE$1.selectionType) {
|
|
18537
|
-
return jsx(DrawFIRLand, {
|
|
19167
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {
|
|
18538
19168
|
sx: {
|
|
18539
19169
|
transform: "scaleY(-1)"
|
|
18540
19170
|
}
|
|
18541
19171
|
});
|
|
18542
19172
|
}
|
|
18543
|
-
return jsx(DrawFIRLand, {});
|
|
19173
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18544
19174
|
};
|
|
19175
|
+
|
|
18545
19176
|
// custom buttons
|
|
18546
19177
|
var shapeButtonNL$1 = {
|
|
18547
19178
|
drawModeId: 'tool-fir',
|
|
@@ -18649,6 +19280,7 @@ var exampleIntersectionWithShapeOptions = {
|
|
|
18649
19280
|
};
|
|
18650
19281
|
|
|
18651
19282
|
var firSelectionType = 'fir';
|
|
19283
|
+
|
|
18652
19284
|
// styles and shapes
|
|
18653
19285
|
var featurePropertiesStart = defaultGeoJSONStyleProperties;
|
|
18654
19286
|
var featurePropertiesEnd = {
|
|
@@ -18677,6 +19309,7 @@ var intersectionShapeBE = {
|
|
|
18677
19309
|
properties: _objectSpread2({}, geoJSONIntersectionBoundsStyle)
|
|
18678
19310
|
})]
|
|
18679
19311
|
};
|
|
19312
|
+
|
|
18680
19313
|
// custom buttons
|
|
18681
19314
|
var shapeButtonNL = {
|
|
18682
19315
|
drawModeId: 'fir-tool-NL',
|
|
@@ -18704,13 +19337,13 @@ var getDoubleControlToolIcon = function getDoubleControlToolIcon(drawMode) {
|
|
|
18704
19337
|
return defaultIcon;
|
|
18705
19338
|
}
|
|
18706
19339
|
if (selectionType === firSelectionType) {
|
|
18707
|
-
return jsx(DrawFIRLand, {
|
|
19340
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {
|
|
18708
19341
|
sx: _objectSpread2({}, drawMode.title === shapeButtonBE.title && {
|
|
18709
19342
|
transform: "scaleY(-1)"
|
|
18710
19343
|
})
|
|
18711
19344
|
});
|
|
18712
19345
|
}
|
|
18713
|
-
return jsx(DrawFIRLand, {});
|
|
19346
|
+
return /*#__PURE__*/jsx(DrawFIRLand, {});
|
|
18714
19347
|
};
|
|
18715
19348
|
var getEditModes = function getEditModes(geoJSONProperties) {
|
|
18716
19349
|
return [_objectSpread2(_objectSpread2({}, defaultPoint), {}, {
|
|
@@ -18751,6 +19384,7 @@ var updateEditModeButtonsWithFir = function updateEditModeButtonsWithFir(drawMod
|
|
|
18751
19384
|
return mode;
|
|
18752
19385
|
});
|
|
18753
19386
|
};
|
|
19387
|
+
|
|
18754
19388
|
// example configs
|
|
18755
19389
|
var startToolExampleConfig = {
|
|
18756
19390
|
defaultGeoJSONIntersectionBounds: intersectionShapeNL,
|
|
@@ -18841,7 +19475,7 @@ var ClickOnMapTool = function ClickOnMapTool(_ref) {
|
|
|
18841
19475
|
map.removeEventListener('click', clickHandler);
|
|
18842
19476
|
};
|
|
18843
19477
|
}, [map, isActive, pointSelected]);
|
|
18844
|
-
return jsx(FeatureLayer, {
|
|
19478
|
+
return /*#__PURE__*/jsx(FeatureLayer, {
|
|
18845
19479
|
features: features,
|
|
18846
19480
|
style: isVisible ? pointStyle : [],
|
|
18847
19481
|
zIndex: layerZIndex
|
|
@@ -18860,6 +19494,7 @@ var metersToNauticalMiles = function metersToNauticalMiles(meters) {
|
|
|
18860
19494
|
}
|
|
18861
19495
|
return meters / METERS_PER_NAUTICAL_MILE;
|
|
18862
19496
|
};
|
|
19497
|
+
|
|
18863
19498
|
/**
|
|
18864
19499
|
* Converts two points to a bearing in degrees, relative to geographic north.
|
|
18865
19500
|
* The input coordinates are in the map projection.
|
|
@@ -18870,6 +19505,7 @@ var metersToNauticalMiles = function metersToNauticalMiles(meters) {
|
|
|
18870
19505
|
*/
|
|
18871
19506
|
var getBearingDegrees = function getBearingDegrees(p1, p2, projection) {
|
|
18872
19507
|
var sourceProjection = projection !== null && projection !== void 0 ? projection : 'EPSG:4326';
|
|
19508
|
+
|
|
18873
19509
|
// Transform from the map projection to geographic lon/lat
|
|
18874
19510
|
try {
|
|
18875
19511
|
var _transform = transform(p1, sourceProjection, 'EPSG:4326'),
|
|
@@ -18898,6 +19534,7 @@ var getBearingDegrees = function getBearingDegrees(p1, p2, projection) {
|
|
|
18898
19534
|
return NaN;
|
|
18899
19535
|
}
|
|
18900
19536
|
};
|
|
19537
|
+
|
|
18901
19538
|
/**
|
|
18902
19539
|
* Format measurements output.
|
|
18903
19540
|
* @param {LineString} line The line.
|
|
@@ -18949,6 +19586,7 @@ var makeToolTipOverlay = function makeToolTipOverlay() {
|
|
|
18949
19586
|
measureTooltipElement.style.position = 'relative';
|
|
18950
19587
|
measureTooltipElement.style.overflow = 'visible';
|
|
18951
19588
|
measureTooltipElement.style.pointerEvents = 'none';
|
|
19589
|
+
|
|
18952
19590
|
// Arrow pointing at the overlay position
|
|
18953
19591
|
var arrowElement = document.createElement('div');
|
|
18954
19592
|
arrowElement.style.position = 'absolute';
|
|
@@ -18991,6 +19629,7 @@ var makeHelpTooltip = function makeHelpTooltip(tooltipMsg) {
|
|
|
18991
19629
|
});
|
|
18992
19630
|
return overlay;
|
|
18993
19631
|
};
|
|
19632
|
+
|
|
18994
19633
|
/**
|
|
18995
19634
|
* Adds the measure line interaction to the map.
|
|
18996
19635
|
* @param map
|
|
@@ -19152,8 +19791,7 @@ var MapMeasure = function MapMeasure(_ref) {
|
|
|
19152
19791
|
// NOVEMBER = 'timeslider-november',
|
|
19153
19792
|
// DECEMBER = 'timeslider-december',
|
|
19154
19793
|
// }
|
|
19155
|
-
var DaysOfWeek
|
|
19156
|
-
(function (DaysOfWeek) {
|
|
19794
|
+
var DaysOfWeek = /*#__PURE__*/function (DaysOfWeek) {
|
|
19157
19795
|
DaysOfWeek["SUNDAY"] = "Sun";
|
|
19158
19796
|
DaysOfWeek["MONDAY"] = "Mon";
|
|
19159
19797
|
DaysOfWeek["TUESDAY"] = "Tue";
|
|
@@ -19161,9 +19799,9 @@ var DaysOfWeek;
|
|
|
19161
19799
|
DaysOfWeek["THURSDAY"] = "Thu";
|
|
19162
19800
|
DaysOfWeek["FRIDAY"] = "Fri";
|
|
19163
19801
|
DaysOfWeek["SATURDAY"] = "Sat";
|
|
19164
|
-
|
|
19165
|
-
|
|
19166
|
-
|
|
19802
|
+
return DaysOfWeek;
|
|
19803
|
+
}(DaysOfWeek || {});
|
|
19804
|
+
var MonthsOfTheYear = /*#__PURE__*/function (MonthsOfTheYear) {
|
|
19167
19805
|
MonthsOfTheYear["JANUARY"] = "Jan";
|
|
19168
19806
|
MonthsOfTheYear["FEBRUARY"] = "Feb";
|
|
19169
19807
|
MonthsOfTheYear["MARCH"] = "Mar";
|
|
@@ -19176,7 +19814,8 @@ var MonthsOfTheYear;
|
|
|
19176
19814
|
MonthsOfTheYear["OCTOBER"] = "Oct";
|
|
19177
19815
|
MonthsOfTheYear["NOVEMBER"] = "Nov";
|
|
19178
19816
|
MonthsOfTheYear["DECEMBER"] = "Dec";
|
|
19179
|
-
|
|
19817
|
+
return MonthsOfTheYear;
|
|
19818
|
+
}(MonthsOfTheYear || {});
|
|
19180
19819
|
var dateToManualFormatString = function dateToManualFormatString(inDate) {
|
|
19181
19820
|
if (!inDate) {
|
|
19182
19821
|
return 'Date not available';
|
|
@@ -19189,6 +19828,24 @@ var dateToManualFormatString = function dateToManualFormatString(inDate) {
|
|
|
19189
19828
|
return "".concat(EEE, " ").concat(dd, " ").concat(MMM, " ").concat(HH, ":").concat(mm, " UTC");
|
|
19190
19829
|
};
|
|
19191
19830
|
|
|
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
|
|
19835
|
+
*
|
|
19836
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19837
|
+
*
|
|
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
|
+
|
|
19192
19849
|
var getButtonSizes = function getButtonSizes(fontSize) {
|
|
19193
19850
|
if (fontSize > 40) {
|
|
19194
19851
|
return {
|
|
@@ -19223,9 +19880,9 @@ var ClockContainer = function ClockContainer(_ref) {
|
|
|
19223
19880
|
var _getButtonSizes = getButtonSizes(fontSize),
|
|
19224
19881
|
buttonSize = _getButtonSizes.buttonSize,
|
|
19225
19882
|
iconSize = _getButtonSizes.iconSize;
|
|
19226
|
-
return jsx(ThemeProvider, {
|
|
19883
|
+
return /*#__PURE__*/jsx(ThemeProvider, {
|
|
19227
19884
|
theme: darkTheme,
|
|
19228
|
-
children: jsxs(Grid, {
|
|
19885
|
+
children: /*#__PURE__*/jsxs(Grid, {
|
|
19229
19886
|
container: true,
|
|
19230
19887
|
sx: {
|
|
19231
19888
|
justifyContent: 'space-evenly',
|
|
@@ -19237,26 +19894,26 @@ var ClockContainer = function ClockContainer(_ref) {
|
|
|
19237
19894
|
borderRadius: '5px'
|
|
19238
19895
|
},
|
|
19239
19896
|
wrap: "nowrap",
|
|
19240
|
-
children: [jsx(Grid, {
|
|
19897
|
+
children: [/*#__PURE__*/jsx(Grid, {
|
|
19241
19898
|
sx: {
|
|
19242
19899
|
marginLeft: '12px',
|
|
19243
19900
|
marginRight: '12px'
|
|
19244
19901
|
},
|
|
19245
|
-
children: jsx(CustomIconButton, {
|
|
19902
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
19246
19903
|
"aria-label": title,
|
|
19247
19904
|
onClick: onToggleClock,
|
|
19248
19905
|
size: buttonSize,
|
|
19249
19906
|
tooltipTitle: title,
|
|
19250
19907
|
variant: "boxed",
|
|
19251
|
-
children: jsx(ChevronRight, {
|
|
19908
|
+
children: /*#__PURE__*/jsx(ChevronRight, {
|
|
19252
19909
|
sx: {
|
|
19253
19910
|
width: iconSize,
|
|
19254
19911
|
height: iconSize
|
|
19255
19912
|
}
|
|
19256
19913
|
})
|
|
19257
19914
|
})
|
|
19258
|
-
}), jsx(Grid, {
|
|
19259
|
-
children: jsx(Typography, {
|
|
19915
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
19916
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
19260
19917
|
sx: {
|
|
19261
19918
|
whiteSpace: 'nowrap',
|
|
19262
19919
|
fontSize: fontSize,
|
|
@@ -19265,12 +19922,12 @@ var ClockContainer = function ClockContainer(_ref) {
|
|
|
19265
19922
|
variant: "subtitle2",
|
|
19266
19923
|
children: currentDateString
|
|
19267
19924
|
})
|
|
19268
|
-
}), jsx(Grid, {
|
|
19925
|
+
}), /*#__PURE__*/jsx(Grid, {
|
|
19269
19926
|
sx: {
|
|
19270
19927
|
marginLeft: '12px',
|
|
19271
19928
|
marginRight: '12px'
|
|
19272
19929
|
},
|
|
19273
|
-
children: jsx(CustomIconButton, {
|
|
19930
|
+
children: /*#__PURE__*/jsx(CustomIconButton, {
|
|
19274
19931
|
"aria-label": optionsTitle,
|
|
19275
19932
|
isSelected: isOptionsMenuVisible,
|
|
19276
19933
|
onClick: onToggleOptions,
|
|
@@ -19278,7 +19935,7 @@ var ClockContainer = function ClockContainer(_ref) {
|
|
|
19278
19935
|
size: buttonSize,
|
|
19279
19936
|
tooltipTitle: optionsTitle,
|
|
19280
19937
|
variant: "boxed",
|
|
19281
|
-
children: jsx(Options, {
|
|
19938
|
+
children: /*#__PURE__*/jsx(Options, {
|
|
19282
19939
|
sx: {
|
|
19283
19940
|
width: iconSize,
|
|
19284
19941
|
height: iconSize
|
|
@@ -19337,6 +19994,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19337
19994
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
19338
19995
|
isResizing = _useState4[0],
|
|
19339
19996
|
setIsResizing = _useState4[1];
|
|
19997
|
+
|
|
19340
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
|
|
19341
19999
|
var fontSize = isResizing ? resizeFontSize : FONT_SIZE_WIDTH_RATIO * size.width;
|
|
19342
20000
|
var toggleClock = function toggleClock(isClockVisible) {
|
|
@@ -19351,8 +20009,8 @@ var Clock = function Clock(_ref2) {
|
|
|
19351
20009
|
var toggleOptions = function toggleOptions() {
|
|
19352
20010
|
onToggleOptions === null || onToggleOptions === void 0 || onToggleOptions();
|
|
19353
20011
|
};
|
|
19354
|
-
return jsx(Fragment, {
|
|
19355
|
-
children: !isClockVisible ? jsx(CustomIconButton, {
|
|
20012
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
20013
|
+
children: !isClockVisible ? /*#__PURE__*/jsx(CustomIconButton, {
|
|
19356
20014
|
"aria-label": t('clock-show'),
|
|
19357
20015
|
onClick: function onClick() {
|
|
19358
20016
|
toggleClock(true);
|
|
@@ -19365,8 +20023,8 @@ var Clock = function Clock(_ref2) {
|
|
|
19365
20023
|
},
|
|
19366
20024
|
tooltipTitle: t('clock-show'),
|
|
19367
20025
|
variant: "boxed",
|
|
19368
|
-
children: jsx(Clock$1, {})
|
|
19369
|
-
}) : jsx(Draggable, {
|
|
20026
|
+
children: /*#__PURE__*/jsx(Clock$1, {})
|
|
20027
|
+
}) : /*#__PURE__*/jsx(Draggable, {
|
|
19370
20028
|
bounds: "parent",
|
|
19371
20029
|
cancel: ".MuiButtonBase-root",
|
|
19372
20030
|
nodeRef: clockElement,
|
|
@@ -19377,7 +20035,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19377
20035
|
});
|
|
19378
20036
|
},
|
|
19379
20037
|
position: position,
|
|
19380
|
-
children: jsx("div", {
|
|
20038
|
+
children: /*#__PURE__*/jsx("div", {
|
|
19381
20039
|
ref: clockElement,
|
|
19382
20040
|
style: {
|
|
19383
20041
|
position: 'absolute',
|
|
@@ -19385,7 +20043,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19385
20043
|
top: '10px',
|
|
19386
20044
|
right: '10px'
|
|
19387
20045
|
},
|
|
19388
|
-
children: jsx(Resizable, {
|
|
20046
|
+
children: /*#__PURE__*/jsx(Resizable, {
|
|
19389
20047
|
enable: resizeHandlePlacement,
|
|
19390
20048
|
lockAspectRatio: true,
|
|
19391
20049
|
minHeight: MIN_HEIGHT,
|
|
@@ -19411,7 +20069,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19411
20069
|
});
|
|
19412
20070
|
},
|
|
19413
20071
|
size: size,
|
|
19414
|
-
children: jsx(ClockContainer, {
|
|
20072
|
+
children: /*#__PURE__*/jsx(ClockContainer, {
|
|
19415
20073
|
fontSize: fontSize,
|
|
19416
20074
|
isOptionsMenuVisible: isOptionsMenuVisible,
|
|
19417
20075
|
onToggleClock: function onToggleClock() {
|
|
@@ -19444,6 +20102,7 @@ var Clock = function Clock(_ref2) {
|
|
|
19444
20102
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
19445
20103
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
19446
20104
|
* */
|
|
20105
|
+
|
|
19447
20106
|
function getIsInsideAcceptanceTime(acceptanceTimeInMinutes, mapDimensions, layerDimensions) {
|
|
19448
20107
|
var _mapDimensions$find, _layerDimensions$find;
|
|
19449
20108
|
var mapCurrentTime = mapDimensions === null || mapDimensions === void 0 || (_mapDimensions$find = mapDimensions.find(function (dimension) {
|