@opengeoweb/webmap-react 9.19.1 → 9.20.2

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 CHANGED
@@ -1,3 +1,4 @@
1
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
1
2
  import * as React from 'react';
2
3
  import React__default, { useRef, useState, useEffect } from 'react';
3
4
  import { legendImageStore, WMImageEventType, webmapUtils, getLegendGraphicURLForLayer, LayerType, getWMJSMapById, debugLogger, DebugType, WMLayer, registerWMLayer, WMBBOX, getWMLayerById, WMJSMap, tilesettings } from '@opengeoweb/webmap';
@@ -7,9 +8,9 @@ import { initReactI18next, useTranslation } from 'react-i18next';
7
8
  import { Paper, Box, Typography, Grid, TextField, FormControl, InputLabel, Select, MenuItem, Icon as Icon$1, FormLabel, Switch, styled, Slider } from '@mui/material';
8
9
  import { Home, Add, Minus, List, Delete, Edit, DrawRegion, DrawPolygon, Location, DrawFIRLand, ArrowUp, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime } from '@opengeoweb/theme';
9
10
  import _, { cloneDeep } from 'lodash';
10
- import proj4 from 'proj4';
11
11
  import * as turf from '@turf/turf';
12
12
  import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
13
+ import proj4 from 'proj4';
13
14
  import { produce } from 'immer';
14
15
  import { debounce } from 'throttle-debounce';
15
16
  import { useResizeDetector } from 'react-resize-detector';
@@ -326,7 +327,9 @@ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty
326
327
  source: 'https://github.com/zloirock/core-js'
327
328
  });
328
329
 
329
- var store$2 = sharedStore.exports;
330
+ var sharedStoreExports = sharedStore.exports;
331
+
332
+ var store$2 = sharedStoreExports;
330
333
 
331
334
  var shared$4 = function (key, value) {
332
335
  return store$2[key] || (store$2[key] = value || {});
@@ -984,7 +987,7 @@ var global$f = global$n;
984
987
  var isObject$8 = isObject$d;
985
988
  var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
986
989
  var hasOwn$9 = hasOwnProperty_1;
987
- var shared$1 = sharedStore.exports;
990
+ var shared$1 = sharedStoreExports;
988
991
  var sharedKey$1 = sharedKey$3;
989
992
  var hiddenKeys$1 = hiddenKeys$4;
990
993
 
@@ -1113,7 +1116,7 @@ var functionName = {
1113
1116
 
1114
1117
  var uncurryThis$j = functionUncurryThis;
1115
1118
  var isCallable$g = isCallable$n;
1116
- var store = sharedStore.exports;
1119
+ var store = sharedStoreExports;
1117
1120
 
1118
1121
  var functionToString = uncurryThis$j(Function.toString);
1119
1122
 
@@ -1181,9 +1184,11 @@ Function.prototype.toString = makeBuiltIn$2(function toString() {
1181
1184
  return isCallable$f(this) && getInternalState$2(this).source || inspectSource$2(this);
1182
1185
  }, 'toString');
1183
1186
 
1187
+ var makeBuiltInExports = makeBuiltIn$3.exports;
1188
+
1184
1189
  var isCallable$e = isCallable$n;
1185
1190
  var definePropertyModule$1 = objectDefineProperty;
1186
- var makeBuiltIn$1 = makeBuiltIn$3.exports;
1191
+ var makeBuiltIn$1 = makeBuiltInExports;
1187
1192
  var defineGlobalProperty$1 = defineGlobalProperty$3;
1188
1193
 
1189
1194
  var defineBuiltIn$7 = function (O, key, value, options) {
@@ -1666,6 +1671,73 @@ if (DESCRIPTORS$5 && values.name !== 'values') try {
1666
1671
  defineProperty$3(values, 'name', { value: 'values' });
1667
1672
  } catch (error) { /* empty */ }
1668
1673
 
1674
+ var DESCRIPTORS$4 = descriptors;
1675
+ var uncurryThis$f = functionUncurryThis;
1676
+ var call$d = functionCall;
1677
+ var fails$f = fails$q;
1678
+ var objectKeys = objectKeys$2;
1679
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1680
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1681
+ var toObject$4 = toObject$7;
1682
+ var IndexedObject$1 = indexedObject;
1683
+
1684
+ // eslint-disable-next-line es/no-object-assign -- safe
1685
+ var $assign = Object.assign;
1686
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1687
+ var defineProperty$2 = Object.defineProperty;
1688
+ var concat = uncurryThis$f([].concat);
1689
+
1690
+ // `Object.assign` method
1691
+ // https://tc39.es/ecma262/#sec-object.assign
1692
+ var objectAssign = !$assign || fails$f(function () {
1693
+ // should have correct order of operations (Edge bug)
1694
+ if (DESCRIPTORS$4 && $assign({ b: 1 }, $assign(defineProperty$2({}, 'a', {
1695
+ enumerable: true,
1696
+ get: function () {
1697
+ defineProperty$2(this, 'b', {
1698
+ value: 3,
1699
+ enumerable: false
1700
+ });
1701
+ }
1702
+ }), { b: 2 })).b !== 1) return true;
1703
+ // should work with symbols and should have deterministic property order (V8 bug)
1704
+ var A = {};
1705
+ var B = {};
1706
+ // eslint-disable-next-line es/no-symbol -- safe
1707
+ var symbol = Symbol('assign detection');
1708
+ var alphabet = 'abcdefghijklmnopqrst';
1709
+ A[symbol] = 7;
1710
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1711
+ return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
1712
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1713
+ var T = toObject$4(target);
1714
+ var argumentsLength = arguments.length;
1715
+ var index = 1;
1716
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1717
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1718
+ while (argumentsLength > index) {
1719
+ var S = IndexedObject$1(arguments[index++]);
1720
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1721
+ var length = keys.length;
1722
+ var j = 0;
1723
+ var key;
1724
+ while (length > j) {
1725
+ key = keys[j++];
1726
+ if (!DESCRIPTORS$4 || call$d(propertyIsEnumerable, S, key)) T[key] = S[key];
1727
+ }
1728
+ } return T;
1729
+ } : $assign;
1730
+
1731
+ var $$h = _export;
1732
+ var assign = objectAssign;
1733
+
1734
+ // `Object.assign` method
1735
+ // https://tc39.es/ecma262/#sec-object.assign
1736
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1737
+ $$h({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1738
+ assign: assign
1739
+ });
1740
+
1669
1741
  // iterable DOM collections
1670
1742
  // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1671
1743
  var domIterables = {
@@ -1747,73 +1819,6 @@ for (var COLLECTION_NAME in DOMIterables) {
1747
1819
 
1748
1820
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1749
1821
 
1750
- var DESCRIPTORS$4 = descriptors;
1751
- var uncurryThis$f = functionUncurryThis;
1752
- var call$d = functionCall;
1753
- var fails$f = fails$q;
1754
- var objectKeys = objectKeys$2;
1755
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1756
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1757
- var toObject$4 = toObject$7;
1758
- var IndexedObject$1 = indexedObject;
1759
-
1760
- // eslint-disable-next-line es/no-object-assign -- safe
1761
- var $assign = Object.assign;
1762
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1763
- var defineProperty$2 = Object.defineProperty;
1764
- var concat = uncurryThis$f([].concat);
1765
-
1766
- // `Object.assign` method
1767
- // https://tc39.es/ecma262/#sec-object.assign
1768
- var objectAssign = !$assign || fails$f(function () {
1769
- // should have correct order of operations (Edge bug)
1770
- if (DESCRIPTORS$4 && $assign({ b: 1 }, $assign(defineProperty$2({}, 'a', {
1771
- enumerable: true,
1772
- get: function () {
1773
- defineProperty$2(this, 'b', {
1774
- value: 3,
1775
- enumerable: false
1776
- });
1777
- }
1778
- }), { b: 2 })).b !== 1) return true;
1779
- // should work with symbols and should have deterministic property order (V8 bug)
1780
- var A = {};
1781
- var B = {};
1782
- // eslint-disable-next-line es/no-symbol -- safe
1783
- var symbol = Symbol('assign detection');
1784
- var alphabet = 'abcdefghijklmnopqrst';
1785
- A[symbol] = 7;
1786
- alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1787
- return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
1788
- }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1789
- var T = toObject$4(target);
1790
- var argumentsLength = arguments.length;
1791
- var index = 1;
1792
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1793
- var propertyIsEnumerable = propertyIsEnumerableModule.f;
1794
- while (argumentsLength > index) {
1795
- var S = IndexedObject$1(arguments[index++]);
1796
- var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
1797
- var length = keys.length;
1798
- var j = 0;
1799
- var key;
1800
- while (length > j) {
1801
- key = keys[j++];
1802
- if (!DESCRIPTORS$4 || call$d(propertyIsEnumerable, S, key)) T[key] = S[key];
1803
- }
1804
- } return T;
1805
- } : $assign;
1806
-
1807
- var $$h = _export;
1808
- var assign = objectAssign;
1809
-
1810
- // `Object.assign` method
1811
- // https://tc39.es/ecma262/#sec-object.assign
1812
- // eslint-disable-next-line es/no-object-assign -- required for testing
1813
- $$h({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1814
- assign: assign
1815
- });
1816
-
1817
1822
  const WEBMAP_REACT_NAMESPACE = 'webmapreact';
1818
1823
  i18n.use(initReactI18next).init({
1819
1824
  lng: 'en',
@@ -1850,7 +1855,7 @@ const LegendLayout = ({
1850
1855
  width,
1851
1856
  minWidth
1852
1857
  }) => {
1853
- return /*#__PURE__*/React__default.createElement(Paper, {
1858
+ return jsxs(Paper, Object.assign({
1854
1859
  "data-testid": "legend",
1855
1860
  sx: {
1856
1861
  padding: '10px',
@@ -1859,46 +1864,62 @@ const LegendLayout = ({
1859
1864
  overflow: 'hidden',
1860
1865
  marginBottom: 0.5
1861
1866
  }
1862
- }, /*#__PURE__*/React__default.createElement(Box, {
1863
- "data-testid": "legend-title"
1864
- }, /*#__PURE__*/React__default.createElement(Typography, {
1865
- sx: {
1866
- fontFamily: 'Roboto, Helvetica, Arial',
1867
- fontSize: '10px',
1868
- minWidth: '100%',
1869
- wordWrap: 'break-word',
1870
- color: 'common.black',
1871
- whiteSpace: 'nowrap'
1872
- },
1873
- variant: "h3"
1874
- }, title)), /*#__PURE__*/React__default.createElement(CustomTooltip, {
1875
- title: title || 'loading',
1876
- placement: "top"
1877
- }, /*#__PURE__*/React__default.createElement(Box, {
1878
- sx: {
1879
- margin: '10px 0px 10px 0px',
1880
- height: `${height}px`,
1881
- width: `${width}px`
1882
- }
1883
- }, children)), /*#__PURE__*/React__default.createElement(Box, {
1884
- "data-testid": "legend-info",
1885
- sx: Object.assign({
1886
- fontFamily: 'Roboto, Helvetica, Arial',
1887
- fontSize: 10,
1888
- color: 'common.black',
1889
- overflowX: 'hidden',
1890
- wordWrap: 'break-word',
1891
- whiteSpace: 'nowrap'
1892
- }, minWidth && {
1893
- minWidth: `${minWidth}px`
1894
- })
1895
- }, dimensions && dimensions.map(dim => ( /*#__PURE__*/React__default.createElement(Box, {
1896
- key: name + dim.name
1897
- }, dim.name === 'time' ? `${dim.currentValue}` : ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
1898
- style: {
1899
- fontWeight: 500
1900
- }
1901
- }, dim.name, ":"), dim.currentValue, " ", dim.units)))))));
1867
+ }, {
1868
+ children: [jsx(Box, Object.assign({
1869
+ "data-testid": "legend-title"
1870
+ }, {
1871
+ children: jsx(Typography, Object.assign({
1872
+ sx: {
1873
+ fontFamily: 'Roboto, Helvetica, Arial',
1874
+ fontSize: '10px',
1875
+ minWidth: '100%',
1876
+ wordWrap: 'break-word',
1877
+ color: 'common.black',
1878
+ whiteSpace: 'nowrap'
1879
+ },
1880
+ variant: "h3"
1881
+ }, {
1882
+ children: title
1883
+ }))
1884
+ })), jsx(CustomTooltip, Object.assign({
1885
+ title: title || 'loading',
1886
+ placement: "top"
1887
+ }, {
1888
+ children: jsx(Box, Object.assign({
1889
+ sx: {
1890
+ margin: '10px 0px 10px 0px',
1891
+ height: `${height}px`,
1892
+ width: `${width}px`
1893
+ }
1894
+ }, {
1895
+ children: children
1896
+ }))
1897
+ })), jsx(Box, Object.assign({
1898
+ "data-testid": "legend-info",
1899
+ sx: Object.assign({
1900
+ fontFamily: 'Roboto, Helvetica, Arial',
1901
+ fontSize: 10,
1902
+ color: 'common.black',
1903
+ overflowX: 'hidden',
1904
+ wordWrap: 'break-word',
1905
+ whiteSpace: 'nowrap'
1906
+ }, minWidth && {
1907
+ minWidth: `${minWidth}px`
1908
+ })
1909
+ }, {
1910
+ children: dimensions && dimensions.map(dim => jsx(Box, {
1911
+ children: dim.name === 'time' ? `${dim.currentValue}` : jsxs(Fragment, {
1912
+ children: [jsxs(Box, Object.assign({
1913
+ style: {
1914
+ fontWeight: 500
1915
+ }
1916
+ }, {
1917
+ children: [dim.name, ":"]
1918
+ })), dim.currentValue, " ", dim.units]
1919
+ })
1920
+ }, name + dim.name))
1921
+ }))]
1922
+ }));
1902
1923
  };
1903
1924
 
1904
1925
  const defaultCanvasWidth = 150;
@@ -1971,78 +1992,64 @@ const Legend = ({
1971
1992
  /* Get the wmLayer, it has more detailed info about the WMS service,
1972
1993
  like a title and the WMS legendgraphic url */
1973
1994
  const wmLayer = webmapUtils.getWMLayerById(layer.id);
1974
- return /*#__PURE__*/React__default.createElement(LegendLayout, {
1995
+ return jsx(LegendLayout, Object.assign({
1975
1996
  title: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title,
1976
1997
  name: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.name,
1977
1998
  dimensions: layer === null || layer === void 0 ? void 0 : layer.dimensions,
1978
1999
  height: canvasContainerHeight,
1979
2000
  width: canvasContainerWidth,
1980
2001
  minWidth: defaultCanvasWidth
1981
- }, /*#__PURE__*/React__default.createElement(CanvasComponent, {
1982
- redrawInterval: 500,
1983
- onRenderCanvas: (ctx, width, height) => {
1984
- /*
1985
- Check if the wmLayer is available, this happens when the WMS GetCapabilities is loaded and parsed.
1986
- Note that we cannot use the wmLayer variable above, as this one could contain a non initialized WMJSLayer.
1987
- */
1988
- const legendWmLayer = webmapUtils.getWMLayerById(layer.id);
1989
- const legendUrl = getLegendGraphicURLForLayer(legendWmLayer);
1990
- const image = legendImageStore.getImage(legendUrl);
1991
- /* If there is no image for the given URL, we do not want to display a legend image (e.g. outside range) */
1992
- if (!image) {
1993
- previousLegendImage.current = null;
1994
- setCanvasContainerWidth(defaultCanvasWidth);
1995
- setCanvasContainerHeight(defaultCanvasHeight);
1996
- ctx.beginPath();
1997
- ctx.fillStyle = '#fff';
1998
- ctx.rect(0, 0, width, height);
1999
- ctx.fill();
2000
- ctx.fillStyle = 'black';
2001
- if (!legendUrl) {
2002
- ctx.fillText('No legend graphic available', 5, 16);
2003
- }
2004
- } else {
2005
- /* If there is an image for the given url, and has no error, but it is not yet loading or loaded, start loading it! */
2006
- if (image && image.hasError() === false && image.isLoaded() === false && image.isLoading() === false) {
2007
- image.load(); /* Will eventually trigger the callback used in the useEffect */
2008
- }
2009
- /* 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 */
2010
- if (image && image.isLoaded()) {
2011
- previousLegendImage.current = image;
2012
- /* Set the canvas container to the same size as the image */
2013
- imageHeight = image.getHeight();
2014
- setCanvasContainerHeight(imageHeight);
2015
- imageWidth = image.getWidth();
2016
- setCanvasContainerWidth(imageWidth);
2017
- /* Give the canvas a white background before adding the image */
2002
+ }, {
2003
+ children: jsx(CanvasComponent, {
2004
+ redrawInterval: 500,
2005
+ onRenderCanvas: (ctx, width, height) => {
2006
+ /*
2007
+ Check if the wmLayer is available, this happens when the WMS GetCapabilities is loaded and parsed.
2008
+ Note that we cannot use the wmLayer variable above, as this one could contain a non initialized WMJSLayer.
2009
+ */
2010
+ const legendWmLayer = webmapUtils.getWMLayerById(layer.id);
2011
+ const legendUrl = getLegendGraphicURLForLayer(legendWmLayer);
2012
+ const image = legendImageStore.getImage(legendUrl);
2013
+ /* If there is no image for the given URL, we do not want to display a legend image (e.g. outside range) */
2014
+ if (!image) {
2015
+ previousLegendImage.current = null;
2016
+ setCanvasContainerWidth(defaultCanvasWidth);
2017
+ setCanvasContainerHeight(defaultCanvasHeight);
2018
+ ctx.beginPath();
2018
2019
  ctx.fillStyle = '#fff';
2019
2020
  ctx.rect(0, 0, width, height);
2020
2021
  ctx.fill();
2021
- /* Set the opacity used in the layer */
2022
- ctx.globalAlpha = layerOpacity;
2022
+ ctx.fillStyle = 'black';
2023
+ if (!legendUrl) {
2024
+ ctx.fillText('No legend graphic available', 5, 16);
2025
+ }
2026
+ } else {
2027
+ /* If there is an image for the given url, and has no error, but it is not yet loading or loaded, start loading it! */
2028
+ if (image && image.hasError() === false && image.isLoaded() === false && image.isLoading() === false) {
2029
+ image.load(); /* Will eventually trigger the callback used in the useEffect */
2030
+ }
2031
+ /* 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 */
2032
+ if (image && image.isLoaded()) {
2033
+ previousLegendImage.current = image;
2034
+ /* Set the canvas container to the same size as the image */
2035
+ imageHeight = image.getHeight();
2036
+ setCanvasContainerHeight(imageHeight);
2037
+ imageWidth = image.getWidth();
2038
+ setCanvasContainerWidth(imageWidth);
2039
+ /* Give the canvas a white background before adding the image */
2040
+ ctx.fillStyle = '#fff';
2041
+ ctx.rect(0, 0, width, height);
2042
+ ctx.fill();
2043
+ /* Set the opacity used in the layer */
2044
+ ctx.globalAlpha = layerOpacity;
2045
+ }
2046
+ renderLegendGraphic(previousLegendImage.current, ctx, imageWidth, imageHeight);
2023
2047
  }
2024
- renderLegendGraphic(previousLegendImage.current, ctx, imageWidth, imageHeight);
2025
2048
  }
2026
- }
2049
+ })
2027
2050
  }));
2028
2051
  };
2029
2052
 
2030
- /* *
2031
- * Licensed under the Apache License, Version 2.0 (the "License");
2032
- * you may not use this file except in compliance with the License.
2033
- * You may obtain a copy of the License at
2034
- *
2035
- * http://www.apache.org/licenses/LICENSE-2.0
2036
- *
2037
- * Unless required by applicable law or agreed to in writing, software
2038
- * distributed under the License is distributed on an "AS IS" BASIS,
2039
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2040
- * See the License for the specific language governing permissions and
2041
- * limitations under the License.
2042
- *
2043
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2044
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
2045
- * */
2046
2053
  const LegendDialog = ({
2047
2054
  layers,
2048
2055
  isOpen,
@@ -2056,7 +2063,7 @@ const LegendDialog = ({
2056
2063
  const {
2057
2064
  t
2058
2065
  } = useWebmapReactTranslation();
2059
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
2066
+ return jsx(ToolContainerDraggable, Object.assign({
2060
2067
  startPosition: {
2061
2068
  right: 20,
2062
2069
  top: 50
@@ -2071,30 +2078,37 @@ const LegendDialog = ({
2071
2078
  onMouseDown: _onMouseDown,
2072
2079
  order: _order,
2073
2080
  source: _source
2074
- }, /*#__PURE__*/React.createElement(Box, {
2075
- sx: {
2076
- padding: 0.5
2077
- }
2078
- }, layers && layers.length > 0 ? ( /*#__PURE__*/React.createElement(Box, {
2079
- "data-testid": "LegendList",
2080
- sx: {
2081
- display: 'flex',
2082
- flexDirection: 'column',
2083
- '&>div:last-child': {
2084
- marginBottom: 0
2081
+ }, {
2082
+ children: jsx(Box, Object.assign({
2083
+ sx: {
2084
+ padding: 0.5
2085
2085
  }
2086
- }
2087
- }, layers.map(layer => ( /*#__PURE__*/React.createElement(Legend, {
2088
- key: layer.id,
2089
- layer: layer
2090
- }))))) : ( /*#__PURE__*/React.createElement(Typography, {
2091
- "data-testid": "NoLayers",
2092
- variant: "body1",
2093
- style: {
2094
- fontWeight: 500,
2095
- fontSize: 14
2096
- }
2097
- }, t('webmap-react-no-layers')))));
2086
+ }, {
2087
+ children: layers && layers.length > 0 ? jsx(Box, Object.assign({
2088
+ "data-testid": "LegendList",
2089
+ sx: {
2090
+ display: 'flex',
2091
+ flexDirection: 'column',
2092
+ '&>div:last-child': {
2093
+ marginBottom: 0
2094
+ }
2095
+ }
2096
+ }, {
2097
+ children: layers.map(layer => jsx(Legend, {
2098
+ layer: layer
2099
+ }, layer.id))
2100
+ })) : jsx(Typography, Object.assign({
2101
+ "data-testid": "NoLayers",
2102
+ variant: "body1",
2103
+ style: {
2104
+ fontWeight: 500,
2105
+ fontSize: 14
2106
+ }
2107
+ }, {
2108
+ children: t('webmap-react-no-layers')
2109
+ }))
2110
+ }))
2111
+ }));
2098
2112
  };
2099
2113
 
2100
2114
  /******************************************************************************
@@ -2111,6 +2125,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2111
2125
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2112
2126
  PERFORMANCE OF THIS SOFTWARE.
2113
2127
  ***************************************************************************** */
2128
+ /* global Reflect, Promise, SuppressedError, Symbol */
2129
+
2114
2130
 
2115
2131
  function __rest(s, e) {
2116
2132
  var t = {};
@@ -2148,7 +2164,7 @@ const MapControlButton = _a => {
2148
2164
  isActive = false
2149
2165
  } = _a,
2150
2166
  props = __rest(_a, ["onClick", "children", "title", "placement", "isActive"]);
2151
- return /*#__PURE__*/React.createElement(CustomIconButton, Object.assign({
2167
+ return jsx(CustomIconButton, Object.assign({
2152
2168
  variant: "tool",
2153
2169
  tooltipProps: {
2154
2170
  placement,
@@ -2156,25 +2172,11 @@ const MapControlButton = _a => {
2156
2172
  },
2157
2173
  onClick: onClick,
2158
2174
  isSelected: isActive
2159
- }, props), children);
2175
+ }, props, {
2176
+ children: children
2177
+ }));
2160
2178
  };
2161
2179
 
2162
- /* *
2163
- * Licensed under the Apache License, Version 2.0 (the "License");
2164
- * you may not use this file except in compliance with the License.
2165
- * You may obtain a copy of the License at
2166
- *
2167
- * http://www.apache.org/licenses/LICENSE-2.0
2168
- *
2169
- * Unless required by applicable law or agreed to in writing, software
2170
- * distributed under the License is distributed on an "AS IS" BASIS,
2171
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2172
- * See the License for the specific language governing permissions and
2173
- * limitations under the License.
2174
- *
2175
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2176
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
2177
- * */
2178
2180
  const ZoomControls = ({
2179
2181
  onZoomIn,
2180
2182
  onZoomOut,
@@ -2183,19 +2185,27 @@ const ZoomControls = ({
2183
2185
  const {
2184
2186
  t
2185
2187
  } = useWebmapReactTranslation();
2186
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MapControlButton, {
2187
- title: t('webmap-react-zoom-reset'),
2188
- "data-testid": "zoom-reset",
2189
- onClick: onZoomReset
2190
- }, /*#__PURE__*/React.createElement(Home, null)), /*#__PURE__*/React.createElement(MapControlButton, {
2191
- title: t('webmap-react-zoom-in'),
2192
- "data-testid": "zoom-in",
2193
- onClick: onZoomIn
2194
- }, /*#__PURE__*/React.createElement(Add, null)), /*#__PURE__*/React.createElement(MapControlButton, {
2195
- title: t('webmap-react-zoom-out'),
2196
- "data-testid": "zoom-out",
2197
- onClick: onZoomOut
2198
- }, /*#__PURE__*/React.createElement(Minus, null)));
2188
+ return jsxs(Fragment, {
2189
+ children: [jsx(MapControlButton, Object.assign({
2190
+ title: t('webmap-react-zoom-reset'),
2191
+ "data-testid": "zoom-reset",
2192
+ onClick: onZoomReset
2193
+ }, {
2194
+ children: jsx(Home, {})
2195
+ })), jsx(MapControlButton, Object.assign({
2196
+ title: t('webmap-react-zoom-in'),
2197
+ "data-testid": "zoom-in",
2198
+ onClick: onZoomIn
2199
+ }, {
2200
+ children: jsx(Add, {})
2201
+ })), jsx(MapControlButton, Object.assign({
2202
+ title: t('webmap-react-zoom-out'),
2203
+ "data-testid": "zoom-out",
2204
+ onClick: onZoomOut
2205
+ }, {
2206
+ children: jsx(Minus, {})
2207
+ }))]
2208
+ });
2199
2209
  };
2200
2210
 
2201
2211
  const MapControls = _a => {
@@ -2203,7 +2213,7 @@ const MapControls = _a => {
2203
2213
  children
2204
2214
  } = _a,
2205
2215
  props = __rest(_a, ["children"]);
2206
- return /*#__PURE__*/React.createElement(Box, Object.assign({
2216
+ return jsx(Box, Object.assign({
2207
2217
  sx: {
2208
2218
  position: 'absolute',
2209
2219
  overflow: 'visible',
@@ -2214,33 +2224,21 @@ const MapControls = _a => {
2214
2224
  top: '96px',
2215
2225
  userSelect: 'none'
2216
2226
  }
2217
- }, props), /*#__PURE__*/React.createElement(Grid, {
2218
- sx: {
2219
- '& > button': {
2220
- marginBottom: 1
2221
- }
2222
- },
2223
- container: true,
2224
- direction: "column"
2225
- }, children));
2227
+ }, props, {
2228
+ children: jsx(Grid, Object.assign({
2229
+ sx: {
2230
+ '& > button': {
2231
+ marginBottom: 1
2232
+ }
2233
+ },
2234
+ container: true,
2235
+ direction: "column"
2236
+ }, {
2237
+ children: children
2238
+ }))
2239
+ }));
2226
2240
  };
2227
2241
 
2228
- /* *
2229
- * Licensed under the Apache License, Version 2.0 (the "License");
2230
- * you may not use this file except in compliance with the License.
2231
- * You may obtain a copy of the License at
2232
- *
2233
- * http://www.apache.org/licenses/LICENSE-2.0
2234
- *
2235
- * Unless required by applicable law or agreed to in writing, software
2236
- * distributed under the License is distributed on an "AS IS" BASIS,
2237
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2238
- * See the License for the specific language governing permissions and
2239
- * limitations under the License.
2240
- *
2241
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2242
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
2243
- * */
2244
2242
  const LegendButton = ({
2245
2243
  openLegendDialog,
2246
2244
  isOpen
@@ -2249,12 +2247,14 @@ const LegendButton = ({
2249
2247
  t
2250
2248
  } = useWebmapReactTranslation();
2251
2249
  const onClickButton = () => openLegendDialog();
2252
- return /*#__PURE__*/React.createElement(MapControlButton, {
2250
+ return jsx(MapControlButton, Object.assign({
2253
2251
  title: t('webmap-react-legend'),
2254
2252
  "data-testid": "open-Legend",
2255
2253
  onClick: onClickButton,
2256
2254
  isActive: isOpen
2257
- }, /*#__PURE__*/React.createElement(List, null));
2255
+ }, {
2256
+ children: jsx(List, {})
2257
+ }));
2258
2258
  };
2259
2259
 
2260
2260
  var wellKnownSymbol$a = wellKnownSymbol$h;
@@ -2720,19 +2720,111 @@ if (NOT_GENERIC || INCORRECT_NAME) {
2720
2720
  }, { unsafe: true });
2721
2721
  }
2722
2722
 
2723
- /* Function which calculates the distance between two points */
2724
- const distance = (a, b) => {
2725
- return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
2726
- };
2727
- const checkHoverVertice = (feature, mouseX, mouseY, convertGeoCoordsToScreenCoords, ignoreCoordinateIndexInFeature) => {
2728
- const maxDistance = 20;
2729
- if (feature.geometry.type === 'Point') {
2730
- const featureCoords = feature.geometry.coordinates;
2731
- /* Get all vertexes */
2732
- const XYCoords = convertGeoCoordsToScreenCoords([featureCoords]);
2733
- if (XYCoords.length > 0 && distance(XYCoords[0], {
2734
- x: mouseX,
2735
- y: mouseY
2723
+ const Proj4js = proj4;
2724
+ // Cache for for storing and reusing Proj4 instances
2725
+ const projectorCache = {};
2726
+ // Ensure that you have a Proj4 object, pulling from the cache if necessary
2727
+ const getProj4 = projection => {
2728
+ if (projection instanceof Proj4js.Proj) {
2729
+ return projection;
2730
+ }
2731
+ if (typeof projection === 'string' && projection in projectorCache) {
2732
+ return projectorCache[projection];
2733
+ }
2734
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2735
+ // @ts-ignore
2736
+ projectorCache[projection] = new Proj4js.Proj(projection);
2737
+ return projectorCache[projection];
2738
+ };
2739
+ /* Function which calculates the distance between two points */
2740
+ const distance = (a, b) => {
2741
+ return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
2742
+ };
2743
+ /* Function which calculates if a point is between two other points */
2744
+ const isBetween = (a, c, b) => {
2745
+ const da = distance(a, c) + distance(c, b);
2746
+ const db = distance(a, b);
2747
+ return Math.abs(da - db) < 1;
2748
+ };
2749
+ const convertGeoCoordsToScreenCoords = (featureCoords, mapId) => {
2750
+ const webmapjs = webmapUtils.getWMJSMapById(mapId);
2751
+ const XYCoords = [];
2752
+ for (const featureCoord of featureCoords) {
2753
+ if (featureCoord.length < 2) {
2754
+ // eslint-disable-next-line no-continue
2755
+ continue;
2756
+ }
2757
+ const coord = webmapjs.getPixelCoordFromLatLong({
2758
+ x: featureCoord[0],
2759
+ y: featureCoord[1]
2760
+ });
2761
+ XYCoords.push(coord);
2762
+ }
2763
+ return XYCoords;
2764
+ };
2765
+ const getPixelCoordFromGeoCoord = (featureCoords, mapId) => {
2766
+ const webmapjs = webmapUtils.getWMJSMapById(mapId);
2767
+ const {
2768
+ width,
2769
+ height
2770
+ } = webmapjs.getSize();
2771
+ const bbox = webmapjs.getBBOX();
2772
+ const proj = webmapjs.getProj4();
2773
+ const XYCoords = [];
2774
+ const from = getProj4(proj.lonlat);
2775
+ const to = getProj4(proj.crs);
2776
+ for (const featureCoord of featureCoords) {
2777
+ if (featureCoord.length < 2) {
2778
+ // eslint-disable-next-line no-continue
2779
+ continue;
2780
+ }
2781
+ let coordinates = {
2782
+ x: featureCoord[0],
2783
+ y: featureCoord[1]
2784
+ };
2785
+ coordinates = proj.proj4.transform(from, to, coordinates);
2786
+ const x = width * (coordinates.x - bbox.left) / (bbox.right - bbox.left);
2787
+ const y = height * (coordinates.y - bbox.top) / (bbox.bottom - bbox.top);
2788
+ XYCoords.push({
2789
+ x,
2790
+ y
2791
+ });
2792
+ }
2793
+ return XYCoords;
2794
+ };
2795
+ const findClosestCoords = (positions, mouseX, mouseY) => {
2796
+ const thresholds = {
2797
+ max: 150,
2798
+ min: 0.5
2799
+ };
2800
+ let closestIndexes = [];
2801
+ let closestDist = Infinity;
2802
+ positions.forEach((position, index) => {
2803
+ const currentDist = distance(position, {
2804
+ x: mouseX,
2805
+ y: mouseY
2806
+ });
2807
+ if (currentDist < thresholds.min || currentDist > thresholds.max) {
2808
+ return;
2809
+ }
2810
+ if (currentDist < closestDist) {
2811
+ closestDist = currentDist;
2812
+ closestIndexes = [index];
2813
+ } else if (currentDist === closestDist) {
2814
+ closestIndexes.push(index);
2815
+ }
2816
+ });
2817
+ return closestIndexes;
2818
+ };
2819
+ const checkHoverVertice = (feature, mouseX, mouseY, convertGeoCoordsToScreenCoords, ignoreCoordinateIndexInFeature) => {
2820
+ const maxDistance = 20;
2821
+ if (feature.geometry.type === 'Point') {
2822
+ const featureCoords = feature.geometry.coordinates;
2823
+ /* Get all vertexes */
2824
+ const XYCoords = convertGeoCoordsToScreenCoords([featureCoords]);
2825
+ if (XYCoords.length > 0 && distance(XYCoords[0], {
2826
+ x: mouseX,
2827
+ y: mouseY
2736
2828
  }) < maxDistance) {
2737
2829
  return {
2738
2830
  coordinateIndexInFeature: 0
@@ -2931,41 +3023,26 @@ const featureBox = {
2931
3023
  }
2932
3024
  };
2933
3025
  const lineString = {
3026
+ type: 'Feature',
3027
+ properties: {
3028
+ stroke: '#66F',
3029
+ 'stroke-width': 5,
3030
+ 'stroke-opacity': '1'
3031
+ },
3032
+ geometry: {
3033
+ type: 'LineString',
3034
+ coordinates: [[]]
3035
+ }
3036
+ };
3037
+ const lineStringCollection = {
2934
3038
  type: 'FeatureCollection',
2935
- features: [{
2936
- type: 'Feature',
2937
- properties: {
2938
- stroke: '#66F',
2939
- 'stroke-width': 5,
2940
- 'stroke-opacity': '1'
2941
- },
2942
- geometry: {
2943
- type: 'LineString',
2944
- coordinates: [[]]
2945
- }
2946
- }]
3039
+ features: [lineString]
2947
3040
  };
2948
3041
 
2949
3042
  const colors = {
2950
3043
  main: '#ff7800',
2951
3044
  vertice: '#000'
2952
3045
  };
2953
- const Proj4js = proj4;
2954
- // Cache for for storing and reusing Proj4 instances
2955
- const projectorCache = {};
2956
- // Ensure that you have a Proj4 object, pulling from the cache if necessary
2957
- const getProj4 = projection => {
2958
- if (projection instanceof Proj4js.Proj) {
2959
- return projection;
2960
- }
2961
- if (typeof projection === 'string' && projection in projectorCache) {
2962
- return projectorCache[projection];
2963
- }
2964
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2965
- // @ts-ignore
2966
- projectorCache[projection] = new Proj4js.Proj(projection);
2967
- return projectorCache[projection];
2968
- };
2969
3046
  var EDITMODE;
2970
3047
  (function (EDITMODE) {
2971
3048
  EDITMODE["EMPTY"] = "EMPTY";
@@ -3023,14 +3100,15 @@ class MapDraw extends React.PureComponent {
3023
3100
  constructor(props) {
3024
3101
  super(props);
3025
3102
  this.handleGeoJSONUpdate = newGeoJSON => {
3103
+ var _a;
3026
3104
  const {
3027
3105
  selectedFeatureIndex,
3028
3106
  mapId
3029
3107
  } = this.props;
3030
3108
  this.geojson = cloneDeep(newGeoJSON);
3031
3109
  /* Ensure that this.snappedPolygonIndex is still within the coordinates array */
3032
- if (this.geojson && this.geojson.features && selectedFeatureIndex < this.geojson.features.length) {
3033
- const feature = this.geojson.features[selectedFeatureIndex];
3110
+ if (((_a = this.geojson) === null || _a === void 0 ? void 0 : _a.features) && selectedFeatureIndex < this.geojson.features.length) {
3111
+ const feature = this.getSelectedFeature();
3034
3112
  if (feature.geometry) {
3035
3113
  const {
3036
3114
  coordinates
@@ -3041,33 +3119,39 @@ class MapDraw extends React.PureComponent {
3041
3119
  }
3042
3120
  }
3043
3121
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3044
- webmapjs && webmapjs.draw('MapDraw::handleGeoJSONUpdate');
3122
+ webmapjs === null || webmapjs === void 0 ? void 0 : webmapjs.draw('MapDraw::handleGeoJSONUpdate');
3045
3123
  };
3046
3124
  this.handleExitDrawMode = (reason = 'escaped') => {
3047
3125
  const {
3048
- exitDrawModeCallback,
3049
- selectedFeatureIndex
3126
+ exitDrawModeCallback
3050
3127
  } = this.props;
3051
3128
  // remove last vertice when pressing ESC while drawing a polygon
3052
- if (this.myDrawMode === DRAWMODE.POLYGON && this.myEditMode === EDITMODE.ADD_FEATURE && reason === 'escaped') {
3053
- const currentFeature = this.geojson.features[selectedFeatureIndex];
3129
+ if (this.myDrawMode === DRAWMODE.POLYGON && this.myEditMode === EDITMODE.ADD_FEATURE) {
3130
+ const currentFeature = this.getSelectedFeature();
3054
3131
  const currentGeometry = currentFeature.geometry;
3055
3132
  const coordinates = currentGeometry.coordinates[0];
3056
3133
  if (currentGeometry.type === 'Polygon') {
3057
- coordinates.splice(coordinates.length - 1, 1);
3134
+ const firstElement = coordinates[0];
3135
+ coordinates[this.mouseIsOverVertexNr] = cloneDeep(firstElement);
3058
3136
  }
3059
3137
  }
3060
3138
  if (exitDrawModeCallback && (this.myEditMode === EDITMODE.EMPTY || this.myEditMode === EDITMODE.DELETE_FEATURES)) {
3061
- exitDrawModeCallback(reason);
3139
+ exitDrawModeCallback(reason, this.geojson);
3062
3140
  }
3063
3141
  this.cancelEdit(this.myDrawMode !== DRAWMODE.BOX);
3064
3142
  if (this.myDrawMode === DRAWMODE.POLYGON && exitDrawModeCallback) {
3065
- exitDrawModeCallback(reason);
3143
+ exitDrawModeCallback(reason, this.geojson);
3066
3144
  }
3067
3145
  if (this.myDrawMode === DRAWMODE.LINESTRING && exitDrawModeCallback) {
3068
- exitDrawModeCallback(reason);
3146
+ exitDrawModeCallback(reason, this.geojson);
3069
3147
  }
3070
3148
  };
3149
+ this.getSelectedFeature = () => {
3150
+ const {
3151
+ selectedFeatureIndex
3152
+ } = this.props;
3153
+ return this.geojson.features[selectedFeatureIndex];
3154
+ };
3071
3155
  this.myEditMode = EDITMODE.EMPTY;
3072
3156
  this.myDrawMode = DRAWMODE.POLYGON;
3073
3157
  this.beforeDraw = this.beforeDraw.bind(this);
@@ -3076,8 +3160,6 @@ class MapDraw extends React.PureComponent {
3076
3160
  this.deleteFeature = this.deleteFeature.bind(this);
3077
3161
  this.mouseUp = this.mouseUp.bind(this);
3078
3162
  this.cancelEdit = this.cancelEdit.bind(this);
3079
- this.distance = this.distance.bind(this);
3080
- this.isBetween = this.isBetween.bind(this);
3081
3163
  this.checkDist = this.checkDist.bind(this);
3082
3164
  this.hoverEdge = this.hoverEdge.bind(this);
3083
3165
  this.drawPolygon = this.drawPolygon.bind(this);
@@ -3100,6 +3182,7 @@ class MapDraw extends React.PureComponent {
3100
3182
  this.checkIfFeatureIsBox = this.checkIfFeatureIsBox.bind(this);
3101
3183
  this.handleGeoJSONUpdate = this.handleGeoJSONUpdate.bind(this);
3102
3184
  this.handleNewFeatureIndex = this.handleNewFeatureIndex.bind(this);
3185
+ this.getSelectedFeature = this.getSelectedFeature.bind(this);
3103
3186
  this.handleDrawMode(props.drawMode);
3104
3187
  this.textPositions = [];
3105
3188
  this.mouseOverPolygonCoordinates = [];
@@ -3209,19 +3292,24 @@ class MapDraw extends React.PureComponent {
3209
3292
  this.componentCleanup();
3210
3293
  }
3211
3294
  handleKeyDown(event) {
3295
+ const {
3296
+ isInEditMode
3297
+ } = this.props;
3212
3298
  const ESCAPE_KEY = 27;
3213
3299
  if (event.keyCode === ESCAPE_KEY) {
3214
3300
  this.handleExitDrawMode('escaped');
3215
3301
  }
3302
+ if (isInEditMode && (event.key === 'Delete' || event.key === 'Backspace')) {
3303
+ this.deleteFeature();
3304
+ }
3216
3305
  }
3217
3306
  handleNewFeatureIndex() {
3218
3307
  var _a;
3219
3308
  // Another feature was selected. The mouseIsOverVertexNr should be updated
3220
3309
  const {
3221
- selectedFeatureIndex,
3222
3310
  mapId
3223
3311
  } = this.props;
3224
- const feature = this.geojson.features[selectedFeatureIndex];
3312
+ const feature = this.getSelectedFeature();
3225
3313
  if (feature) {
3226
3314
  const featureCoords = feature.geometry.coordinates;
3227
3315
  this.mouseIsOverVertexNr = featureCoords.length - 1;
@@ -3249,47 +3337,17 @@ class MapDraw extends React.PureComponent {
3249
3337
  }
3250
3338
  }
3251
3339
  }
3252
- getPixelCoordFromGeoCoord(featureCoords) {
3340
+ hoverVertex(feature, mouseX, mouseY) {
3253
3341
  const {
3254
3342
  mapId
3255
3343
  } = this.props;
3256
- const webmapjs = webmapUtils.getWMJSMapById(mapId);
3257
- const {
3258
- width,
3259
- height
3260
- } = webmapjs.getSize();
3261
- const bbox = webmapjs.getBBOX();
3262
- const proj = webmapjs.getProj4();
3263
- const XYCoords = [];
3264
- const from = getProj4(proj.lonlat);
3265
- const to = getProj4(proj.crs);
3266
- for (const featureCoord of featureCoords) {
3267
- if (featureCoord.length < 2) {
3268
- // eslint-disable-next-line no-continue
3269
- continue;
3270
- }
3271
- let coordinates = {
3272
- x: featureCoord[0],
3273
- y: featureCoord[1]
3274
- };
3275
- coordinates = proj.proj4.transform(from, to, coordinates);
3276
- const x = width * (coordinates.x - bbox.left) / (bbox.right - bbox.left);
3277
- const y = height * (coordinates.y - bbox.top) / (bbox.bottom - bbox.top);
3278
- XYCoords.push({
3279
- x,
3280
- y
3281
- });
3282
- }
3283
- return XYCoords;
3284
- }
3285
- hoverVertex(feature, mouseX, mouseY) {
3286
3344
  let foundVertex = VERTEX.NONE;
3287
3345
  this.mouseIsOverVertexNr = VERTEX.NONE;
3288
3346
  if (feature.geometry.type === 'Point') {
3289
3347
  this.snappedPolygonIndex = SNAPPEDFEATURE.NONE;
3290
3348
  const featureCoords = feature.geometry.coordinates;
3291
3349
  /* Get all vertexes */
3292
- const XYCoords = this.convertGeoCoordsToScreenCoords([featureCoords]);
3350
+ const XYCoords = convertGeoCoordsToScreenCoords([featureCoords], mapId);
3293
3351
  if (XYCoords.length > 0 && this.checkDist(XYCoords[0], 0, mouseX, mouseY)) {
3294
3352
  this.mouseIsOverVertexNr = 0;
3295
3353
  return;
@@ -3304,7 +3362,7 @@ class MapDraw extends React.PureComponent {
3304
3362
  continue;
3305
3363
  }
3306
3364
  /* Get all vertexes */
3307
- const XYCoords = this.convertGeoCoordsToScreenCoords([featureCoords]);
3365
+ const XYCoords = convertGeoCoordsToScreenCoords([featureCoords], mapId);
3308
3366
  if (XYCoords.length > 0 && this.checkDist(XYCoords[0], polygonIndex, mouseX, mouseY)) {
3309
3367
  this.mouseIsOverVertexNr = polygonIndex;
3310
3368
  return;
@@ -3319,7 +3377,7 @@ class MapDraw extends React.PureComponent {
3319
3377
  continue;
3320
3378
  }
3321
3379
  /* Get all vertexes */
3322
- const XYCoords = this.convertGeoCoordsToScreenCoords(featureCoords);
3380
+ const XYCoords = convertGeoCoordsToScreenCoords(featureCoords, mapId);
3323
3381
  const middle = {
3324
3382
  x: 0,
3325
3383
  y: 0
@@ -3351,7 +3409,7 @@ class MapDraw extends React.PureComponent {
3351
3409
  const lineStringIndex = 0;
3352
3410
  const featureCoords = feature.geometry.coordinates;
3353
3411
  /* Get all vertexes */
3354
- const XYCoords = this.convertGeoCoordsToScreenCoords(featureCoords);
3412
+ const XYCoords = convertGeoCoordsToScreenCoords(featureCoords, mapId);
3355
3413
  /* Snap to the vertex closer than specified pixels */
3356
3414
  for (let j = 0; j < XYCoords.length; j += 1) {
3357
3415
  const coord = XYCoords[j];
@@ -3367,10 +3425,10 @@ class MapDraw extends React.PureComponent {
3367
3425
  mouseMove(event) {
3368
3426
  const {
3369
3427
  isInEditMode,
3370
- selectedFeatureIndex,
3371
- onHoverFeature
3428
+ onHoverFeature,
3429
+ mapId
3372
3430
  } = this.props;
3373
- if (event && event.rightButton === true) {
3431
+ if ((event === null || event === void 0 ? void 0 : event.rightButton) === true) {
3374
3432
  return undefined;
3375
3433
  }
3376
3434
  /* mouseMove is an event callback function which is triggered when the mouse moves over the map
@@ -3387,7 +3445,7 @@ class MapDraw extends React.PureComponent {
3387
3445
  if (onHoverFeature) {
3388
3446
  const handleMouseStoppedTimer = () => {
3389
3447
  const result = checkHoverFeatures(this.geojson, this.mouseX, this.mouseY, coordinates => {
3390
- return this.convertGeoCoordsToScreenCoords(coordinates);
3448
+ return convertGeoCoordsToScreenCoords(coordinates, mapId);
3391
3449
  });
3392
3450
  if (result) {
3393
3451
  this.featureEvent = {
@@ -3402,9 +3460,6 @@ class MapDraw extends React.PureComponent {
3402
3460
  } else {
3403
3461
  this.featureEvent = undefined;
3404
3462
  }
3405
- const {
3406
- mapId
3407
- } = this.props;
3408
3463
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3409
3464
  webmapjs && webmapjs.draw('MapDraw::onHoverFeature');
3410
3465
  };
@@ -3414,13 +3469,10 @@ class MapDraw extends React.PureComponent {
3414
3469
  if (isInEditMode === false) {
3415
3470
  return undefined;
3416
3471
  }
3417
- const feature = this.geojson.features[selectedFeatureIndex];
3472
+ const feature = this.getSelectedFeature();
3418
3473
  if (!feature) {
3419
3474
  return undefined;
3420
3475
  }
3421
- const {
3422
- mapId
3423
- } = this.props;
3424
3476
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3425
3477
  this.mouseGeoCoord = webmapjs.getLatLongFromPixelCoord({
3426
3478
  x: mouseX,
@@ -3515,8 +3567,7 @@ class MapDraw extends React.PureComponent {
3515
3567
  mouseY
3516
3568
  } = event;
3517
3569
  const {
3518
- mapId,
3519
- selectedFeatureIndex
3570
+ mapId
3520
3571
  } = this.props;
3521
3572
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3522
3573
  if (this.myDrawMode === DRAWMODE.POLYGON) {
@@ -3525,7 +3576,7 @@ class MapDraw extends React.PureComponent {
3525
3576
  x: mouseX,
3526
3577
  y: mouseY
3527
3578
  });
3528
- const feature = this.geojson.features[selectedFeatureIndex];
3579
+ const feature = this.getSelectedFeature();
3529
3580
  if (this.checkIfFeatureIsBox(feature)) {
3530
3581
  return false;
3531
3582
  }
@@ -3545,7 +3596,7 @@ class MapDraw extends React.PureComponent {
3545
3596
  x: mouseX,
3546
3597
  y: mouseY
3547
3598
  });
3548
- const feature = this.geojson.features[selectedFeatureIndex];
3599
+ const feature = this.getSelectedFeature();
3549
3600
  if (this.checkIfFeatureIsBox(feature)) {
3550
3601
  return false;
3551
3602
  }
@@ -3581,7 +3632,7 @@ class MapDraw extends React.PureComponent {
3581
3632
  if (!this.geojson.features[selectedFeatureIndex]) {
3582
3633
  this.geojson.features[selectedFeatureIndex] = getNewFeature(this.myDrawMode);
3583
3634
  }
3584
- const feature = this.geojson.features[selectedFeatureIndex];
3635
+ const feature = this.getSelectedFeature();
3585
3636
  this.initializeFeatureCoordinates(feature, this.myDrawMode);
3586
3637
  this.mouseGeoCoord = webmapjs.getLatLongFromPixelCoord({
3587
3638
  x: mouseX,
@@ -3590,16 +3641,12 @@ class MapDraw extends React.PureComponent {
3590
3641
  if (this.myDrawMode === DRAWMODE.POINT || this.myDrawMode === DRAWMODE.MULTIPOINT) {
3591
3642
  /* Create points */
3592
3643
  const pointGeometry = feature.geometry;
3593
- if (pointGeometry) {
3594
- if (pointGeometry.coordinates === undefined) {
3595
- pointGeometry.coordinates = [];
3596
- }
3644
+ if ((pointGeometry === null || pointGeometry === void 0 ? void 0 : pointGeometry.coordinates) === undefined) {
3645
+ pointGeometry.coordinates = [];
3597
3646
  }
3598
3647
  const multiPointGeometry = feature.geometry;
3599
- if (multiPointGeometry) {
3600
- if (multiPointGeometry.coordinates === undefined) {
3601
- multiPointGeometry.coordinates = [[]];
3602
- }
3648
+ if ((multiPointGeometry === null || multiPointGeometry === void 0 ? void 0 : multiPointGeometry.coordinates) === undefined) {
3649
+ multiPointGeometry.coordinates = [[]];
3603
3650
  }
3604
3651
  if (this.myDrawMode === DRAWMODE.POINT) {
3605
3652
  const featureCoords = pointGeometry.coordinates;
@@ -3630,18 +3677,17 @@ class MapDraw extends React.PureComponent {
3630
3677
  if (this.myDrawMode === DRAWMODE.POLYGON || this.myDrawMode === DRAWMODE.BOX) {
3631
3678
  /* Create poly's and boxes */
3632
3679
  this.myEditMode = EDITMODE.ADD_FEATURE;
3633
- if (feature.geometry) {
3634
- if (feature.geometry.coordinates === undefined) {
3635
- feature.geometry.coordinates = [[]];
3636
- }
3680
+ const polygonGeometry = feature.geometry;
3681
+ if ((polygonGeometry === null || polygonGeometry === void 0 ? void 0 : polygonGeometry.coordinates) === undefined) {
3682
+ polygonGeometry.coordinates = [[]];
3637
3683
  }
3638
- if (feature.geometry.coordinates[0] === undefined || feature.geometry.coordinates[0].length === 0) {
3639
- feature.geometry.coordinates[0] = []; /* Used to create the first polygon */
3684
+ if (polygonGeometry.coordinates[0] === undefined || polygonGeometry.coordinates[0].length === 0) {
3685
+ polygonGeometry.coordinates[0] = []; /* Used to create the first polygon */
3640
3686
  } else {
3641
- feature.geometry.coordinates.push([]); /* Used to create extra polygons in the same feature */
3687
+ polygonGeometry.coordinates.push([]); /* Used to create extra polygons in the same feature */
3642
3688
  }
3643
- this.snappedPolygonIndex = feature.geometry.coordinates.length - 1;
3644
- const featureCoords = feature.geometry.coordinates[this.snappedPolygonIndex];
3689
+ this.snappedPolygonIndex = polygonGeometry.coordinates.length - 1;
3690
+ const featureCoords = polygonGeometry.coordinates[this.snappedPolygonIndex];
3645
3691
  featureCoords.push([this.mouseGeoCoord.x, this.mouseGeoCoord.y]);
3646
3692
  featureCoords.push([this.mouseGeoCoord.x, this.mouseGeoCoord.y]);
3647
3693
  /* This is triggered when a bounding box is created. Five points are added at once */
@@ -3689,8 +3735,7 @@ class MapDraw extends React.PureComponent {
3689
3735
  mouseY
3690
3736
  } = event;
3691
3737
  const {
3692
- mapId,
3693
- selectedFeatureIndex
3738
+ mapId
3694
3739
  } = this.props;
3695
3740
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3696
3741
  if (this.myDrawMode === DRAWMODE.MULTIPOINT) {
@@ -3699,12 +3744,14 @@ class MapDraw extends React.PureComponent {
3699
3744
  x: mouseX,
3700
3745
  y: mouseY
3701
3746
  });
3702
- const feature = this.geojson.features[selectedFeatureIndex];
3703
- const featureCoords = feature.geometry.coordinates;
3704
- featureCoords.push([this.mouseGeoCoord.x, this.mouseGeoCoord.y]);
3705
- this.featureHasChanged('point added to multipoint');
3706
- this.mouseIsOverVertexNr = VERTEX.NONE;
3707
- this.mouseMove(event);
3747
+ const feature = this.getSelectedFeature();
3748
+ if (feature.geometry.type === 'MultiPoint') {
3749
+ const featureCoords = feature.geometry.coordinates;
3750
+ featureCoords.push([this.mouseGeoCoord.x, this.mouseGeoCoord.y]);
3751
+ this.featureHasChanged('point added to multipoint');
3752
+ this.mouseIsOverVertexNr = VERTEX.NONE;
3753
+ this.mouseMove(event);
3754
+ }
3708
3755
  return false;
3709
3756
  }
3710
3757
  }
@@ -3716,8 +3763,7 @@ class MapDraw extends React.PureComponent {
3716
3763
  mouseY
3717
3764
  } = event;
3718
3765
  const {
3719
- mapId,
3720
- selectedFeatureIndex
3766
+ mapId
3721
3767
  } = this.props;
3722
3768
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3723
3769
  if (this.myDrawMode === DRAWMODE.POLYGON) {
@@ -3726,12 +3772,14 @@ class MapDraw extends React.PureComponent {
3726
3772
  x: mouseX,
3727
3773
  y: mouseY
3728
3774
  });
3729
- const feature = this.geojson.features[selectedFeatureIndex];
3730
- const featureCoords = feature.geometry.coordinates[this.snappedPolygonIndex];
3731
- featureCoords.push([this.mouseGeoCoord.x, this.mouseGeoCoord.y]);
3732
- this.featureHasChanged('vertex added to polygon');
3733
- this.mouseIsOverVertexNr = featureCoords.length - 1;
3734
- this.mouseMove(event);
3775
+ const feature = this.getSelectedFeature();
3776
+ if (feature.geometry.type === 'Polygon') {
3777
+ const featureCoords = feature.geometry.coordinates[this.snappedPolygonIndex];
3778
+ featureCoords.push([this.mouseGeoCoord.x, this.mouseGeoCoord.y]);
3779
+ this.featureHasChanged('vertex added to polygon');
3780
+ this.mouseIsOverVertexNr = featureCoords.length - 1;
3781
+ this.mouseMove(event);
3782
+ }
3735
3783
  return false;
3736
3784
  }
3737
3785
  }
@@ -3743,8 +3791,7 @@ class MapDraw extends React.PureComponent {
3743
3791
  mouseY
3744
3792
  } = event;
3745
3793
  const {
3746
- mapId,
3747
- selectedFeatureIndex
3794
+ mapId
3748
3795
  } = this.props;
3749
3796
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3750
3797
  if (this.myDrawMode === DRAWMODE.LINESTRING) {
@@ -3753,7 +3800,7 @@ class MapDraw extends React.PureComponent {
3753
3800
  x: mouseX,
3754
3801
  y: mouseY
3755
3802
  });
3756
- const feature = this.geojson.features[selectedFeatureIndex];
3803
+ const feature = this.getSelectedFeature();
3757
3804
  const featureCoords = feature.geometry.coordinates;
3758
3805
  featureCoords.push([this.mouseGeoCoord.x, this.mouseGeoCoord.y]);
3759
3806
  this.featureHasChanged('vertex added to LineString');
@@ -3768,7 +3815,7 @@ class MapDraw extends React.PureComponent {
3768
3815
  const {
3769
3816
  isInEditMode
3770
3817
  } = this.props;
3771
- if (event && event.rightButton === true) {
3818
+ if ((event === null || event === void 0 ? void 0 : event.rightButton) === true) {
3772
3819
  return;
3773
3820
  }
3774
3821
  if (isInEditMode === false) {
@@ -3817,10 +3864,9 @@ class MapDraw extends React.PureComponent {
3817
3864
  }
3818
3865
  deletePolygon(index) {
3819
3866
  const {
3820
- selectedFeatureIndex,
3821
3867
  deletePolygonCallback
3822
3868
  } = this.props;
3823
- const feature = this.geojson.features[selectedFeatureIndex];
3869
+ const feature = this.getSelectedFeature();
3824
3870
  feature.geometry.coordinates.splice(index, 1);
3825
3871
  if (deletePolygonCallback) {
3826
3872
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -3835,43 +3881,45 @@ class MapDraw extends React.PureComponent {
3835
3881
  selectedFeatureIndex
3836
3882
  } = this.props;
3837
3883
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3838
- if (this.mouseIsOverVertexNr === VERTEX.NONE) {
3839
- return;
3840
- }
3841
- const feature = this.geojson.features[selectedFeatureIndex];
3842
- const featureCoords = feature.geometry.coordinates[this.snappedPolygonIndex];
3884
+ const feature = this.geojson.features[selectedFeatureIndex]; // Not actually necessarily a polygon
3885
+ const polygonIndex =
3886
+ // This allows us to delete nodes even while not hovering them
3887
+ (feature === null || feature === void 0 ? void 0 : feature.geometry.coordinates.length) === 1 ? 0 : this.snappedPolygonIndex;
3888
+ const featureCoords = feature === null || feature === void 0 ? void 0 : feature.geometry.coordinates[polygonIndex];
3843
3889
  if (featureCoords === undefined) {
3844
3890
  return;
3845
3891
  }
3846
- if (this.mouseIsOverVertexNr !== VERTEX.MIDDLE_POINT_OF_FEATURE) {
3892
+ if (this.mouseIsOverVertexNr !== VERTEX.MIDDLE_POINT_OF_FEATURE && Array.isArray(featureCoords)) {
3847
3893
  /* Remove edge of polygon */
3848
- if (featureCoords.length <= 3) {
3894
+ if (featureCoords.length <= 4) {
3849
3895
  /* Remove the polygon completely if it can not have an area */
3850
- this.deletePolygon(this.snappedPolygonIndex);
3896
+ this.deletePolygon(polygonIndex);
3851
3897
  } else {
3898
+ const closestCoords = findClosestCoords(convertGeoCoordsToScreenCoords(featureCoords, mapId), this.mouseX, this.mouseY);
3899
+ const newLength = featureCoords.length - closestCoords.length;
3852
3900
  /* Remove edge of polygon */
3853
- // eslint-disable-next-line no-lonely-if
3854
- if (!this.checkIfFeatureIsBox(feature)) {
3855
- if (Array.isArray(featureCoords) && typeof this.mouseIsOverVertexNr === 'number') {
3856
- featureCoords.splice(this.mouseIsOverVertexNr, 1);
3857
- }
3901
+ closestCoords.sort().reverse().forEach(index => {
3902
+ featureCoords.splice(index, 1);
3903
+ });
3904
+ if (closestCoords.length > 1) {
3905
+ featureCoords.push(cloneDeep(featureCoords[0]));
3858
3906
  }
3907
+ this.mouseIsOverVertexNr = newLength - 1;
3859
3908
  }
3860
3909
  } else {
3861
3910
  /* Remove the polygon completely */
3862
- this.deletePolygon(this.snappedPolygonIndex);
3911
+ this.deletePolygon(polygonIndex);
3863
3912
  }
3864
3913
  this.featureHasChanged('deleteFeature');
3865
- this.selectedEdge = EDGE.NONE;
3866
- this.mouseIsOverVertexNr = VERTEX.NONE;
3867
3914
  webmapjs.draw('MapDraw::deletefeatures');
3868
3915
  }
3869
3916
  mouseUp(event) {
3870
3917
  const {
3871
3918
  isInEditMode,
3872
- onClickFeature
3919
+ onClickFeature,
3920
+ mapId
3873
3921
  } = this.props;
3874
- if (event && event.rightButton === true) {
3922
+ if ((event === null || event === void 0 ? void 0 : event.rightButton) === true) {
3875
3923
  return;
3876
3924
  }
3877
3925
  if (onClickFeature) {
@@ -3881,7 +3929,7 @@ class MapDraw extends React.PureComponent {
3881
3929
  } = event;
3882
3930
  const ignoreCoordinateIndexInFeature = true;
3883
3931
  const result = checkHoverFeatures(this.geojson, mouseX, mouseY, coordinates => {
3884
- return this.convertGeoCoordsToScreenCoords(coordinates);
3932
+ return convertGeoCoordsToScreenCoords(coordinates, mapId);
3885
3933
  }, ignoreCoordinateIndexInFeature);
3886
3934
  if (result) {
3887
3935
  const featureEvent = {
@@ -3923,14 +3971,11 @@ class MapDraw extends React.PureComponent {
3923
3971
  cancelEdit(cancelLastPoint) {
3924
3972
  const {
3925
3973
  isInEditMode,
3926
- selectedFeatureIndex
3974
+ mapId
3927
3975
  } = this.props;
3928
3976
  if (isInEditMode === false) {
3929
3977
  return;
3930
3978
  }
3931
- const {
3932
- mapId
3933
- } = this.props;
3934
3979
  const webmapjs = webmapUtils.getWMJSMapById(mapId);
3935
3980
  /* When in addpolygon mode, finish the polygon */
3936
3981
  if (this.myEditMode === EDITMODE.ADD_FEATURE) {
@@ -3939,7 +3984,7 @@ class MapDraw extends React.PureComponent {
3939
3984
  if (this.snappedPolygonIndex === SNAPPEDFEATURE.NONE) {
3940
3985
  return;
3941
3986
  }
3942
- const feature = this.geojson.features[selectedFeatureIndex];
3987
+ const feature = this.getSelectedFeature();
3943
3988
  const {
3944
3989
  coordinates
3945
3990
  } = feature.geometry;
@@ -3961,7 +4006,7 @@ class MapDraw extends React.PureComponent {
3961
4006
  }
3962
4007
  }
3963
4008
  if (this.myDrawMode === DRAWMODE.LINESTRING) {
3964
- const feature = this.geojson.features[selectedFeatureIndex];
4009
+ const feature = this.getSelectedFeature();
3965
4010
  const featureCoords = feature.geometry.coordinates;
3966
4011
  featureCoords.pop();
3967
4012
  }
@@ -4129,13 +4174,11 @@ class MapDraw extends React.PureComponent {
4129
4174
  }
4130
4175
  }
4131
4176
  validatePolys(fixPolys) {
4132
- if (!this.geojson || !this.geojson.features || !this.geojson.features.length) {
4177
+ var _a, _b;
4178
+ if (!((_b = (_a = this.geojson) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.length)) {
4133
4179
  return;
4134
4180
  }
4135
4181
  for (const geoJsonFeature of this.geojson.features) {
4136
- if (!this.geojson.features) {
4137
- this.geojson.features = [];
4138
- }
4139
4182
  const feature = geoJsonFeature;
4140
4183
  this.validateFeature(feature);
4141
4184
  const featureType = feature.geometry.type;
@@ -4144,30 +4187,6 @@ class MapDraw extends React.PureComponent {
4144
4187
  const polygonGeometry = feature.geometry;
4145
4188
  for (const polyCoordinates of polygonGeometry.coordinates) {
4146
4189
  let featureCoords = polyCoordinates;
4147
- /* Remove duplicates */
4148
- if (!this.checkIfFeatureIsBox(feature)) {
4149
- for (let coordIndex = featureCoords.length - 2; coordIndex >= 0; coordIndex -= 1) {
4150
- const _startCoord = featureCoords[coordIndex];
4151
- const _endCoord = featureCoords[coordIndex + 1];
4152
- if (_startCoord && _endCoord) {
4153
- if (_startCoord[0] === _endCoord[0] && _startCoord[1] === _endCoord[1]) {
4154
- featureCoords.splice(coordIndex, 1);
4155
- }
4156
- }
4157
- }
4158
- /* Add begin to end to make closed polygon */
4159
- const startCoord = featureCoords[0];
4160
- const endCoord = featureCoords[featureCoords.length - 1];
4161
- if (startCoord && endCoord) {
4162
- if (startCoord[0] !== endCoord[0] || startCoord[1] !== endCoord[1]) {
4163
- featureCoords.push(cloneDeep(startCoord));
4164
- if (this.mouseIsOverVertexNr !== VERTEX.NONE && this.mouseIsOverVertexNr !== VERTEX.MIDDLE_POINT_OF_FEATURE) {
4165
- /* This means that our selected vertex is one lower */
4166
- this.mouseIsOverVertexNr -= 1;
4167
- }
4168
- }
4169
- }
4170
- }
4171
4190
  /* Sort clockwise */
4172
4191
  if (fixPolys) {
4173
4192
  if (this.checkIfFeatureIsBox(feature)) {
@@ -4218,11 +4237,13 @@ class MapDraw extends React.PureComponent {
4218
4237
  just before viewer will flip the back canvas buffer to the front.
4219
4238
  You are free to draw anything you like on the canvas.
4220
4239
  */
4240
+ var _a, _b, _c, _d, _e;
4221
4241
  const {
4222
4242
  selectedFeatureIndex,
4223
- isInEditMode
4243
+ isInEditMode,
4244
+ mapId
4224
4245
  } = this.props;
4225
- if (!this.geojson || !this.geojson.features || !this.geojson.features.length) {
4246
+ if (!((_b = (_a = this.geojson) === null || _a === void 0 ? void 0 : _a.features) === null || _b === void 0 ? void 0 : _b.length)) {
4226
4247
  return;
4227
4248
  }
4228
4249
  this.textPositions = [];
@@ -4239,7 +4260,7 @@ class MapDraw extends React.PureComponent {
4239
4260
  };
4240
4261
  if (featureType === 'Point') {
4241
4262
  const featureCoords = feature.geometry.coordinates;
4242
- const XYCoords = this.getPixelCoordFromGeoCoord([featureCoords]);
4263
+ const XYCoords = getPixelCoordFromGeoCoord([featureCoords], mapId);
4243
4264
  if (XYCoords.length === 0) {
4244
4265
  // eslint-disable-next-line no-continue
4245
4266
  continue;
@@ -4250,7 +4271,7 @@ class MapDraw extends React.PureComponent {
4250
4271
  }
4251
4272
  if (featureType === 'MultiPoint') {
4252
4273
  const featureCoords = feature.geometry.coordinates;
4253
- const XYCoords = this.getPixelCoordFromGeoCoord(featureCoords);
4274
+ const XYCoords = getPixelCoordFromGeoCoord(featureCoords, mapId);
4254
4275
  if (XYCoords.length === 0) {
4255
4276
  // eslint-disable-next-line no-continue
4256
4277
  continue;
@@ -4264,7 +4285,7 @@ class MapDraw extends React.PureComponent {
4264
4285
  for (const multiPoly of multiPolygonGeometry.coordinates) {
4265
4286
  for (let polygonIndex = 0; polygonIndex < multiPoly.length; polygonIndex += 1) {
4266
4287
  const featureCoords = multiPoly[polygonIndex];
4267
- const XYCoords = this.getPixelCoordFromGeoCoord(featureCoords);
4288
+ const XYCoords = getPixelCoordFromGeoCoord(featureCoords, mapId);
4268
4289
  /* Only draw if there is stuff to show */
4269
4290
  if (XYCoords.length === 0) {
4270
4291
  // eslint-disable-next-line no-continue
@@ -4291,7 +4312,7 @@ class MapDraw extends React.PureComponent {
4291
4312
  if (totalmiddle.nr > 0) {
4292
4313
  const mx = totalmiddle.x / totalmiddle.nr;
4293
4314
  const my = totalmiddle.y / totalmiddle.nr;
4294
- if (feature.properties && feature.properties.text) {
4315
+ if ((_c = feature.properties) === null || _c === void 0 ? void 0 : _c.text) {
4295
4316
  this.textPositions.push({
4296
4317
  x: mx,
4297
4318
  y: my,
@@ -4305,14 +4326,14 @@ class MapDraw extends React.PureComponent {
4305
4326
  /* Loop through all polygons of the same feature */
4306
4327
  for (let polygonIndex = 0; polygonIndex < polygonGeometry.coordinates.length; polygonIndex += 1) {
4307
4328
  const featureCoords = polygonGeometry.coordinates[polygonIndex];
4308
- const XYCoords = this.getPixelCoordFromGeoCoord(featureCoords);
4329
+ const XYCoords = getPixelCoordFromGeoCoord(featureCoords, mapId);
4309
4330
  /* Only draw if there is stuff to show */
4310
4331
  if (XYCoords.length === 0) {
4311
4332
  // eslint-disable-next-line no-continue
4312
4333
  continue;
4313
4334
  }
4314
4335
  const middle = this.drawPolygon(ctx, XYCoords, featureIndex, polygonIndex);
4315
- if (middle && feature.properties && feature.properties.text) {
4336
+ if (middle && ((_d = feature.properties) === null || _d === void 0 ? void 0 : _d.text)) {
4316
4337
  this.textPositions.push({
4317
4338
  x: middle.x,
4318
4339
  y: middle.y,
@@ -4341,14 +4362,14 @@ class MapDraw extends React.PureComponent {
4341
4362
  // eslint-disable-next-line no-continue
4342
4363
  continue;
4343
4364
  }
4344
- const XYCoords = this.getPixelCoordFromGeoCoord(featureCoords);
4365
+ const XYCoords = getPixelCoordFromGeoCoord(featureCoords, mapId);
4345
4366
  /* Only draw if there is stuff to show */
4346
4367
  if (XYCoords.length === 0) {
4347
4368
  // eslint-disable-next-line no-continue
4348
4369
  continue;
4349
4370
  }
4350
4371
  const middle = this.drawLine(ctx, XYCoords, featureIndex, 0);
4351
- if (middle && feature.properties && feature.properties.text) {
4372
+ if (middle && ((_e = feature.properties) === null || _e === void 0 ? void 0 : _e.text)) {
4352
4373
  this.textPositions.push({
4353
4374
  x: middle.x,
4354
4375
  y: middle.y,
@@ -4365,7 +4386,7 @@ class MapDraw extends React.PureComponent {
4365
4386
  }
4366
4387
  /* Higlight polygon with mousehover */
4367
4388
  if (isInEditMode === true && this.mouseOverPolygonFeatureIndex === selectedFeatureIndex && this.mouseIsOverVertexNr === VERTEX.NONE && this.snappedPolygonIndex === SNAPPEDFEATURE.NONE && this.selectedEdge === EDGE.NONE || this.mouseIsOverVertexNr === VERTEX.MIDDLE_POINT_OF_FEATURE) {
4368
- const feature = this.geojson.features[selectedFeatureIndex];
4389
+ const feature = this.getSelectedFeature();
4369
4390
  const featureProperties = feature.properties;
4370
4391
  if (this.mouseOverPolygonCoordinates.length >= 2) {
4371
4392
  ctx.beginPath();
@@ -4397,20 +4418,9 @@ class MapDraw extends React.PureComponent {
4397
4418
  ctx.fillText(text, x, y);
4398
4419
  }
4399
4420
  }
4400
- /* Function which calculates the distance between two points */
4401
- // eslint-disable-next-line class-methods-use-this
4402
- distance(a, b) {
4403
- return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
4404
- }
4405
- /* Function which calculates if a point is between two other points */
4406
- isBetween(a, c, b) {
4407
- const da = this.distance(a, c) + this.distance(c, b);
4408
- const db = this.distance(a, b);
4409
- return Math.abs(da - db) < 1;
4410
- }
4411
4421
  /* Checks if mouse is in proximity of given coordinate */
4412
4422
  checkDist(coord, polygonIndex, mouseX, mouseY) {
4413
- const VERTEX = this.distance(coord, {
4423
+ const VERTEX = distance(coord, {
4414
4424
  x: mouseX,
4415
4425
  y: mouseY
4416
4426
  });
@@ -4422,6 +4432,9 @@ class MapDraw extends React.PureComponent {
4422
4432
  return false;
4423
4433
  }
4424
4434
  hoverEdge(geometry, mouseX, mouseY) {
4435
+ const {
4436
+ mapId
4437
+ } = this.props;
4425
4438
  const {
4426
4439
  coordinates,
4427
4440
  type
@@ -4434,11 +4447,11 @@ class MapDraw extends React.PureComponent {
4434
4447
  continue;
4435
4448
  }
4436
4449
  /* Get all vertexes */
4437
- const XYCoords = this.convertGeoCoordsToScreenCoords(featureCoords);
4450
+ const XYCoords = convertGeoCoordsToScreenCoords(featureCoords, mapId);
4438
4451
  for (let j = 0; j < XYCoords.length; j += 1) {
4439
4452
  const startV = XYCoords[j];
4440
4453
  const stopV = XYCoords[(j + 1) % XYCoords.length];
4441
- if (this.isBetween(startV, {
4454
+ if (isBetween(startV, {
4442
4455
  x: mouseX,
4443
4456
  y: mouseY
4444
4457
  }, stopV)) {
@@ -4463,11 +4476,11 @@ class MapDraw extends React.PureComponent {
4463
4476
  };
4464
4477
  }
4465
4478
  /* Get all vertexes */
4466
- const XYCoords = this.convertGeoCoordsToScreenCoords(featureCoords);
4479
+ const XYCoords = convertGeoCoordsToScreenCoords(featureCoords, mapId);
4467
4480
  for (let j = 0; j < XYCoords.length - 1; j += 1) {
4468
4481
  const startV = XYCoords[j];
4469
4482
  const stopV = XYCoords[(j + 1) % XYCoords.length];
4470
- if (this.isBetween(startV, {
4483
+ if (isBetween(startV, {
4471
4484
  x: mouseX,
4472
4485
  y: mouseY
4473
4486
  }, stopV)) {
@@ -4527,7 +4540,7 @@ class MapDraw extends React.PureComponent {
4527
4540
  const {
4528
4541
  properties: featureProperties
4529
4542
  } = feature;
4530
- if (featureProperties && featureProperties.imageURL) {
4543
+ if (featureProperties === null || featureProperties === void 0 ? void 0 : featureProperties.imageURL) {
4531
4544
  this.drawIcon(ctx, _coord, featureProperties);
4532
4545
  }
4533
4546
  const drawStyledMarker = featureProperties ? featureProperties.stroke || featureProperties['stroke-width'] || featureProperties.fill : null;
@@ -4625,7 +4638,7 @@ class MapDraw extends React.PureComponent {
4625
4638
  selectedFeatureIndex
4626
4639
  } = this.props;
4627
4640
  const feature = this.geojson.features[featureIndex];
4628
- if (!feature || !feature.geometry) {
4641
+ if (!(feature === null || feature === void 0 ? void 0 : feature.geometry)) {
4629
4642
  return;
4630
4643
  }
4631
4644
  if (feature.geometry.type !== 'LineString') {
@@ -4699,7 +4712,7 @@ class MapDraw extends React.PureComponent {
4699
4712
  selectedFeatureIndex
4700
4713
  } = this.props;
4701
4714
  const feature = this.geojson.features[featureIndex];
4702
- if (!feature || !feature.geometry) {
4715
+ if (!(feature === null || feature === void 0 ? void 0 : feature.geometry)) {
4703
4716
  return;
4704
4717
  }
4705
4718
  if (feature.geometry.type !== 'Polygon' && feature.geometry.type !== 'MultiPolygon') {
@@ -4768,25 +4781,6 @@ class MapDraw extends React.PureComponent {
4768
4781
  middle.nr = XYCoords.length - 1;
4769
4782
  return middle;
4770
4783
  }
4771
- convertGeoCoordsToScreenCoords(featureCoords) {
4772
- const {
4773
- mapId
4774
- } = this.props;
4775
- const webmapjs = webmapUtils.getWMJSMapById(mapId);
4776
- const XYCoords = [];
4777
- for (const featureCoord of featureCoords) {
4778
- if (featureCoord.length < 2) {
4779
- // eslint-disable-next-line no-continue
4780
- continue;
4781
- }
4782
- const coord = webmapjs.getPixelCoordFromLatLong({
4783
- x: featureCoord[0],
4784
- y: featureCoord[1]
4785
- });
4786
- XYCoords.push(coord);
4787
- }
4788
- return XYCoords;
4789
- }
4790
4784
  initializeFeatureCoordinates(feature, type) {
4791
4785
  this.validateFeature(feature);
4792
4786
  // eslint-disable-next-line no-underscore-dangle
@@ -4829,7 +4823,8 @@ class MapDraw extends React.PureComponent {
4829
4823
  }
4830
4824
  // eslint-disable-next-line class-methods-use-this
4831
4825
  checkIfFeatureIsBox(feature) {
4832
- if (!feature || !feature.properties || !feature.properties._type) {
4826
+ var _a;
4827
+ if (!((_a = feature === null || feature === void 0 ? void 0 : feature.properties) === null || _a === void 0 ? void 0 : _a._type)) {
4833
4828
  return false;
4834
4829
  }
4835
4830
  return feature.properties._type === 'box';
@@ -4846,7 +4841,7 @@ class MapDraw extends React.PureComponent {
4846
4841
  }
4847
4842
  }
4848
4843
  render() {
4849
- return /*#__PURE__*/React.createElement("div", null);
4844
+ return jsx("div", {});
4850
4845
  }
4851
4846
  }
4852
4847
  // eslint-disable-next-line react/static-property-placement
@@ -4860,42 +4855,45 @@ MapDraw.defaultProps = {
4860
4855
  const MapDrawContainer = ({
4861
4856
  featureLayers,
4862
4857
  mapId
4863
- }) => ( /*#__PURE__*/React.createElement(React.Fragment, null, featureLayers.map(layer => {
4864
- return /*#__PURE__*/React.createElement("div", {
4865
- "data-testid": `featureLayer-${layer.id}`,
4866
- key: layer.id,
4867
- style: {
4868
- display: 'none'
4869
- }
4870
- }, /*#__PURE__*/React.createElement(MapDraw, {
4871
- geojson: layer.geojson,
4872
- isInEditMode: layer.isInEditMode,
4873
- isInDeleteMode: layer.isInDeleteMode,
4874
- drawMode: layer.drawMode,
4875
- mapId: mapId,
4876
- onHoverFeature: hoverInfo => {
4877
- if (layer.onHoverFeature) {
4878
- layer.onHoverFeature(hoverInfo);
4879
- }
4880
- },
4881
- onClickFeature: hoverInfo => {
4882
- if (layer.onClickFeature) {
4883
- layer.onClickFeature(hoverInfo);
4884
- }
4885
- },
4886
- updateGeojson: (geojson, reason) => {
4887
- if (layer.updateGeojson) {
4888
- layer.updateGeojson(geojson, reason);
4889
- }
4890
- },
4891
- exitDrawModeCallback: reason => {
4892
- if (layer.exitDrawModeCallback) {
4893
- layer.exitDrawModeCallback(reason);
4858
+ }) => jsx(Fragment, {
4859
+ children: featureLayers.map(layer => {
4860
+ return jsx("div", Object.assign({
4861
+ "data-testid": `featureLayer-${layer.id}`,
4862
+ style: {
4863
+ display: 'none'
4894
4864
  }
4895
- },
4896
- selectedFeatureIndex: parseInt(layer.selectedFeatureIndex || '0', 10)
4897
- }));
4898
- })));
4865
+ }, {
4866
+ children: jsx(MapDraw, {
4867
+ geojson: layer.geojson,
4868
+ isInEditMode: layer.isInEditMode,
4869
+ isInDeleteMode: layer.isInDeleteMode,
4870
+ drawMode: layer.drawMode,
4871
+ mapId: mapId,
4872
+ onHoverFeature: hoverInfo => {
4873
+ if (layer.onHoverFeature) {
4874
+ layer.onHoverFeature(hoverInfo);
4875
+ }
4876
+ },
4877
+ onClickFeature: hoverInfo => {
4878
+ if (layer.onClickFeature) {
4879
+ layer.onClickFeature(hoverInfo);
4880
+ }
4881
+ },
4882
+ updateGeojson: (geojson, reason) => {
4883
+ if (layer.updateGeojson) {
4884
+ layer.updateGeojson(geojson, reason);
4885
+ }
4886
+ },
4887
+ exitDrawModeCallback: (reason, newGeoJSON) => {
4888
+ if (layer.exitDrawModeCallback) {
4889
+ layer.exitDrawModeCallback(reason, newGeoJSON);
4890
+ }
4891
+ },
4892
+ selectedFeatureIndex: parseInt(layer.selectedFeatureIndex || '0', 10)
4893
+ })
4894
+ }), layer.id);
4895
+ })
4896
+ });
4899
4897
 
4900
4898
  var NATIVE_BIND$1 = functionBindNative;
4901
4899
 
@@ -5028,30 +5026,32 @@ const GeoJSONTextField = ({
5028
5026
  setValidity(false);
5029
5027
  }
5030
5028
  };
5031
- return /*#__PURE__*/React__default.createElement(Grid, {
5029
+ return jsx(Grid, Object.assign({
5032
5030
  item: true,
5033
5031
  xs: 12,
5034
5032
  sx: sx
5035
- }, /*#__PURE__*/React__default.createElement(TextField, {
5036
- sx: {
5037
- padding: 0,
5038
- border: 'none',
5039
- width: '100%',
5040
- height: '100%',
5041
- fontSize: '10px',
5042
- '.MuiInputBase-root': {
5033
+ }, {
5034
+ children: jsx(TextField, {
5035
+ sx: {
5036
+ padding: 0,
5037
+ border: 'none',
5038
+ width: '100%',
5043
5039
  height: '100%',
5044
- alignItems: 'baseline'
5045
- }
5046
- },
5047
- multiline: true,
5048
- error: !isValid,
5049
- maxRows: _maxRows,
5050
- label: !isValid ? 'GeoJSON not valid' : _title,
5051
- variant: "filled",
5052
- onChange: onChange,
5053
- value: JSON.stringify(geoJSON, null, 2),
5054
- disabled: !onChangeGeoJSON
5040
+ fontSize: '10px',
5041
+ '.MuiInputBase-root': {
5042
+ height: '100%',
5043
+ alignItems: 'baseline'
5044
+ }
5045
+ },
5046
+ multiline: true,
5047
+ error: !isValid,
5048
+ maxRows: _maxRows,
5049
+ label: !isValid ? 'GeoJSON not valid' : _title,
5050
+ variant: "filled",
5051
+ onChange: onChange,
5052
+ value: JSON.stringify(geoJSON, null, 2),
5053
+ disabled: !onChangeGeoJSON
5054
+ })
5055
5055
  }));
5056
5056
  };
5057
5057
 
@@ -5069,81 +5069,88 @@ const FeatureLayers = ({
5069
5069
  label: `${index + 1}: ${geojson.features[index].geometry.type}`
5070
5070
  };
5071
5071
  }) : [];
5072
- return /*#__PURE__*/React__default.createElement(Grid, {
5072
+ return jsx(Grid, Object.assign({
5073
5073
  item: true,
5074
5074
  sm: 12
5075
- }, /*#__PURE__*/React__default.createElement(FormControl, {
5076
- disabled: !featureLayerList.length,
5077
- variant: "filled",
5078
- sx: {
5079
- width: '100%'
5080
- }
5081
- }, /*#__PURE__*/React__default.createElement(InputLabel, {
5082
- id: "demo-feature-number"
5083
- }, "Features"), /*#__PURE__*/React__default.createElement(Select, {
5084
- labelId: "demo-feature-type",
5085
- value: (featureLayerList.length ? activeFeatureLayerIndex : '').toString(),
5086
- onChange: event => {
5087
- const featureNr = parseInt(event.target.value, 10);
5088
- onChangeLayerIndex(featureNr, geojson.features[featureNr]);
5089
- },
5090
- sx: {
5091
- '.MuiSelect-select': {
5092
- display: 'flex'
5093
- }
5094
- }
5095
- }, featureLayerList.map(listItem => {
5096
- return /*#__PURE__*/React__default.createElement(MenuItem, {
5097
- key: listItem.index,
5098
- value: listItem.index
5099
- }, /*#__PURE__*/React__default.createElement(Icon$1, {
5075
+ }, {
5076
+ children: jsxs(FormControl, Object.assign({
5077
+ disabled: !featureLayerList.length,
5078
+ variant: "filled",
5100
5079
  sx: {
5101
- transform: 'scale(0.9)'
5080
+ width: '100%'
5102
5081
  }
5103
- }, getToolIcon(listItem.value)), listItem.label);
5104
- }))));
5105
- };
5106
-
5107
- /* *
5108
- * Licensed under the Apache License, Version 2.0 (the "License");
5109
- * you may not use this file except in compliance with the License.
5110
- * You may obtain a copy of the License at
5111
- *
5112
- * http://www.apache.org/licenses/LICENSE-2.0
5113
- *
5114
- * Unless required by applicable law or agreed to in writing, software
5115
- * distributed under the License is distributed on an "AS IS" BASIS,
5116
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5117
- * See the License for the specific language governing permissions and
5118
- * limitations under the License.
5119
- *
5120
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5121
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
5122
- * */
5123
- const EditModeButton = ({
5124
- isInEditMode,
5125
- drawMode,
5126
- onToggleEditMode
5127
- }) => {
5128
- return /*#__PURE__*/React__default.createElement(Grid, {
5129
- item: true,
5130
- xs: 12
5131
- }, /*#__PURE__*/React__default.createElement(CustomTooltip, {
5132
- title: "Switch mode"
5133
- }, /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(FormLabel, null, "View"), /*#__PURE__*/React__default.createElement(Switch, {
5134
- "data-testid": "switchMode",
5135
- checked: isInEditMode,
5136
- onClick: () => onToggleEditMode(!isInEditMode)
5137
- }), /*#__PURE__*/React__default.createElement(FormLabel, null, "Edit"), drawMode && ( /*#__PURE__*/React__default.createElement(Typography, {
5138
- component: "span",
5139
- sx: {
5140
- display: 'inline-block',
5141
- marginLeft: 2,
5142
- top: -1,
5143
- position: 'relative',
5144
- fontSize: 14
5145
- }
5146
- }, "press ESC to exit draw mode")))));
5082
+ }, {
5083
+ children: [jsx(InputLabel, Object.assign({
5084
+ id: "demo-feature-number"
5085
+ }, {
5086
+ children: "Features"
5087
+ })), jsx(Select, Object.assign({
5088
+ labelId: "demo-feature-type",
5089
+ value: (featureLayerList.length ? activeFeatureLayerIndex : '').toString(),
5090
+ onChange: event => {
5091
+ const featureNr = parseInt(event.target.value, 10);
5092
+ onChangeLayerIndex(featureNr, geojson.features[featureNr]);
5093
+ },
5094
+ sx: {
5095
+ '.MuiSelect-select': {
5096
+ display: 'flex'
5097
+ }
5098
+ }
5099
+ }, {
5100
+ children: featureLayerList.map(listItem => {
5101
+ return jsxs(MenuItem, Object.assign({
5102
+ value: listItem.index
5103
+ }, {
5104
+ children: [jsx(Icon$1, Object.assign({
5105
+ sx: {
5106
+ transform: 'scale(0.9)'
5107
+ }
5108
+ }, {
5109
+ children: getToolIcon(listItem.value)
5110
+ })), listItem.label]
5111
+ }), listItem.index);
5112
+ })
5113
+ }))]
5114
+ }))
5115
+ }));
5116
+ };
5117
+
5118
+ const EditModeButton = ({
5119
+ isInEditMode,
5120
+ drawMode,
5121
+ onToggleEditMode
5122
+ }) => {
5123
+ return jsx(Grid, Object.assign({
5124
+ item: true,
5125
+ xs: 12
5126
+ }, {
5127
+ children: jsx(CustomTooltip, Object.assign({
5128
+ title: "Switch mode"
5129
+ }, {
5130
+ children: jsxs("span", {
5131
+ children: [jsx(FormLabel, {
5132
+ children: "View"
5133
+ }), jsx(Switch, {
5134
+ "data-testid": "switchMode",
5135
+ checked: isInEditMode,
5136
+ onClick: () => onToggleEditMode(!isInEditMode)
5137
+ }), jsx(FormLabel, {
5138
+ children: "Edit"
5139
+ }), drawMode && jsx(Typography, Object.assign({
5140
+ component: "span",
5141
+ sx: {
5142
+ display: 'inline-block',
5143
+ marginLeft: 2,
5144
+ top: -1,
5145
+ position: 'relative',
5146
+ fontSize: 14
5147
+ }
5148
+ }, {
5149
+ children: "press ESC to exit draw mode"
5150
+ }))]
5151
+ })
5152
+ }))
5153
+ }));
5147
5154
  };
5148
5155
 
5149
5156
  /* *
@@ -5521,7 +5528,7 @@ const useGeoJSON = () => {
5521
5528
  value: 'LineString'
5522
5529
  }];
5523
5530
  const [isInEditMode, setEditMode] = useState(false);
5524
- const [geojson, setGeojson] = useState(lineString);
5531
+ const [geojson, setGeojson] = useState(lineStringCollection);
5525
5532
  const [geojsonText, setGeojsonText] = useState('');
5526
5533
  const [drawMode, setDrawMode] = useState('LINESTRING');
5527
5534
  const [currentFeatureNrToEdit, setCurrentFeatureNrToEdit] = useState(0);
@@ -5536,8 +5543,8 @@ const useGeoJSON = () => {
5536
5543
  setGeojsonText(JSON.stringify(simpleBoxGeoJSON, null, 2));
5537
5544
  }
5538
5545
  if (selectedKey === 'LINESTRING') {
5539
- setGeojson(lineString);
5540
- setGeojsonText(JSON.stringify(lineString, null, 2));
5546
+ setGeojson(lineStringCollection);
5547
+ setGeojsonText(JSON.stringify(lineStringCollection, null, 2));
5541
5548
  }
5542
5549
  if (selectedKey === 'POINT' || selectedKey === 'MULTIPOINT') {
5543
5550
  setGeojson(simplePointsGeojson);
@@ -5559,52 +5566,46 @@ const useGeoJSON = () => {
5559
5566
  };
5560
5567
  };
5561
5568
 
5562
- /* *
5563
- * Licensed under the Apache License, Version 2.0 (the "License");
5564
- * you may not use this file except in compliance with the License.
5565
- * You may obtain a copy of the License at
5566
- *
5567
- * http://www.apache.org/licenses/LICENSE-2.0
5568
- *
5569
- * Unless required by applicable law or agreed to in writing, software
5570
- * distributed under the License is distributed on an "AS IS" BASIS,
5571
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5572
- * See the License for the specific language governing permissions and
5573
- * limitations under the License.
5574
- *
5575
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5576
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
5577
- * */
5578
5569
  const StoryLayoutGrid = ({
5579
5570
  mapComponent,
5580
5571
  children
5581
5572
  }) => {
5582
- return /*#__PURE__*/React__default.createElement(Paper, null, /*#__PURE__*/React__default.createElement(Box, {
5583
- sx: {
5584
- display: 'grid',
5585
- gridTemplateColumns: '70% 30%',
5586
- gridTemplateRows: '150px 1fr',
5587
- gridTemplateAreas: "'map controls'\n'map textarea'",
5588
- width: '100%',
5589
- height: '100vh'
5590
- }
5591
- }, /*#__PURE__*/React__default.createElement(Box, {
5592
- sx: {
5593
- gridArea: 'map',
5594
- width: '100%',
5595
- height: '100%'
5596
- }
5597
- }, mapComponent), /*#__PURE__*/React__default.createElement(Box, {
5598
- sx: {
5599
- gridArea: 'controls',
5600
- width: '100%',
5601
- height: '100%',
5602
- padding: 2
5603
- }
5604
- }, /*#__PURE__*/React__default.createElement(Grid, {
5605
- spacing: 2,
5606
- container: true
5607
- }, children))));
5573
+ return jsx(Paper, {
5574
+ children: jsxs(Box, Object.assign({
5575
+ sx: {
5576
+ display: 'grid',
5577
+ gridTemplateColumns: '70% 30%',
5578
+ gridTemplateRows: '150px 1fr',
5579
+ gridTemplateAreas: "'map controls'\n'map textarea'",
5580
+ width: '100%',
5581
+ height: '100vh'
5582
+ }
5583
+ }, {
5584
+ children: [jsx(Box, Object.assign({
5585
+ sx: {
5586
+ gridArea: 'map',
5587
+ width: '100%',
5588
+ height: '100%'
5589
+ }
5590
+ }, {
5591
+ children: mapComponent
5592
+ })), jsx(Box, Object.assign({
5593
+ sx: {
5594
+ gridArea: 'controls',
5595
+ width: '100%',
5596
+ height: '100%',
5597
+ padding: 2
5598
+ }
5599
+ }, {
5600
+ children: jsx(Grid, Object.assign({
5601
+ spacing: 2,
5602
+ container: true
5603
+ }, {
5604
+ children: children
5605
+ }))
5606
+ }))]
5607
+ }))
5608
+ });
5608
5609
  };
5609
5610
 
5610
5611
  const SelectField = ({
@@ -5623,24 +5624,31 @@ const SelectField = ({
5623
5624
  onChangeValue(value);
5624
5625
  };
5625
5626
  const getLabel = currentValue => `${currentValue}${_labelSuffix}`;
5626
- return /*#__PURE__*/React__default.createElement(FormControl, {
5627
+ return jsxs(FormControl, Object.assign({
5627
5628
  variant: "filled",
5628
5629
  sx: {
5629
5630
  width: _width
5630
5631
  }
5631
- }, /*#__PURE__*/React__default.createElement(InputLabel, null, label), /*#__PURE__*/React__default.createElement(Select, {
5632
- value: value,
5633
- onChange: onChange
5634
- }, _options.map(value => ( /*#__PURE__*/React__default.createElement(MenuItem, {
5635
- value: value,
5636
- key: value
5637
- }, _showValueAsColor ? ( /*#__PURE__*/React__default.createElement(Box, {
5638
- sx: {
5639
- backgroundColor: value,
5640
- width: 20,
5641
- height: 20
5642
- }
5643
- })) : getLabel(value.toString()))))));
5632
+ }, {
5633
+ children: [jsx(InputLabel, {
5634
+ children: label
5635
+ }), jsx(Select, Object.assign({
5636
+ value: value,
5637
+ onChange: onChange
5638
+ }, {
5639
+ children: _options.map(value => jsx(MenuItem, Object.assign({
5640
+ value: value
5641
+ }, {
5642
+ children: _showValueAsColor ? jsx(Box, {
5643
+ sx: {
5644
+ backgroundColor: value,
5645
+ width: 20,
5646
+ height: 20
5647
+ }
5648
+ }) : getLabel(value.toString())
5649
+ }), value))
5650
+ }))]
5651
+ }));
5644
5652
  };
5645
5653
 
5646
5654
  const IntersectionSelect = ({
@@ -5649,35 +5657,44 @@ const IntersectionSelect = ({
5649
5657
  isDisabled: _isDisabled = false
5650
5658
  }) => {
5651
5659
  const [activeIntersection, setActiveIntersection] = React__default.useState(0);
5652
- return /*#__PURE__*/React__default.createElement(Grid, {
5660
+ return jsx(Grid, Object.assign({
5653
5661
  item: true,
5654
5662
  sm: 12
5655
- }, /*#__PURE__*/React__default.createElement(FormControl, {
5656
- variant: "filled",
5657
- sx: {
5658
- width: '100%'
5659
- }
5660
- }, /*#__PURE__*/React__default.createElement(InputLabel, {
5661
- id: "demo-intersection"
5662
- }, "Intersection shapes"), /*#__PURE__*/React__default.createElement(Select, {
5663
- labelId: "demo-intersection",
5664
- value: activeIntersection.toString(),
5665
- onChange: event => {
5666
- const featureIndex = parseInt(event.target.value, 10);
5667
- setActiveIntersection(featureIndex);
5668
- const {
5669
- geojson,
5670
- title
5671
- } = intersections[featureIndex];
5672
- onChangeIntersection(geojson, title);
5673
- },
5674
- disabled: _isDisabled
5675
- }, intersections.map((listItem, index) => {
5676
- return /*#__PURE__*/React__default.createElement(MenuItem, {
5677
- key: listItem.title,
5678
- value: index
5679
- }, listItem.title);
5680
- }))));
5663
+ }, {
5664
+ children: jsxs(FormControl, Object.assign({
5665
+ variant: "filled",
5666
+ sx: {
5667
+ width: '100%'
5668
+ }
5669
+ }, {
5670
+ children: [jsx(InputLabel, Object.assign({
5671
+ id: "demo-intersection"
5672
+ }, {
5673
+ children: "Intersection shapes"
5674
+ })), jsx(Select, Object.assign({
5675
+ labelId: "demo-intersection",
5676
+ value: activeIntersection.toString(),
5677
+ onChange: event => {
5678
+ const featureIndex = parseInt(event.target.value, 10);
5679
+ setActiveIntersection(featureIndex);
5680
+ const {
5681
+ geojson,
5682
+ title
5683
+ } = intersections[featureIndex];
5684
+ onChangeIntersection(geojson, title);
5685
+ },
5686
+ disabled: _isDisabled
5687
+ }, {
5688
+ children: intersections.map((listItem, index) => {
5689
+ return jsx(MenuItem, Object.assign({
5690
+ value: index
5691
+ }, {
5692
+ children: listItem.title
5693
+ }), listItem.title);
5694
+ })
5695
+ }))]
5696
+ }))
5697
+ }));
5681
5698
  };
5682
5699
 
5683
5700
  /**
@@ -5974,7 +5991,7 @@ const getFeatureExtent = geoJSON => {
5974
5991
  const defaultIntersectionStyleProperties = Object.assign(Object.assign({}, defaultGeoJSONStyleProperties), {
5975
5992
  'fill-opacity': 0.5
5976
5993
  });
5977
- const emptyLineString = Object.assign(Object.assign({}, lineString.features[0]), {
5994
+ const emptyLineString = Object.assign(Object.assign({}, lineString), {
5978
5995
  properties: defaultGeoJSONStyleProperties
5979
5996
  });
5980
5997
  const emptyPoint = Object.assign(Object.assign({}, featurePoint), {
@@ -5993,15 +6010,15 @@ const emptyIntersectionShape = Object.assign(Object.assign({}, emptyGeoJSON), {
5993
6010
  const getIcon = selectionType => {
5994
6011
  switch (selectionType) {
5995
6012
  case 'point':
5996
- return /*#__PURE__*/React__default.createElement(Location, null);
6013
+ return jsx(Location, {});
5997
6014
  case 'poly':
5998
- return /*#__PURE__*/React__default.createElement(DrawPolygon, null);
6015
+ return jsx(DrawPolygon, {});
5999
6016
  case 'box':
6000
- return /*#__PURE__*/React__default.createElement(DrawRegion, null);
6017
+ return jsx(DrawRegion, {});
6001
6018
  case 'linestring':
6002
- return /*#__PURE__*/React__default.createElement(Edit, null);
6019
+ return jsx(Edit, {});
6003
6020
  case 'delete':
6004
- return /*#__PURE__*/React__default.createElement(Delete, null);
6021
+ return jsx(Delete, {});
6005
6022
  default:
6006
6023
  return null;
6007
6024
  }
@@ -6099,7 +6116,7 @@ const useMapDrawTool = ({
6099
6116
  const isNewSelectedTool = !isGeoJSONFeatureCreatedByTool(geoJSON, newMode.selectionType, featureLayerIndex);
6100
6117
  const shouldUpdateShape = !geoJSON.features.length || isNewSelectedTool || !newMode.isSelectable;
6101
6118
  if (shouldUpdateShape) {
6102
- const updatedGeoJSON = changeGeoJSON(addSelectionTypeToGeoJSON(newMode.shape, newMode.selectionType));
6119
+ const updatedGeoJSON = changeGeoJSON(addSelectionTypeToGeoJSON(newMode.shape, newMode.selectionType))[0];
6103
6120
  setFeatureLayerIndex(updatedGeoJSON.features.length - 1);
6104
6121
  }
6105
6122
  // handle modes and update feature layer index
@@ -6119,9 +6136,11 @@ const useMapDrawTool = ({
6119
6136
  }
6120
6137
  setGeoJSON(newGeoJSON);
6121
6138
  if (geoJSONIntersectionBounds) {
6122
- setGeoJSONIntersection(createInterSections(newGeoJSON, geoJSONIntersectionBounds, _defaultGeoJSONIntersectionProperties));
6139
+ const newIntersection = createInterSections(newGeoJSON, geoJSONIntersectionBounds, _defaultGeoJSONIntersectionProperties);
6140
+ setGeoJSONIntersection(newIntersection);
6141
+ return [newGeoJSON, newIntersection];
6123
6142
  }
6124
- return newGeoJSON;
6143
+ return [newGeoJSON];
6125
6144
  };
6126
6145
  const onSetGeoJSONIntersectionBounds = newGeoJSON => {
6127
6146
  setGeoJSONIntersectionBounds(newGeoJSON);
@@ -6213,12 +6232,12 @@ const getToolIcon = selectionType => {
6213
6232
  return defaultIcon;
6214
6233
  }
6215
6234
  if (selectionType === shapeButtonNL$2.selectionType) {
6216
- return /*#__PURE__*/React__default.createElement(DrawFIRLand, null);
6235
+ return jsx(DrawFIRLand, {});
6217
6236
  }
6218
6237
  if (selectionType === customLineButton.selectionType) {
6219
- return /*#__PURE__*/React__default.createElement(ArrowUp, null);
6238
+ return jsx(ArrowUp, {});
6220
6239
  }
6221
- return /*#__PURE__*/React__default.createElement("div", null);
6240
+ return jsx("div", {});
6222
6241
  };
6223
6242
  // custom buttons
6224
6243
  const shapeButtonNL$2 = {
@@ -6426,16 +6445,16 @@ const getIntersectionToolIcon = selectionType => {
6426
6445
  return defaultIcon;
6427
6446
  }
6428
6447
  if (selectionType === shapeButtonNL$1.selectionType) {
6429
- return /*#__PURE__*/React__default.createElement(DrawFIRLand, null);
6448
+ return jsx(DrawFIRLand, {});
6430
6449
  }
6431
6450
  if (selectionType === shapeButtonBE$1.selectionType) {
6432
- return /*#__PURE__*/React__default.createElement(DrawFIRLand, {
6451
+ return jsx(DrawFIRLand, {
6433
6452
  sx: {
6434
6453
  transform: `scaleY(-1)`
6435
6454
  }
6436
6455
  });
6437
6456
  }
6438
- return /*#__PURE__*/React__default.createElement(DrawFIRLand, null);
6457
+ return jsx(DrawFIRLand, {});
6439
6458
  };
6440
6459
  // custom buttons
6441
6460
  const shapeButtonNL$1 = {
@@ -6605,13 +6624,13 @@ const getDoubleControlToolIcon = drawMode => {
6605
6624
  return defaultIcon;
6606
6625
  }
6607
6626
  if (selectionType === firSelectionType) {
6608
- return /*#__PURE__*/React__default.createElement(DrawFIRLand, {
6627
+ return jsx(DrawFIRLand, {
6609
6628
  sx: Object.assign({}, drawMode.title === shapeButtonBE.title && {
6610
6629
  transform: `scaleY(-1)`
6611
6630
  })
6612
6631
  });
6613
6632
  }
6614
- return /*#__PURE__*/React__default.createElement(DrawFIRLand, null);
6633
+ return jsx(DrawFIRLand, {});
6615
6634
  };
6616
6635
  const getEditModes = geoJSONProperties => [Object.assign(Object.assign({}, defaultPoint), {
6617
6636
  shape: Object.assign(Object.assign({}, defaultPoint.shape), {
@@ -7881,27 +7900,11 @@ var radarGetCapabilities_spec = {
7881
7900
  WMS_Capabilities: WMS_Capabilities
7882
7901
  };
7883
7902
 
7884
- /* *
7885
- * Licensed under the Apache License, Version 2.0 (the "License");
7886
- * you may not use this file except in compliance with the License.
7887
- * You may obtain a copy of the License at
7888
- *
7889
- * http://www.apache.org/licenses/LICENSE-2.0
7890
- *
7891
- * Unless required by applicable law or agreed to in writing, software
7892
- * distributed under the License is distributed on an "AS IS" BASIS,
7893
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7894
- * See the License for the specific language governing permissions and
7895
- * limitations under the License.
7896
- *
7897
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7898
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
7899
- * */
7900
7903
  const ReactMapViewLayer = props => {
7901
7904
  const {
7902
7905
  id
7903
7906
  } = props;
7904
- return /*#__PURE__*/React.createElement("div", {
7907
+ return jsx("div", Object.assign({
7905
7908
  style: {
7906
7909
  width: '100%',
7907
7910
  padding: '2px',
@@ -7913,7 +7916,11 @@ const ReactMapViewLayer = props => {
7913
7916
  background: 'rgba(255, 255, 255, 0.5)',
7914
7917
  display: 'none'
7915
7918
  }
7916
- }, /*#__PURE__*/React.createElement("div", null, id));
7919
+ }, {
7920
+ children: jsx("div", {
7921
+ children: id
7922
+ })
7923
+ }));
7917
7924
  };
7918
7925
 
7919
7926
  var defineProperty$1 = objectDefineProperty.f;
@@ -8263,7 +8270,7 @@ $$8({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
8263
8270
  }
8264
8271
  });
8265
8272
 
8266
- var makeBuiltIn = makeBuiltIn$3.exports;
8273
+ var makeBuiltIn = makeBuiltInExports;
8267
8274
  var defineProperty = objectDefineProperty;
8268
8275
 
8269
8276
  var defineBuiltInAccessor$1 = function (target, name, descriptor) {
@@ -10154,7 +10161,7 @@ class ReactMapView extends React.Component {
10154
10161
  wmFeatureLayer.geojson = featureLayer.geojson;
10155
10162
  }
10156
10163
  });
10157
- return /*#__PURE__*/React.createElement("div", {
10164
+ return jsx("div", Object.assign({
10158
10165
  className: "MapView",
10159
10166
  style: {
10160
10167
  height: '100%',
@@ -10163,60 +10170,69 @@ class ReactMapView extends React.Component {
10163
10170
  display: 'block',
10164
10171
  overflow: 'hidden'
10165
10172
  }
10166
- }, /*#__PURE__*/React.createElement("div", {
10167
- ref: this.adagucContainerRef,
10168
- style: {
10169
- minWidth: 'inherit',
10170
- minHeight: 'inherit',
10171
- width: 'inherit',
10172
- height: 'inherit',
10173
- overflow: 'hidden',
10174
- display: 'block',
10175
- border: 'none'
10176
- }
10177
- }, /*#__PURE__*/React.createElement("div", {
10178
- className: "MapViewComponent",
10179
- style: {
10180
- position: 'absolute',
10181
- overflow: 'hidden',
10182
- display: 'block',
10183
- padding: '0',
10184
- margin: '0',
10185
- zIndex: 10
10186
- }
10187
- }, /*#__PURE__*/React.createElement("div", {
10188
- role: "application",
10189
- "aria-label": "map",
10190
- ref: this.adagucWebMapJSRef
10191
- })), /*#__PURE__*/React.createElement("div", {
10192
- style: {
10193
- position: 'absolute',
10194
- overflow: 'hidden',
10195
- display: 'block',
10196
- padding: '0',
10197
- margin: '0',
10198
- zIndex: 100
10199
- }
10200
- }, /*#__PURE__*/React.createElement("div", null, children), adagucInitialised && featureLayers && featureLayers.length ? ( /*#__PURE__*/React.createElement(MapDrawContainer, {
10201
- featureLayers: featureLayers,
10202
- mapId: mapId
10203
- })) : null), passiveMap && (
10204
- /*#__PURE__*/
10205
- // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/control-has-associated-label, jsx-a11y/interactive-supports-focus
10206
- React.createElement("div", {
10207
- style: {
10208
- position: 'absolute',
10209
- overflow: 'hidden',
10210
- display: 'block',
10211
- padding: '0',
10212
- margin: '0',
10213
- zIndex: 100,
10214
- width: '100%',
10215
- height: '100%'
10216
- },
10217
- onClick: onClick,
10218
- role: "button"
10219
- }))));
10173
+ }, {
10174
+ children: jsxs("div", Object.assign({
10175
+ ref: this.adagucContainerRef,
10176
+ style: {
10177
+ minWidth: 'inherit',
10178
+ minHeight: 'inherit',
10179
+ width: 'inherit',
10180
+ height: 'inherit',
10181
+ overflow: 'hidden',
10182
+ display: 'block',
10183
+ border: 'none'
10184
+ }
10185
+ }, {
10186
+ children: [jsx("div", Object.assign({
10187
+ className: "MapViewComponent",
10188
+ style: {
10189
+ position: 'absolute',
10190
+ overflow: 'hidden',
10191
+ display: 'block',
10192
+ padding: '0',
10193
+ margin: '0',
10194
+ zIndex: 10
10195
+ }
10196
+ }, {
10197
+ children: jsx("div", {
10198
+ role: "application",
10199
+ "aria-label": "map",
10200
+ ref: this.adagucWebMapJSRef
10201
+ })
10202
+ })), jsxs("div", Object.assign({
10203
+ style: {
10204
+ position: 'absolute',
10205
+ overflow: 'hidden',
10206
+ display: 'block',
10207
+ padding: '0',
10208
+ margin: '0',
10209
+ zIndex: 100
10210
+ }
10211
+ }, {
10212
+ children: [jsx("div", {
10213
+ children: children
10214
+ }), adagucInitialised && featureLayers && featureLayers.length ? jsx(MapDrawContainer, {
10215
+ featureLayers: featureLayers,
10216
+ mapId: mapId
10217
+ }) : null]
10218
+ })), passiveMap &&
10219
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/control-has-associated-label, jsx-a11y/interactive-supports-focus
10220
+ jsx("div", {
10221
+ style: {
10222
+ position: 'absolute',
10223
+ overflow: 'hidden',
10224
+ display: 'block',
10225
+ padding: '0',
10226
+ margin: '0',
10227
+ zIndex: 100,
10228
+ width: '100%',
10229
+ height: '100%'
10230
+ },
10231
+ onClick: onClick,
10232
+ role: "button"
10233
+ })]
10234
+ }))
10235
+ }));
10220
10236
  }
10221
10237
  }
10222
10238
  ReactMapView.defaultProps = {
@@ -10243,22 +10259,6 @@ ReactMapView.defaultProps = {
10243
10259
  }
10244
10260
  };
10245
10261
 
10246
- /* *
10247
- * Licensed under the Apache License, Version 2.0 (the "License");
10248
- * you may not use this file except in compliance with the License.
10249
- * You may obtain a copy of the License at
10250
- *
10251
- * http://www.apache.org/licenses/LICENSE-2.0
10252
- *
10253
- * Unless required by applicable law or agreed to in writing, software
10254
- * distributed under the License is distributed on an "AS IS" BASIS,
10255
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10256
- * See the License for the specific language governing permissions and
10257
- * limitations under the License.
10258
- *
10259
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10260
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
10261
- * */
10262
10262
  const getTimeDimension = dimensions => dimensions.find(dimension => dimension.name === 'time' && dimension.currentValue !== undefined);
10263
10263
  const formatTime = (time, timeFormat) => dateUtils.dateToString(dateUtils.utc(time), timeFormat);
10264
10264
  const defaultTimeFormat = "EEE dd MMM yyyy HH:mm 'UTC'";
@@ -10271,7 +10271,7 @@ const MapTime = ({
10271
10271
  return null;
10272
10272
  }
10273
10273
  const mapTime = formatTime(timeDimension.currentValue, _timeFormat);
10274
- return /*#__PURE__*/React.createElement(Box, {
10274
+ return jsx(Box, Object.assign({
10275
10275
  "data-testid": "map-time",
10276
10276
  sx: {
10277
10277
  zIndex: 10,
@@ -10279,12 +10279,18 @@ const MapTime = ({
10279
10279
  bottom: '12px',
10280
10280
  position: 'absolute'
10281
10281
  }
10282
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Typography, {
10283
- variant: "caption",
10284
- sx: {
10285
- fontWeight: 500
10286
- }
10287
- }, mapTime)));
10282
+ }, {
10283
+ children: jsx(Box, {
10284
+ children: jsx(Typography, Object.assign({
10285
+ variant: "caption",
10286
+ sx: {
10287
+ fontWeight: 500
10288
+ }
10289
+ }, {
10290
+ children: mapTime
10291
+ }))
10292
+ })
10293
+ }));
10288
10294
  };
10289
10295
 
10290
10296
  /* *
@@ -10544,7 +10550,7 @@ const MapView = _a => {
10544
10550
  const reactMapViewProps = Object.assign(Object.assign({}, props), {
10545
10551
  mapId
10546
10552
  });
10547
- return /*#__PURE__*/React.createElement(Box, {
10553
+ return jsxs(Box, Object.assign({
10548
10554
  ref: ref,
10549
10555
  sx: {
10550
10556
  display: 'grid',
@@ -10553,92 +10559,70 @@ const MapView = _a => {
10553
10559
  position: 'relative',
10554
10560
  overflow: 'hidden'
10555
10561
  }
10556
- }, controls && controls.zoomControls && ( /*#__PURE__*/React.createElement(MapControls, {
10557
- style: {
10558
- top: 0,
10559
- position: 'absolute'
10560
- }
10561
- }, /*#__PURE__*/React.createElement(ProfileAxis, {
10562
- mapId: mapId
10563
- }), /*#__PURE__*/React.createElement(ZoomControls, {
10564
- onZoomIn: () => {
10565
- const wmjsMap = webmapUtils.getWMJSMapById(mapId);
10566
- wmjsMap.zoomIn(undefined);
10567
- },
10568
- onZoomOut: () => {
10569
- const wmjsMap = webmapUtils.getWMJSMapById(mapId);
10570
- wmjsMap.zoomOut();
10571
- },
10572
- onZoomReset: () => {
10573
- const wmjsMap = webmapUtils.getWMJSMapById(mapId);
10574
- wmjsMap.zoomToLayer(wmjsMap.getActiveLayer());
10575
- }
10576
- }))), /*#__PURE__*/React.createElement(Box, {
10577
- sx: {
10578
- gridColumnStart: 1,
10579
- gridRowStart: 1
10580
- }
10581
- }, /*#__PURE__*/React.createElement(ReactMapView, Object.assign({}, reactMapViewProps, {
10582
- showLegend: false,
10583
- displayTimeInMap: false,
10584
- onWMJSMount: id => {
10585
- wmjsMapRef.current = webmapUtils.getWMJSMapById(id);
10586
- if (onWMJSMount) {
10587
- onWMJSMount(id);
10562
+ }, {
10563
+ children: [controls && controls.zoomControls && jsxs(MapControls, Object.assign({
10564
+ style: {
10565
+ top: 0,
10566
+ position: 'absolute'
10588
10567
  }
10589
- }
10590
- }), children)), displayTimeInMap && dimensions && /*#__PURE__*/React.createElement(MapTime, {
10591
- dimensions: dimensions
10568
+ }, {
10569
+ children: [jsx(ProfileAxis, {
10570
+ mapId: mapId
10571
+ }), jsx(ZoomControls, {
10572
+ onZoomIn: () => {
10573
+ const wmjsMap = webmapUtils.getWMJSMapById(mapId);
10574
+ wmjsMap.zoomIn(undefined);
10575
+ },
10576
+ onZoomOut: () => {
10577
+ const wmjsMap = webmapUtils.getWMJSMapById(mapId);
10578
+ wmjsMap.zoomOut();
10579
+ },
10580
+ onZoomReset: () => {
10581
+ const wmjsMap = webmapUtils.getWMJSMapById(mapId);
10582
+ wmjsMap.zoomToLayer(wmjsMap.getActiveLayer());
10583
+ }
10584
+ })]
10585
+ })), jsx(Box, Object.assign({
10586
+ sx: {
10587
+ gridColumnStart: 1,
10588
+ gridRowStart: 1
10589
+ }
10590
+ }, {
10591
+ children: jsx(ReactMapView, Object.assign({}, reactMapViewProps, {
10592
+ showLegend: false,
10593
+ displayTimeInMap: false,
10594
+ onWMJSMount: id => {
10595
+ wmjsMapRef.current = webmapUtils.getWMJSMapById(id);
10596
+ if (onWMJSMount) {
10597
+ onWMJSMount(id);
10598
+ }
10599
+ }
10600
+ }, {
10601
+ children: children
10602
+ }))
10603
+ })), displayTimeInMap && dimensions && jsx(MapTime, {
10604
+ dimensions: dimensions
10605
+ })]
10592
10606
  }));
10593
10607
  };
10594
10608
 
10595
- /* *
10596
- * Licensed under the Apache License, Version 2.0 (the "License");
10597
- * you may not use this file except in compliance with the License.
10598
- * You may obtain a copy of the License at
10599
- *
10600
- * http://www.apache.org/licenses/LICENSE-2.0
10601
- *
10602
- * Unless required by applicable law or agreed to in writing, software
10603
- * distributed under the License is distributed on an "AS IS" BASIS,
10604
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10605
- * See the License for the specific language governing permissions and
10606
- * limitations under the License.
10607
- *
10608
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10609
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
10610
- * */
10611
10609
  const MapViewLayer = props => {
10612
10610
  // TODO: This component should not do anything, but just return null: https://gitlab.com/opengeoweb/opengeoweb/-/issues/4579
10613
10611
  const {
10614
10612
  id
10615
10613
  } = props;
10616
10614
  return React.useMemo(() => {
10617
- return /*#__PURE__*/React.createElement("div", {
10615
+ return jsx("div", Object.assign({
10618
10616
  "data-testid": "mapViewLayer",
10619
10617
  style: {
10620
10618
  display: 'none'
10621
10619
  }
10622
- }, id);
10620
+ }, {
10621
+ children: id
10622
+ }));
10623
10623
  }, [id]);
10624
10624
  };
10625
10625
 
10626
- /* *
10627
- * Licensed under the Apache License, Version 2.0 (the "License");
10628
- * you may not use this file except in compliance with the License.
10629
- * You may obtain a copy of the License at
10630
- *
10631
- * http://www.apache.org/licenses/LICENSE-2.0
10632
- *
10633
- * Unless required by applicable law or agreed to in writing, software
10634
- * distributed under the License is distributed on an "AS IS" BASIS,
10635
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10636
- * See the License for the specific language governing permissions and
10637
- * limitations under the License.
10638
- *
10639
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10640
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
10641
- * */
10642
10626
  const MapWarningProperties = ({
10643
10627
  selectedFeatureProperties,
10644
10628
  languageIndex,
@@ -10649,7 +10633,7 @@ const MapWarningProperties = ({
10649
10633
  const {
10650
10634
  t
10651
10635
  } = useWebmapReactTranslation();
10652
- return /*#__PURE__*/React__default.createElement("div", {
10636
+ return jsx("div", Object.assign({
10653
10637
  style: {
10654
10638
  position: 'fixed',
10655
10639
  width: `${newWidth}px`,
@@ -10658,30 +10642,46 @@ const MapWarningProperties = ({
10658
10642
  justifyContent: 'center',
10659
10643
  left: '50px'
10660
10644
  }
10661
- }, /*#__PURE__*/React__default.createElement("div", {
10662
- "data-testid": "map-warning-properties",
10663
- style: {
10664
- marginTop: '50px',
10665
- width: '350px',
10666
- height: '190px',
10667
- padding: '0px 20px 20px',
10668
- overflow: 'auto',
10669
- fontSize: '11px',
10670
- backgroundColor: '#CCCCCCC0'
10671
- }
10672
- }, /*#__PURE__*/React__default.createElement("h1", {
10673
- "data-testid": "map-warning-properties-title"
10674
- }, selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].areaDesc), selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].areaDesc && ( /*#__PURE__*/React__default.createElement("pre", {
10675
- "data-testid": "map-warning-properties-row"
10676
- }, t('webmap-react-event'), ' ', selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].event)), selectedFeatureProperties.onset && ( /*#__PURE__*/React__default.createElement("pre", {
10677
- "data-testid": "map-warning-properties-row"
10678
- }, t('webmap-react-sent'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.onset), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc'))), selectedFeatureProperties.expires && ( /*#__PURE__*/React__default.createElement("pre", {
10679
- "data-testid": "map-warning-properties-row"
10680
- }, t('webmap-react-expires'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.expires), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc'))), selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].senderName && ( /*#__PURE__*/React__default.createElement("pre", {
10681
- "data-testid": "map-warning-properties-row"
10682
- }, t('webmap-react-sender'), ' ', selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].senderName)), selectedFeatureProperties.identifier && ( /*#__PURE__*/React__default.createElement("pre", {
10683
- "data-testid": "map-warning-properties-row"
10684
- }, t('webmap-react-identifier'), ' ', selectedFeatureProperties.identifier))));
10645
+ }, {
10646
+ children: jsxs("div", Object.assign({
10647
+ "data-testid": "map-warning-properties",
10648
+ style: {
10649
+ marginTop: '50px',
10650
+ width: '350px',
10651
+ height: '190px',
10652
+ padding: '0px 20px 20px',
10653
+ overflow: 'auto',
10654
+ fontSize: '11px',
10655
+ backgroundColor: '#CCCCCCC0'
10656
+ }
10657
+ }, {
10658
+ children: [jsx("h1", Object.assign({
10659
+ "data-testid": "map-warning-properties-title"
10660
+ }, {
10661
+ children: selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].areaDesc
10662
+ })), selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].areaDesc && jsxs("pre", Object.assign({
10663
+ "data-testid": "map-warning-properties-row"
10664
+ }, {
10665
+ children: [t('webmap-react-event'), ' ', selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].event]
10666
+ })), selectedFeatureProperties.onset && jsxs("pre", Object.assign({
10667
+ "data-testid": "map-warning-properties-row"
10668
+ }, {
10669
+ children: [t('webmap-react-sent'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.onset), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc')]
10670
+ })), selectedFeatureProperties.expires && jsxs("pre", Object.assign({
10671
+ "data-testid": "map-warning-properties-row"
10672
+ }, {
10673
+ children: [t('webmap-react-expires'), ' ', dateUtils.dateToString(dateUtils.utc(selectedFeatureProperties.expires), dateUtils.DATE_FORMAT_NAME_OF_MONTH), ' ', t('webmap-react-utc')]
10674
+ })), selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].senderName && jsxs("pre", Object.assign({
10675
+ "data-testid": "map-warning-properties-row"
10676
+ }, {
10677
+ children: [t('webmap-react-sender'), ' ', selectedFeatureProperties.languages && selectedFeatureProperties.languages[language].senderName]
10678
+ })), selectedFeatureProperties.identifier && jsxs("pre", Object.assign({
10679
+ "data-testid": "map-warning-properties-row"
10680
+ }, {
10681
+ children: [t('webmap-react-identifier'), ' ', selectedFeatureProperties.identifier]
10682
+ }))]
10683
+ }))
10684
+ }));
10685
10685
  };
10686
10686
 
10687
10687
  const dimensionConfig = [{
@@ -10733,22 +10733,6 @@ const marksByDimension = dim => {
10733
10733
  return marks;
10734
10734
  };
10735
10735
 
10736
- /* *
10737
- * Licensed under the Apache License, Version 2.0 (the "License");
10738
- * you may not use this file except in compliance with the License.
10739
- * You may obtain a copy of the License at
10740
- *
10741
- * http://www.apache.org/licenses/LICENSE-2.0
10742
- *
10743
- * Unless required by applicable law or agreed to in writing, software
10744
- * distributed under the License is distributed on an "AS IS" BASIS,
10745
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10746
- * See the License for the specific language governing permissions and
10747
- * limitations under the License.
10748
- *
10749
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10750
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
10751
- * */
10752
10736
  const DimensionSelectButton = ({
10753
10737
  dimension,
10754
10738
  onClickDimensionButton,
@@ -10761,30 +10745,16 @@ const DimensionSelectButton = ({
10761
10745
  const dimConfig = dimensionConfig.find(cnf => cnf.name === dimension);
10762
10746
  const Icon = getDimensionIcon$1(dimConfig && dimConfig.iconType || 'IconLevels');
10763
10747
  const title = `${showPrefix} ${dimConfig ? dimConfig.label.toLowerCase() : dimension.toLowerCase()}`;
10764
- return /*#__PURE__*/React.createElement(MapControlButton, {
10748
+ return jsx(MapControlButton, Object.assign({
10765
10749
  title: title,
10766
10750
  "data-testid": `dimensionMapBtn-${dimension}`,
10767
10751
  onClick: onClickDimensionButton,
10768
10752
  isActive: _isActive
10769
- }, /*#__PURE__*/React.createElement(Icon, null));
10753
+ }, {
10754
+ children: jsx(Icon, {})
10755
+ }));
10770
10756
  };
10771
10757
 
10772
- /* *
10773
- * Licensed under the Apache License, Version 2.0 (the "License");
10774
- * you may not use this file except in compliance with the License.
10775
- * You may obtain a copy of the License at
10776
- *
10777
- * http://www.apache.org/licenses/LICENSE-2.0
10778
- *
10779
- * Unless required by applicable law or agreed to in writing, software
10780
- * distributed under the License is distributed on an "AS IS" BASIS,
10781
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10782
- * See the License for the specific language governing permissions and
10783
- * limitations under the License.
10784
- *
10785
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10786
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
10787
- * */
10788
10758
  const DimensionSelectDialog = ({
10789
10759
  isOpen,
10790
10760
  order: _order = 0,
@@ -10798,7 +10768,7 @@ const DimensionSelectDialog = ({
10798
10768
  const dimConfig = dimensionConfig.find(cnf => cnf.name === dimensionName);
10799
10769
  const title = dimConfig ? dimConfig.label : dimensionName;
10800
10770
  const topPos = _index * 32 + 164; // index * btn height + offset top of window
10801
- return /*#__PURE__*/React.createElement(ToolContainerDraggable, {
10771
+ return jsx(ToolContainerDraggable, Object.assign({
10802
10772
  startPosition: {
10803
10773
  left: 50,
10804
10774
  top: topPos
@@ -10812,14 +10782,20 @@ const DimensionSelectDialog = ({
10812
10782
  onMouseDown: onMouseDown,
10813
10783
  order: _order,
10814
10784
  source: _source
10815
- }, /*#__PURE__*/React.createElement("div", {
10816
- style: {
10817
- padding: 4
10818
- }
10819
- }, /*#__PURE__*/React.createElement(Grid, {
10820
- container: true,
10821
- direction: "row"
10822
- }, children)));
10785
+ }, {
10786
+ children: jsx("div", Object.assign({
10787
+ style: {
10788
+ padding: 4
10789
+ }
10790
+ }, {
10791
+ children: jsx(Grid, Object.assign({
10792
+ container: true,
10793
+ direction: "row"
10794
+ }, {
10795
+ children: children
10796
+ }))
10797
+ }))
10798
+ }));
10823
10799
  };
10824
10800
 
10825
10801
  const SmallFontSlider = styled(Slider)(() => ({
@@ -10857,74 +10833,68 @@ const DimensionSelectSlider = ({
10857
10833
  event.preventDefault();
10858
10834
  }
10859
10835
  };
10860
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
10861
- "data-testid": "slider-dimensionSelect",
10862
- sx: {
10863
- height: '320px',
10864
- margin: '10px',
10865
- marginLeft: '-5px',
10866
- minWidth: 120,
10867
- fontSize: '90%'
10868
- }
10869
- }, /*#__PURE__*/React.createElement(Box, {
10870
- component: "span",
10871
- m: 1
10872
- }, /*#__PURE__*/React.createElement(SmallFontSlider, {
10873
- "data-testid": "verticalSlider",
10874
- orientation: "vertical",
10875
- "aria-labelledby": "vertical-slider",
10876
- step: null,
10877
- min: 0,
10878
- max: indexLabelMarks.length - 1,
10879
- marks: indexLabelMarks,
10880
- style: !_validSelection ? {
10881
- color: _alertColor
10882
- } : {},
10883
- disabled: _isDisabled,
10884
- value: sliderValue,
10885
- onKeyDown: upDownNavigation,
10886
- onChange: (e, val) => {
10887
- onChangeDimensionValue(values[val].toString());
10888
- if (!_managedValue) {
10889
- setCurrentIndex(val);
10890
- }
10891
- }
10892
- }))), /*#__PURE__*/React.createElement(CustomTooltip, {
10893
- title: layerTitle
10894
- }, /*#__PURE__*/React.createElement(Typography, {
10895
- variant: "body2",
10896
- sx: {
10897
- paddingLeft: '10px',
10898
- maxWidth: 130,
10899
- overflow: 'hidden',
10900
- textOverflow: 'ellipsis'
10901
- }
10902
- }, layerTitle)));
10836
+ return jsxs(Fragment, {
10837
+ children: [jsx(Box, Object.assign({
10838
+ "data-testid": "slider-dimensionSelect",
10839
+ sx: {
10840
+ height: '320px',
10841
+ margin: '10px',
10842
+ marginLeft: '-5px',
10843
+ minWidth: 120,
10844
+ fontSize: '90%'
10845
+ }
10846
+ }, {
10847
+ children: jsx(Box, Object.assign({
10848
+ component: "span",
10849
+ m: 1
10850
+ }, {
10851
+ children: jsx(SmallFontSlider, {
10852
+ "data-testid": "verticalSlider",
10853
+ orientation: "vertical",
10854
+ "aria-labelledby": "vertical-slider",
10855
+ step: null,
10856
+ min: 0,
10857
+ max: indexLabelMarks.length - 1,
10858
+ marks: indexLabelMarks,
10859
+ style: !_validSelection ? {
10860
+ color: _alertColor
10861
+ } : {},
10862
+ disabled: _isDisabled,
10863
+ value: sliderValue,
10864
+ onKeyDown: upDownNavigation,
10865
+ onChange: (e, val) => {
10866
+ onChangeDimensionValue(values[val].toString());
10867
+ if (!_managedValue) {
10868
+ setCurrentIndex(val);
10869
+ }
10870
+ }
10871
+ })
10872
+ }))
10873
+ })), jsx(CustomTooltip, Object.assign({
10874
+ title: layerTitle
10875
+ }, {
10876
+ children: jsx(Typography, Object.assign({
10877
+ variant: "body2",
10878
+ sx: {
10879
+ paddingLeft: '10px',
10880
+ maxWidth: 130,
10881
+ overflow: 'hidden',
10882
+ textOverflow: 'ellipsis'
10883
+ }
10884
+ }, {
10885
+ children: layerTitle
10886
+ }))
10887
+ }))]
10888
+ });
10903
10889
  };
10904
10890
 
10905
- /* *
10906
- * Licensed under the Apache License, Version 2.0 (the "License");
10907
- * you may not use this file except in compliance with the License.
10908
- * You may obtain a copy of the License at
10909
- *
10910
- * http://www.apache.org/licenses/LICENSE-2.0
10911
- *
10912
- * Unless required by applicable law or agreed to in writing, software
10913
- * distributed under the License is distributed on an "AS IS" BASIS,
10914
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10915
- * See the License for the specific language governing permissions and
10916
- * limitations under the License.
10917
- *
10918
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10919
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
10920
- * */
10921
10891
  const Icon = ({
10922
10892
  isLayerDimensionSynced
10923
- }) => isLayerDimensionSynced ? ( /*#__PURE__*/React.createElement(Link, {
10893
+ }) => isLayerDimensionSynced ? jsx(Link, {
10924
10894
  "data-testid": "syncIcon"
10925
- })) : ( /*#__PURE__*/React.createElement(LinkOff, {
10895
+ }) : jsx(LinkOff, {
10926
10896
  "data-testid": "syncDisIcon"
10927
- }));
10897
+ });
10928
10898
  const MapDimensionSelect = ({
10929
10899
  layerId,
10930
10900
  dimensionName,
@@ -10949,30 +10919,33 @@ const MapDimensionSelect = ({
10949
10919
  t
10950
10920
  } = useWebmapReactTranslation();
10951
10921
  const tooltipTitle = isLayerDimensionSynced ? t('webmap-react-click-disconnect') : t('webmap-react-click-connect');
10952
- return /*#__PURE__*/React.createElement(Grid, {
10953
- key: layerId,
10922
+ return jsxs(Grid, Object.assign({
10954
10923
  item: true,
10955
10924
  xs: "auto"
10956
- }, /*#__PURE__*/React.createElement(CustomIconButton, {
10957
- tooltipTitle: tooltipTitle,
10958
- onClick: () => handleSyncChanged(layerId, dimensionName, layerDimension.currentValue, !layerDimension.synced),
10959
- sx: {
10960
- margin: '5px'
10961
- },
10962
- "data-testid": "syncButton"
10963
- }, /*#__PURE__*/React.createElement(Icon, {
10964
- isLayerDimensionSynced: isLayerDimensionSynced
10965
- })), /*#__PURE__*/React.createElement(DimensionSelectSlider, {
10966
- marks: marks,
10967
- layerTitle: layerTitle,
10968
- reverse: dimConfig ? dimConfig.reversed : false,
10969
- managedValue: Number(layerDimension.currentValue) || layerDimension.currentValue,
10970
- onChangeDimensionValue: value => {
10971
- handleDimensionValueChanged(layerId, dimensionName, value);
10972
- },
10973
- isDisabled: false,
10974
- validSelection: layerDimension.synced === false || !(layerDimension.validSyncSelection !== undefined && layerDimension.validSyncSelection === false)
10975
- }));
10925
+ }, {
10926
+ children: [jsx(CustomIconButton, Object.assign({
10927
+ tooltipTitle: tooltipTitle,
10928
+ onClick: () => handleSyncChanged(layerId, dimensionName, layerDimension.currentValue, !layerDimension.synced),
10929
+ sx: {
10930
+ margin: '5px'
10931
+ },
10932
+ "data-testid": "syncButton"
10933
+ }, {
10934
+ children: jsx(Icon, {
10935
+ isLayerDimensionSynced: isLayerDimensionSynced
10936
+ })
10937
+ })), jsx(DimensionSelectSlider, {
10938
+ marks: marks,
10939
+ layerTitle: layerTitle,
10940
+ reverse: dimConfig ? dimConfig.reversed : false,
10941
+ managedValue: Number(layerDimension.currentValue) || layerDimension.currentValue,
10942
+ onChangeDimensionValue: value => {
10943
+ handleDimensionValueChanged(layerId, dimensionName, value);
10944
+ },
10945
+ isDisabled: false,
10946
+ validSelection: layerDimension.synced === false || !(layerDimension.validSyncSelection !== undefined && layerDimension.validSyncSelection === false)
10947
+ })]
10948
+ }), layerId);
10976
10949
  };
10977
10950
 
10978
10951
  const LayerInfoButton = _a => {
@@ -10981,7 +10954,7 @@ const LayerInfoButton = _a => {
10981
10954
  onClick
10982
10955
  } = _a,
10983
10956
  props = __rest(_a, ["isActive", "onClick"]);
10984
- return /*#__PURE__*/React__default.createElement(CustomIconButton, Object.assign({
10957
+ return jsx(CustomIconButton, Object.assign({
10985
10958
  variant: "flat",
10986
10959
  isSelected: isActive,
10987
10960
  onClick: onClick,
@@ -10989,7 +10962,9 @@ const LayerInfoButton = _a => {
10989
10962
  "data-testid": "layerInfoButton",
10990
10963
  "aria-label": "layer info",
10991
10964
  className: "layerInfoButton"
10992
- }, props), /*#__PURE__*/React__default.createElement(Info, null));
10965
+ }, props, {
10966
+ children: jsx(Info, {})
10967
+ }));
10993
10968
  };
10994
10969
 
10995
10970
  const textStyle = {
@@ -11003,13 +10978,19 @@ const LayerInfoText = ({
11003
10978
  label,
11004
10979
  value
11005
10980
  }) => {
11006
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Typography$1, {
11007
- variant: "subtitle2",
11008
- sx: textStyle
11009
- }, label), /*#__PURE__*/React__default.createElement(Typography$1, {
11010
- variant: "body2",
11011
- sx: textStyleWithMargin
11012
- }, value));
10981
+ return jsxs(Fragment, {
10982
+ children: [jsx(Typography$1, Object.assign({
10983
+ variant: "subtitle2",
10984
+ sx: textStyle
10985
+ }, {
10986
+ children: label
10987
+ })), jsx(Typography$1, Object.assign({
10988
+ variant: "body2",
10989
+ sx: textStyleWithMargin
10990
+ }, {
10991
+ children: value
10992
+ }))]
10993
+ });
11013
10994
  };
11014
10995
 
11015
10996
  const valueStyle = Object.assign(Object.assign({}, textStyle), {
@@ -11019,59 +11000,61 @@ const LayerInfoList = ({
11019
11000
  label,
11020
11001
  list
11021
11002
  }) => {
11022
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Typography$1, {
11023
- variant: "subtitle2",
11024
- sx: textStyle
11025
- }, label), list.length === 0 ? ( /*#__PURE__*/React__default.createElement(Typography$1, {
11026
- variant: "body2",
11027
- sx: textStyleWithMargin
11028
- }, "-")) : ( /*#__PURE__*/React__default.createElement(Grid$1, {
11029
- container: true,
11030
- direction: "column"
11031
- }, list.map(item => ( /*#__PURE__*/React__default.createElement("div", {
11032
- key: item.label
11033
- }, /*#__PURE__*/React__default.createElement(Grid$1, {
11034
- item: true,
11035
- container: true,
11036
- direction: "row"
11037
- }, item.icon, /*#__PURE__*/React__default.createElement(Grid$1, {
11038
- item: true,
11039
- sx: {
11040
- marginLeft: '10px'
11041
- }
11042
- }, /*#__PURE__*/React__default.createElement(Typography$1, {
11043
- variant: "body2",
11044
- sx: textStyle
11045
- }, item.label, ":"))), /*#__PURE__*/React__default.createElement(Grid$1, {
11046
- item: true,
11047
- container: true,
11048
- direction: "row",
11049
- sx: {
11050
- marginBottom: 1,
11051
- paddingLeft: '34px'
11052
- }
11053
- }, /*#__PURE__*/React__default.createElement(Typography$1, {
11054
- variant: "body2",
11055
- sx: valueStyle
11056
- }, item.value))))))));
11003
+ return jsxs(Fragment, {
11004
+ children: [jsx(Typography$1, Object.assign({
11005
+ variant: "subtitle2",
11006
+ sx: textStyle
11007
+ }, {
11008
+ children: label
11009
+ })), list.length === 0 ? jsx(Typography$1, Object.assign({
11010
+ variant: "body2",
11011
+ sx: textStyleWithMargin
11012
+ }, {
11013
+ children: "-"
11014
+ })) : jsx(Grid$1, Object.assign({
11015
+ container: true,
11016
+ direction: "column"
11017
+ }, {
11018
+ children: list.map(item => jsxs("div", {
11019
+ children: [jsxs(Grid$1, Object.assign({
11020
+ item: true,
11021
+ container: true,
11022
+ direction: "row"
11023
+ }, {
11024
+ children: [item.icon, jsx(Grid$1, Object.assign({
11025
+ item: true,
11026
+ sx: {
11027
+ marginLeft: '10px'
11028
+ }
11029
+ }, {
11030
+ children: jsxs(Typography$1, Object.assign({
11031
+ variant: "body2",
11032
+ sx: textStyle
11033
+ }, {
11034
+ children: [item.label, ":"]
11035
+ }))
11036
+ }))]
11037
+ })), jsx(Grid$1, Object.assign({
11038
+ item: true,
11039
+ container: true,
11040
+ direction: "row",
11041
+ sx: {
11042
+ marginBottom: 1,
11043
+ paddingLeft: '34px'
11044
+ }
11045
+ }, {
11046
+ children: jsx(Typography$1, Object.assign({
11047
+ variant: "body2",
11048
+ sx: valueStyle
11049
+ }, {
11050
+ children: item.value
11051
+ }))
11052
+ }))]
11053
+ }, item.label))
11054
+ }))]
11055
+ });
11057
11056
  };
11058
11057
 
11059
- /* *
11060
- * Licensed under the Apache License, Version 2.0 (the "License");
11061
- * you may not use this file except in compliance with the License.
11062
- * You may obtain a copy of the License at
11063
- *
11064
- * http://www.apache.org/licenses/LICENSE-2.0
11065
- *
11066
- * Unless required by applicable law or agreed to in writing, software
11067
- * distributed under the License is distributed on an "AS IS" BASIS,
11068
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11069
- * See the License for the specific language governing permissions and
11070
- * limitations under the License.
11071
- *
11072
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11073
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
11074
- * */
11075
11058
  const LayerInfoLegend = ({
11076
11059
  title,
11077
11060
  name,
@@ -11081,17 +11064,23 @@ const LayerInfoLegend = ({
11081
11064
  const {
11082
11065
  t
11083
11066
  } = useWebmapReactTranslation();
11084
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Typography$1, {
11085
- variant: "subtitle2",
11086
- sx: textStyleWithMargin
11087
- }, t('webmap-react-legend')), /*#__PURE__*/React__default.createElement(LegendLayout, {
11088
- title: title,
11089
- name: name,
11090
- dimensions: dimensions
11091
- }, legendURL ? /*#__PURE__*/React__default.createElement("img", {
11092
- alt: title,
11093
- src: legendURL
11094
- }) : '-'));
11067
+ return jsxs(Fragment, {
11068
+ children: [jsx(Typography$1, Object.assign({
11069
+ variant: "subtitle2",
11070
+ sx: textStyleWithMargin
11071
+ }, {
11072
+ children: t('webmap-react-legend')
11073
+ })), jsx(LegendLayout, Object.assign({
11074
+ title: title,
11075
+ name: name,
11076
+ dimensions: dimensions
11077
+ }, {
11078
+ children: legendURL ? jsx("img", {
11079
+ alt: title,
11080
+ src: legendURL
11081
+ }) : '-'
11082
+ }))]
11083
+ });
11095
11084
  };
11096
11085
 
11097
11086
  var fails$4 = fails$q;
@@ -11561,13 +11550,13 @@ const getDimensionIcon = (name, dimensions) => {
11561
11550
  }
11562
11551
  switch (dimension.name.toLowerCase()) {
11563
11552
  case 'time':
11564
- return /*#__PURE__*/React__default.createElement(DimensionsTime, null);
11553
+ return jsx(DimensionsTime, {});
11565
11554
  case 'reference_time':
11566
- return /*#__PURE__*/React__default.createElement(DimensionsRefTime, null);
11555
+ return jsx(DimensionsRefTime, {});
11567
11556
  case 'elevation':
11568
- return /*#__PURE__*/React__default.createElement(DimensionsElevation, null);
11557
+ return jsx(DimensionsElevation, {});
11569
11558
  default:
11570
- return /*#__PURE__*/React__default.createElement(DimensionsOther, null);
11559
+ return jsx(DimensionsOther, {});
11571
11560
  }
11572
11561
  };
11573
11562
  const getDimensionLabel = name => {
@@ -11601,22 +11590,6 @@ const getDimensionsList = dimensions => {
11601
11590
  return result;
11602
11591
  };
11603
11592
 
11604
- /* *
11605
- * Licensed under the Apache License, Version 2.0 (the "License");
11606
- * you may not use this file except in compliance with the License.
11607
- * You may obtain a copy of the License at
11608
- *
11609
- * http://www.apache.org/licenses/LICENSE-2.0
11610
- *
11611
- * Unless required by applicable law or agreed to in writing, software
11612
- * distributed under the License is distributed on an "AS IS" BASIS,
11613
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11614
- * See the License for the specific language governing permissions and
11615
- * limitations under the License.
11616
- *
11617
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11618
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
11619
- * */
11620
11593
  const LayerInfoDialog = ({
11621
11594
  onClose,
11622
11595
  layer,
@@ -11634,7 +11607,7 @@ const LayerInfoDialog = ({
11634
11607
  const {
11635
11608
  t
11636
11609
  } = useWebmapReactTranslation();
11637
- return /*#__PURE__*/React__default.createElement(ToolContainerDraggable, {
11610
+ return jsx(ToolContainerDraggable, Object.assign({
11638
11611
  onClose: onClose,
11639
11612
  startSize: {
11640
11613
  width: 288,
@@ -11649,43 +11622,47 @@ const LayerInfoDialog = ({
11649
11622
  onMouseDown: _onMouseDown,
11650
11623
  order: _order,
11651
11624
  source: _source
11652
- }, /*#__PURE__*/React__default.createElement(Box$1, {
11653
- sx: {
11654
- padding: 2
11655
- }
11656
- }, /*#__PURE__*/React__default.createElement(LayerInfoText, {
11657
- label: t('webmap-react-title'),
11658
- value: layer.title
11659
- }), /*#__PURE__*/React__default.createElement(LayerInfoText, {
11660
- label: t('webmap-react-name'),
11661
- value: layer.name
11662
- }), /*#__PURE__*/React__default.createElement(LayerInfoText, {
11663
- label: t('webmap-react-service'),
11664
- value: serviceName
11665
- }), /*#__PURE__*/React__default.createElement(LayerInfoText, {
11666
- label: t('webmap-react-abstract'),
11667
- value: layer.abstract || '-'
11668
- }), /*#__PURE__*/React__default.createElement(LayerInfoList, {
11669
- label: t('webmap-react-dimensions'),
11670
- list: dimensions
11671
- }), /*#__PURE__*/React__default.createElement(LayerInfoText, {
11672
- label: t('webmap-react-styles'),
11673
- value: styles
11674
- }), /*#__PURE__*/React__default.createElement(LayerInfoText, {
11675
- label: t('webmap-react-bounding-box'),
11676
- value: bbox
11677
- }), /*#__PURE__*/React__default.createElement(LayerInfoText, {
11678
- label: t('webmap-react-groups'),
11679
- value: ((_a = layer.path) === null || _a === void 0 ? void 0 : _a.join('/')) || '-'
11680
- }), /*#__PURE__*/React__default.createElement(LayerInfoText, {
11681
- label: t('webmap-react-keywords'),
11682
- value: ((_b = layer.keywords) === null || _b === void 0 ? void 0 : _b.join(', ')) || '-'
11683
- }), /*#__PURE__*/React__default.createElement(LayerInfoLegend, {
11684
- title: layer.title,
11685
- name: layer.name,
11686
- dimensions: layer.dimensions,
11687
- legendURL: ((_c = layer.styles) === null || _c === void 0 ? void 0 : _c.length) ? layer.styles[0].legendURL : undefined
11688
- })));
11625
+ }, {
11626
+ children: jsxs(Box$1, Object.assign({
11627
+ sx: {
11628
+ padding: 2
11629
+ }
11630
+ }, {
11631
+ children: [jsx(LayerInfoText, {
11632
+ label: t('webmap-react-title'),
11633
+ value: layer.title
11634
+ }), jsx(LayerInfoText, {
11635
+ label: t('webmap-react-name'),
11636
+ value: layer.name
11637
+ }), jsx(LayerInfoText, {
11638
+ label: t('webmap-react-service'),
11639
+ value: serviceName
11640
+ }), jsx(LayerInfoText, {
11641
+ label: t('webmap-react-abstract'),
11642
+ value: layer.abstract || '-'
11643
+ }), jsx(LayerInfoList, {
11644
+ label: t('webmap-react-dimensions'),
11645
+ list: dimensions
11646
+ }), jsx(LayerInfoText, {
11647
+ label: t('webmap-react-styles'),
11648
+ value: styles
11649
+ }), jsx(LayerInfoText, {
11650
+ label: t('webmap-react-bounding-box'),
11651
+ value: bbox
11652
+ }), jsx(LayerInfoText, {
11653
+ label: t('webmap-react-groups'),
11654
+ value: ((_a = layer.path) === null || _a === void 0 ? void 0 : _a.join('/')) || '-'
11655
+ }), jsx(LayerInfoText, {
11656
+ label: t('webmap-react-keywords'),
11657
+ value: ((_b = layer.keywords) === null || _b === void 0 ? void 0 : _b.join(', ')) || '-'
11658
+ }), jsx(LayerInfoLegend, {
11659
+ title: layer.title,
11660
+ name: layer.name,
11661
+ dimensions: layer.dimensions,
11662
+ legendURL: ((_c = layer.styles) === null || _c === void 0 ? void 0 : _c.length) ? layer.styles[0].legendURL : undefined
11663
+ })]
11664
+ }))
11665
+ }));
11689
11666
  };
11690
11667
 
11691
11668
  /* *
@@ -11845,25 +11822,25 @@ const MeteoCanada = {
11845
11822
 
11846
11823
  var publicServices = /*#__PURE__*/Object.freeze({
11847
11824
  __proto__: null,
11825
+ ArcGisCanvas: ArcGisCanvas,
11848
11826
  DWD: DWD,
11849
- nationaalgeoregister: nationaalgeoregister,
11850
- KNMImsgcpp: KNMImsgcpp,
11827
+ DWDObservations: DWDObservations,
11828
+ DWDWXProdukt: DWDWXProdukt,
11829
+ DWDWarnings: DWDWarnings,
11830
+ ECMWFPublicService: ECMWFPublicService,
11831
+ EUMETSAT: EUMETSAT,
11832
+ FMIopenwms: FMIopenwms,
11851
11833
  HeiGit: HeiGit,
11852
- ArcGisCanvas: ArcGisCanvas,
11853
- KNMIgeoservicesRadar: KNMIgeoservicesRadar,
11854
- KNMIgeoservicesObs: KNMIgeoservicesObs,
11855
- KNMIgeoservicesKlimaatAtlas: KNMIgeoservicesKlimaatAtlas,
11856
11834
  KNMIgeoservicesHarmonie: KNMIgeoservicesHarmonie,
11857
11835
  KNMIgeoservicesHarmonieMLService: KNMIgeoservicesHarmonieMLService,
11836
+ KNMIgeoservicesKlimaatAtlas: KNMIgeoservicesKlimaatAtlas,
11837
+ KNMIgeoservicesObs: KNMIgeoservicesObs,
11838
+ KNMIgeoservicesRadar: KNMIgeoservicesRadar,
11839
+ KNMImsgcpp: KNMImsgcpp,
11858
11840
  MetNorwayService: MetNorwayService,
11859
- FMIopenwms: FMIopenwms,
11860
- DWDObservations: DWDObservations,
11861
- DWDWarnings: DWDWarnings,
11862
- DWDWXProdukt: DWDWXProdukt,
11863
- EUMETSAT: EUMETSAT,
11841
+ MeteoCanada: MeteoCanada,
11864
11842
  eumetviewEUMETSAT: eumetviewEUMETSAT,
11865
- ECMWFPublicService: ECMWFPublicService,
11866
- MeteoCanada: MeteoCanada
11843
+ nationaalgeoregister: nationaalgeoregister
11867
11844
  });
11868
11845
 
11869
11846
  /* *
@@ -12204,48 +12181,48 @@ const msgNaturalEUMETSAT = {
12204
12181
 
12205
12182
  var publicLayers = /*#__PURE__*/Object.freeze({
12206
12183
  __proto__: null,
12207
- defaultLayers: defaultLayers,
12184
+ FMITemp: FMITemp,
12185
+ MetNoTemp: MetNoTemp,
12208
12186
  baseLayer: baseLayer,
12209
- baseLayerOpenStreetMapNL: baseLayerOpenStreetMapNL,
12210
12187
  baseLayerArcGisCanvas: baseLayerArcGisCanvas,
12211
- baseLayerWorldMap: baseLayerWorldMap,
12212
12188
  baseLayerHeiGit: baseLayerHeiGit,
12213
- msgCppLayer: msgCppLayer,
12214
- veiligheidsRegiosGebiedsIndelingenLabels: veiligheidsRegiosGebiedsIndelingenLabels,
12215
- veiligheidsRegiosGebiedsIndelingen: veiligheidsRegiosGebiedsIndelingen,
12216
- radarLayer: radarLayer,
12217
- radarLayerWithError: radarLayerWithError,
12218
- obsAirTemperature: obsAirTemperature,
12219
- obsWind: obsWind,
12220
- obsAirPressureAtSeaLevel: obsAirPressureAtSeaLevel,
12221
- obsRelativeHumidity: obsRelativeHumidity,
12222
- obsGlobalSolarRadiation: obsGlobalSolarRadiation,
12223
- obsPrecipitationIntensityPWS: obsPrecipitationIntensityPWS,
12224
- harmonieRelativeHumidityPl: harmonieRelativeHumidityPl,
12225
- harmonieWindPl: harmonieWindPl,
12189
+ baseLayerOpenStreetMapNL: baseLayerOpenStreetMapNL,
12190
+ baseLayerWorldMap: baseLayerWorldMap,
12191
+ defaultLayers: defaultLayers,
12192
+ dwdObservationsWetterLayer: dwdObservationsWetterLayer,
12193
+ dwdObservationsWetterLayerWithHeader: dwdObservationsWetterLayerWithHeader,
12194
+ dwdObservationsWindLayer: dwdObservationsWindLayer,
12195
+ dwdRadarLayer: dwdRadarLayer,
12196
+ dwdWarningLayer: dwdWarningLayer,
12226
12197
  harmonieAirTemperature: harmonieAirTemperature,
12227
12198
  harmoniePrecipitation: harmoniePrecipitation,
12228
12199
  harmoniePressure: harmoniePressure,
12200
+ harmonieRelativeHumidityPl: harmonieRelativeHumidityPl,
12229
12201
  harmonieWindFlags: harmonieWindFlags,
12202
+ harmonieWindPl: harmonieWindPl,
12230
12203
  klimaatAtlasTG3: klimaatAtlasTG3,
12231
- dwdWarningLayer: dwdWarningLayer,
12232
- dwdRadarLayer: dwdRadarLayer,
12233
- dwdObservationsWetterLayer: dwdObservationsWetterLayer,
12234
- dwdObservationsWetterLayerWithHeader: dwdObservationsWetterLayerWithHeader,
12235
- dwdObservationsWindLayer: dwdObservationsWindLayer,
12236
- FMITemp: FMITemp,
12237
- MetNoTemp: MetNoTemp,
12204
+ metNorwayLatestT: metNorwayLatestT,
12205
+ metNorwaySalinaty: metNorwaySalinaty,
12238
12206
  metNorwayWind1: metNorwayWind1,
12239
12207
  metNorwayWind2: metNorwayWind2,
12240
12208
  metNorwayWind3: metNorwayWind3,
12241
- metNorwayLatestT: metNorwayLatestT,
12242
- metNorwaySalinaty: metNorwaySalinaty,
12243
- msgFesEUMETSAT: msgFesEUMETSAT,
12244
- msgNaturalenhncdEUMETSAT: msgNaturalenhncdEUMETSAT,
12245
12209
  msgAshEUMETSAT: msgAshEUMETSAT,
12210
+ msgCppLayer: msgCppLayer,
12246
12211
  msgCthEUMETSAT: msgCthEUMETSAT,
12212
+ msgFesEUMETSAT: msgFesEUMETSAT,
12247
12213
  msgFogEUMETSAT: msgFogEUMETSAT,
12248
- msgNaturalEUMETSAT: msgNaturalEUMETSAT
12214
+ msgNaturalEUMETSAT: msgNaturalEUMETSAT,
12215
+ msgNaturalenhncdEUMETSAT: msgNaturalenhncdEUMETSAT,
12216
+ obsAirPressureAtSeaLevel: obsAirPressureAtSeaLevel,
12217
+ obsAirTemperature: obsAirTemperature,
12218
+ obsGlobalSolarRadiation: obsGlobalSolarRadiation,
12219
+ obsPrecipitationIntensityPWS: obsPrecipitationIntensityPWS,
12220
+ obsRelativeHumidity: obsRelativeHumidity,
12221
+ obsWind: obsWind,
12222
+ radarLayer: radarLayer,
12223
+ radarLayerWithError: radarLayerWithError,
12224
+ veiligheidsRegiosGebiedsIndelingen: veiligheidsRegiosGebiedsIndelingen,
12225
+ veiligheidsRegiosGebiedsIndelingenLabels: veiligheidsRegiosGebiedsIndelingenLabels
12249
12226
  });
12250
12227
 
12251
- export { DRAWMODE, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDITMODE, EditModeButton as EditModeButtonField, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MINUTE_TO_MILLISECOND, MapControlButton, MapControls, MapDimensionSelect, MapDrawContainer, MapTime, MapView, MapViewLayer, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION, ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO, radarGetCapabilities_spec as RadarGetCapabilities, ReactMapView, ReactMapViewLayer, SelectField, StoryLayoutGrid, WEBMAP_REACT_NAMESPACE, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, addWMLayerPropsBasedOnChildProps, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, checkHoverFeatures, createInterSections, currentlySupportedDrawModes, defaultBox, defaultDelete, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultModes, defaultPoint, defaultPolygon, defaultTimeFormat, dimensionConfig, distance, drawPolyStoryStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureBox, featureMultiPoint, featurePoint, featurePolygon, fillOptions, firSelectionType, formatTime, getCurrentDimensionValue, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawFunctionFromStore, getFeatureCollection, getFeatureExtent, getFeatureLayers, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getTimeDimension, getToolIcon, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isAGeoJSONLayer, isAMapLayer, isGeoJSONFeatureCreatedByTool, isPointFeatureCollection, lineString, makeLayerPropListFromChildren, marksByDimension, moveFeature, opacityOptions, orderLayers, parseWMJSLayer, publicLayers, publicServices, registerDrawFunction, removeWMLayerFromMap, rewindGeometry, setWMLayerPropsBasedOnChildProps, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useGeoJSON, useMapDrawTool, webmapReactTranslations };
12228
+ export { DRAWMODE, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDITMODE, EditModeButton as EditModeButtonField, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MINUTE_TO_MILLISECOND, MapControlButton, MapControls, MapDimensionSelect, MapDrawContainer, MapTime, MapView, MapViewLayer, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION, ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO, Proj4js, radarGetCapabilities_spec as RadarGetCapabilities, ReactMapView, ReactMapViewLayer, SelectField, StoryLayoutGrid, WEBMAP_REACT_NAMESPACE, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, addWMLayerPropsBasedOnChildProps, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, checkHoverFeatures, convertGeoCoordsToScreenCoords, createInterSections, currentlySupportedDrawModes, defaultBox, defaultDelete, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultModes, defaultPoint, defaultPolygon, defaultTimeFormat, dimensionConfig, distance, drawPolyStoryStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureBox, featureMultiPoint, featurePoint, featurePolygon, fillOptions, findClosestCoords, firSelectionType, formatTime, getCurrentDimensionValue, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawFunctionFromStore, getFeatureCollection, getFeatureExtent, getFeatureLayers, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getPixelCoordFromGeoCoord, getProj4, getTimeDimension, getToolIcon, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isAGeoJSONLayer, isAMapLayer, isBetween, isGeoJSONFeatureCreatedByTool, isPointFeatureCollection, lineString, lineStringCollection, makeLayerPropListFromChildren, marksByDimension, moveFeature, opacityOptions, orderLayers, parseWMJSLayer, projectorCache, publicLayers, publicServices, registerDrawFunction, removeWMLayerFromMap, rewindGeometry, setWMLayerPropsBasedOnChildProps, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useGeoJSON, useMapDrawTool, webmapReactTranslations };