@opengeoweb/webmap 9.28.1 → 9.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/index.esm.js +709 -714
  2. package/package.json +1 -1
  3. package/src/index.d.ts +1 -1
  4. package/src/lib/components/IWMJSMap.d.ts +315 -315
  5. package/src/lib/components/WMAnimate.d.ts +14 -14
  6. package/src/lib/components/WMAnimate.spec.d.ts +1 -1
  7. package/src/lib/components/WMBBOX.d.ts +31 -31
  8. package/src/lib/components/WMBBOX.spec.d.ts +1 -1
  9. package/src/lib/components/WMCanvasBuffer.d.ts +123 -123
  10. package/src/lib/components/WMCanvasBuffer.spec.d.ts +1 -1
  11. package/src/lib/components/WMCanvasDrawFunctions.d.ts +11 -11
  12. package/src/lib/components/WMConstants.d.ts +19 -19
  13. package/src/lib/components/WMDrawMarker.d.ts +2 -2
  14. package/src/lib/components/WMDrawMarker.spec.d.ts +1 -1
  15. package/src/lib/components/WMFlyToBBox.d.ts +25 -25
  16. package/src/lib/components/WMFlyToBBox.spec.d.ts +1 -1
  17. package/src/lib/components/WMGetServiceFromStore.d.ts +3 -3
  18. package/src/lib/components/WMGlobals.d.ts +8 -8
  19. package/src/lib/components/WMImage.d.ts +97 -97
  20. package/src/lib/components/WMImage.spec.d.ts +1 -1
  21. package/src/lib/components/WMImageStore.d.ts +44 -44
  22. package/src/lib/components/WMImageStore.spec.d.ts +1 -1
  23. package/src/lib/components/WMJSDimension.d.ts +112 -112
  24. package/src/lib/components/WMJSDimension.spec.d.ts +1 -1
  25. package/src/lib/components/WMJSExternalDependencies.d.ts +2 -2
  26. package/src/lib/components/WMJSMap.d.ts +222 -220
  27. package/src/lib/components/WMJSMap.spec.d.ts +1 -1
  28. package/src/lib/components/WMJSMapHelpers.d.ts +59 -58
  29. package/src/lib/components/WMJSMapHelpers.spec.d.ts +1 -1
  30. package/src/lib/components/WMJSService.d.ts +69 -69
  31. package/src/lib/components/WMJSService.spec.d.ts +1 -1
  32. package/src/lib/components/WMJSTools.d.ts +100 -100
  33. package/src/lib/components/WMJSTools.spec.d.ts +1 -1
  34. package/src/lib/components/WMLayer.d.ts +194 -194
  35. package/src/lib/components/WMLayer.spec.d.ts +1 -1
  36. package/src/lib/components/WMLegend.d.ts +6 -6
  37. package/src/lib/components/WMLegend.spec.d.ts +1 -1
  38. package/src/lib/components/WMListener.d.ts +57 -57
  39. package/src/lib/components/WMListener.spec.d.ts +1 -1
  40. package/src/lib/components/WMMapPin.d.ts +31 -31
  41. package/src/lib/components/WMMemo.d.ts +5 -5
  42. package/src/lib/components/WMMemo.spec.d.ts +1 -1
  43. package/src/lib/components/WMPrefetch.d.ts +9 -9
  44. package/src/lib/components/WMPrefetch.spec.d.ts +1 -1
  45. package/src/lib/components/WMProjection.d.ts +16 -16
  46. package/src/lib/components/WMTileRenderer.d.ts +7 -7
  47. package/src/lib/components/WMTileRenderer.spec.d.ts +1 -1
  48. package/src/lib/components/WMTime.d.ts +43 -43
  49. package/src/lib/components/WMTime.spec.d.ts +1 -1
  50. package/src/lib/components/WMTimeTypes.d.ts +19 -19
  51. package/src/lib/components/WMTimer.d.ts +11 -11
  52. package/src/lib/components/WMTimer.spec.d.ts +1 -1
  53. package/src/lib/components/WMXMLParser.d.ts +9 -9
  54. package/src/lib/components/WMXMLParser.spec.d.ts +1 -1
  55. package/src/lib/components/index.d.ts +24 -24
  56. package/src/lib/components/types.d.ts +174 -174
  57. package/src/lib/index.d.ts +5 -5
  58. package/src/lib/utils/consoleErrorMessages.d.ts +11 -11
  59. package/src/lib/utils/fakeMaxAgeResponses.d.ts +1 -1
  60. package/src/lib/utils/getCapabilities/getCapabilities.d.ts +18 -18
  61. package/src/lib/utils/getCapabilities/getCapabilities.spec.d.ts +1 -1
  62. package/src/lib/utils/getCapabilities/index.d.ts +2 -2
  63. package/src/lib/utils/getCapabilities/mocks/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +1 -1
  64. package/src/lib/utils/getCapabilities/mocks/index.d.ts +89 -89
  65. package/src/lib/utils/getCapabilities/mocks/mockGetCapabilities.d.ts +87 -87
  66. package/src/lib/utils/i18n.d.ts +4 -2
  67. package/src/lib/utils/index.d.ts +9 -9
  68. package/src/lib/utils/mapConstants.d.ts +7 -7
  69. package/src/lib/utils/specs/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +2 -2
  70. package/src/lib/utils/specs/WMS130GetCapabilitiesHarmN25.d.ts +2 -2
  71. package/src/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithInheritAndReplaceLayerprops.d.ts +2 -2
  72. package/src/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithInheritLayerprops.d.ts +2 -2
  73. package/src/lib/utils/specs/WMS130GetCapabilitiesRadarTestWithoutInheritLayerprops.d.ts +2 -2
  74. package/src/lib/utils/specs/WMSSmartMet.d.ts +2 -2
  75. package/src/lib/utils/testSettings.d.ts +14 -14
  76. package/src/lib/utils/testUtils.d.ts +21 -21
  77. package/src/lib/utils/tilesettings.d.ts +26 -26
  78. package/src/lib/utils/utils.d.ts +56 -56
  79. package/src/lib/utils/utils.spec.d.ts +1 -1
package/index.esm.js CHANGED
@@ -5165,22 +5165,22 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
5165
5165
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
5166
5166
  };
5167
5167
 
5168
- /* *
5169
- * Licensed under the Apache License, Version 2.0 (the "License");
5170
- * you may not use this file except in compliance with the License.
5171
- * You may obtain a copy of the License at
5172
- *
5173
- * http://www.apache.org/licenses/LICENSE-2.0
5174
- *
5175
- * Unless required by applicable law or agreed to in writing, software
5176
- * distributed under the License is distributed on an "AS IS" BASIS,
5177
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5178
- * See the License for the specific language governing permissions and
5179
- * limitations under the License.
5180
- *
5181
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5182
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
5183
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5168
+ /* *
5169
+ * Licensed under the Apache License, Version 2.0 (the "License");
5170
+ * you may not use this file except in compliance with the License.
5171
+ * You may obtain a copy of the License at
5172
+ *
5173
+ * http://www.apache.org/licenses/LICENSE-2.0
5174
+ *
5175
+ * Unless required by applicable law or agreed to in writing, software
5176
+ * distributed under the License is distributed on an "AS IS" BASIS,
5177
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5178
+ * See the License for the specific language governing permissions and
5179
+ * limitations under the License.
5180
+ *
5181
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5182
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
5183
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5184
5184
  * */
5185
5185
  const WMEmptyLayerName = 'empty_layer';
5186
5186
  const WMEmptyLayerTitle = 'empty layer';
@@ -5212,10 +5212,10 @@ var DebugType;
5212
5212
  })(DebugType || (DebugType = {}));
5213
5213
  const debugLogger = (type, message, ...optionalParam) => {
5214
5214
  };
5215
- /**
5216
- * Checks if variable is defined or not
5217
- * @param variable The variable to check
5218
- * @returns true if variable is indeed defined, otherwise false.
5215
+ /**
5216
+ * Checks if variable is defined or not
5217
+ * @param variable The variable to check
5218
+ * @returns true if variable is indeed defined, otherwise false.
5219
5219
  */
5220
5220
  const isDefined = variable => {
5221
5221
  if (variable === null) {
@@ -5226,10 +5226,10 @@ const isDefined = variable => {
5226
5226
  }
5227
5227
  return true;
5228
5228
  };
5229
- /**
5230
- * Converts a variable to an array. If the variable is not an array it will be pushed as the first entry in a new array. If the variable is already an array, nothing will be done.
5231
- * @param array The variable to convert
5232
- * @returns Always an array
5229
+ /**
5230
+ * Converts a variable to an array. If the variable is not an array it will be pushed as the first entry in a new array. If the variable is already an array, nothing will be done.
5231
+ * @param array The variable to convert
5232
+ * @returns Always an array
5233
5233
  */
5234
5234
  const toArray = array => {
5235
5235
  if (array === null || typeof array === 'undefined') {
@@ -5242,11 +5242,11 @@ const toArray = array => {
5242
5242
  newArray[0] = array;
5243
5243
  return newArray;
5244
5244
  };
5245
- /**
5246
- * Function which checks wether URL contains a ? token. If not, it is assumed that this token was not provided by the user,
5247
- * manually add the token later.
5248
- * @param url The URL to check
5249
- * @return the fixed URL
5245
+ /**
5246
+ * Function which checks wether URL contains a ? token. If not, it is assumed that this token was not provided by the user,
5247
+ * manually add the token later.
5248
+ * @param url The URL to check
5249
+ * @return the fixed URL
5250
5250
  */
5251
5251
  const WMJScheckURL = url => {
5252
5252
  if (!isDefined(url)) {
@@ -5258,14 +5258,9 @@ const WMJScheckURL = url => {
5258
5258
  }
5259
5259
  return trimmedUrl;
5260
5260
  };
5261
- const preventdefaultEvent = e => {
5262
- const event = e || window.event;
5261
+ const preventdefaultEvent = event => {
5263
5262
  if (event.preventDefault) {
5264
- // Firefox
5265
5263
  event.preventDefault();
5266
- } else {
5267
- // IE
5268
- event.returnValue = false;
5269
5264
  }
5270
5265
  };
5271
5266
  const getMouseXCoordinate = event => {
@@ -5350,11 +5345,11 @@ const getMapDimURL = (layer, dimensionOverride) => {
5350
5345
  });
5351
5346
  return request;
5352
5347
  };
5353
- /**
5354
- * Parses url and then it it allows for setting / changing key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
5355
- * @param baseUrl
5356
- * @param params
5357
- * @returns
5348
+ /**
5349
+ * Parses url and then it it allows for setting / changing key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
5350
+ * @param baseUrl
5351
+ * @param params
5352
+ * @returns
5358
5353
  */
5359
5354
  const getUriWithParam = (baseUrl,
5360
5355
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5369,11 +5364,11 @@ params) => {
5369
5364
  Url.search = urlParams.toString();
5370
5365
  return Url.toString();
5371
5366
  };
5372
- /**
5373
- * Parses url and then it it allows for setting additional key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
5374
- * @param baseUrl
5375
- * @param params
5376
- * @returns
5367
+ /**
5368
+ * Parses url and then it it allows for setting additional key value pairs in that URL (From https://stackoverflow.com/questions/5999118/how-can-i-add-or-update-a-query-string-parameter)
5369
+ * @param baseUrl
5370
+ * @param params
5371
+ * @returns
5377
5372
  */
5378
5373
  const getUriAddParam = (baseUrl,
5379
5374
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5393,10 +5388,10 @@ params) => {
5393
5388
  Url.search = urlParams.toString();
5394
5389
  return Url.toString();
5395
5390
  };
5396
- /**
5397
- * Converts a JS date to a ISO8601 string
5398
- * @param date
5399
- * @returns ISO8601 string
5391
+ /**
5392
+ * Converts a JS date to a ISO8601 string
5393
+ * @param date
5394
+ * @returns ISO8601 string
5400
5395
  */
5401
5396
  const dateToISO8601 = date => {
5402
5397
  const prf = (input, width) => {
@@ -5414,10 +5409,10 @@ const dateToISO8601 = date => {
5414
5409
  const iso = `${prf(date.getUTCFullYear(), 4)}-${prf(date.getUTCMonth() + 1, 2)}-${prf(date.getUTCDate(), 2)}T${prf(date.getUTCHours(), 2)}:${prf(date.getUTCMinutes(), 2)}:${prf(date.getUTCSeconds(), 2)}Z`;
5415
5410
  return iso;
5416
5411
  };
5417
- /**
5418
- * Helper function to figure out the styles from the WMS layer object from the WMS GetCapabilities document
5419
- * @param layerObjectFromWMS The layer object from the WMS GetCapabilities JSON document
5420
- * @returns Style[] Array of style objects.
5412
+ /**
5413
+ * Helper function to figure out the styles from the WMS layer object from the WMS GetCapabilities document
5414
+ * @param layerObjectFromWMS The layer object from the WMS GetCapabilities JSON document
5415
+ * @returns Style[] Array of style objects.
5421
5416
  */
5422
5417
  const addStylesForLayer = layerObjectFromWMS => {
5423
5418
  /* Get the Style object */
@@ -5504,12 +5499,12 @@ const addBoundingBoxForLayer = layerObjectFromWMS => {
5504
5499
  }
5505
5500
  return undefined;
5506
5501
  };
5507
- /**
5508
- * Sorts an array with objects by object key.
5509
- *
5510
- * @param array Array of objects
5511
- * @param key The key of the object to use for sorting
5512
- * @returns Sorted array.
5502
+ /**
5503
+ * Sorts an array with objects by object key.
5504
+ *
5505
+ * @param array Array of objects
5506
+ * @param key The key of the object to use for sorting
5507
+ * @returns Sorted array.
5513
5508
  */
5514
5509
  function sortArrayOfObjectsByKey(array, key) {
5515
5510
  const spreadArray = [...array];
@@ -5527,10 +5522,10 @@ function sortArrayOfObjectsByKey(array, key) {
5527
5522
  return 0;
5528
5523
  });
5529
5524
  }
5530
- /**
5531
- * A LayerTree with deeply nested children will be flattened into a 1D array. Children properties are removed and result is sorted alphabetically by the layers title.
5532
- * @param layerTree a WMS LayerTree
5533
- * @returns Flat array of layers as LayerProps[]
5525
+ /**
5526
+ * A LayerTree with deeply nested children will be flattened into a 1D array. Children properties are removed and result is sorted alphabetically by the layers title.
5527
+ * @param layerTree a WMS LayerTree
5528
+ * @returns Flat array of layers as LayerProps[]
5534
5529
  */
5535
5530
  const flattenLayerTree = layerTree => {
5536
5531
  const omit = (prop, _a) => {
@@ -5549,13 +5544,13 @@ const flattenLayerTree = layerTree => {
5549
5544
  const flatLayerObject = recurseLayerTree(layerTree.children);
5550
5545
  return sortArrayOfObjectsByKey(flatLayerObject, 'title');
5551
5546
  };
5552
- /**
5553
- * Makes a LayerProps object from the WMSLayerFromGetCapabilities and nestedLayerPath
5554
- * @param layer WMSLayerFromGetCapabilities
5555
- * @param path The path of the layer in the WMS GetCapabilities tree (Array of strings)
5556
- * @param isleaf Is this a group layer or an actual layer
5557
- * @param nestedLayerPath The path of the layer in the WMS GetCapabilities, in this case array of LayerProps
5558
- * @returns
5547
+ /**
5548
+ * Makes a LayerProps object from the WMSLayerFromGetCapabilities and nestedLayerPath
5549
+ * @param layer WMSLayerFromGetCapabilities
5550
+ * @param path The path of the layer in the WMS GetCapabilities tree (Array of strings)
5551
+ * @param isleaf Is this a group layer or an actual layer
5552
+ * @param nestedLayerPath The path of the layer in the WMS GetCapabilities, in this case array of LayerProps
5553
+ * @returns
5559
5554
  */
5560
5555
  const makeNodeLayerFromWMSGetCapabilityLayer = (layer, path = [], isleaf = false, nestedLayerPath = []) => {
5561
5556
  var _a, _b;
@@ -5606,12 +5601,12 @@ const makeNodeLayerFromWMSGetCapabilityLayer = (layer, path = [], isleaf = false
5606
5601
  crs
5607
5602
  };
5608
5603
  };
5609
- /**
5610
- * Builds a standardized LayerTree object based on WMSLayerFromGetCapabilities object.
5611
- * @param wmsLayer The WMSLayerFromGetCapabilities object
5612
- * @param nestedPath - Optional, only to be used by buildLayerTreeFromNestedWMSLayer
5613
- * @param nestedLayerPath - Optional, only to be used by buildLayerTreeFromNestedWMSLayer
5614
- * @returns A LayerTree object.
5604
+ /**
5605
+ * Builds a standardized LayerTree object based on WMSLayerFromGetCapabilities object.
5606
+ * @param wmsLayer The WMSLayerFromGetCapabilities object
5607
+ * @param nestedPath - Optional, only to be used by buildLayerTreeFromNestedWMSLayer
5608
+ * @param nestedLayerPath - Optional, only to be used by buildLayerTreeFromNestedWMSLayer
5609
+ * @returns A LayerTree object.
5615
5610
  */
5616
5611
  const buildLayerTreeFromNestedWMSLayer = (wmsLayer, nestedPath = [], nestedLayerPath = []) => {
5617
5612
  const isleaf = wmsLayer.Name && !wmsLayer.Layer;
@@ -5629,25 +5624,25 @@ const buildLayerTreeFromNestedWMSLayer = (wmsLayer, nestedPath = [], nestedLayer
5629
5624
  return layerTree;
5630
5625
  };
5631
5626
 
5632
- /* *
5633
- * Licensed under the Apache License, Version 2.0 (the "License");
5634
- * you may not use this file except in compliance with the License.
5635
- * You may obtain a copy of the License at
5636
- *
5637
- * http://www.apache.org/licenses/LICENSE-2.0
5638
- *
5639
- * Unless required by applicable law or agreed to in writing, software
5640
- * distributed under the License is distributed on an "AS IS" BASIS,
5641
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5642
- * See the License for the specific language governing permissions and
5643
- * limitations under the License.
5644
- *
5645
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5646
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
5647
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5627
+ /* *
5628
+ * Licensed under the Apache License, Version 2.0 (the "License");
5629
+ * you may not use this file except in compliance with the License.
5630
+ * You may obtain a copy of the License at
5631
+ *
5632
+ * http://www.apache.org/licenses/LICENSE-2.0
5633
+ *
5634
+ * Unless required by applicable law or agreed to in writing, software
5635
+ * distributed under the License is distributed on an "AS IS" BASIS,
5636
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5637
+ * See the License for the specific language governing permissions and
5638
+ * limitations under the License.
5639
+ *
5640
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
5641
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
5642
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
5648
5643
  * */
5649
- /**
5650
- * Global service store for re-use of services
5644
+ /**
5645
+ * Global service store for re-use of services
5651
5646
  */
5652
5647
  const WMServiceStore = [];
5653
5648
  const WMServiceStoreXML2JSONRequest = {
@@ -6637,22 +6632,22 @@ $$b({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_RE
6637
6632
  }
6638
6633
  });
6639
6634
 
6640
- /* *
6641
- * Licensed under the Apache License, Version 2.0 (the "License");
6642
- * you may not use this file except in compliance with the License.
6643
- * You may obtain a copy of the License at
6644
- *
6645
- * http://www.apache.org/licenses/LICENSE-2.0
6646
- *
6647
- * Unless required by applicable law or agreed to in writing, software
6648
- * distributed under the License is distributed on an "AS IS" BASIS,
6649
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6650
- * See the License for the specific language governing permissions and
6651
- * limitations under the License.
6652
- *
6653
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6654
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
6655
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6635
+ /* *
6636
+ * Licensed under the Apache License, Version 2.0 (the "License");
6637
+ * you may not use this file except in compliance with the License.
6638
+ * You may obtain a copy of the License at
6639
+ *
6640
+ * http://www.apache.org/licenses/LICENSE-2.0
6641
+ *
6642
+ * Unless required by applicable law or agreed to in writing, software
6643
+ * distributed under the License is distributed on an "AS IS" BASIS,
6644
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6645
+ * See the License for the specific language governing permissions and
6646
+ * limitations under the License.
6647
+ *
6648
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6649
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
6650
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6656
6651
  * */
6657
6652
  const consoleErrorMessages = {
6658
6653
  noCapabilityElementFound: 'No Capability element found in service',
@@ -6683,28 +6678,28 @@ class WMListener {
6683
6678
  this.registeredEvents = new Map();
6684
6679
  this._suspendedEvents = new Map();
6685
6680
  }
6686
- /**
6687
- * Remove events by name and function.
6688
- * @param name Event name
6689
- * @param f Function pointer to check
6681
+ /**
6682
+ * Remove events by name and function.
6683
+ * @param name Event name
6684
+ * @param f Function pointer to check
6690
6685
  */
6691
6686
  removeEventListener(name, f) {
6692
6687
  return this.removeEvents(name, f);
6693
6688
  }
6694
- /**
6695
- * Remove all events by name
6696
- * @param name Event name
6689
+ /**
6690
+ * Remove all events by name
6691
+ * @param name Event name
6697
6692
  */
6698
6693
  removeEventListeners(name) {
6699
6694
  return this.removeEvents(name);
6700
6695
  }
6701
- /**
6702
- * Add multiple functions which will be called after the event with the same name is triggered
6703
- * @param name: The name of the event to register
6704
- * @param function: The function to trigger
6705
- * @param keepOnCall: When false, this event name and function combination is removed once triggered.
6706
- * When true Otherwise keep the event and allow it to be triggered multiple times
6707
- * @return: true if the event is registerd, false if it already was registered
6696
+ /**
6697
+ * Add multiple functions which will be called after the event with the same name is triggered
6698
+ * @param name: The name of the event to register
6699
+ * @param function: The function to trigger
6700
+ * @param keepOnCall: When false, this event name and function combination is removed once triggered.
6701
+ * When true Otherwise keep the event and allow it to be triggered multiple times
6702
+ * @return: true if the event is registerd, false if it already was registered
6708
6703
  */
6709
6704
  addEventListener(name, functionpointer, keepOnCall = true) {
6710
6705
  const events = this.registeredEvents.get(name);
@@ -6730,43 +6725,43 @@ class WMListener {
6730
6725
  });
6731
6726
  return true;
6732
6727
  }
6733
- /**
6734
- * Destroys this listener, deregistering all events
6728
+ /**
6729
+ * Destroys this listener, deregistering all events
6735
6730
  */
6736
6731
  destroy() {
6737
6732
  this.registeredEvents.clear();
6738
6733
  }
6739
- /**
6740
- * Suspend a specific event by name, triggers will not be called
6741
- * @param name
6734
+ /**
6735
+ * Suspend a specific event by name, triggers will not be called
6736
+ * @param name
6742
6737
  */
6743
6738
  suspendEvent(name) {
6744
6739
  this._suspendedEvents.set(name, true);
6745
6740
  }
6746
- /**
6747
- * Resume a specific event by name, resuming normal operation
6748
- * @param name
6741
+ /**
6742
+ * Resume a specific event by name, resuming normal operation
6743
+ * @param name
6749
6744
  */
6750
6745
  resumeEvent(name) {
6751
6746
  this._suspendedEvents.set(name, false);
6752
6747
  }
6753
- /**
6754
- * This listener will not listen to any triggers
6748
+ /**
6749
+ * This listener will not listen to any triggers
6755
6750
  */
6756
6751
  suspendEvents() {
6757
6752
  this._suspendAllEvents = true;
6758
6753
  }
6759
- /**
6760
- * Resume event listening
6754
+ /**
6755
+ * Resume event listening
6761
6756
  */
6762
6757
  resumeEvents() {
6763
6758
  this._suspendAllEvents = false;
6764
6759
  }
6765
- /**
6766
- * Trigger an event with custom parameters
6767
- * @param name The name of the event to trigger
6768
- * @param param The parameters to provide to the associated function
6769
- * @returns The results of the function.
6760
+ /**
6761
+ * Trigger an event with custom parameters
6762
+ * @param name The name of the event to trigger
6763
+ * @param param The parameters to provide to the associated function
6764
+ * @returns The results of the function.
6770
6765
  */
6771
6766
  triggerEvent(name, param) {
6772
6767
  if (this._suspendAllEvents === true || this._suspendedEvents.get(name) === true) {
@@ -6862,22 +6857,22 @@ $$9({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
6862
6857
  }
6863
6858
  });
6864
6859
 
6865
- /* *
6866
- * Licensed under the Apache License, Version 2.0 (the "License");
6867
- * you may not use this file except in compliance with the License.
6868
- * You may obtain a copy of the License at
6869
- *
6870
- * http://www.apache.org/licenses/LICENSE-2.0
6871
- *
6872
- * Unless required by applicable law or agreed to in writing, software
6873
- * distributed under the License is distributed on an "AS IS" BASIS,
6874
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6875
- * See the License for the specific language governing permissions and
6876
- * limitations under the License.
6877
- *
6878
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6879
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
6880
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6860
+ /* *
6861
+ * Licensed under the Apache License, Version 2.0 (the "License");
6862
+ * you may not use this file except in compliance with the License.
6863
+ * You may obtain a copy of the License at
6864
+ *
6865
+ * http://www.apache.org/licenses/LICENSE-2.0
6866
+ *
6867
+ * Unless required by applicable law or agreed to in writing, software
6868
+ * distributed under the License is distributed on an "AS IS" BASIS,
6869
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6870
+ * See the License for the specific language governing permissions and
6871
+ * limitations under the License.
6872
+ *
6873
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6874
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
6875
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6881
6876
  * */
6882
6877
  const WMXMLStringToXMLDocument = xmlString => {
6883
6878
  const xmlData = new DOMParser().parseFromString(xmlString, 'text/xml');
@@ -6992,8 +6987,8 @@ const getWMSUrl = (service = '', additionalParams = {}) => getUriAddParam(servic
6992
6987
  service: 'WMS',
6993
6988
  request: 'GetCapabilities'
6994
6989
  }, additionalParams));
6995
- /**
6996
- * Global getcapabilities function
6990
+ /**
6991
+ * Global getcapabilities function
6997
6992
  */
6998
6993
  const WMJSGetCapabilities = (service, succes, fail, options, disableCache = false) => {
6999
6994
  /* Make the getCapabilitiesJSONrequest */
@@ -7048,12 +7043,12 @@ const generateWMJSServiceId = () => {
7048
7043
  generatedServiceIds += 1;
7049
7044
  return `serviceid_${generatedServiceIds}`;
7050
7045
  };
7051
- /**
7052
- * WMJSService Class
7053
- *
7054
- * options:
7055
- * service
7056
- * title (optional)
7046
+ /**
7047
+ * WMJSService Class
7048
+ *
7049
+ * options:
7050
+ * service
7051
+ * title (optional)
7057
7052
  */
7058
7053
  class WMJSService {
7059
7054
  constructor(options) {
@@ -7176,12 +7171,12 @@ class WMJSService {
7176
7171
  }
7177
7172
  return WMSVersion.version111;
7178
7173
  }
7179
- /**
7180
- * Does getcapabilities for a service.
7181
- * When multple getCapabilities for the same service are made,
7182
- * this method makes one get request and fires all callbacks with the same result.
7183
- * @param succescallback Function called upon succes, cannot be left blank
7184
- * @param failcallback Function called upon failure, cannot be left blank
7174
+ /**
7175
+ * Does getcapabilities for a service.
7176
+ * When multple getCapabilities for the same service are made,
7177
+ * this method makes one get request and fires all callbacks with the same result.
7178
+ * @param succescallback Function called upon succes, cannot be left blank
7179
+ * @param failcallback Function called upon failure, cannot be left blank
7185
7180
  */
7186
7181
  getCapabilities(succescallback, failcallback, forceReload,
7187
7182
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
@@ -7293,9 +7288,9 @@ class WMJSService {
7293
7288
  }
7294
7289
  return undefined;
7295
7290
  }
7296
- /**
7297
- * Calls succes with a hierarchical node structure
7298
- * Calls failure with a string when someting goes wrong
7291
+ /**
7292
+ * Calls succes with a hierarchical node structure
7293
+ * Calls failure with a string when someting goes wrong
7299
7294
  */
7300
7295
  getNodes(succes, failure, forceReload, options) {
7301
7296
  if (!failure) {
@@ -7323,8 +7318,8 @@ class WMJSService {
7323
7318
  };
7324
7319
  this.getCapabilities(callback, fail, forceReload, options);
7325
7320
  }
7326
- /** Calls succes with an array of all layerobjects
7327
- * Calls failure when something goes wrong
7321
+ /** Calls succes with an array of all layerobjects
7322
+ * Calls failure when something goes wrong
7328
7323
  */
7329
7324
  getLayerObjectsFlat(succes, failure, forceReload, options = this._options) {
7330
7325
  if (isDefined(this._flatLayerObject) && forceReload !== true) {
@@ -7483,7 +7478,7 @@ class DateInterval {
7483
7478
  }
7484
7479
  getTime() {
7485
7480
  let timeres = 0;
7486
- /* Months and years are unequally distributed in time
7481
+ /* Months and years are unequally distributed in time
7487
7482
  So get time is not possible */
7488
7483
  if (this.month !== 0) {
7489
7484
  throw new Error('month !== 0');
@@ -7541,16 +7536,16 @@ const getTimeValues = isotime => isotime.split(/\D+/).map(parseTimeValue);
7541
7536
  /* Parses ISO8601 times to a Javascript Date Object */
7542
7537
  /** ************************************************* */
7543
7538
  const parseISO8601DateToDate = unvalidatedIsotime => {
7544
- /*
7545
- The following functions are added to the standard Date object:
7546
- - add(dateInterval) adds a DateInterval time to this time
7547
- - substract(dateInterval) substracts a DateInterval time to this time
7548
- - toISO8601() returns the date object as iso8601 string
7549
- - clone() creates a copy of this object
7539
+ /*
7540
+ The following functions are added to the standard Date object:
7541
+ - add(dateInterval) adds a DateInterval time to this time
7542
+ - substract(dateInterval) substracts a DateInterval time to this time
7543
+ - toISO8601() returns the date object as iso8601 string
7544
+ - clone() creates a copy of this object
7550
7545
  */
7551
- /** Timeformats according to:
7552
- * https://portal.ogc.org/files/?artifact_id=14416 / 06-042_OpenGIS_Web_Map_Service_WMS_Implementation_Specification.pdf,
7553
- * chapter D2.1 are supported
7546
+ /** Timeformats according to:
7547
+ * https://portal.ogc.org/files/?artifact_id=14416 / 06-042_OpenGIS_Web_Map_Service_WMS_Implementation_Specification.pdf,
7548
+ * chapter D2.1 are supported
7554
7549
  */
7555
7550
  const makeISO8601StringFromFlexibleWMSDateString = isoString => {
7556
7551
  // Datestring starting with a - token are not supported.
@@ -7914,12 +7909,12 @@ class ParseISOTimeRangeDuration {
7914
7909
  return timeStep;
7915
7910
  }
7916
7911
  }
7917
- /* Returns the timestep at the currentDate, if currentdate is outside the range,
7912
+ /* Returns the timestep at the currentDate, if currentdate is outside the range,
7918
7913
  a exception is thrown. */
7919
7914
  getTimeStepFromDateWithinRange(currentDate) {
7920
7915
  return this.getTimeStepFromDate(currentDate, true);
7921
7916
  }
7922
- /* Returns the timestep at the currentDate, if currentdate is outside the range,
7917
+ /* Returns the timestep at the currentDate, if currentdate is outside the range,
7923
7918
  a minimum or maximum step which lies within the time range is returned. */
7924
7919
  getTimeStepFromDateClipped(currentDate) {
7925
7920
  return this.getTimeStepFromDate(currentDate, false);
@@ -7939,20 +7934,20 @@ function calculateTimeIntervalFromList(dateStrings) {
7939
7934
  const seconds = dateUtils.differenceInSeconds(secondDate, firstDate) % 60;
7940
7935
  return new DateInterval(years.toString(), months.toString(), days.toString(), hours.toString(), minutes.toString(), seconds.toString());
7941
7936
  }
7942
- /* Example:
7943
- function init(){
7944
- let isodate="1999-01-01T00:00:00Z/2009-12-01T00:00:00Z/PT60S";
7945
- //Split on '/'
7946
- let times=isodate.split('/');
7947
- //Some safety checks
7948
- if(times[1]==undefined){times[1]=times[0];times[2]='PT1M';}
7949
- //Convert the dates
7950
- starttime=parseISO8601DateToDate(times[0]);
7951
- stoptime=parseISO8601DateToDate(times[1]);
7952
- interval=parseISO8601IntervalToDateInterval(times[2]);
7953
- //Calculate the number if steps
7954
- steps=getNumberOfTimeSteps(starttime,stoptime,interval);
7955
- }
7937
+ /* Example:
7938
+ function init(){
7939
+ let isodate="1999-01-01T00:00:00Z/2009-12-01T00:00:00Z/PT60S";
7940
+ //Split on '/'
7941
+ let times=isodate.split('/');
7942
+ //Some safety checks
7943
+ if(times[1]==undefined){times[1]=times[0];times[2]='PT1M';}
7944
+ //Convert the dates
7945
+ starttime=parseISO8601DateToDate(times[0]);
7946
+ stoptime=parseISO8601DateToDate(times[1]);
7947
+ interval=parseISO8601IntervalToDateInterval(times[2]);
7948
+ //Calculate the number if steps
7949
+ steps=getNumberOfTimeSteps(starttime,stoptime,interval);
7950
+ }
7956
7951
  */
7957
7952
 
7958
7953
  // eslint-disable-next-line es/no-typed-arrays -- safe
@@ -10086,22 +10081,22 @@ var DOM_EXCEPTION = 'DOMException';
10086
10081
  // `DOMException.prototype[@@toStringTag]` property
10087
10082
  setToStringTag(getBuiltIn(DOM_EXCEPTION), DOM_EXCEPTION);
10088
10083
 
10089
- /* *
10090
- * Licensed under the Apache License, Version 2.0 (the "License");
10091
- * you may not use this file except in compliance with the License.
10092
- * You may obtain a copy of the License at
10093
- *
10094
- * http://www.apache.org/licenses/LICENSE-2.0
10095
- *
10096
- * Unless required by applicable law or agreed to in writing, software
10097
- * distributed under the License is distributed on an "AS IS" BASIS,
10098
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10099
- * See the License for the specific language governing permissions and
10100
- * limitations under the License.
10101
- *
10102
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10103
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
10104
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
10084
+ /* *
10085
+ * Licensed under the Apache License, Version 2.0 (the "License");
10086
+ * you may not use this file except in compliance with the License.
10087
+ * You may obtain a copy of the License at
10088
+ *
10089
+ * http://www.apache.org/licenses/LICENSE-2.0
10090
+ *
10091
+ * Unless required by applicable law or agreed to in writing, software
10092
+ * distributed under the License is distributed on an "AS IS" BASIS,
10093
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10094
+ * See the License for the specific language governing permissions and
10095
+ * limitations under the License.
10096
+ *
10097
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10098
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
10099
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
10105
10100
  * */
10106
10101
  const fakeMaxAgeResponsesByLayer = {
10107
10102
  'observation:wis2_air_temperature': 600,
@@ -10116,22 +10111,22 @@ const fakeMaxAgeResponsesByLayer = {
10116
10111
  'fmi:observation:cloudceiling_foreign': 3600
10117
10112
  };
10118
10113
 
10119
- /**
10120
- * Returns the current time in ms
10121
- * @returns the current time in ms
10114
+ /**
10115
+ * Returns the current time in ms
10116
+ * @returns the current time in ms
10122
10117
  */
10123
10118
  const getCurrentImageTime = () => {
10124
10119
  return new Date().getTime();
10125
10120
  };
10126
- /**
10127
- * WMImage provides an API to the HTML image element. It is used for caching and easier access to images.
10121
+ /**
10122
+ * WMImage provides an API to the HTML image element. It is used for caching and easier access to images.
10128
10123
  */
10129
10124
  class WMImage {
10130
- /**
10131
- *
10132
- * @param src Optionally set the source URL to load
10133
- * @param callback Optionally set the callback function to trigger once image has loaded
10134
- * @param options Additional options to the image. You can set { randomizer: true } to force unique url's and prevent caching.
10125
+ /**
10126
+ *
10127
+ * @param src Optionally set the source URL to load
10128
+ * @param callback Optionally set the callback function to trigger once image has loaded
10129
+ * @param options Additional options to the image. You can set { randomizer: true } to force unique url's and prevent caching.
10135
10130
  */
10136
10131
  constructor(src, callback, options) {
10137
10132
  this._loadDuration = undefined;
@@ -10193,8 +10188,8 @@ class WMImage {
10193
10188
  this._numFailedAttempts = 0;
10194
10189
  this._imageTimeStampAtError = getCurrentImageTime();
10195
10190
  }
10196
- /**
10197
- * Returns true if the image has been loaded
10191
+ /**
10192
+ * Returns true if the image has been loaded
10198
10193
  */
10199
10194
  isLoaded() {
10200
10195
  if (this._isLoading) {
@@ -10230,29 +10225,29 @@ class WMImage {
10230
10225
  const maxAge = this._fakeMaxAge * 1000;
10231
10226
  return imageAge > maxAge;
10232
10227
  }
10233
- /**
10234
- * Returns true if the image is still loading
10228
+ /**
10229
+ * Returns true if the image is still loading
10235
10230
  */
10236
10231
  isLoading() {
10237
10232
  return this._isLoading;
10238
10233
  }
10239
- /**
10240
- * Get the amount of milliseconds since the image experienced an image load.
10241
- * @returns milliseconds since the image had an error
10234
+ /**
10235
+ * Get the amount of milliseconds since the image experienced an image load.
10236
+ * @returns milliseconds since the image had an error
10242
10237
  */
10243
10238
  getLastErrorMSecondsAgo() {
10244
10239
  return getCurrentImageTime() - this._imageTimeStampAtError;
10245
10240
  }
10246
- /**
10247
- * @returns The number of failed attempts for this image
10241
+ /**
10242
+ * @returns The number of failed attempts for this image
10248
10243
  */
10249
10244
  getNumFailedAttempts() {
10250
10245
  return this._numFailedAttempts;
10251
10246
  }
10252
- /**
10253
- * Set source of image, but it will not load the image yet.
10254
- * @param src URL of the image to load
10255
- * @param options WMImageOptions to give to the image
10247
+ /**
10248
+ * Set source of image, but it will not load the image yet.
10249
+ * @param src URL of the image to load
10250
+ * @param options WMImageOptions to give to the image
10256
10251
  */
10257
10252
  setSource(src, options) {
10258
10253
  if (this._isLoading) {
@@ -10271,26 +10266,26 @@ class WMImage {
10271
10266
  this._imageTimeStampAtError = getCurrentImageTime();
10272
10267
  this._isLoaded = false;
10273
10268
  }
10274
- /**
10275
- * Re-intialize the image
10269
+ /**
10270
+ * Re-intialize the image
10276
10271
  */
10277
10272
  clear() {
10278
10273
  this.init();
10279
10274
  }
10280
- /**
10281
- * Get the URL of the image
10275
+ /**
10276
+ * Get the URL of the image
10282
10277
  */
10283
10278
  getSrc() {
10284
10279
  return this.srcToLoad;
10285
10280
  }
10286
- /**
10287
- * Check if the image has an error
10281
+ /**
10282
+ * Check if the image has an error
10288
10283
  */
10289
10284
  hasError() {
10290
10285
  return this._hasError;
10291
10286
  }
10292
- /**
10293
- * Start loading the image
10287
+ /**
10288
+ * Start loading the image
10294
10289
  */
10295
10290
  load() {
10296
10291
  if (!this._isLoading) {
@@ -10361,8 +10356,8 @@ class WMImage {
10361
10356
  const hostName = `${splittedHREF[0]}//${splittedHREF[1]}/`;
10362
10357
  this.srcToLoad = hostName + this.srcToLoad;
10363
10358
  }
10364
- /*
10365
- * If the image has already loaded this source succesfully (without error), simply trigger the loadevent.
10359
+ /*
10360
+ * If the image has already loaded this source succesfully (without error), simply trigger the loadevent.
10366
10361
  */
10367
10362
  if (this.srcToLoad === this._srcLoaded && !this._hasError) {
10368
10363
  this._loadEvent(false);
@@ -10404,20 +10399,20 @@ class WMImage {
10404
10399
  getLoadDuration() {
10405
10400
  return this._loadDuration;
10406
10401
  }
10407
- /**
10408
- * Get the width of the current image
10402
+ /**
10403
+ * Get the width of the current image
10409
10404
  */
10410
10405
  getWidth() {
10411
10406
  return this.el.width;
10412
10407
  }
10413
- /**
10414
- * Get the height of the current image
10408
+ /**
10409
+ * Get the height of the current image
10415
10410
  */
10416
10411
  getHeight() {
10417
10412
  return this.el.height;
10418
10413
  }
10419
- /**
10420
- * Get the HTMLImageElement behind the WMImage
10414
+ /**
10415
+ * Get the HTMLImageElement behind the WMImage
10421
10416
  */
10422
10417
  getElement() {
10423
10418
  return this.el;
@@ -10430,10 +10425,10 @@ var WMImageEventType;
10430
10425
  WMImageEventType[WMImageEventType["Deleted"] = 1] = "Deleted";
10431
10426
  })(WMImageEventType || (WMImageEventType = {}));
10432
10427
  class WMImageStore {
10433
- /**
10434
- * Constructs a new WMImageStore with given amount of image cache.
10435
- * @param {*} maxNumberOfImages
10436
- * @param {*} options
10428
+ /**
10429
+ * Constructs a new WMImageStore with given amount of image cache.
10430
+ * @param {*} maxNumberOfImages
10431
+ * @param {*} options
10437
10432
  */
10438
10433
  constructor(maxNumberOfImages, options) {
10439
10434
  this.imagesbysrc = new Map();
@@ -10460,8 +10455,8 @@ class WMImageStore {
10460
10455
  eventCallback.callback(_img, eventCallback.id, imageEventType);
10461
10456
  }
10462
10457
  }
10463
- /**
10464
- * Check if we have similar images with the same source in the pipeline
10458
+ /**
10459
+ * Check if we have similar images with the same source in the pipeline
10465
10460
  */
10466
10461
  getImageForSrc(src) {
10467
10462
  return this.imagesbysrc.get(src);
@@ -10505,10 +10500,10 @@ class WMImageStore {
10505
10500
  });
10506
10501
  return numLoading;
10507
10502
  }
10508
- /**
10509
- * Get an WMImage object for given URL
10510
- * @param {*} src The url for the image
10511
- * @returns WMImage object
10503
+ /**
10504
+ * Get an WMImage object for given URL
10505
+ * @param {*} src The url for the image
10506
+ * @returns WMImage object
10512
10507
  */
10513
10508
  getImage(src, loadOptions) {
10514
10509
  if (!src) {
@@ -10790,22 +10785,22 @@ $({ target: 'Number', proto: true, forced: FORCED }, {
10790
10785
  }
10791
10786
  });
10792
10787
 
10793
- /* *
10794
- * Licensed under the Apache License, Version 2.0 (the "License");
10795
- * you may not use this file except in compliance with the License.
10796
- * You may obtain a copy of the License at
10797
- *
10798
- * http://www.apache.org/licenses/LICENSE-2.0
10799
- *
10800
- * Unless required by applicable law or agreed to in writing, software
10801
- * distributed under the License is distributed on an "AS IS" BASIS,
10802
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10803
- * See the License for the specific language governing permissions and
10804
- * limitations under the License.
10805
- *
10806
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10807
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
10808
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
10788
+ /* *
10789
+ * Licensed under the Apache License, Version 2.0 (the "License");
10790
+ * you may not use this file except in compliance with the License.
10791
+ * You may obtain a copy of the License at
10792
+ *
10793
+ * http://www.apache.org/licenses/LICENSE-2.0
10794
+ *
10795
+ * Unless required by applicable law or agreed to in writing, software
10796
+ * distributed under the License is distributed on an "AS IS" BASIS,
10797
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10798
+ * See the License for the specific language governing permissions and
10799
+ * limitations under the License.
10800
+ *
10801
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10802
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
10803
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
10809
10804
  * */
10810
10805
  class WMBBOX {
10811
10806
  constructor(left, bottom, right, top) {
@@ -10820,8 +10815,8 @@ class WMBBOX {
10820
10815
  this.toString = this.toString.bind(this);
10821
10816
  this.setBBOX(left, bottom, right, top);
10822
10817
  }
10823
- /**
10824
- * Clone an existing BBOX
10818
+ /**
10819
+ * Clone an existing BBOX
10825
10820
  */
10826
10821
  clone() {
10827
10822
  return new WMBBOX(this.left, this.bottom, this.right, this.top);
@@ -10832,12 +10827,12 @@ class WMBBOX {
10832
10827
  this.right = bbox.right;
10833
10828
  this.top = bbox.top;
10834
10829
  }
10835
- /**
10836
- * setBBOX method
10837
- * Creates a WebMapJS bounding box based on 4 numeric values
10838
- * Creates a WebMapJS bounding box based on 1 string with commaseparated numeric values
10839
- * Creates a WebMapJS bounding box based on an exisiting WebMapJS bounding box.
10840
- * When no parameters are given, a global latlon bbox is generated.
10830
+ /**
10831
+ * setBBOX method
10832
+ * Creates a WebMapJS bounding box based on 4 numeric values
10833
+ * Creates a WebMapJS bounding box based on 1 string with commaseparated numeric values
10834
+ * Creates a WebMapJS bounding box based on an exisiting WebMapJS bounding box.
10835
+ * When no parameters are given, a global latlon bbox is generated.
10841
10836
  */
10842
10837
  setBBOX(left, bottom, right, top) {
10843
10838
  /* Check if we recieve more than one parameter by checking the second bottom parameter. */
@@ -10887,14 +10882,14 @@ class WMBBOX {
10887
10882
  this.top = 90;
10888
10883
  }
10889
10884
  }
10890
- /*
10891
- * Compares two boundingboxes and returns true if they are equal
10885
+ /*
10886
+ * Compares two boundingboxes and returns true if they are equal
10892
10887
  */
10893
10888
  equals(left, bottom, right, top) {
10894
10889
  return left === this.left && bottom === this.bottom && right === this.right && top === this.top;
10895
10890
  }
10896
- /**
10897
- * Returns the current BBOX as a string, useful for generating WMS requests.
10891
+ /**
10892
+ * Returns the current BBOX as a string, useful for generating WMS requests.
10898
10893
  */
10899
10894
  toString() {
10900
10895
  return `${this.left},${this.bottom},${this.right},${this.top}`;
@@ -10903,10 +10898,10 @@ class WMBBOX {
10903
10898
 
10904
10899
  const ANIMATIONFRAMEREQUEST_DONE = -1;
10905
10900
  const MIN_FRACTION_OF_OVERLAP = 0.75;
10906
- /**
10907
- * Function to find image url's which are similar to other images, without taking width, height and bbox into account
10908
- * @param imageSource The source / url of the image to check
10909
- * @returns A signature for this image, which is the same for images with different bbox and or width/height
10901
+ /**
10902
+ * Function to find image url's which are similar to other images, without taking width, height and bbox into account
10903
+ * @param imageSource The source / url of the image to check
10904
+ * @returns A signature for this image, which is the same for images with different bbox and or width/height
10910
10905
  */
10911
10906
  const makeQueryStringWithoutGeoInfo = imageSource => {
10912
10907
  if (imageSource.indexOf('GFI%3ATIME_ELEVATION') !== -1) {
@@ -10924,12 +10919,12 @@ const makeQueryStringWithoutGeoInfo = imageSource => {
10924
10919
  HEIGHT: ''
10925
10920
  });
10926
10921
  };
10927
- /**
10928
- * Function which returns how much two bbox areas have the same area and do overlap.
10929
- * See test in WMCanvasBuffer.spec.ts for details
10930
- * @param boxA
10931
- * @param boxB
10932
- * @returns
10922
+ /**
10923
+ * Function which returns how much two bbox areas have the same area and do overlap.
10924
+ * See test in WMCanvasBuffer.spec.ts for details
10925
+ * @param boxA
10926
+ * @param boxB
10927
+ * @returns
10933
10928
  */
10934
10929
  const getOverlappingAreaRatio = (boxA, boxB) => {
10935
10930
  const area1 = Math.abs(boxA.left - boxA.right) * Math.abs(boxA.bottom - boxA.top);
@@ -10942,10 +10937,10 @@ const getOverlappingAreaRatio = (boxA, boxB) => {
10942
10937
  const intersectingFraction = intersectingArea / area1;
10943
10938
  return [areaFraction, intersectingFraction];
10944
10939
  };
10945
- /**
10946
- * Sort the imageslist
10947
- * @param imagesList
10948
- * @returns
10940
+ /**
10941
+ * Sort the imageslist
10942
+ * @param imagesList
10943
+ * @returns
10949
10944
  */
10950
10945
  const getSortedListOfImages = (imagesList, bbox) => {
10951
10946
  if (!(imagesList === null || imagesList === void 0 ? void 0 : imagesList.length)) {
@@ -11034,9 +11029,9 @@ class WMCanvasBuffer {
11034
11029
  this._animationFrameRequest = ANIMATIONFRAMEREQUEST_DONE;
11035
11030
  this._isBufferLoading = false;
11036
11031
  }
11037
- /**
11038
- * Triggered by the WMImageStore when an image completes loading
11039
- * @param image
11032
+ /**
11033
+ * Triggered by the WMImageStore when an image completes loading
11034
+ * @param image
11040
11035
  */
11041
11036
  _imageLoadComplete(image) {
11042
11037
  if (!this._webMapJS) {
@@ -11118,9 +11113,9 @@ class WMCanvasBuffer {
11118
11113
  // Draw this image, it is loaded and OK
11119
11114
  this._drawCanvasGeoLayer(layer);
11120
11115
  } else {
11121
- /**
11122
- * Check if this image has an error.
11123
- * If the error has occured some time ago, and the amount of retries is low, just retry to load the image.
11116
+ /**
11117
+ * Check if this image has an error.
11118
+ * If the error has occured some time ago, and the amount of retries is low, just retry to load the image.
11124
11119
  */
11125
11120
  if ((imageToDisplay === null || imageToDisplay === void 0 ? void 0 : imageToDisplay.hasError()) && imageToDisplay.isLoading() === false && imageToDisplay.getLastErrorMSecondsAgo() > 5000 && imageToDisplay.getNumFailedAttempts() < 10) {
11126
11121
  imageToDisplay.forceReload();
@@ -11185,20 +11180,20 @@ class WMCanvasBuffer {
11185
11180
  y
11186
11181
  };
11187
11182
  }
11188
- /**
11189
- * Made accessible for testing purposes
11190
- * @returns
11183
+ /**
11184
+ * Made accessible for testing purposes
11185
+ * @returns
11191
11186
  */
11192
11187
  getSharedImagesList() {
11193
11188
  return this.sharedImagesList;
11194
11189
  }
11195
- /**
11196
- * Function to find the an alternative available image for an image url that is not yet loaded
11197
- * @param imageUrl The image source / url to find an alternative for
11198
- * @param imageStore The imagestore where the other images are located
11199
- * @param bbox The boundingbox to search this image for
11200
- * @param filterUnsuitableAlternatives When true, images which have an overlap or ratio less then given threshold will be discarded as alternative
11201
- * @returns A canvasLayer, containing the new image source with its geo properties
11190
+ /**
11191
+ * Function to find the an alternative available image for an image url that is not yet loaded
11192
+ * @param imageUrl The image source / url to find an alternative for
11193
+ * @param imageStore The imagestore where the other images are located
11194
+ * @param bbox The boundingbox to search this image for
11195
+ * @param filterUnsuitableAlternatives When true, images which have an overlap or ratio less then given threshold will be discarded as alternative
11196
+ * @returns A canvasLayer, containing the new image source with its geo properties
11202
11197
  */
11203
11198
  getAlternativeImage(imageUrl, bbox, filterUnsuitableAlternatives = false) {
11204
11199
  const sigImageUrl = makeQueryStringWithoutGeoInfo(imageUrl);
@@ -11218,9 +11213,9 @@ class WMCanvasBuffer {
11218
11213
  });
11219
11214
  return foundAltImages;
11220
11215
  }
11221
- /**
11222
- * Removes the image from the alternative imageslist (in case imagestore cache gets cleaned), this used when the imagestore triggers a delete event for an image
11223
- * @param imageUrl The url for the image to remove
11216
+ /**
11217
+ * Removes the image from the alternative imageslist (in case imagestore cache gets cleaned), this used when the imagestore triggers a delete event for an image
11218
+ * @param imageUrl The url for the image to remove
11224
11219
  */
11225
11220
  removeAlternativeImage(imageUrl) {
11226
11221
  const sigImageUrl = makeQueryStringWithoutGeoInfo(imageUrl);
@@ -11236,9 +11231,9 @@ class WMCanvasBuffer {
11236
11231
  delete this.sharedImagesList[sigImageUrl];
11237
11232
  }
11238
11233
  }
11239
- /**
11240
- * Add an image to the sharedimages list
11241
- * @param newLayer A canvaslayer object to add.
11234
+ /**
11235
+ * Add an image to the sharedimages list
11236
+ * @param newLayer A canvaslayer object to add.
11242
11237
  */
11243
11238
  addAlternativeImage(newLayer) {
11244
11239
  var _a;
@@ -11256,11 +11251,11 @@ class WMCanvasBuffer {
11256
11251
  imagesForUrl[indexForExisting] = newLayer;
11257
11252
  }
11258
11253
  }
11259
- /**
11260
- * Used to tell the canvas that the map is resized,
11261
- * @param w
11262
- * @param h
11263
- * @returns
11254
+ /**
11255
+ * Used to tell the canvas that the map is resized,
11256
+ * @param w
11257
+ * @param h
11258
+ * @returns
11264
11259
  */
11265
11260
  resize(w, h) {
11266
11261
  const width = parseInt(w, 10);
@@ -11275,21 +11270,21 @@ class WMCanvasBuffer {
11275
11270
  this._ctx.canvas.height = height;
11276
11271
  this._ctx.canvas.width = width;
11277
11272
  }
11278
- /**
11279
- * Reset when a new set of layers have been added
11273
+ /**
11274
+ * Reset when a new set of layers have been added
11280
11275
  */
11281
11276
  initCanvasLayers() {
11282
11277
  this._canvasLayers.length = 0;
11283
11278
  }
11284
- /**
11285
- * Set's a layer inside the canvasbuffer with given index and imagesource.
11286
- * The image is directly loaded, but if loading is not complete when drawing, an alternative image is search in the alternative images list
11287
- * @param layerIndex The layer index, similar to z-Index, 0 drawn on the bottom, higher numbers on top
11288
- * @param imageSource The url of the image, usually a GetMap url
11289
- * @param linkedInfo A linkedinfo object to track properties for the image and layer, like errors
11290
- * @param opacity Opacity of this layer
11291
- * @param bbox The boundingbox for this layer
11292
- * @returns Void
11279
+ /**
11280
+ * Set's a layer inside the canvasbuffer with given index and imagesource.
11281
+ * The image is directly loaded, but if loading is not complete when drawing, an alternative image is search in the alternative images list
11282
+ * @param layerIndex The layer index, similar to z-Index, 0 drawn on the bottom, higher numbers on top
11283
+ * @param imageSource The url of the image, usually a GetMap url
11284
+ * @param linkedInfo A linkedinfo object to track properties for the image and layer, like errors
11285
+ * @param opacity Opacity of this layer
11286
+ * @param bbox The boundingbox for this layer
11287
+ * @returns Void
11293
11288
  */
11294
11289
  addLayerToCanvas(layerIndex, imageSource, linkedInfo, opacity, bbox) {
11295
11290
  var _a, _b;
@@ -11357,8 +11352,8 @@ class WMCanvasBuffer {
11357
11352
  this._currentnewbbox = newbbox;
11358
11353
  this.display();
11359
11354
  }
11360
- /**
11361
- * Used when the map is destroyed
11355
+ /**
11356
+ * Used when the map is destroyed
11362
11357
  */
11363
11358
  destroy() {
11364
11359
  this.sharedImagesList = null;
@@ -11394,9 +11389,9 @@ i18n.init({
11394
11389
  }
11395
11390
  }
11396
11391
  });
11397
- const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
11392
+ const translateKeyOutsideComponents = (t, key, params = undefined) => t ? t(key, Object.assign({
11398
11393
  ns: WEBMAP_NAMESPACE
11399
- }, params));
11394
+ }, params)) : key;
11400
11395
 
11401
11396
  const getBBOXandProjString = (layer, projection) => {
11402
11397
  let request = '';
@@ -11546,13 +11541,13 @@ const buildMapLayerDims = map => {
11546
11541
  });
11547
11542
  });
11548
11543
  };
11549
- /**
11550
- * Makes a valid getfeatureinfoURL for each layer
11551
- * @param layer
11552
- * @param x
11553
- * @param y
11554
- * @param format
11555
- * @returns
11544
+ /**
11545
+ * Makes a valid getfeatureinfoURL for each layer
11546
+ * @param layer
11547
+ * @param x
11548
+ * @param y
11549
+ * @param format
11550
+ * @returns
11556
11551
  */
11557
11552
  const getWMSGetFeatureInfoRequestURL = (layer, x, y, format = 'text/html') => {
11558
11553
  /* For invalid layers we cannot build an url */
@@ -11694,20 +11689,20 @@ const getPixelCoordFromGeoCoord = (map, coordinates, _bbox, _width, _height) =>
11694
11689
  y
11695
11690
  };
11696
11691
  };
11697
- const getErrorsToDisplay = (canvasErrors, getLayerByServiceAndName) => {
11692
+ const getErrorsToDisplay = (canvasErrors, getLayerByServiceAndName, t) => {
11698
11693
  return canvasErrors.reduce((list, error) => {
11699
11694
  if (error.linkedInfo && error.linkedInfo.layer) {
11700
11695
  const layer = getLayerByServiceAndName(error.linkedInfo.layer.service, error.linkedInfo.layer.name);
11701
11696
  // Only show if layer is present and enabled
11702
11697
  if (layer && layer.enabled) {
11703
11698
  const message = error.linkedInfo.message ? `, ${error.linkedInfo.message}` : '';
11704
- return list.concat(translateKeyOutsideComponents('layer-failed-to-load-message', {
11699
+ return list.concat(translateKeyOutsideComponents(t, 'layer-failed-to-load-message', {
11705
11700
  title: error.linkedInfo.layer.title || '',
11706
11701
  message
11707
11702
  }));
11708
11703
  }
11709
11704
  } else {
11710
- return list.concat(translateKeyOutsideComponents('layer-failed-to-load'));
11705
+ return list.concat(translateKeyOutsideComponents(t, 'layer-failed-to-load'));
11711
11706
  }
11712
11707
  return list;
11713
11708
  }, []);
@@ -11845,27 +11840,27 @@ function prefetchImagesForNonAnimation(wmMap, maxImagesToPrefetch = MAX_IMAGES_T
11845
11840
  prefetchLayerImagesInOrder(wmMap, timesToPrefetch, maxImagesToPrefetch, batchSize);
11846
11841
  }
11847
11842
 
11848
- /* *
11849
- * Licensed under the Apache License, Version 2.0 (the "License");
11850
- * you may not use this file except in compliance with the License.
11851
- * You may obtain a copy of the License at
11852
- *
11853
- * http://www.apache.org/licenses/LICENSE-2.0
11854
- *
11855
- * Unless required by applicable law or agreed to in writing, software
11856
- * distributed under the License is distributed on an "AS IS" BASIS,
11857
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11858
- * See the License for the specific language governing permissions and
11859
- * limitations under the License.
11860
- *
11861
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11862
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
11863
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
11843
+ /* *
11844
+ * Licensed under the Apache License, Version 2.0 (the "License");
11845
+ * you may not use this file except in compliance with the License.
11846
+ * You may obtain a copy of the License at
11847
+ *
11848
+ * http://www.apache.org/licenses/LICENSE-2.0
11849
+ *
11850
+ * Unless required by applicable law or agreed to in writing, software
11851
+ * distributed under the License is distributed on an "AS IS" BASIS,
11852
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11853
+ * See the License for the specific language governing permissions and
11854
+ * limitations under the License.
11855
+ *
11856
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11857
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
11858
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
11864
11859
  * */
11865
- /**
11866
- * Set the length of the timer, in milli seconds, after time has elapsed function is called
11867
- * @param secstime Time in milli seconds
11868
- * @param functionhandler Function to call after time is elapsed
11860
+ /**
11861
+ * Set the length of the timer, in milli seconds, after time has elapsed function is called
11862
+ * @param secstime Time in milli seconds
11863
+ * @param functionhandler Function to call after time is elapsed
11869
11864
  */
11870
11865
  class WMTimer {
11871
11866
  constructor() {
@@ -11882,22 +11877,22 @@ class WMTimer {
11882
11877
  }
11883
11878
  }
11884
11879
 
11885
- /* *
11886
- * Licensed under the Apache License, Version 2.0 (the "License");
11887
- * you may not use this file except in compliance with the License.
11888
- * You may obtain a copy of the License at
11889
- *
11890
- * http://www.apache.org/licenses/LICENSE-2.0
11891
- *
11892
- * Unless required by applicable law or agreed to in writing, software
11893
- * distributed under the License is distributed on an "AS IS" BASIS,
11894
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11895
- * See the License for the specific language governing permissions and
11896
- * limitations under the License.
11897
- *
11898
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11899
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
11900
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
11880
+ /* *
11881
+ * Licensed under the Apache License, Version 2.0 (the "License");
11882
+ * you may not use this file except in compliance with the License.
11883
+ * You may obtain a copy of the License at
11884
+ *
11885
+ * http://www.apache.org/licenses/LICENSE-2.0
11886
+ *
11887
+ * Unless required by applicable law or agreed to in writing, software
11888
+ * distributed under the License is distributed on an "AS IS" BASIS,
11889
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11890
+ * See the License for the specific language governing permissions and
11891
+ * limitations under the License.
11892
+ *
11893
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11894
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
11895
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
11901
11896
  * */
11902
11897
  var _WMJSAnimate_instances, _WMJSAnimate_animate;
11903
11898
  class WMJSAnimate {
@@ -12280,10 +12275,10 @@ class WMTileRenderer {
12280
12275
  }
12281
12276
  }
12282
12277
 
12283
- /**
12284
- * Re-formats isoString to the string that is expected by WMJSDimension (for time).
12285
- * @param dateIn The input date to re-format, usually in the format `YYYY-MM-DDThh:mm:ss.uuuZ`
12286
- * @returns The formated input date in the format `YYYY-MM-DDThh:mm:ssZ`
12278
+ /**
12279
+ * Re-formats isoString to the string that is expected by WMJSDimension (for time).
12280
+ * @param dateIn The input date to re-format, usually in the format `YYYY-MM-DDThh:mm:ss.uuuZ`
12281
+ * @returns The formated input date in the format `YYYY-MM-DDThh:mm:ssZ`
12287
12282
  */
12288
12283
  const handleDateUtilsISOString = dateIn => {
12289
12284
  /* Try to fix the timestrings generated by our dateUtils made with dateUtils.dateToIsoString() */
@@ -12300,11 +12295,11 @@ const handleDateUtilsISOString = dateIn => {
12300
12295
  }
12301
12296
  return dateIn;
12302
12297
  };
12303
- /**
12304
- * WMJSDimension Class
12305
- * Keep all information for a single dimension, like time.
12306
- * Author : MaartenPlieger (plieger at knmi.nl)
12307
- * Copyright KNMI
12298
+ /**
12299
+ * WMJSDimension Class
12300
+ * Keep all information for a single dimension, like time.
12301
+ * Author : MaartenPlieger (plieger at knmi.nl)
12302
+ * Copyright KNMI
12308
12303
  */
12309
12304
  class WMJSDimension {
12310
12305
  constructor(config) {
@@ -12386,10 +12381,10 @@ class WMJSDimension {
12386
12381
  debugLogger(DebugType.Warning);
12387
12382
  return;
12388
12383
  }
12389
- /*
12390
- * Calculate the model run length,
12391
- * this can be done by looking at the difference between
12392
- * the last dim_reference_time and last dim_time
12384
+ /*
12385
+ * Calculate the model run length,
12386
+ * this can be done by looking at the difference between
12387
+ * the last dim_reference_time and last dim_time
12393
12388
  */
12394
12389
  /* 1. Get the last value in the list of the referencetime */
12395
12390
  const lastRefTime = new Date(referenceTimeDim.getLastValue());
@@ -12538,9 +12533,9 @@ class WMJSDimension {
12538
12533
  this.dimTimeInterval = this.calculatedTimeInterval;
12539
12534
  }
12540
12535
  }
12541
- /**
12542
- * Returns the current value of this dimensions.
12543
- * If a ISO8601 period is set, the getValue will return a timeRange using addTimeRangeDurationToValue instead of a single value
12536
+ /**
12537
+ * Returns the current value of this dimensions.
12538
+ * If a ISO8601 period is set, the getValue will return a timeRange using addTimeRangeDurationToValue instead of a single value
12544
12539
  */
12545
12540
  getValue() {
12546
12541
  if (!this._initialized) {
@@ -12588,10 +12583,10 @@ class WMJSDimension {
12588
12583
  return null;
12589
12584
  }).filter(dateString => dateString !== null);
12590
12585
  }
12591
- /**
12592
- * Set current value of this dimension
12593
- * @param value The new value for this dimension (string)
12594
- * @param forceValue When set to false,check if the given value is outside range, and do nothing if this is the case
12586
+ /**
12587
+ * Set current value of this dimension
12588
+ * @param value The new value for this dimension (string)
12589
+ * @param forceValue When set to false,check if the given value is outside range, and do nothing if this is the case
12595
12590
  */
12596
12591
  setValue(value, forceValue = true) {
12597
12592
  if (!this._initialized) {
@@ -12604,9 +12599,9 @@ class WMJSDimension {
12604
12599
  }
12605
12600
  this.currentValue = value;
12606
12601
  }
12607
- /**
12608
- * Returns values of the dimension, according to values defined in WMS specification, e.g. 2011-01-01T00:00:00Z/2012-01-01T00:00:00Z/P1M or list of values.
12609
- * @returns
12602
+ /**
12603
+ * Returns values of the dimension, according to values defined in WMS specification, e.g. 2011-01-01T00:00:00Z/2012-01-01T00:00:00Z/P1M or list of values.
12604
+ * @returns
12610
12605
  */
12611
12606
  getValues() {
12612
12607
  this.initialize();
@@ -12703,8 +12698,8 @@ class WMJSDimension {
12703
12698
  }
12704
12699
  return value;
12705
12700
  }
12706
- /**
12707
- * Get dimension value for specified index
12701
+ /**
12702
+ * Get dimension value for specified index
12708
12703
  */
12709
12704
  getValueForIndex(index) {
12710
12705
  this.initialize();
@@ -12733,9 +12728,9 @@ class WMJSDimension {
12733
12728
  }
12734
12729
  return null;
12735
12730
  }
12736
- /**
12737
- * Hint about the timestep size / time resolution of this dimension.
12738
- * @returns The dimTimeInterval
12731
+ /**
12732
+ * Hint about the timestep size / time resolution of this dimension.
12733
+ * @returns The dimTimeInterval
12739
12734
  */
12740
12735
  getDimInterval() {
12741
12736
  this.initialize();
@@ -12761,31 +12756,31 @@ class WMJSDimension {
12761
12756
  isRegularInterval
12762
12757
  };
12763
12758
  }
12764
- /**
12765
- * Shorthand functionf or getValueForIndex
12759
+ /**
12760
+ * Shorthand functionf or getValueForIndex
12766
12761
  */
12767
12762
  get(index) {
12768
12763
  return this.getValueForIndex(index);
12769
12764
  }
12770
- /**
12771
- * Returns the first dimension value
12765
+ /**
12766
+ * Returns the first dimension value
12772
12767
  */
12773
12768
  getFirstValue() {
12774
12769
  return this.get(0);
12775
12770
  }
12776
- /**
12777
- * Returns the last dimension value
12771
+ /**
12772
+ * Returns the last dimension value
12778
12773
  */
12779
12774
  getLastValue() {
12780
12775
  return this.get(this.size() - 1);
12781
12776
  }
12782
- /**
12783
- * Get index value for specified value. Returns the index in the store for the given time value, either a date or a iso8601 string can be passes as input.
12784
- * @param value Either a JS Date object or an ISO8601 String
12785
- * @return The index of the value. If outSideOfRangeFlag is false, a valid index will
12786
- * always be returned. If outSideOfRangeFlag is true:
12787
- * -1 if the value is not in the store, and is lower than available values,
12788
- * -2 if the value is not in the store, and is higher than available values
12777
+ /**
12778
+ * Get index value for specified value. Returns the index in the store for the given time value, either a date or a iso8601 string can be passes as input.
12779
+ * @param value Either a JS Date object or an ISO8601 String
12780
+ * @return The index of the value. If outSideOfRangeFlag is false, a valid index will
12781
+ * always be returned. If outSideOfRangeFlag is true:
12782
+ * -1 if the value is not in the store, and is lower than available values,
12783
+ * -2 if the value is not in the store, and is higher than available values
12789
12784
  */
12790
12785
  getIndexForValue(value, outSideOfRangeFlag = true) {
12791
12786
  this.initialize();
@@ -12854,8 +12849,8 @@ class WMJSDimension {
12854
12849
  }
12855
12850
  return -1;
12856
12851
  }
12857
- /**
12858
- * Get number of values
12852
+ /**
12853
+ * Get number of values
12859
12854
  */
12860
12855
  size() {
12861
12856
  this.initialize();
@@ -12867,8 +12862,8 @@ class WMJSDimension {
12867
12862
  }
12868
12863
  return null;
12869
12864
  }
12870
- /**
12871
- * Clone this dimension
12865
+ /**
12866
+ * Clone this dimension
12872
12867
  */
12873
12868
  clone() {
12874
12869
  const dim = new WMJSDimension();
@@ -12885,22 +12880,22 @@ class WMJSDimension {
12885
12880
  }
12886
12881
  }
12887
12882
 
12888
- /* *
12889
- * Licensed under the Apache License, Version 2.0 (the "License");
12890
- * you may not use this file except in compliance with the License.
12891
- * You may obtain a copy of the License at
12892
- *
12893
- * http://www.apache.org/licenses/LICENSE-2.0
12894
- *
12895
- * Unless required by applicable law or agreed to in writing, software
12896
- * distributed under the License is distributed on an "AS IS" BASIS,
12897
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12898
- * See the License for the specific language governing permissions and
12899
- * limitations under the License.
12900
- *
12901
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12902
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
12903
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
12883
+ /* *
12884
+ * Licensed under the Apache License, Version 2.0 (the "License");
12885
+ * you may not use this file except in compliance with the License.
12886
+ * You may obtain a copy of the License at
12887
+ *
12888
+ * http://www.apache.org/licenses/LICENSE-2.0
12889
+ *
12890
+ * Unless required by applicable law or agreed to in writing, software
12891
+ * distributed under the License is distributed on an "AS IS" BASIS,
12892
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12893
+ * See the License for the specific language governing permissions and
12894
+ * limitations under the License.
12895
+ *
12896
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
12897
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
12898
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
12904
12899
  * */
12905
12900
  const WMDrawMarker = (context, coordx, coordy, fillColor = '#FFF') => {
12906
12901
  const ctx = context;
@@ -13163,22 +13158,22 @@ const drawScaleBar = (scaleBarProps, ctx) => {
13163
13158
  };
13164
13159
  /* eslint-enable no-param-reassign */
13165
13160
 
13166
- /* *
13167
- * Licensed under the Apache License, Version 2.0 (the "License");
13168
- * you may not use this file except in compliance with the License.
13169
- * You may obtain a copy of the License at
13170
- *
13171
- * http://www.apache.org/licenses/LICENSE-2.0
13172
- *
13173
- * Unless required by applicable law or agreed to in writing, software
13174
- * distributed under the License is distributed on an "AS IS" BASIS,
13175
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13176
- * See the License for the specific language governing permissions and
13177
- * limitations under the License.
13178
- *
13179
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13180
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
13181
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
13161
+ /* *
13162
+ * Licensed under the Apache License, Version 2.0 (the "License");
13163
+ * you may not use this file except in compliance with the License.
13164
+ * You may obtain a copy of the License at
13165
+ *
13166
+ * http://www.apache.org/licenses/LICENSE-2.0
13167
+ *
13168
+ * Unless required by applicable law or agreed to in writing, software
13169
+ * distributed under the License is distributed on an "AS IS" BASIS,
13170
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13171
+ * See the License for the specific language governing permissions and
13172
+ * limitations under the License.
13173
+ *
13174
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13175
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
13176
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
13182
13177
  * */
13183
13178
  const SCALE_DELAY = 10;
13184
13179
  const ZOOMED_CALLBACK_DELAY = 500;
@@ -13286,8 +13281,8 @@ let WebMapJSMapNo = 0;
13286
13281
  const bgMapImageStore = new WMImageStore(bgImageStoreLength, {
13287
13282
  id: 'bgMapImageStore'
13288
13283
  });
13289
- /**
13290
- * WMJSMap class
13284
+ /**
13285
+ * WMJSMap class
13291
13286
  */
13292
13287
  class WMJSMap {
13293
13288
  _pixelCoordinatesToXY(coordinates) {
@@ -13359,21 +13354,21 @@ class WMJSMap {
13359
13354
  this.canvasErrors.push({
13360
13355
  linkedInfo: {
13361
13356
  layer,
13362
- message: translateKeyOutsideComponents('time-outside-range')
13357
+ message: translateKeyOutsideComponents(this.t, 'time-outside-range')
13363
13358
  }
13364
13359
  });
13365
13360
  } else if (dimension.currentValue === WMDateTooEarlyString) {
13366
13361
  this.canvasErrors.push({
13367
13362
  linkedInfo: {
13368
13363
  layer,
13369
- message: translateKeyOutsideComponents('time-too-early')
13364
+ message: translateKeyOutsideComponents(this.t, 'time-too-early')
13370
13365
  }
13371
13366
  });
13372
13367
  } else if (dimension.currentValue === WMDateTooLateString) {
13373
13368
  this.canvasErrors.push({
13374
13369
  linkedInfo: {
13375
13370
  layer,
13376
- message: translateKeyOutsideComponents('time-too-late')
13371
+ message: translateKeyOutsideComponents(this.t, 'time-too-late')
13377
13372
  }
13378
13373
  });
13379
13374
  }
@@ -13381,7 +13376,7 @@ class WMJSMap {
13381
13376
  }
13382
13377
  /* Display errors found during drawing canvas */
13383
13378
  if (this.canvasErrors && this.canvasErrors.length > 0) {
13384
- const errorsToDisplay = getErrorsToDisplay(this.canvasErrors, this.getLayerByServiceAndName);
13379
+ const errorsToDisplay = getErrorsToDisplay(this.canvasErrors, this.getLayerByServiceAndName, this.t);
13385
13380
  this.canvasErrors = [];
13386
13381
  if (errorsToDisplay.length > 0) {
13387
13382
  const mw = this._width / 2;
@@ -13447,7 +13442,7 @@ class WMJSMap {
13447
13442
  }
13448
13443
  }
13449
13444
  ctx.fillStyle = '#000000';
13450
- ctx.fillText(`${translateKeyOutsideComponents('map-projection')}: ${this._srs}`, 5, this._height - 26);
13445
+ ctx.fillText(`${translateKeyOutsideComponents(this.t, 'map-projection')}: ${this._srs}`, 5, this._height - 26);
13451
13446
  }
13452
13447
  /* Show layer metadata */
13453
13448
  if (this.showLayerInfo === true) {
@@ -13629,9 +13624,9 @@ class WMJSMap {
13629
13624
  this.activeLayer.active = true;
13630
13625
  this._wmEventListener.triggerEvent('onchangeactivelayer');
13631
13626
  }
13632
- /*
13633
- Calculates how many baselayers there are.
13634
- Useful when changing properties for a divbuffer index (for example setLayerOpacity)
13627
+ /*
13628
+ Calculates how many baselayers there are.
13629
+ Useful when changing properties for a divbuffer index (for example setLayerOpacity)
13635
13630
  */
13636
13631
  _calculateNumBaseLayers() {
13637
13632
  this._numBaseLayers = 0;
@@ -14257,7 +14252,7 @@ class WMJSMap {
14257
14252
  }
14258
14253
  _mouseWheelEvent(event) {
14259
14254
  if (this.holdShiftToScroll && !event.shiftKey) {
14260
- this.setMessageValue = translateKeyOutsideComponents('hold-shift-to-zoom');
14255
+ this.setMessageValue = translateKeyOutsideComponents(this.t, 'hold-shift-to-zoom');
14261
14256
  this.draw();
14262
14257
  // Clear text after 500ms
14263
14258
  setTimeout(() => {
@@ -14586,8 +14581,8 @@ class WMJSMap {
14586
14581
  this._wmEventListener.triggerEvent('onlayerchange');
14587
14582
  this._rebuildMapDimensions();
14588
14583
  }
14589
- /**
14590
- * Reorder layers according to an index array with indices on how the layers should be reordered.
14584
+ /**
14585
+ * Reorder layers according to an index array with indices on how the layers should be reordered.
14591
14586
  */
14592
14587
  reorderLayers(order) {
14593
14588
  // The length should be the same
@@ -14647,10 +14642,10 @@ class WMJSMap {
14647
14642
  getActiveLayer() {
14648
14643
  return this.activeLayer;
14649
14644
  }
14650
- /**
14651
- * setProjection
14652
- * Set the projection of the current webmap object
14653
- *_srs also accepts a projectionProperty object
14645
+ /**
14646
+ * setProjection
14647
+ * Set the projection of the current webmap object
14648
+ *_srs also accepts a projectionProperty object
14654
14649
  */
14655
14650
  setProjection(_srs, _bbox) {
14656
14651
  if (!_srs) {
@@ -15326,26 +15321,26 @@ class WMJSMap {
15326
15321
  }
15327
15322
  }
15328
15323
 
15329
- /* *
15330
- * Licensed under the Apache License, Version 2.0 (the "License");
15331
- * you may not use this file except in compliance with the License.
15332
- * You may obtain a copy of the License at
15333
- *
15334
- * http://www.apache.org/licenses/LICENSE-2.0
15335
- *
15336
- * Unless required by applicable law or agreed to in writing, software
15337
- * distributed under the License is distributed on an "AS IS" BASIS,
15338
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15339
- * See the License for the specific language governing permissions and
15340
- * limitations under the License.
15341
- *
15342
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15343
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
15344
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
15324
+ /* *
15325
+ * Licensed under the Apache License, Version 2.0 (the "License");
15326
+ * you may not use this file except in compliance with the License.
15327
+ * You may obtain a copy of the License at
15328
+ *
15329
+ * http://www.apache.org/licenses/LICENSE-2.0
15330
+ *
15331
+ * Unless required by applicable law or agreed to in writing, software
15332
+ * distributed under the License is distributed on an "AS IS" BASIS,
15333
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15334
+ * See the License for the specific language governing permissions and
15335
+ * limitations under the License.
15336
+ *
15337
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15338
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
15339
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
15345
15340
  * */
15346
- /**
15347
- * WMProjection Class
15348
- * Keep all projection information, by a bbox and an srs value.
15341
+ /**
15342
+ * WMProjection Class
15343
+ * Keep all projection information, by a bbox and an srs value.
15349
15344
  */
15350
15345
  class WMProjection {
15351
15346
  constructor() {
@@ -15361,11 +15356,11 @@ var LayerType;
15361
15356
  LayerType["overLayer"] = "overLayer";
15362
15357
  LayerType["featureLayer"] = "featureLayer";
15363
15358
  })(LayerType || (LayerType = {}));
15364
- /**
15365
- * Helper function to figure out the dimensions from the WMS layer object (From WMS GetCapabilities). Parses both WMS 1.1.1 and WMS 1.3.0.
15366
- * @param layerObjectFromWMS The corresponding layer object from the WMS GetCapabilities.
15367
- * @param layer THe WMLayer to configure
15368
- * @param layerDimNamesToRemove A set of dimensions names which are flagged for removal, this function removes the dimension from the set if found in the layer.
15359
+ /**
15360
+ * Helper function to figure out the dimensions from the WMS layer object (From WMS GetCapabilities). Parses both WMS 1.1.1 and WMS 1.3.0.
15361
+ * @param layerObjectFromWMS The corresponding layer object from the WMS GetCapabilities.
15362
+ * @param layer THe WMLayer to configure
15363
+ * @param layerDimNamesToRemove A set of dimensions names which are flagged for removal, this function removes the dimension from the set if found in the layer.
15369
15364
  */
15370
15365
  const addDimsForLayer = (layerProps, layer, layerDimNamesToRemove) => {
15371
15366
  var _a;
@@ -15379,7 +15374,7 @@ const addDimsForLayer = (layerProps, layer, layerDimNamesToRemove) => {
15379
15374
  unitSymbol: layerDimension.unitSymbol || '',
15380
15375
  value: layerDimension.values || '',
15381
15376
  default: layerDimension.currentValue,
15382
- /* If presets with other dimensions, like elevation, cause
15377
+ /* If presets with other dimensions, like elevation, cause
15383
15378
  problems, try to add the dimension here */
15384
15379
  linkDimensionToMap: dimName !== 'reference_time' && dimName !== 'interval_start' && dimName !== 'interval_end'
15385
15380
  };
@@ -15421,10 +15416,10 @@ const addDimsForLayer = (layerProps, layer, layerDimNamesToRemove) => {
15421
15416
  }
15422
15417
  });
15423
15418
  };
15424
- /**
15425
- * Helper function to configure the WMS Styles from the WMS GetCapabilities document.
15426
- * @param nestedLayerPath Array of WMS Layers from `[Root WMS Layer] => [Parent(s) WMS Layer] => [This WMS layer]`.
15427
- * @param wmLayer The WMLayer object to configure
15419
+ /**
15420
+ * Helper function to configure the WMS Styles from the WMS GetCapabilities document.
15421
+ * @param nestedLayerPath Array of WMS Layers from `[Root WMS Layer] => [Parent(s) WMS Layer] => [This WMS layer]`.
15422
+ * @param wmLayer The WMLayer object to configure
15428
15423
  */
15429
15424
  const configureStyles = (layerProps, wmLayer) => {
15430
15425
  // eslint-disable-next-line no-param-reassign
@@ -15442,18 +15437,18 @@ const configureStyles = (layerProps, wmLayer) => {
15442
15437
  }
15443
15438
  }
15444
15439
  };
15445
- /**
15446
- * Helper function to configure the dimensions for this layer from the WMS GetCapabilities document.
15447
- * @param nestedLayerPath Array of WMS Layers from `[Root WMS Layer] => [Parent(s) WMS Layer] => [This WMS layer]`.
15448
- * @param wmLayer The WMLayer object to configure
15440
+ /**
15441
+ * Helper function to configure the dimensions for this layer from the WMS GetCapabilities document.
15442
+ * @param nestedLayerPath Array of WMS Layers from `[Root WMS Layer] => [Parent(s) WMS Layer] => [This WMS layer]`.
15443
+ * @param wmLayer The WMLayer object to configure
15449
15444
  */
15450
15445
  const configureDimensions = (layerProps, wmLayer) => {
15451
- /*
15452
- WMS 1.1.1:
15453
- <Dimension name="time" units="ISO8601"/>
15454
- <Extent name="time" default="2021-05-14T10:35:00Z" multipleValues="1" nearestValue="0">2021-03-31T09:25:00Z/2021-05-14T10:35:00Z/PT5M</Extent>
15455
- WMS 1.3.0:
15456
- <Dimension name="time" units="ISO8601" default="2021-05-14T07:35:00Z" multipleValues="1" nearestValue="0" current="1">2021-03-31T09:25:00Z/2021-05-14T07:35:00Z/PT5M</Dimension>
15446
+ /*
15447
+ WMS 1.1.1:
15448
+ <Dimension name="time" units="ISO8601"/>
15449
+ <Extent name="time" default="2021-05-14T10:35:00Z" multipleValues="1" nearestValue="0">2021-03-31T09:25:00Z/2021-05-14T10:35:00Z/PT5M</Extent>
15450
+ WMS 1.3.0:
15451
+ <Dimension name="time" units="ISO8601" default="2021-05-14T07:35:00Z" multipleValues="1" nearestValue="0" current="1">2021-03-31T09:25:00Z/2021-05-14T07:35:00Z/PT5M</Dimension>
15457
15452
  */
15458
15453
  /* Flag dimensions which are currently in use for this layer, it is possible that the update will remove dimensions from this layer; keep track of the current ones */
15459
15454
  const layerDimNamesToRemove = new Set();
@@ -15861,10 +15856,10 @@ class WMLayer {
15861
15856
  this.isConfigured = true;
15862
15857
  layerDoneCallback(this);
15863
15858
  }
15864
- /**
15865
- * Calls success with a configured layer object
15866
- * Calls options.failure with error message.
15867
- * Throws string exceptions when someting goes wrong
15859
+ /**
15860
+ * Calls success with a configured layer object
15861
+ * Calls options.failure with error message.
15862
+ * Throws string exceptions when someting goes wrong
15868
15863
  */
15869
15864
  parseLayer(_layerDoneCallback, forceReload,
15870
15865
  // eslint-disable-next-line no-unused-vars
@@ -15907,10 +15902,10 @@ class WMLayer {
15907
15902
  }, requestfail, forceReload, options);
15908
15903
  }
15909
15904
  }
15910
- /**
15911
- * A Promise to parse the layer, it will fetch the WMS GetCapabilities document, configure the layer and resolve to a WMLayer object
15912
- * @param forceReload Do not use the cache of the WMS GetCapabilities document, but instead fetch new data from the server
15913
- * @returns WMLayer object
15905
+ /**
15906
+ * A Promise to parse the layer, it will fetch the WMS GetCapabilities document, configure the layer and resolve to a WMLayer object
15907
+ * @param forceReload Do not use the cache of the WMS GetCapabilities document, but instead fetch new data from the server
15908
+ * @returns WMLayer object
15914
15909
  */
15915
15910
  parseLayerPromise(forceReload = false) {
15916
15911
  return new Promise((resolve, reject) => {
@@ -15934,18 +15929,18 @@ class WMLayer {
15934
15929
  });
15935
15930
  return newLayer;
15936
15931
  }
15937
- /**
15938
- * Set or change the name of this layer. This involves re-parsing the WMS GetCapabilities document and updating the affected layer properties. When done, it resolves the WMLayer
15939
- * @param name The name of the layer
15940
- * @returns Promise resolving to a WMLayer object
15932
+ /**
15933
+ * Set or change the name of this layer. This involves re-parsing the WMS GetCapabilities document and updating the affected layer properties. When done, it resolves the WMLayer
15934
+ * @param name The name of the layer
15935
+ * @returns Promise resolving to a WMLayer object
15941
15936
  */
15942
15937
  setName(name) {
15943
15938
  this.name = name;
15944
15939
  return this.parseLayerPromise(false);
15945
15940
  }
15946
- /**
15947
- * Sets the style by its name
15948
- * @param style: The name of the style (not the object)
15941
+ /**
15942
+ * Sets the style by its name
15943
+ * @param style: The name of the style (not the object)
15949
15944
  */
15950
15945
  setStyle(styleName) {
15951
15946
  debugLogger(DebugType.Log);
@@ -15977,10 +15972,10 @@ class WMLayer {
15977
15972
  }
15978
15973
  return [];
15979
15974
  }
15980
- /**
15981
- * Get the styleobject by name
15982
- * @param styleName The name of the style
15983
- * @param nextPrev, can be -1 or +1 to get the next or previous style object in circular manner.
15975
+ /**
15976
+ * Get the styleobject by name
15977
+ * @param styleName The name of the style
15978
+ * @param nextPrev, can be -1 or +1 to get the next or previous style object in circular manner.
15984
15979
  */
15985
15980
  getStyleObject(styleName, nextPrev) {
15986
15981
  if (isDefined(this.styles) === false) {
@@ -16005,8 +16000,8 @@ class WMLayer {
16005
16000
  }
16006
16001
  return undefined;
16007
16002
  }
16008
- /*
16009
- *Get the current stylename as used in the getmap request
16003
+ /*
16004
+ *Get the current stylename as used in the getmap request
16010
16005
  */
16011
16006
  getStyle() {
16012
16007
  return this.currentStyle;
@@ -16014,9 +16009,9 @@ class WMLayer {
16014
16009
  getDimension(name) {
16015
16010
  return this.dimensions.find(dim => dim.name === name);
16016
16011
  }
16017
- /**
16018
- * Returns the Coordinate Reference Systems for this layer
16019
- * @returns List of WMProjection objects
16012
+ /**
16013
+ * Returns the Coordinate Reference Systems for this layer
16014
+ * @returns List of WMProjection objects
16020
16015
  */
16021
16016
  getCRS() {
16022
16017
  const crs = [];
@@ -16035,11 +16030,11 @@ class WMLayer {
16035
16030
  }
16036
16031
  return crs;
16037
16032
  }
16038
- /**
16039
- * Get Coordinate reference system by name
16040
- *
16041
- * @param srsName Name of the coordinate reference system to get
16042
- * @returns A WMProjection object if found, otherwise undefined.
16033
+ /**
16034
+ * Get Coordinate reference system by name
16035
+ *
16036
+ * @param srsName Name of the coordinate reference system to get
16037
+ * @returns A WMProjection object if found, otherwise undefined.
16043
16038
  */
16044
16039
  getCRSByName(srsName) {
16045
16040
  for (const projProps of this.projectionProperties) {
@@ -16055,11 +16050,11 @@ class WMLayer {
16055
16050
  }
16056
16051
  return undefined;
16057
16052
  }
16058
- /**
16059
- * Get Coordinate reference system by name. Note 2021-05-17: It is more inline with other function names to use the getCRSByName function instead.
16060
- *
16061
- * @param srsName Name of the coordinate reference system to get
16062
- * @returns A WMProjection object if found, otherwise undefined.
16053
+ /**
16054
+ * Get Coordinate reference system by name. Note 2021-05-17: It is more inline with other function names to use the getCRSByName function instead.
16055
+ *
16056
+ * @param srsName Name of the coordinate reference system to get
16057
+ * @returns A WMProjection object if found, otherwise undefined.
16063
16058
  */
16064
16059
  getProjection(srsName) {
16065
16060
  return this.getCRSByName(srsName);
@@ -16081,22 +16076,22 @@ class WMLayer {
16081
16076
  }
16082
16077
  }
16083
16078
 
16084
- /* *
16085
- * Licensed under the Apache License, Version 2.0 (the "License");
16086
- * you may not use this file except in compliance with the License.
16087
- * You may obtain a copy of the License at
16088
- *
16089
- * http://www.apache.org/licenses/LICENSE-2.0
16090
- *
16091
- * Unless required by applicable law or agreed to in writing, software
16092
- * distributed under the License is distributed on an "AS IS" BASIS,
16093
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16094
- * See the License for the specific language governing permissions and
16095
- * limitations under the License.
16096
- *
16097
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16098
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
16099
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16079
+ /* *
16080
+ * Licensed under the Apache License, Version 2.0 (the "License");
16081
+ * you may not use this file except in compliance with the License.
16082
+ * You may obtain a copy of the License at
16083
+ *
16084
+ * http://www.apache.org/licenses/LICENSE-2.0
16085
+ *
16086
+ * Unless required by applicable law or agreed to in writing, software
16087
+ * distributed under the License is distributed on an "AS IS" BASIS,
16088
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16089
+ * See the License for the specific language governing permissions and
16090
+ * limitations under the License.
16091
+ *
16092
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16093
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
16094
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16100
16095
  * */
16101
16096
  const defaultAnimationDelayAtStart = 250;
16102
16097
  const defaultDelay = 1000; // [ms]
@@ -16115,22 +16110,22 @@ var mapConstants = /*#__PURE__*/Object.freeze({
16115
16110
  speedFactors: speedFactors
16116
16111
  });
16117
16112
 
16118
- /* *
16119
- * Licensed under the Apache License, Version 2.0 (the "License");
16120
- * you may not use this file except in compliance with the License.
16121
- * You may obtain a copy of the License at
16122
- *
16123
- * http://www.apache.org/licenses/LICENSE-2.0
16124
- *
16125
- * Unless required by applicable law or agreed to in writing, software
16126
- * distributed under the License is distributed on an "AS IS" BASIS,
16127
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16128
- * See the License for the specific language governing permissions and
16129
- * limitations under the License.
16130
- *
16131
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16132
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
16133
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16113
+ /* *
16114
+ * Licensed under the Apache License, Version 2.0 (the "License");
16115
+ * you may not use this file except in compliance with the License.
16116
+ * You may obtain a copy of the License at
16117
+ *
16118
+ * http://www.apache.org/licenses/LICENSE-2.0
16119
+ *
16120
+ * Unless required by applicable law or agreed to in writing, software
16121
+ * distributed under the License is distributed on an "AS IS" BASIS,
16122
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16123
+ * See the License for the specific language governing permissions and
16124
+ * limitations under the License.
16125
+ *
16126
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16127
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
16128
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16134
16129
  * */
16135
16130
  let generatedLayerIds = 0;
16136
16131
  const generateLayerId = () => {
@@ -16147,21 +16142,21 @@ const generateTimesliderId = () => {
16147
16142
  generatedTimesliderIds += 1;
16148
16143
  return `timesliderid_${generatedTimesliderIds}`;
16149
16144
  };
16150
- /**
16151
- * Map for registering wmlayers with their id's
16145
+ /**
16146
+ * Map for registering wmlayers with their id's
16152
16147
  */
16153
16148
  const registeredWMLayersForReactLayerId = {};
16154
- /**
16155
- * Registers a WMJSLayer in a lookuptable with a layerId
16156
- * @param {WMLayer} wmLayer
16157
- * @param {string} layerId
16149
+ /**
16150
+ * Registers a WMJSLayer in a lookuptable with a layerId
16151
+ * @param {WMLayer} wmLayer
16152
+ * @param {string} layerId
16158
16153
  */
16159
16154
  const registerWMLayer = (wmLayer, layerId) => {
16160
16155
  registeredWMLayersForReactLayerId[layerId] = wmLayer;
16161
16156
  };
16162
- /**
16163
- * Get the WMLayer from the lookuptable with layerId
16164
- * @param {string} layerId
16157
+ /**
16158
+ * Get the WMLayer from the lookuptable with layerId
16159
+ * @param {string} layerId
16165
16160
  */
16166
16161
  const getWMLayerById = layerId => {
16167
16162
  return registeredWMLayersForReactLayerId[layerId];
@@ -16182,14 +16177,14 @@ const unRegisterAllWMJSLayersAndMaps = () => {
16182
16177
  unRegisterWMJSMap(mapId);
16183
16178
  });
16184
16179
  };
16185
- /**
16186
- * Map for registering wmlayers with their id's
16180
+ /**
16181
+ * Map for registering wmlayers with their id's
16187
16182
  */
16188
16183
  const registeredWMMapForReactMapId = {};
16189
- /**
16190
- * Registers a IWMJSMap in a lookuptable with a wmjsMapId
16191
- * @param {IWMJSMap} wmjsMap
16192
- * @param {string} wmjsMapId
16184
+ /**
16185
+ * Registers a IWMJSMap in a lookuptable with a wmjsMapId
16186
+ * @param {IWMJSMap} wmjsMap
16187
+ * @param {string} wmjsMapId
16193
16188
  */
16194
16189
  const registerWMJSMap = (wmjsMap, wmjsMapId) => {
16195
16190
  if (registeredWMMapForReactMapId[wmjsMapId]) {
@@ -16216,24 +16211,24 @@ const unRegisterWMJSMap = wmjsMapId => {
16216
16211
  delete registeredWMMapForReactMapId[wmjsMapId];
16217
16212
  }
16218
16213
  };
16219
- /**
16220
- * Get the wmjsMap from the lookuptable with wmjsMapId
16221
- * @param {string} wmjsMapId
16214
+ /**
16215
+ * Get the wmjsMap from the lookuptable with wmjsMapId
16216
+ * @param {string} wmjsMapId
16222
16217
  */
16223
16218
  const getWMJSMapById = wmjsMapId => {
16224
16219
  return registeredWMMapForReactMapId[wmjsMapId];
16225
16220
  };
16226
- /**
16227
- * Get all wmjsMap id's from the lookuptable with wmjsMapId
16228
- * @param {string} wmjsMapId
16221
+ /**
16222
+ * Get all wmjsMap id's from the lookuptable with wmjsMapId
16223
+ * @param {string} wmjsMapId
16229
16224
  */
16230
16225
  const getWMJSMapIds = () => {
16231
16226
  return Object.keys(registeredWMMapForReactMapId);
16232
16227
  };
16233
- /**
16234
- * Returns the WMJSDimension object for given layerId and dimension name
16235
- * @param layerId The layerId
16236
- * @param dimensionName The dimension to lookup
16228
+ /**
16229
+ * Returns the WMJSDimension object for given layerId and dimension name
16230
+ * @param layerId The layerId
16231
+ * @param dimensionName The dimension to lookup
16237
16232
  */
16238
16233
  const getWMJSDimensionForLayerAndDimension = (layerId, dimensionName) => {
16239
16234
  const wmLayer = getWMLayerById(layerId);
@@ -16246,10 +16241,10 @@ const getWMJSDimensionForLayerAndDimension = (layerId, dimensionName) => {
16246
16241
  }
16247
16242
  return wmjsDimension;
16248
16243
  };
16249
- /**
16250
- * Gets the WMJSTimeDimension for given activeLayerId and dimensions list
16251
- * @param layerId: The layer id to search the WMJSDimension for
16252
- * @return: The WMJSDimension if found, otherwise null
16244
+ /**
16245
+ * Gets the WMJSTimeDimension for given activeLayerId and dimensions list
16246
+ * @param layerId: The layer id to search the WMJSDimension for
16247
+ * @return: The WMJSDimension if found, otherwise null
16253
16248
  */
16254
16249
  const getWMJSTimeDimensionForLayerId = layerId => {
16255
16250
  const wmLayer = getWMLayerById(layerId);
@@ -16258,8 +16253,8 @@ const getWMJSTimeDimensionForLayerId = layerId => {
16258
16253
  }
16259
16254
  return wmLayer.getDimension('time');
16260
16255
  };
16261
- /**
16262
- * Clears the image store for all maps
16256
+ /**
16257
+ * Clears the image store for all maps
16263
16258
  */
16264
16259
  const clearImageCacheForAllMaps = () => {
16265
16260
  getWMJSMapIds().forEach(id => {
@@ -16282,8 +16277,8 @@ const roundWithTimeStep = (unixTime, timeStep, type) => {
16282
16277
  }
16283
16278
  return undefined;
16284
16279
  };
16285
- /**
16286
- * Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
16280
+ /**
16281
+ * Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
16287
16282
  */
16288
16283
  const getSpeedDelay = speedFactor => {
16289
16284
  return defaultDelay / speedFactor;
@@ -16309,22 +16304,22 @@ var utils = /*#__PURE__*/Object.freeze({
16309
16304
  unRegisterWMJSMap: unRegisterWMJSMap
16310
16305
  });
16311
16306
 
16312
- /* *
16313
- * Licensed under the Apache License, Version 2.0 (the "License");
16314
- * you may not use this file except in compliance with the License.
16315
- * You may obtain a copy of the License at
16316
- *
16317
- * http://www.apache.org/licenses/LICENSE-2.0
16318
- *
16319
- * Unless required by applicable law or agreed to in writing, software
16320
- * distributed under the License is distributed on an "AS IS" BASIS,
16321
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16322
- * See the License for the specific language governing permissions and
16323
- * limitations under the License.
16324
- *
16325
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16326
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
16327
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16307
+ /* *
16308
+ * Licensed under the Apache License, Version 2.0 (the "License");
16309
+ * you may not use this file except in compliance with the License.
16310
+ * You may obtain a copy of the License at
16311
+ *
16312
+ * http://www.apache.org/licenses/LICENSE-2.0
16313
+ *
16314
+ * Unless required by applicable law or agreed to in writing, software
16315
+ * distributed under the License is distributed on an "AS IS" BASIS,
16316
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16317
+ * See the License for the specific language governing permissions and
16318
+ * limitations under the License.
16319
+ *
16320
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16321
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
16322
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16328
16323
  * */
16329
16324
  const defaultReduxLayerRadarColor = {
16330
16325
  service: 'https://testservice',
@@ -16699,22 +16694,22 @@ var testSettings = /*#__PURE__*/Object.freeze({
16699
16694
  styleListForRADNL25PCPCMLayer: styleListForRADNL25PCPCMLayer
16700
16695
  });
16701
16696
 
16702
- /* *
16703
- * Licensed under the Apache License, Version 2.0 (the "License");
16704
- * you may not use this file except in compliance with the License.
16705
- * You may obtain a copy of the License at
16706
- *
16707
- * http://www.apache.org/licenses/LICENSE-2.0
16708
- *
16709
- * Unless required by applicable law or agreed to in writing, software
16710
- * distributed under the License is distributed on an "AS IS" BASIS,
16711
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16712
- * See the License for the specific language governing permissions and
16713
- * limitations under the License.
16714
- *
16715
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16716
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
16717
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16697
+ /* *
16698
+ * Licensed under the Apache License, Version 2.0 (the "License");
16699
+ * you may not use this file except in compliance with the License.
16700
+ * You may obtain a copy of the License at
16701
+ *
16702
+ * http://www.apache.org/licenses/LICENSE-2.0
16703
+ *
16704
+ * Unless required by applicable law or agreed to in writing, software
16705
+ * distributed under the License is distributed on an "AS IS" BASIS,
16706
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16707
+ * See the License for the specific language governing permissions and
16708
+ * limitations under the License.
16709
+ *
16710
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
16711
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
16712
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
16718
16713
  * */
16719
16714
  const tilesettings = {
16720
16715
  WorldMap_Light_Grey_Canvas: {
@@ -16811,16 +16806,16 @@ const tilesettings = {
16811
16806
  tileServerType: 'osm',
16812
16807
  copyRight: 'Natural Earth II | Ingmapping'
16813
16808
  },
16814
- /* TODO
16815
- 'EPSG:4326': {
16816
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG4326/',
16817
- minLevel: 0,
16818
- maxLevel: 9,
16819
- origX: -180,
16820
- origY: 90,
16821
- resolution: 1.422222,
16822
- tileServerType: 'osm',
16823
- copyRight: 'Natural Earth II | Ingmapping',
16809
+ /* TODO
16810
+ 'EPSG:4326': {
16811
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG4326/',
16812
+ minLevel: 0,
16813
+ maxLevel: 9,
16814
+ origX: -180,
16815
+ origY: 90,
16816
+ resolution: 1.422222,
16817
+ tileServerType: 'osm',
16818
+ copyRight: 'Natural Earth II | Ingmapping',
16824
16819
  }, */
16825
16820
  'EPSG:3411': {
16826
16821
  home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3411/',
@@ -17066,22 +17061,22 @@ const tilesettings = {
17066
17061
  }
17067
17062
  };
17068
17063
 
17069
- /* *
17070
- * Licensed under the Apache License, Version 2.0 (the "License");
17071
- * you may not use this file except in compliance with the License.
17072
- * You may obtain a copy of the License at
17073
- *
17074
- * http://www.apache.org/licenses/LICENSE-2.0
17075
- *
17076
- * Unless required by applicable law or agreed to in writing, software
17077
- * distributed under the License is distributed on an "AS IS" BASIS,
17078
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17079
- * See the License for the specific language governing permissions and
17080
- * limitations under the License.
17081
- *
17082
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17083
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
17084
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
17064
+ /* *
17065
+ * Licensed under the Apache License, Version 2.0 (the "License");
17066
+ * you may not use this file except in compliance with the License.
17067
+ * You may obtain a copy of the License at
17068
+ *
17069
+ * http://www.apache.org/licenses/LICENSE-2.0
17070
+ *
17071
+ * Unless required by applicable law or agreed to in writing, software
17072
+ * distributed under the License is distributed on an "AS IS" BASIS,
17073
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17074
+ * See the License for the specific language governing permissions and
17075
+ * limitations under the License.
17076
+ *
17077
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17078
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
17079
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
17085
17080
  * */
17086
17081
  const defaultReduxLayerRadarKNMI = {
17087
17082
  service: 'https://testservice',
@@ -17122,22 +17117,22 @@ const multiDimensionLayer = {
17122
17117
  }]
17123
17118
  };
17124
17119
 
17125
- /* *
17126
- * Licensed under the Apache License, Version 2.0 (the "License");
17127
- * you may not use this file except in compliance with the License.
17128
- * You may obtain a copy of the License at
17129
- *
17130
- * http://www.apache.org/licenses/LICENSE-2.0
17131
- *
17132
- * Unless required by applicable law or agreed to in writing, software
17133
- * distributed under the License is distributed on an "AS IS" BASIS,
17134
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17135
- * See the License for the specific language governing permissions and
17136
- * limitations under the License.
17137
- *
17138
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17139
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
17140
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
17120
+ /* *
17121
+ * Licensed under the Apache License, Version 2.0 (the "License");
17122
+ * you may not use this file except in compliance with the License.
17123
+ * You may obtain a copy of the License at
17124
+ *
17125
+ * http://www.apache.org/licenses/LICENSE-2.0
17126
+ *
17127
+ * Unless required by applicable law or agreed to in writing, software
17128
+ * distributed under the License is distributed on an "AS IS" BASIS,
17129
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17130
+ * See the License for the specific language governing permissions and
17131
+ * limitations under the License.
17132
+ *
17133
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17134
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
17135
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
17141
17136
  * */
17142
17137
  const WMS111GetCapabilitiesGeoServicesRADAR = `<?xml version="1.0" encoding="UTF-8"?>
17143
17138
  <!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd" [
@@ -17546,9 +17541,9 @@ const mockGetCapabilities = Object.assign(Object.assign({}, getCapabilities$1),
17546
17541
  WMS111GetCapabilitiesGeoServicesRADAR
17547
17542
  });
17548
17543
 
17549
- /**
17550
- * Converts webmapjs node structure to LayerTree
17551
- * @param nodesToRecur THe WebMapJS node structure from service.getNodes();
17544
+ /**
17545
+ * Converts webmapjs node structure to LayerTree
17546
+ * @param nodesToRecur THe WebMapJS node structure from service.getNodes();
17552
17547
  */
17553
17548
  const recurseNodes = nodesToRecur => {
17554
17549
  const newLayerTreeObj = {
@@ -17570,10 +17565,10 @@ const recurseNodes = nodesToRecur => {
17570
17565
  }
17571
17566
  return newLayerTreeObj;
17572
17567
  };
17573
- /**
17574
- * Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
17575
- * @param serviceUrl The URL of the WMS service
17576
- * @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
17568
+ /**
17569
+ * Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
17570
+ * @param serviceUrl The URL of the WMS service
17571
+ * @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
17577
17572
  */
17578
17573
  const getLayersFromService = (serviceUrl, forceReload = false) => {
17579
17574
  return new Promise((resolve, reject) => {
@@ -17587,10 +17582,10 @@ const getLayersFromService = (serviceUrl, forceReload = false) => {
17587
17582
  }, forceReload);
17588
17583
  });
17589
17584
  };
17590
- /**
17591
- * Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
17592
- * @param serviceUrl The URL of the WMS service
17593
- * @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
17585
+ /**
17586
+ * Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
17587
+ * @param serviceUrl The URL of the WMS service
17588
+ * @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
17594
17589
  */
17595
17590
  const getLayersFlattenedFromService = (serviceUrl, forceReload = false) => {
17596
17591
  return new Promise((resolve, reject) => {