@opengeoweb/webmap-react 9.28.1 → 9.29.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 +251 -245
- package/package.json +1 -1
- package/src/index.d.ts +5 -5
- package/src/lib/components/Axis/ProfileAxis.d.ts +8 -8
- package/src/lib/components/Axis/ProfileAxis.spec.d.ts +1 -1
- package/src/lib/components/Axis/ProfileAxis.stories.d.ts +9 -9
- package/src/lib/components/Axis/profileUtils.d.ts +17 -17
- package/src/lib/components/Axis/profileUtils.spec.d.ts +1 -1
- package/src/lib/components/LayerInfo/LayerInfoButton.d.ts +9 -9
- package/src/lib/components/LayerInfo/LayerInfoButton.spec.d.ts +1 -1
- package/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +14 -14
- package/src/lib/components/LayerInfo/LayerInfoDialog.spec.d.ts +1 -1
- package/src/lib/components/LayerInfo/LayerInfoDialog.stories.d.ts +25 -25
- package/src/lib/components/LayerInfo/LayerInfoLegend.d.ts +9 -9
- package/src/lib/components/LayerInfo/LayerInfoLegend.spec.d.ts +1 -1
- package/src/lib/components/LayerInfo/LayerInfoList.d.ts +11 -11
- package/src/lib/components/LayerInfo/LayerInfoText.d.ts +15 -15
- package/src/lib/components/LayerInfo/LayerInfoUtils.d.ts +9 -9
- package/src/lib/components/LayerInfo/LayerInfoUtils.spec.d.ts +1 -1
- package/src/lib/components/LayerInfo/index.d.ts +6 -6
- package/src/lib/components/Legend/Legend.d.ts +7 -7
- package/src/lib/components/Legend/Legend.spec.d.ts +1 -1
- package/src/lib/components/Legend/Legend.stories.d.ts +8 -8
- package/src/lib/components/Legend/LegendButton.d.ts +5 -5
- package/src/lib/components/Legend/LegendButton.spec.d.ts +1 -1
- package/src/lib/components/Legend/LegendDialog.d.ts +15 -15
- package/src/lib/components/Legend/LegendDialog.spec.d.ts +1 -1
- package/src/lib/components/Legend/LegendLayout.d.ts +13 -13
- package/src/lib/components/Legend/LegendLayout.spec.d.ts +1 -1
- package/src/lib/components/Legend/index.d.ts +4 -4
- package/src/lib/components/MapControls/MapControlButton.d.ts +10 -10
- package/src/lib/components/MapControls/MapControlButton.spec.d.ts +1 -1
- package/src/lib/components/MapControls/MapControls.d.ts +7 -7
- package/src/lib/components/MapControls/MapControls.spec.d.ts +1 -1
- package/src/lib/components/MapControls/ZoomControls.d.ts +8 -8
- package/src/lib/components/MapControls/ZoomControls.spec.d.ts +1 -1
- package/src/lib/components/MapControls/index.d.ts +3 -3
- package/src/lib/components/MapDimensionSelect/DimensionSelectButton.d.ts +8 -8
- package/src/lib/components/MapDimensionSelect/DimensionSelectButton.spec.d.ts +1 -1
- package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.d.ts +14 -14
- package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.stories.d.ts +29 -29
- package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.d.ts +14 -14
- package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.spec.d.ts +1 -1
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.d.ts +11 -11
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.spec.d.ts +1 -1
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.stories.d.ts +7 -7
- package/src/lib/components/MapDimensionSelect/index.d.ts +6 -6
- package/src/lib/components/MapDimensionSelect/utils.d.ts +17 -17
- package/src/lib/components/MapDimensionSelect/utils.spec.d.ts +1 -1
- package/src/lib/components/MapDraw/MapDraw.d.ts +158 -158
- package/src/lib/components/MapDraw/MapDraw.spec.d.ts +1 -1
- package/src/lib/components/MapDraw/MapDraw.stories.d.ts +37 -37
- package/src/lib/components/MapDraw/MapDrawContainer.d.ts +23 -23
- package/src/lib/components/MapDraw/MapDrawContainer.spec.d.ts +1 -1
- package/src/lib/components/MapDraw/geojsonShapes.d.ts +19 -19
- package/src/lib/components/MapDraw/index.d.ts +5 -5
- package/src/lib/components/MapDraw/mapDrawUtils.d.ts +44 -44
- package/src/lib/components/MapDraw/mapDrawUtils.spec.d.ts +1 -1
- package/src/lib/components/MapDraw/storyComponents/EditModeButton.d.ts +8 -8
- package/src/lib/components/MapDraw/storyComponents/FeatureInfo.d.ts +3 -3
- package/src/lib/components/MapDraw/storyComponents/FeatureInfoHTML.d.ts +3 -3
- package/src/lib/components/MapDraw/storyComponents/FeatureLayers.d.ts +9 -9
- package/src/lib/components/MapDraw/storyComponents/GeoJSONTextField.d.ts +11 -11
- package/src/lib/components/MapDraw/storyComponents/IntersectionSelect.d.ts +12 -12
- package/src/lib/components/MapDraw/storyComponents/MapDrawGeoJSON.d.ts +3 -3
- package/src/lib/components/MapDraw/storyComponents/SelectField.d.ts +10 -10
- package/src/lib/components/MapDraw/storyComponents/StoryLayout.d.ts +10 -10
- package/src/lib/components/MapDraw/storyComponents/StoryLayoutGrid.d.ts +5 -5
- package/src/lib/components/MapDraw/storyComponents/Synops.d.ts +3 -3
- package/src/lib/components/MapDraw/storyComponents/ToolButton.d.ts +10 -10
- package/src/lib/components/MapDraw/storyComponents/geojsonExamples.d.ts +12 -12
- package/src/lib/components/MapDraw/storyComponents/index.d.ts +8 -8
- package/src/lib/components/MapDraw/storyComponents/storyUtils.d.ts +49 -49
- package/src/lib/components/MapDrawTool/MapDrawTool.stories.d.ts +13 -13
- package/src/lib/components/MapDrawTool/MapDrawToolIntersection.stories.d.ts +11 -11
- package/src/lib/components/MapDrawTool/MapDrawToolMultipleDrawTools.stories.d.ts +6 -6
- package/src/lib/components/MapDrawTool/index.d.ts +7 -7
- package/src/lib/components/MapDrawTool/storyExamplesMapDrawTool.d.ts +10 -10
- package/src/lib/components/MapDrawTool/storyExamplesMapDrawToolIntersection.d.ts +10 -10
- package/src/lib/components/MapDrawTool/storyExamplesMapDrawToolMultipleDrawTools.d.ts +13 -13
- package/src/lib/components/MapDrawTool/types.d.ts +13 -13
- package/src/lib/components/MapDrawTool/useMapDrawTool.d.ts +53 -53
- package/src/lib/components/MapDrawTool/useMapDrawTool.spec.d.ts +1 -1
- package/src/lib/components/MapDrawTool/utils.d.ts +62 -62
- package/src/lib/components/MapDrawTool/utils.spec.d.ts +1 -1
- package/src/lib/components/MapTime/MapTime.d.ts +11 -11
- package/src/lib/components/MapTime/MapTime.spec.d.ts +1 -1
- package/src/lib/components/MapTime/index.d.ts +1 -1
- package/src/lib/components/MapView/MapView.Error.stories.d.ts +14 -14
- package/src/lib/components/MapView/MapView.MapPin.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.Passive.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.ProfileSounding.stories.d.ts +9 -9
- package/src/lib/components/MapView/MapView.RadarAnimation.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.RadarData.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.SetProjectionBBox.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.SetProjectionBBoxLocalState.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.ShiftToZoom.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.ShowLayerInfo.stories.d.ts +10 -10
- package/src/lib/components/MapView/MapView.TiledBaseLayers.stories.d.ts +22 -22
- package/src/lib/components/MapView/MapView.d.ts +8 -8
- package/src/lib/components/MapView/MapView.spec.d.ts +1 -1
- package/src/lib/components/MapView/MapViewLayer.d.ts +16 -16
- package/src/lib/components/MapView/index.d.ts +2 -2
- package/src/lib/components/MapWarning/MapWarningProperties.d.ts +23 -23
- package/src/lib/components/MapWarning/MapWarningProperties.spec.d.ts +1 -1
- package/src/lib/components/MapWarning/index.d.ts +1 -1
- package/src/lib/components/Providers/Providers.d.ts +3 -3
- package/src/lib/components/Providers/index.d.ts +1 -1
- package/src/lib/components/ReactMapView/ReactMapView.d.ts +64 -64
- package/src/lib/components/ReactMapView/ReactMapView.spec.d.ts +2 -2
- package/src/lib/components/ReactMapView/ReactMapViewLayer.d.ts +8 -8
- package/src/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +4 -4
- package/src/lib/components/ReactMapView/ReactMapViewParseLayer.spec.d.ts +1 -1
- package/src/lib/components/ReactMapView/index.d.ts +5 -5
- package/src/lib/components/ReactMapView/types.d.ts +88 -86
- package/src/lib/components/ReactMapView/utils.d.ts +26 -26
- package/src/lib/components/ReactMapView/utils.spec.d.ts +1 -1
- package/src/lib/components/index.d.ts +12 -12
- package/src/lib/index.d.ts +3 -3
- package/src/lib/layers/defaultLayers.d.ts +15 -15
- package/src/lib/layers/defaultStorybookSettings.d.ts +9 -9
- package/src/lib/layers/index.d.ts +3 -3
- package/src/lib/layers/profileLayers.d.ts +19 -19
- package/src/lib/layers/publicLayers.d.ts +310 -310
- package/src/lib/layers/publicServices.d.ts +90 -90
- package/src/lib/utils/i18n.d.ts +6 -6
package/index.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import React__default, { useRef, useState, useEffect } from 'react';
|
|
|
6
6
|
import { CustomTooltip, CanvasComponent, ToolContainerDraggable, CustomIconButton, dateUtils, PROJECTION } from '@opengeoweb/shared';
|
|
7
7
|
import i18n from 'i18next';
|
|
8
8
|
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
9
|
-
import { Paper, Box, Typography,
|
|
9
|
+
import { Paper, Box, Typography, Grid2, TextField, FormControl, InputLabel, Select, MenuItem, Icon as Icon$1, FormLabel, Switch, styled, Slider } from '@mui/material';
|
|
10
10
|
import { Home, Add, Minus, List, Delete, Edit, DrawRegion, DrawPolygon, Location, DrawFIRLand, ArrowUp, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime } from '@opengeoweb/theme';
|
|
11
11
|
import _, { cloneDeep } from 'lodash';
|
|
12
12
|
import * as turf from '@turf/turf';
|
|
@@ -17,7 +17,6 @@ import { debounce } from 'throttle-debounce';
|
|
|
17
17
|
import { useResizeDetector } from 'react-resize-detector';
|
|
18
18
|
import Box$1 from '@mui/material/Box';
|
|
19
19
|
import Typography$1 from '@mui/material/Typography';
|
|
20
|
-
import Grid$1 from '@mui/material/Grid';
|
|
21
20
|
|
|
22
21
|
var en = {
|
|
23
22
|
"webmap-react-event": "event:",
|
|
@@ -1933,13 +1932,13 @@ const LegendLayout = ({
|
|
|
1933
1932
|
|
|
1934
1933
|
const defaultCanvasWidth = 150;
|
|
1935
1934
|
const defaultCanvasHeight = 30;
|
|
1936
|
-
/**
|
|
1937
|
-
* Renders a legendgraphic image based on a WMImage.
|
|
1938
|
-
*
|
|
1939
|
-
* @param wmImage The wmImage element to render (from WMImage.js)
|
|
1940
|
-
* @param ctx The canvas to render the image on
|
|
1941
|
-
* @param width The width you want the image to have
|
|
1942
|
-
* @param height The height you want the image to have
|
|
1935
|
+
/**
|
|
1936
|
+
* Renders a legendgraphic image based on a WMImage.
|
|
1937
|
+
*
|
|
1938
|
+
* @param wmImage The wmImage element to render (from WMImage.js)
|
|
1939
|
+
* @param ctx The canvas to render the image on
|
|
1940
|
+
* @param width The width you want the image to have
|
|
1941
|
+
* @param height The height you want the image to have
|
|
1943
1942
|
*/
|
|
1944
1943
|
const renderLegendGraphic = (wmImage, ctx, width, height) => {
|
|
1945
1944
|
ctx.beginPath();
|
|
@@ -1998,7 +1997,7 @@ const Legend = ({
|
|
|
1998
1997
|
return null;
|
|
1999
1998
|
}
|
|
2000
1999
|
const layerOpacity = layer.opacity ? layer.opacity : 1;
|
|
2001
|
-
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
2000
|
+
/* Get the wmLayer, it has more detailed info about the WMS service,
|
|
2002
2001
|
like a title and the WMS legendgraphic url */
|
|
2003
2002
|
const wmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
2004
2003
|
return jsx(LegendLayout, Object.assign({
|
|
@@ -2012,9 +2011,9 @@ const Legend = ({
|
|
|
2012
2011
|
children: jsx(CanvasComponent, {
|
|
2013
2012
|
redrawInterval: 500,
|
|
2014
2013
|
onRenderCanvas: (ctx, width, height) => {
|
|
2015
|
-
/*
|
|
2016
|
-
Check if the wmLayer is available, this happens when the WMS GetCapabilities is loaded and parsed.
|
|
2017
|
-
Note that we cannot use the wmLayer variable above, as this one could contain a non initialized WMJSLayer.
|
|
2014
|
+
/*
|
|
2015
|
+
Check if the wmLayer is available, this happens when the WMS GetCapabilities is loaded and parsed.
|
|
2016
|
+
Note that we cannot use the wmLayer variable above, as this one could contain a non initialized WMJSLayer.
|
|
2018
2017
|
*/
|
|
2019
2018
|
const legendWmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
2020
2019
|
const legendUrl = getLegendGraphicURLForLayer(legendWmLayer);
|
|
@@ -2234,7 +2233,7 @@ const MapControls = _a => {
|
|
|
2234
2233
|
userSelect: 'none'
|
|
2235
2234
|
}
|
|
2236
2235
|
}, props, {
|
|
2237
|
-
children: jsx(
|
|
2236
|
+
children: jsx(Grid2, Object.assign({
|
|
2238
2237
|
sx: {
|
|
2239
2238
|
'& > button': {
|
|
2240
2239
|
marginBottom: 1
|
|
@@ -2997,8 +2996,8 @@ const generateDrawFunctionId = () => {
|
|
|
2997
2996
|
generatedDrawFunctionIds += 1;
|
|
2998
2997
|
return `drawFunctionId_${generatedDrawFunctionIds}`;
|
|
2999
2998
|
};
|
|
3000
|
-
/**
|
|
3001
|
-
* DrawFunction store for re-use of drawFunctions
|
|
2999
|
+
/**
|
|
3000
|
+
* DrawFunction store for re-use of drawFunctions
|
|
3002
3001
|
*/
|
|
3003
3002
|
const drawFunctionStore = [];
|
|
3004
3003
|
const getDrawFunctionFromStore = id => {
|
|
@@ -3018,22 +3017,22 @@ const NEW_LINESTRING_CREATED = translateKeyOutsideComponents('webmap-react-new-l
|
|
|
3018
3017
|
const NEW_FEATURE_CREATED = translateKeyOutsideComponents('webmap-react-new-feature');
|
|
3019
3018
|
const NEW_POINT_CREATED = translateKeyOutsideComponents('webmap-react-new-point');
|
|
3020
3019
|
|
|
3021
|
-
/* *
|
|
3022
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3023
|
-
* you may not use this file except in compliance with the License.
|
|
3024
|
-
* You may obtain a copy of the License at
|
|
3025
|
-
*
|
|
3026
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3027
|
-
*
|
|
3028
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
3029
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3030
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3031
|
-
* See the License for the specific language governing permissions and
|
|
3032
|
-
* limitations under the License.
|
|
3033
|
-
*
|
|
3034
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3035
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3036
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3020
|
+
/* *
|
|
3021
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3022
|
+
* you may not use this file except in compliance with the License.
|
|
3023
|
+
* You may obtain a copy of the License at
|
|
3024
|
+
*
|
|
3025
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3026
|
+
*
|
|
3027
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3028
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3029
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3030
|
+
* See the License for the specific language governing permissions and
|
|
3031
|
+
* limitations under the License.
|
|
3032
|
+
*
|
|
3033
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3034
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
3035
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
3037
3036
|
* */
|
|
3038
3037
|
const defaultGeoJSONStyleProperties = {
|
|
3039
3038
|
fill: '#ff7800',
|
|
@@ -3134,10 +3133,10 @@ var DRAGMODE;
|
|
|
3134
3133
|
DRAGMODE["VERTEX"] = "VERTEX";
|
|
3135
3134
|
DRAGMODE["FEATURE"] = "FEATURE";
|
|
3136
3135
|
})(DRAGMODE || (DRAGMODE = {}));
|
|
3137
|
-
/**
|
|
3138
|
-
* Initializes a new feature for given type
|
|
3139
|
-
* @param type
|
|
3140
|
-
* @returns
|
|
3136
|
+
/**
|
|
3137
|
+
* Initializes a new feature for given type
|
|
3138
|
+
* @param type
|
|
3139
|
+
* @returns
|
|
3141
3140
|
*/
|
|
3142
3141
|
const getNewFeature = type => {
|
|
3143
3142
|
switch (type) {
|
|
@@ -3356,8 +3355,7 @@ class MapDraw extends React.PureComponent {
|
|
|
3356
3355
|
const {
|
|
3357
3356
|
isInEditMode
|
|
3358
3357
|
} = this.props;
|
|
3359
|
-
|
|
3360
|
-
if (event.keyCode === ESCAPE_KEY) {
|
|
3358
|
+
if (event.key === 'Escape') {
|
|
3361
3359
|
this.handleExitDrawMode('escaped');
|
|
3362
3360
|
}
|
|
3363
3361
|
if (isInEditMode && (event.key === 'Delete' || event.key === 'Backspace')) {
|
|
@@ -3492,9 +3490,9 @@ class MapDraw extends React.PureComponent {
|
|
|
3492
3490
|
if ((event === null || event === void 0 ? void 0 : event.rightButton) === true) {
|
|
3493
3491
|
return undefined;
|
|
3494
3492
|
}
|
|
3495
|
-
/* mouseMove is an event callback function which is triggered when the mouse moves over the map
|
|
3496
|
-
This event is only triggered if the map is in hover state.
|
|
3497
|
-
E.g. when the map is dragging/panning, this event is not triggerd
|
|
3493
|
+
/* mouseMove is an event callback function which is triggered when the mouse moves over the map
|
|
3494
|
+
This event is only triggered if the map is in hover state.
|
|
3495
|
+
E.g. when the map is dragging/panning, this event is not triggerd
|
|
3498
3496
|
*/
|
|
3499
3497
|
const {
|
|
3500
3498
|
mouseX,
|
|
@@ -3579,13 +3577,13 @@ class MapDraw extends React.PureComponent {
|
|
|
3579
3577
|
// eslint-disable-next-line consistent-return
|
|
3580
3578
|
return false;
|
|
3581
3579
|
}
|
|
3582
|
-
/* We did not find anything under the mousecursor,
|
|
3583
|
-
return true means that the map will continue with its own mousehandling
|
|
3580
|
+
/* We did not find anything under the mousecursor,
|
|
3581
|
+
return true means that the map will continue with its own mousehandling
|
|
3584
3582
|
*/
|
|
3585
3583
|
if (this.mouseIsOverVertexNr === VERTEX.NONE && this.selectedEdge === EDGE.NONE) {
|
|
3586
3584
|
webmapjs.draw('MapDraw::mouseMove');
|
|
3587
3585
|
// eslint-disable-next-line consistent-return
|
|
3588
|
-
return true; /* False means that this component will take over entire controll.
|
|
3586
|
+
return true; /* False means that this component will take over entire controll.
|
|
3589
3587
|
True means that it is still possible to pan and drag the map while editing */
|
|
3590
3588
|
}
|
|
3591
3589
|
return undefined;
|
|
@@ -3680,10 +3678,10 @@ class MapDraw extends React.PureComponent {
|
|
|
3680
3678
|
}
|
|
3681
3679
|
return true;
|
|
3682
3680
|
}
|
|
3683
|
-
/**
|
|
3684
|
-
* This creates a new feature in the geojson features array at the selectedFeatureIndex location
|
|
3685
|
-
* @param event
|
|
3686
|
-
* @returns
|
|
3681
|
+
/**
|
|
3682
|
+
* This creates a new feature in the geojson features array at the selectedFeatureIndex location
|
|
3683
|
+
* @param event
|
|
3684
|
+
* @returns if a new feature is made
|
|
3687
3685
|
*/
|
|
3688
3686
|
createNewFeature(event) {
|
|
3689
3687
|
const {
|
|
@@ -3696,7 +3694,7 @@ class MapDraw extends React.PureComponent {
|
|
|
3696
3694
|
} = this.props;
|
|
3697
3695
|
const webmapjs = webmapUtils.getWMJSMapById(mapId);
|
|
3698
3696
|
if (!webmapjs) {
|
|
3699
|
-
return;
|
|
3697
|
+
return false;
|
|
3700
3698
|
}
|
|
3701
3699
|
if (this.myEditMode === EDITMODE.EMPTY) {
|
|
3702
3700
|
this.myEditMode = EDITMODE.ADD_FEATURE;
|
|
@@ -3755,7 +3753,8 @@ class MapDraw extends React.PureComponent {
|
|
|
3755
3753
|
if (polygonGeometry.coordinates[0] === undefined || polygonGeometry.coordinates[0].length === 0) {
|
|
3756
3754
|
polygonGeometry.coordinates[0] = []; /* Used to create the first polygon */
|
|
3757
3755
|
} else {
|
|
3758
|
-
|
|
3756
|
+
this.myEditMode = EDITMODE.EMPTY;
|
|
3757
|
+
return false;
|
|
3759
3758
|
}
|
|
3760
3759
|
this.snappedPolygonIndex = polygonGeometry.coordinates.length - 1;
|
|
3761
3760
|
const featureCoords = polygonGeometry.coordinates[this.snappedPolygonIndex];
|
|
@@ -3791,13 +3790,9 @@ class MapDraw extends React.PureComponent {
|
|
|
3791
3790
|
this.mouseIsOverVertexNr = featureCoords.length - 1;
|
|
3792
3791
|
}
|
|
3793
3792
|
webmapjs.draw('MapDraw::mouseDown');
|
|
3794
|
-
|
|
3795
|
-
// @ts-ignore
|
|
3796
|
-
return false;
|
|
3793
|
+
return true;
|
|
3797
3794
|
}
|
|
3798
|
-
|
|
3799
|
-
// @ts-ignore
|
|
3800
|
-
return true;
|
|
3795
|
+
return false;
|
|
3801
3796
|
}
|
|
3802
3797
|
/* This is triggered when new points are added during the addmultipoint mode. One point is added per time */
|
|
3803
3798
|
addPointToMultiPointFeature(event) {
|
|
@@ -3931,10 +3926,8 @@ class MapDraw extends React.PureComponent {
|
|
|
3931
3926
|
if (this.insertVertexInEdge(event) === false) {
|
|
3932
3927
|
return false;
|
|
3933
3928
|
}
|
|
3934
|
-
/* This
|
|
3935
|
-
|
|
3936
|
-
// @ts-ignore
|
|
3937
|
-
if (this.createNewFeature(event) === false) {
|
|
3929
|
+
/* This checks if a new feature should be created. */
|
|
3930
|
+
if (this.createNewFeature(event)) {
|
|
3938
3931
|
/* Start with mouse move from this mouse down location, enables sizing the box while moving the mouse */
|
|
3939
3932
|
this.mouseMove(event);
|
|
3940
3933
|
return false;
|
|
@@ -3951,7 +3944,7 @@ class MapDraw extends React.PureComponent {
|
|
|
3951
3944
|
if (this.addPointToLineStringFeature(event) === false) {
|
|
3952
3945
|
return false;
|
|
3953
3946
|
}
|
|
3954
|
-
return false; /* False means that this component will take over entire controll.
|
|
3947
|
+
return false; /* False means that this component will take over entire controll.
|
|
3955
3948
|
True means that it is still possible to pan and drag the map while editing */
|
|
3956
3949
|
}
|
|
3957
3950
|
deletePolygon(index) {
|
|
@@ -4331,9 +4324,9 @@ class MapDraw extends React.PureComponent {
|
|
|
4331
4324
|
}
|
|
4332
4325
|
}
|
|
4333
4326
|
beforeDraw(ctx) {
|
|
4334
|
-
/* beforeDraw is an event callback function which is triggered
|
|
4335
|
-
just before viewer will flip the back canvas buffer to the front.
|
|
4336
|
-
You are free to draw anything you like on the canvas.
|
|
4327
|
+
/* beforeDraw is an event callback function which is triggered
|
|
4328
|
+
just before viewer will flip the back canvas buffer to the front.
|
|
4329
|
+
You are free to draw anything you like on the canvas.
|
|
4337
4330
|
*/
|
|
4338
4331
|
var _a, _b, _c;
|
|
4339
4332
|
const {
|
|
@@ -4699,7 +4692,7 @@ class MapDraw extends React.PureComponent {
|
|
|
4699
4692
|
const image = webmapjs === null || webmapjs === void 0 ? void 0 : webmapjs.getMapImageStore.getImage(featureProperties.imageURL);
|
|
4700
4693
|
if (image.isLoaded() === false && image.hasError() === false && image.isLoading() === false) {
|
|
4701
4694
|
image.load();
|
|
4702
|
-
/* After the image is loaded the canvas will be redrawn and drawIcon will be triggered again
|
|
4695
|
+
/* After the image is loaded the canvas will be redrawn and drawIcon will be triggered again
|
|
4703
4696
|
via the beforecanvasdisplay listener. */
|
|
4704
4697
|
return undefined;
|
|
4705
4698
|
}
|
|
@@ -5154,9 +5147,10 @@ const GeoJSONTextField = ({
|
|
|
5154
5147
|
setValidity(false);
|
|
5155
5148
|
}
|
|
5156
5149
|
};
|
|
5157
|
-
return jsx(
|
|
5158
|
-
|
|
5159
|
-
|
|
5150
|
+
return jsx(Grid2, Object.assign({
|
|
5151
|
+
size: {
|
|
5152
|
+
xs: 12
|
|
5153
|
+
},
|
|
5160
5154
|
sx: sx
|
|
5161
5155
|
}, {
|
|
5162
5156
|
children: jsx(TextField, {
|
|
@@ -5197,9 +5191,10 @@ const FeatureLayers = ({
|
|
|
5197
5191
|
label: `${index + 1}: ${geojson.features[index].geometry.type}`
|
|
5198
5192
|
};
|
|
5199
5193
|
}) : [];
|
|
5200
|
-
return jsx(
|
|
5201
|
-
|
|
5202
|
-
|
|
5194
|
+
return jsx(Grid2, Object.assign({
|
|
5195
|
+
size: {
|
|
5196
|
+
sm: 12
|
|
5197
|
+
}
|
|
5203
5198
|
}, {
|
|
5204
5199
|
children: jsxs(FormControl, Object.assign({
|
|
5205
5200
|
disabled: !featureLayerList.length,
|
|
@@ -5248,9 +5243,10 @@ const EditModeButton = ({
|
|
|
5248
5243
|
drawMode,
|
|
5249
5244
|
onToggleEditMode
|
|
5250
5245
|
}) => {
|
|
5251
|
-
return jsx(
|
|
5252
|
-
|
|
5253
|
-
|
|
5246
|
+
return jsx(Grid2, Object.assign({
|
|
5247
|
+
size: {
|
|
5248
|
+
xs: 12
|
|
5249
|
+
}
|
|
5254
5250
|
}, {
|
|
5255
5251
|
children: jsx(CustomTooltip, Object.assign({
|
|
5256
5252
|
title: "Switch mode"
|
|
@@ -5281,22 +5277,22 @@ const EditModeButton = ({
|
|
|
5281
5277
|
}));
|
|
5282
5278
|
};
|
|
5283
5279
|
|
|
5284
|
-
/* *
|
|
5285
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5286
|
-
* you may not use this file except in compliance with the License.
|
|
5287
|
-
* You may obtain a copy of the License at
|
|
5288
|
-
*
|
|
5289
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5290
|
-
*
|
|
5291
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
5292
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5293
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5294
|
-
* See the License for the specific language governing permissions and
|
|
5295
|
-
* limitations under the License.
|
|
5296
|
-
*
|
|
5297
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5298
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
5299
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5280
|
+
/* *
|
|
5281
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5282
|
+
* you may not use this file except in compliance with the License.
|
|
5283
|
+
* You may obtain a copy of the License at
|
|
5284
|
+
*
|
|
5285
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
5286
|
+
*
|
|
5287
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
5288
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
5289
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
5290
|
+
* See the License for the specific language governing permissions and
|
|
5291
|
+
* limitations under the License.
|
|
5292
|
+
*
|
|
5293
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
5294
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
5295
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
5300
5296
|
* */
|
|
5301
5297
|
const simplePolygonGeoJSON = {
|
|
5302
5298
|
type: 'FeatureCollection',
|
|
@@ -5785,7 +5781,7 @@ const StoryLayoutGrid = ({
|
|
|
5785
5781
|
padding: 2
|
|
5786
5782
|
}
|
|
5787
5783
|
}, {
|
|
5788
|
-
children: jsx(
|
|
5784
|
+
children: jsx(Grid2, Object.assign({
|
|
5789
5785
|
spacing: 2,
|
|
5790
5786
|
container: true
|
|
5791
5787
|
}, {
|
|
@@ -5845,9 +5841,10 @@ const IntersectionSelect = ({
|
|
|
5845
5841
|
isDisabled: _isDisabled = false
|
|
5846
5842
|
}) => {
|
|
5847
5843
|
const [activeIntersection, setActiveIntersection] = React__default.useState(0);
|
|
5848
|
-
return jsx(
|
|
5849
|
-
|
|
5850
|
-
|
|
5844
|
+
return jsx(Grid2, Object.assign({
|
|
5845
|
+
size: {
|
|
5846
|
+
sm: 12
|
|
5847
|
+
}
|
|
5851
5848
|
}, {
|
|
5852
5849
|
children: jsxs(FormControl, Object.assign({
|
|
5853
5850
|
variant: "filled",
|
|
@@ -5885,12 +5882,12 @@ const IntersectionSelect = ({
|
|
|
5885
5882
|
}));
|
|
5886
5883
|
};
|
|
5887
5884
|
|
|
5888
|
-
/**
|
|
5889
|
-
* Adds properties to the first geojson feature based on the given property object.
|
|
5890
|
-
* It only extends or changes the properties which are defined in styleConfig,
|
|
5891
|
-
* all other properties in the geojson are left unchanged.
|
|
5892
|
-
* @param geojson
|
|
5893
|
-
* @param featureProperties
|
|
5885
|
+
/**
|
|
5886
|
+
* Adds properties to the first geojson feature based on the given property object.
|
|
5887
|
+
* It only extends or changes the properties which are defined in styleConfig,
|
|
5888
|
+
* all other properties in the geojson are left unchanged.
|
|
5889
|
+
* @param geojson
|
|
5890
|
+
* @param featureProperties
|
|
5894
5891
|
*/
|
|
5895
5892
|
const addFeatureProperties = (geojson, featureProperties, featureIndex = 0) => {
|
|
5896
5893
|
if (!geojson) {
|
|
@@ -5919,13 +5916,13 @@ const getGeoJSONPropertyValue = (property, properties, polygonDrawMode, defaultP
|
|
|
5919
5916
|
// otherwise get values from defaultStyle
|
|
5920
5917
|
return defaultProperties[property];
|
|
5921
5918
|
};
|
|
5922
|
-
/**
|
|
5923
|
-
* moves geoJSON feature as new feature. Mutates newGeoJSON
|
|
5924
|
-
* @constructor
|
|
5925
|
-
* @param {GeoJSON.FeatureCollection} currentGeoJSON - current geoJSON
|
|
5926
|
-
* @param {GeoJSON.FeatureCollection} newGeoJSON - new geoJSON
|
|
5927
|
-
* @param {number} featureLayerIndex - feature layer index
|
|
5928
|
-
* @param {string} text - reason of change
|
|
5919
|
+
/**
|
|
5920
|
+
* moves geoJSON feature as new feature. Mutates newGeoJSON
|
|
5921
|
+
* @constructor
|
|
5922
|
+
* @param {GeoJSON.FeatureCollection} currentGeoJSON - current geoJSON
|
|
5923
|
+
* @param {GeoJSON.FeatureCollection} newGeoJSON - new geoJSON
|
|
5924
|
+
* @param {number} featureLayerIndex - feature layer index
|
|
5925
|
+
* @param {string} text - reason of change
|
|
5929
5926
|
*/
|
|
5930
5927
|
const moveFeature = (currentGeoJSON, newGeoJSON, featureLayerIndex, reason, selectionType) => {
|
|
5931
5928
|
const feature = newGeoJSON.features[featureLayerIndex];
|
|
@@ -5974,11 +5971,11 @@ const moveFeature = (currentGeoJSON, newGeoJSON, featureLayerIndex, reason, sele
|
|
|
5974
5971
|
}
|
|
5975
5972
|
return undefined;
|
|
5976
5973
|
};
|
|
5977
|
-
/**
|
|
5978
|
-
* Returns the intersection of two point features. In case of a polygon, only the first feature is used.
|
|
5979
|
-
* @param a Feature A
|
|
5980
|
-
* @param b Feature B
|
|
5981
|
-
* @returns The intersection of the two features.
|
|
5974
|
+
/**
|
|
5975
|
+
* Returns the intersection of two point features. In case of a polygon, only the first feature is used.
|
|
5976
|
+
* @param a Feature A
|
|
5977
|
+
* @param b Feature B
|
|
5978
|
+
* @returns The intersection of the two features.
|
|
5982
5979
|
*/
|
|
5983
5980
|
const intersectPointGeoJSONS = (a, b, geoJSONProperties = {
|
|
5984
5981
|
stroke: '#FF0000',
|
|
@@ -6009,11 +6006,11 @@ const intersectPointGeoJSONS = (a, b, geoJSONProperties = {
|
|
|
6009
6006
|
}] : [featureA]
|
|
6010
6007
|
}, geoJSONProperties);
|
|
6011
6008
|
};
|
|
6012
|
-
/**
|
|
6013
|
-
* Returns the intersection of two (multi) polygon features. In case of a polygon, only the first feature is used.
|
|
6014
|
-
* @param a Feature A
|
|
6015
|
-
* @param b Feature B
|
|
6016
|
-
* @returns The intersection of the two features.
|
|
6009
|
+
/**
|
|
6010
|
+
* Returns the intersection of two (multi) polygon features. In case of a polygon, only the first feature is used.
|
|
6011
|
+
* @param a Feature A
|
|
6012
|
+
* @param b Feature B
|
|
6013
|
+
* @returns The intersection of the two features.
|
|
6017
6014
|
*/
|
|
6018
6015
|
const intersectPolygonGeoJSONS = (a, b, geoJSONProperties = {
|
|
6019
6016
|
stroke: '#FF0000',
|
|
@@ -6048,10 +6045,10 @@ const intersectPolygonGeoJSONS = (a, b, geoJSONProperties = {
|
|
|
6048
6045
|
const isPointFeatureCollection = geojson => {
|
|
6049
6046
|
return geojson.features[0].geometry.type === 'Point';
|
|
6050
6047
|
};
|
|
6051
|
-
/**
|
|
6052
|
-
* Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
|
|
6053
|
-
* @param geoJSONs
|
|
6054
|
-
* @returns GeoJSONS extend with intersections
|
|
6048
|
+
/**
|
|
6049
|
+
* Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
|
|
6050
|
+
* @param geoJSONs
|
|
6051
|
+
* @returns GeoJSONS extend with intersections
|
|
6055
6052
|
*/
|
|
6056
6053
|
const createInterSections = (geojson, otherGeoJSON, geoJSONproperties = {
|
|
6057
6054
|
stroke: '#f24a00',
|
|
@@ -9608,22 +9605,22 @@ $$1({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
|
|
|
9608
9605
|
}
|
|
9609
9606
|
});
|
|
9610
9607
|
|
|
9611
|
-
/* *
|
|
9612
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9613
|
-
* you may not use this file except in compliance with the License.
|
|
9614
|
-
* You may obtain a copy of the License at
|
|
9615
|
-
*
|
|
9616
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9617
|
-
*
|
|
9618
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
9619
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9620
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9621
|
-
* See the License for the specific language governing permissions and
|
|
9622
|
-
* limitations under the License.
|
|
9623
|
-
*
|
|
9624
|
-
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9625
|
-
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
9626
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9608
|
+
/* *
|
|
9609
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9610
|
+
* you may not use this file except in compliance with the License.
|
|
9611
|
+
* You may obtain a copy of the License at
|
|
9612
|
+
*
|
|
9613
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9614
|
+
*
|
|
9615
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9616
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
9617
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9618
|
+
* See the License for the specific language governing permissions and
|
|
9619
|
+
* limitations under the License.
|
|
9620
|
+
*
|
|
9621
|
+
* Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
9622
|
+
* Copyright 2020 - Finnish Meteorological Institute (FMI)
|
|
9623
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
9627
9624
|
* */
|
|
9628
9625
|
const getCurrentDimensionValue = (name, dimensions = []) => {
|
|
9629
9626
|
const currentDimension = dimensions.find(dim => dim.name === name);
|
|
@@ -9678,21 +9675,21 @@ const getLayerUpdateInfo = (wmLayer, mapId) => {
|
|
|
9678
9675
|
return updateObject;
|
|
9679
9676
|
};
|
|
9680
9677
|
|
|
9681
|
-
/** Returns filtered list of props with geoJson
|
|
9682
|
-
* @param children React.ReactNode, layers with geoJson
|
|
9678
|
+
/** Returns filtered list of props with geoJson
|
|
9679
|
+
* @param children React.ReactNode, layers with geoJson
|
|
9683
9680
|
*/
|
|
9684
9681
|
const getFeatureLayers = children => children && Array.isArray(children) ? children
|
|
9685
9682
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9686
9683
|
// @ts-ignore
|
|
9687
9684
|
.reduce((acc, val) => acc.concat(val), []).filter(c => c && c.props && c.props.geojson).map(c => c.props).reverse() : [];
|
|
9688
|
-
/**
|
|
9689
|
-
* Returns true if this is a maplayer and not a baselayer or overlayer
|
|
9690
|
-
* @param layer The LayerFoundation object, or the props from the ReactWMJSLayer
|
|
9685
|
+
/**
|
|
9686
|
+
* Returns true if this is a maplayer and not a baselayer or overlayer
|
|
9687
|
+
* @param layer The LayerFoundation object, or the props from the ReactWMJSLayer
|
|
9691
9688
|
*/
|
|
9692
9689
|
const isAMapLayer = layer => layer.layerType === LayerType.mapLayer;
|
|
9693
|
-
/**
|
|
9694
|
-
* Returns true if this is a geojsonlayer (layer containing geojson field)
|
|
9695
|
-
* @param layer The LayerFoundation object, or the props from the ReactWMJSLayer
|
|
9690
|
+
/**
|
|
9691
|
+
* Returns true if this is a geojsonlayer (layer containing geojson field)
|
|
9692
|
+
* @param layer The LayerFoundation object, or the props from the ReactWMJSLayer
|
|
9696
9693
|
*/
|
|
9697
9694
|
const isAGeoJSONLayer = layer => layer.geojson !== undefined;
|
|
9698
9695
|
function getIsInsideAcceptanceTime(acceptanceTimeInMinutes, mapDimensions, layerDimensions) {
|
|
@@ -9916,17 +9913,17 @@ class ReactMapView extends React.Component {
|
|
|
9916
9913
|
this.clearRefetchTimer();
|
|
9917
9914
|
}
|
|
9918
9915
|
};
|
|
9919
|
-
/**
|
|
9920
|
-
* Start the refetch timer
|
|
9921
|
-
* @param force - Force a fetch and wmLayer parse immediately
|
|
9916
|
+
/**
|
|
9917
|
+
* Start the refetch timer
|
|
9918
|
+
* @param force - Force a fetch and wmLayer parse immediately
|
|
9922
9919
|
*/
|
|
9923
9920
|
this.onStartRefetchTimer = force => {
|
|
9924
9921
|
const {
|
|
9925
9922
|
shouldAutoFetch
|
|
9926
9923
|
} = this.props;
|
|
9927
|
-
/* TODO, Maarten Plieger, 2021-09-02
|
|
9928
|
-
This causes many issues, we should improve the update strategy.
|
|
9929
|
-
Certain presets have >20 layers. This causes 20 times parsing the GetCapabilities for a minor update of the store.
|
|
9924
|
+
/* TODO, Maarten Plieger, 2021-09-02
|
|
9925
|
+
This causes many issues, we should improve the update strategy.
|
|
9926
|
+
Certain presets have >20 layers. This causes 20 times parsing the GetCapabilities for a minor update of the store.
|
|
9930
9927
|
*/
|
|
9931
9928
|
this.clearRefetchTimer();
|
|
9932
9929
|
const autoFetchInterval = Number(shouldAutoFetch); // Default true -> 1 minute
|
|
@@ -10293,6 +10290,11 @@ class ReactMapView extends React.Component {
|
|
|
10293
10290
|
}
|
|
10294
10291
|
const wmjsMap = new WMJSMap(this.adagucWebMapJSRef.current);
|
|
10295
10292
|
wmjsMap.shouldPrefetch = !shouldDisablePrefetching;
|
|
10293
|
+
// pass translation function
|
|
10294
|
+
const {
|
|
10295
|
+
t
|
|
10296
|
+
} = this.props;
|
|
10297
|
+
wmjsMap.t = t;
|
|
10296
10298
|
this.adaguc.currentChildren = [];
|
|
10297
10299
|
this.adaguc.baseLayers = [];
|
|
10298
10300
|
webmapUtils.registerWMJSMap(wmjsMap, mapId);
|
|
@@ -10525,28 +10527,28 @@ const MapTime = ({
|
|
|
10525
10527
|
}));
|
|
10526
10528
|
};
|
|
10527
10529
|
|
|
10528
|
-
/* *
|
|
10529
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10530
|
-
* you may not use this file except in compliance with the License.
|
|
10531
|
-
* You may obtain a copy of the License at
|
|
10532
|
-
*
|
|
10533
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10534
|
-
*
|
|
10535
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
10536
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10537
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10538
|
-
* See the License for the specific language governing permissions and
|
|
10539
|
-
* limitations under the License.
|
|
10540
|
-
*
|
|
10541
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10542
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
10543
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
10530
|
+
/* *
|
|
10531
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10532
|
+
* you may not use this file except in compliance with the License.
|
|
10533
|
+
* You may obtain a copy of the License at
|
|
10534
|
+
*
|
|
10535
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10536
|
+
*
|
|
10537
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
10538
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
10539
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10540
|
+
* See the License for the specific language governing permissions and
|
|
10541
|
+
* limitations under the License.
|
|
10542
|
+
*
|
|
10543
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
10544
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
10545
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
10544
10546
|
* */
|
|
10545
10547
|
const MS_IN_HOUR = 3600 * 1000;
|
|
10546
10548
|
// The following is necessary to allow to assign to the CanvasRenderingContext2D ctx property
|
|
10547
10549
|
/* eslint-disable no-param-reassign */
|
|
10548
|
-
/**
|
|
10549
|
-
* This component registers to a webmap instance and draws axis for height and time in the map using the Map Canvas.
|
|
10550
|
+
/**
|
|
10551
|
+
* This component registers to a webmap instance and draws axis for height and time in the map using the Map Canvas.
|
|
10550
10552
|
*/
|
|
10551
10553
|
const ProfileAxis = ({
|
|
10552
10554
|
mapId
|
|
@@ -10607,13 +10609,13 @@ const ProfileAxis = ({
|
|
|
10607
10609
|
}, [mapId]);
|
|
10608
10610
|
return null;
|
|
10609
10611
|
};
|
|
10610
|
-
/**
|
|
10611
|
-
* Calculates a time spacing. This is used to place labels on the X axis (time axis).
|
|
10612
|
-
* To make readable time labels, the time spacing is discretized to rounded times,
|
|
10613
|
-
* The time spacing changes according to zoom level.
|
|
10614
|
-
* @param bbox
|
|
10615
|
-
* @param width
|
|
10616
|
-
* @returns
|
|
10612
|
+
/**
|
|
10613
|
+
* Calculates a time spacing. This is used to place labels on the X axis (time axis).
|
|
10614
|
+
* To make readable time labels, the time spacing is discretized to rounded times,
|
|
10615
|
+
* The time spacing changes according to zoom level.
|
|
10616
|
+
* @param bbox
|
|
10617
|
+
* @param width
|
|
10618
|
+
* @returns
|
|
10617
10619
|
*/
|
|
10618
10620
|
const getTimeSpacingInMs = (bbox, width) => {
|
|
10619
10621
|
const hoursInView = Math.abs(bbox.right - bbox.left) / (MS_IN_HOUR * width / 500);
|
|
@@ -10655,13 +10657,13 @@ const drawTimeAxis = (ctx, bbox, offsetX, offsetY, width, height, axisStyle) =>
|
|
|
10655
10657
|
ctx.font = fontStyleBig;
|
|
10656
10658
|
ctx.fillText('time UTC (h)', width / 2 - 10, offsetY + 38);
|
|
10657
10659
|
};
|
|
10658
|
-
/**
|
|
10659
|
-
* Calculates a spacing for the height axis. This is used to place labels on the Y axis (height axis).
|
|
10660
|
-
* To make readable height labels, the height spacing is discretized to rounded elevations,
|
|
10661
|
-
* The spacing changes according to zoom level.
|
|
10662
|
-
* @param bbox
|
|
10663
|
-
* @param height
|
|
10664
|
-
* @returns
|
|
10660
|
+
/**
|
|
10661
|
+
* Calculates a spacing for the height axis. This is used to place labels on the Y axis (height axis).
|
|
10662
|
+
* To make readable height labels, the height spacing is discretized to rounded elevations,
|
|
10663
|
+
* The spacing changes according to zoom level.
|
|
10664
|
+
* @param bbox
|
|
10665
|
+
* @param height
|
|
10666
|
+
* @returns
|
|
10665
10667
|
*/
|
|
10666
10668
|
const getHeightSpacingInMs = (bbox, height) => {
|
|
10667
10669
|
const numMeterInView = Math.abs(bbox.bottom - bbox.top) / height;
|
|
@@ -10766,6 +10768,9 @@ const MapView = _a => {
|
|
|
10766
10768
|
dimensions,
|
|
10767
10769
|
mapId: mapIdProp
|
|
10768
10770
|
} = props;
|
|
10771
|
+
const {
|
|
10772
|
+
t
|
|
10773
|
+
} = useTranslation();
|
|
10769
10774
|
const wmjsMapRef = React.useRef(null);
|
|
10770
10775
|
const mapId = React.useRef(mapIdProp).current;
|
|
10771
10776
|
if (mapIdProp !== mapId) {
|
|
@@ -10844,7 +10849,8 @@ const MapView = _a => {
|
|
|
10844
10849
|
if (onWMJSMount) {
|
|
10845
10850
|
onWMJSMount(id);
|
|
10846
10851
|
}
|
|
10847
|
-
}
|
|
10852
|
+
},
|
|
10853
|
+
t: t
|
|
10848
10854
|
}, {
|
|
10849
10855
|
children: children
|
|
10850
10856
|
}))
|
|
@@ -11036,7 +11042,7 @@ const DimensionSelectDialog = ({
|
|
|
11036
11042
|
padding: 4
|
|
11037
11043
|
}
|
|
11038
11044
|
}, {
|
|
11039
|
-
children: jsx(
|
|
11045
|
+
children: jsx(Grid2, Object.assign({
|
|
11040
11046
|
container: true,
|
|
11041
11047
|
direction: "row"
|
|
11042
11048
|
}, {
|
|
@@ -11094,7 +11100,9 @@ const DimensionSelectSlider = ({
|
|
|
11094
11100
|
}, {
|
|
11095
11101
|
children: jsx(Box, Object.assign({
|
|
11096
11102
|
component: "span",
|
|
11097
|
-
|
|
11103
|
+
sx: {
|
|
11104
|
+
m: 1
|
|
11105
|
+
}
|
|
11098
11106
|
}, {
|
|
11099
11107
|
children: jsx(SmallFontSlider, {
|
|
11100
11108
|
"data-testid": "verticalSlider",
|
|
@@ -11167,9 +11175,10 @@ const MapDimensionSelect = ({
|
|
|
11167
11175
|
t
|
|
11168
11176
|
} = useWebmapReactTranslation();
|
|
11169
11177
|
const tooltipTitle = isLayerDimensionSynced ? t('webmap-react-click-disconnect') : t('webmap-react-click-connect');
|
|
11170
|
-
return jsxs(
|
|
11171
|
-
|
|
11172
|
-
|
|
11178
|
+
return jsxs(Grid2, Object.assign({
|
|
11179
|
+
size: {
|
|
11180
|
+
xs: 'auto'
|
|
11181
|
+
}
|
|
11173
11182
|
}, {
|
|
11174
11183
|
children: [jsx(CustomIconButton, Object.assign({
|
|
11175
11184
|
tooltipTitle: tooltipTitle,
|
|
@@ -11259,18 +11268,16 @@ const LayerInfoList = ({
|
|
|
11259
11268
|
sx: textStyleWithMargin
|
|
11260
11269
|
}, {
|
|
11261
11270
|
children: "-"
|
|
11262
|
-
})) : jsx(
|
|
11271
|
+
})) : jsx(Grid2, Object.assign({
|
|
11263
11272
|
container: true,
|
|
11264
11273
|
direction: "column"
|
|
11265
11274
|
}, {
|
|
11266
11275
|
children: list.map(item => jsxs("div", {
|
|
11267
|
-
children: [jsxs(
|
|
11268
|
-
item: true,
|
|
11276
|
+
children: [jsxs(Grid2, Object.assign({
|
|
11269
11277
|
container: true,
|
|
11270
11278
|
direction: "row"
|
|
11271
11279
|
}, {
|
|
11272
|
-
children: [item.icon, jsx(
|
|
11273
|
-
item: true,
|
|
11280
|
+
children: [item.icon, jsx(Grid2, Object.assign({
|
|
11274
11281
|
sx: {
|
|
11275
11282
|
marginLeft: '10px'
|
|
11276
11283
|
}
|
|
@@ -11282,8 +11289,7 @@ const LayerInfoList = ({
|
|
|
11282
11289
|
children: [item.label, ":"]
|
|
11283
11290
|
}))
|
|
11284
11291
|
}))]
|
|
11285
|
-
})), jsx(
|
|
11286
|
-
item: true,
|
|
11292
|
+
})), jsx(Grid2, Object.assign({
|
|
11287
11293
|
container: true,
|
|
11288
11294
|
direction: "row",
|
|
11289
11295
|
sx: {
|
|
@@ -11913,22 +11919,22 @@ const LayerInfoDialog = ({
|
|
|
11913
11919
|
}));
|
|
11914
11920
|
};
|
|
11915
11921
|
|
|
11916
|
-
/* *
|
|
11917
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11918
|
-
* you may not use this file except in compliance with the License.
|
|
11919
|
-
* You may obtain a copy of the License at
|
|
11920
|
-
*
|
|
11921
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11922
|
-
*
|
|
11923
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11924
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11925
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11926
|
-
* See the License for the specific language governing permissions and
|
|
11927
|
-
* limitations under the License.
|
|
11928
|
-
*
|
|
11929
|
-
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11930
|
-
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
11931
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11922
|
+
/* *
|
|
11923
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11924
|
+
* you may not use this file except in compliance with the License.
|
|
11925
|
+
* You may obtain a copy of the License at
|
|
11926
|
+
*
|
|
11927
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11928
|
+
*
|
|
11929
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11930
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11931
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11932
|
+
* See the License for the specific language governing permissions and
|
|
11933
|
+
* limitations under the License.
|
|
11934
|
+
*
|
|
11935
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11936
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
11937
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11932
11938
|
* */
|
|
11933
11939
|
const baseLayerGrey = {
|
|
11934
11940
|
id: webmapUtils.generateLayerId(),
|
|
@@ -11957,22 +11963,22 @@ var defaultLayers = /*#__PURE__*/Object.freeze({
|
|
|
11957
11963
|
overLayer: overLayer
|
|
11958
11964
|
});
|
|
11959
11965
|
|
|
11960
|
-
/* *
|
|
11961
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11962
|
-
* you may not use this file except in compliance with the License.
|
|
11963
|
-
* You may obtain a copy of the License at
|
|
11964
|
-
*
|
|
11965
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11966
|
-
*
|
|
11967
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11968
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11969
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11970
|
-
* See the License for the specific language governing permissions and
|
|
11971
|
-
* limitations under the License.
|
|
11972
|
-
*
|
|
11973
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11974
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11975
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11966
|
+
/* *
|
|
11967
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
11968
|
+
* you may not use this file except in compliance with the License.
|
|
11969
|
+
* You may obtain a copy of the License at
|
|
11970
|
+
*
|
|
11971
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11972
|
+
*
|
|
11973
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11974
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
11975
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11976
|
+
* See the License for the specific language governing permissions and
|
|
11977
|
+
* limitations under the License.
|
|
11978
|
+
*
|
|
11979
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
11980
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
11981
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
11976
11982
|
* */
|
|
11977
11983
|
const DWD = {
|
|
11978
11984
|
name: 'DWD',
|
|
@@ -12087,22 +12093,22 @@ var publicServices = /*#__PURE__*/Object.freeze({
|
|
|
12087
12093
|
nationaalgeoregister: nationaalgeoregister
|
|
12088
12094
|
});
|
|
12089
12095
|
|
|
12090
|
-
/* *
|
|
12091
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12092
|
-
* you may not use this file except in compliance with the License.
|
|
12093
|
-
* You may obtain a copy of the License at
|
|
12094
|
-
*
|
|
12095
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12096
|
-
*
|
|
12097
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
12098
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12099
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12100
|
-
* See the License for the specific language governing permissions and
|
|
12101
|
-
* limitations under the License.
|
|
12102
|
-
*
|
|
12103
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
12104
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
12105
|
-
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
12096
|
+
/* *
|
|
12097
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12098
|
+
* you may not use this file except in compliance with the License.
|
|
12099
|
+
* You may obtain a copy of the License at
|
|
12100
|
+
*
|
|
12101
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12102
|
+
*
|
|
12103
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12104
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12105
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12106
|
+
* See the License for the specific language governing permissions and
|
|
12107
|
+
* limitations under the License.
|
|
12108
|
+
*
|
|
12109
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
12110
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
12111
|
+
* Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
|
|
12106
12112
|
* */
|
|
12107
12113
|
const baseLayer = {
|
|
12108
12114
|
name: 'arcGisSat',
|
|
@@ -12245,7 +12251,7 @@ const harmonieAirTemperature = {
|
|
|
12245
12251
|
};
|
|
12246
12252
|
const harmoniePrecipitation = {
|
|
12247
12253
|
service: KNMIgeoservicesHarmonie.url,
|
|
12248
|
-
name: '
|
|
12254
|
+
name: 'rainfall_rate_hagl',
|
|
12249
12255
|
id: webmapUtils.generateLayerId(),
|
|
12250
12256
|
layerType: LayerType.mapLayer,
|
|
12251
12257
|
enabled: true
|