@opengeoweb/webmap 9.26.0 → 9.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -2,6 +2,50 @@ import { compact, range, isEqual } from 'lodash';
2
2
  import { PROJECTION, dateUtils, defaultDelay as defaultDelay$1 } from '@opengeoweb/shared';
3
3
  import { debounce, throttle } from 'throttle-debounce';
4
4
  import proj4 from 'proj4';
5
+ import i18n from 'i18next';
6
+
7
+ var en = {
8
+ "map-projection": "Map projection",
9
+ "hold-shift-to-zoom": "Hold SHIFT to zoom",
10
+ "layer-failed-to-load": "Layer failed to load.",
11
+ "layer-failed-to-load-message": "Layer with title \"{{title}}\" failed to load{{message}}",
12
+ "time-too-early": "Time too early",
13
+ "time-too-late": "Time too late",
14
+ "time-outside-range": "Time outside range"
15
+ };
16
+ var fi = {
17
+ "map-projection": "Karttaprojektio",
18
+ "hold-shift-to-zoom": "Zoomaa SHIFT painettuna",
19
+ "layer-failed-to-load": "Tason lataus epäonnistui",
20
+ "layer-failed-to-load-message": "Tason \"{{title}}\" lataus epäonnistui{{message}}",
21
+ "time-too-early": "Liian varhainen aika",
22
+ "time-too-late": "Liian myöhäinen aika",
23
+ "time-outside-range": "Aika valintavälin ulkopuolella"
24
+ };
25
+ var no = {
26
+ "map-projection": "Kartprojeksjon",
27
+ "hold-shift-to-zoom": "Hold SHIFT for å zoome",
28
+ "layer-failed-to-load": "Kartlaget kunne ikke lastes.",
29
+ "layer-failed-to-load-message": "Kartlaget med tittelen \"{{title}}\" kunne ikke lastes{{message}}",
30
+ "time-too-early": "Tid for tidlig",
31
+ "time-too-late": "Tid for sent",
32
+ "time-outside-range": "Tid utenfor spekteret"
33
+ };
34
+ var nl = {
35
+ "map-projection": "Kaart projectie",
36
+ "hold-shift-to-zoom": "Houd SHIFT ingedrukt om te zoomen",
37
+ "layer-failed-to-load": "Laag kon niet worden geladen.",
38
+ "layer-failed-to-load-message": "Laag met titel \"{{title}}\" kon niet worden geladen{{message}}",
39
+ "time-too-early": "Tijd te vroeg",
40
+ "time-too-late": "Tijd te laat",
41
+ "time-outside-range": "Tijd buiten bereik"
42
+ };
43
+ var webmapTranslations = {
44
+ en: en,
45
+ fi: fi,
46
+ no: no,
47
+ nl: nl
48
+ };
5
49
 
6
50
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
7
51
 
@@ -6606,395 +6650,20 @@ $$b({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_RE
6606
6650
  * See the License for the specific language governing permissions and
6607
6651
  * limitations under the License.
6608
6652
  *
6609
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6610
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
6653
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6654
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
6611
6655
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6612
6656
  * */
6613
- var I18n = {
6614
- delete: {
6615
- text: 'Delete'
6616
- },
6617
- delete_selected_flag_tooltip: {
6618
- tooltip: 'Delete selected flag'
6619
- },
6620
- add_flag_tooltip: {
6621
- tooltip: 'Add a flag with current latitude, longitude and name'
6622
- },
6623
- are_you_sure: {
6624
- text: 'Are you sure about deleting this flag?'
6625
- },
6626
- delete_title_confirm: {
6627
- text: 'Delete flag'
6628
- },
6629
- default_selected_flag: {
6630
- text: 'None'
6631
- },
6632
- selected_flag: {
6633
- text: 'Nearest flag:'
6634
- },
6635
- add_point_interest_abstract: {
6636
- text: 'Add or update your point of interest here with a latitude, a longitude and a name of choice.'
6637
- },
6638
- insert_name: {
6639
- text: 'Name:'
6640
- },
6641
- add_point_interest: {
6642
- text: 'Add point of interest'
6643
- },
6644
- add: {
6645
- text: 'Add'
6646
- },
6647
- place_search_term: {
6648
- text: 'Search for location…'
6649
- },
6650
- debug_searching_location: {
6651
- text: 'Searching for location in SQLite DB:'
6652
- },
6653
- debug_searching_sqlite_location: {
6654
- text: 'Searching for location with GeoNames API:'
6655
- },
6656
- geonames_api_call_failed: {
6657
- text: 'GeoNames API request failed'
6658
- },
6659
- geonames_sqlite_call_failed: {
6660
- text: 'GeoNames SQLite request failed.'
6661
- },
6662
- no_results_search: {
6663
- text: 'No results for search'
6664
- },
6665
- unable_to_connect_server: {
6666
- text: 'Unable to connect to the service.'
6667
- },
6668
- unable_to_search: {
6669
- text: 'Unable to perform a search'
6670
- },
6671
- no_urls_in_config: {
6672
- text: 'No GeoNames URLs defined in config file'
6673
- },
6674
- only_alpha_num_allowed: {
6675
- text: 'Search may only contain alpha numeric characters'
6676
- },
6677
- no_search_definition: {
6678
- text: 'Search term is empty'
6679
- },
6680
- service_has_error: {
6681
- text: '--- service has an error ---'
6682
- },
6683
- no_time_dimension_in_layer: {
6684
- text: 'No time dimension found in this layer'
6685
- },
6686
- no_service_defined: {
6687
- text: 'No service defined'
6688
- },
6689
- service_url_empty: {
6690
- text: 'Service URL is empty'
6691
- },
6692
- wms_service_exception_code: {
6693
- text: 'WMS Service exception with code '
6694
- },
6695
- unnamed_service: {
6696
- text: 'Unnamed service'
6697
- },
6698
- add_layers: {
6699
- text: 'Add layers…',
6700
- tooltip: 'Add new datasets, layers and services'
6701
- },
6702
- add_custom_service: {
6703
- text: 'Add a custom version 1.1.1 Web Map Service (WMS)'
6704
- },
6705
- properties_for: {
6706
- text: 'Properties for'
6707
- },
6708
- color_range: {
6709
- text: 'Color range'
6710
- },
6711
- reset: {
6712
- text: 'Reset'
6713
- },
6714
- apply: {
6715
- text: 'Apply'
6716
- },
6717
- min_value: {
6718
- text: 'Min value'
6719
- },
6720
- max_value: {
6721
- text: 'Max value'
6722
- },
6723
- wms_version: {
6724
- text: 'WMS version'
6725
- },
6726
- wms_comp_mode: {
6727
- text: 'WMS 1.3.0 BBOX compatibility mode'
6728
- },
6729
- projections: {
6730
- text: 'Projections'
6731
- },
6732
- projection: {
6733
- text: 'Projection'
6734
- },
6735
- epsg_code: {
6736
- text: 'EPSG Code'
6737
- },
6738
- bounding_box: {
6739
- text: 'Bounding Box'
6740
- },
6741
- file_metadata: {
6742
- text: 'File metadata'
6743
- },
6744
- show_file_metadata: {
6745
- text: 'Show file metadata'
6746
- },
6747
- download_data_wcs: {
6748
- text: 'Download data via WCS'
6749
- },
6750
- coordinate_reference_system: {
6751
- text: 'Coordinate reference system'
6752
- },
6753
- area_bounding_box: {
6754
- text: 'Area / Bounding box'
6755
- },
6756
- dimensions: {
6757
- text: 'Dimensions'
6758
- },
6759
- dimension: {
6760
- text: 'Dimension'
6761
- },
6762
- formats: {
6763
- text: 'Formats'
6764
- },
6765
- north: {
6766
- text: 'North'
6767
- },
6768
- west: {
6769
- text: 'West'
6770
- },
6771
- east: {
6772
- text: 'East'
6773
- },
6774
- south: {
6775
- text: 'South'
6776
- },
6777
- cell_size: {
6778
- text: 'Cell size'
6779
- },
6780
- x_resolution: {
6781
- text: 'X Resolution'
6782
- },
6783
- y_resolution: {
6784
- text: 'Y Resolution'
6785
- },
6786
- raster_size: {
6787
- text: 'Raster size'
6788
- },
6789
- raster_width: {
6790
- text: 'Raster width'
6791
- },
6792
- raster_height: {
6793
- text: 'Raster height'
6794
- },
6795
- format: {
6796
- text: 'Format'
6797
- },
6798
- show: {
6799
- text: 'Show'
6800
- },
6801
- create_permanent_links: {
6802
- text: 'Create permanent links'
6803
- },
6804
- please_select_product: {
6805
- text: 'Please select a product'
6806
- },
6807
- no_capability_element_found: {
6808
- text: 'No Capability element found in service'
6809
- },
6810
- no_wms_capability_element_found: {
6811
- text: 'No WMS Capability element found'
6812
- },
6813
- no_wms_layer_element_found: {
6814
- text: 'No WMS Layer element found'
6815
- },
6816
- settings_and_options: {
6817
- tooltip: 'Settings and options'
6818
- },
6819
- show_time_selection_window: {
6820
- text: 'Show time selection window…'
6821
- },
6822
- create_animation: {
6823
- text: 'Create animation…'
6824
- },
6825
- create_link: {
6826
- text: 'Create link…'
6827
- },
6828
- show_debug_information: {
6829
- text: 'Show debug information…'
6830
- },
6831
- add_custom_wms_service: {
6832
- text: 'Add custom WMS service…'
6833
- },
6834
- undo_zoom_pan_action: {
6835
- text: 'Undo zoom/pan action'
6836
- },
6837
- redo_zoom_pan_action: {
6838
- text: 'Redo zoom/pan action'
6839
- },
6840
- abort_loading: {
6841
- text: 'Abort loading'
6842
- },
6843
- about_the_adaguc_viewer: {
6844
- text: 'About the ADAGUC viewer',
6845
- tooptip: 'Display info about the ADAGUC viewer'
6846
- },
6847
- about_adaguc: {
6848
- text: 'About ADAGUC'
6849
- },
6850
- about_adaguc_more_information: {
6851
- text: '<br/><br/>Please visit <a target="_blank" href="http://adaguc.knmi.nl/">http://adaguc.knmi.nl/</a> for more information.<div>'
6852
- },
6853
- layers: {
6854
- text: 'Layers',
6855
- tooltip: 'Layers'
6856
- },
6857
- predefined_areas: {
6858
- tooltip: 'Select predefined areas'
6859
- },
6860
- basemaps_overlays: {
6861
- tooltip: 'Select basemaps and overlays'
6862
- },
6863
- add_layers_and_services: {
6864
- text: 'Add Layers and Services'
6865
- },
6866
- add_new_layer: {
6867
- tooltip: 'Add new layer'
6868
- },
6869
- clone_this_layer: {
6870
- tooltip: 'Clone this layer and place it on top of the layerlist'
6871
- },
6872
- remove_this_layer: {
6873
- tooltip: 'Remove this layer'
6874
- },
6875
- move_layer_up: {
6876
- tooltip: 'Move this layer up in the list and the map view'
6877
- },
6878
- move_layer_down: {
6879
- tooltip: 'Move this layer down in the list and the map view'
6880
- },
6881
- title: {
6882
- text: 'Title'
6883
- },
6884
- layer: {
6885
- text: 'Layer'
6886
- },
6887
- type: {
6888
- text: 'Type'
6889
- },
6890
- name: {
6891
- text: 'Name'
6892
- },
6893
- abstract: {
6894
- text: 'Abstract'
6895
- },
6896
- service: {
6897
- text: 'Service'
6898
- },
6899
- description: {
6900
- text: 'Description'
6901
- },
6902
- no_dimensions_available: {
6903
- text: 'No layers with a time dimension available.'
6904
- },
6905
- load_all: {
6906
- text: 'Load all'
6907
- },
6908
- play_animation: {
6909
- text: 'Play animation'
6910
- },
6911
- stop: {
6912
- text: 'Stop'
6913
- },
6914
- start: {
6915
- text: 'Start'
6916
- },
6917
- opacity: {
6918
- text: 'Opacity:'
6919
- },
6920
- zoom_to_this_layer: {
6921
- tooltip: 'Zoom to this layer'
6922
- },
6923
- start_or_stop_animation: {
6924
- tooltip: 'Start or stop animation'
6925
- },
6926
- reload_this_layer: {
6927
- tooltip: 'Reload this layer'
6928
- },
6929
- layer_properties: {
6930
- tooltip: 'Layer properties'
6931
- },
6932
- hide_or_display_layer: {
6933
- tooltip: 'Hide or display this layer'
6934
- },
6935
- select_layer_product_from_service: {
6936
- tooltip: 'Select a layer or product from the service'
6937
- },
6938
- change_style_layer: {
6939
- tooltip: 'Change the style of this layer'
6940
- },
6941
- available_styles: {
6942
- text: 'Available styles'
6943
- },
6944
- no_styles_available: {
6945
- text: 'No styles available'
6946
- },
6947
- default: {
6948
- text: 'Default'
6949
- },
6950
- embed: {
6951
- text: 'Embed'
6952
- },
6953
- time_selection: {
6954
- text: 'Time selection'
6955
- },
6956
- local_time: {
6957
- text: 'Local time'
6958
- },
6959
- year: {
6960
- text: 'Year'
6961
- },
6962
- month: {
6963
- text: 'Month'
6964
- },
6965
- day: {
6966
- text: 'Day'
6967
- },
6968
- hour: {
6969
- text: 'Hour'
6970
- },
6971
- min: {
6972
- text: 'Min'
6973
- },
6974
- select_layer: {
6975
- text: 'Select layer'
6976
- },
6977
- select_dimension: {
6978
- text: 'Select dimension'
6979
- },
6980
- start_at: {
6981
- text: 'Start at'
6982
- },
6983
- number_of_steps: {
6984
- text: 'Number of steps'
6985
- },
6986
- delay_ms: {
6987
- text: 'Delay (ms)'
6988
- },
6989
- enter_wms_version_url: {
6990
- text: 'Enter WMS version 1.1.1 URL here...'
6991
- },
6992
- enter_search_term: {
6993
- text: 'Enter your location here&hellip;'
6994
- },
6995
- not_available_message: {
6996
- text: 'Not available'
6997
- }
6657
+ const consoleErrorMessages = {
6658
+ noCapabilityElementFound: 'No Capability element found in service',
6659
+ noServiceDefined: 'No service defined',
6660
+ noWmsCapabilityElementFound: 'No WMS Capability element found',
6661
+ noWmsLayerElementFound: 'No WMS Layer element found',
6662
+ notAvailableMessage: 'Not available',
6663
+ serviceHasError: '--- service has an error ---',
6664
+ serviceUrlEmpty: 'Service URL is empty',
6665
+ unableToConnectServer: 'Unable to connect to the service.',
6666
+ wmsServiceExceptionCode: 'WMS Service exception with code'
6998
6667
  };
6999
6668
 
7000
6669
  class WMListener {
@@ -7333,12 +7002,12 @@ const WMJSGetCapabilities = (service, succes, fail, options, disableCache = fals
7333
7002
  headers = options.headers;
7334
7003
  }
7335
7004
  if (!isDefined(service)) {
7336
- fail(I18n.no_service_defined.text);
7005
+ fail(consoleErrorMessages.noServiceDefined);
7337
7006
  return;
7338
7007
  }
7339
7008
  if (service.length === 0) {
7340
7009
  debugLogger(DebugType.Error);
7341
- fail(I18n.service_url_empty.text);
7010
+ fail(consoleErrorMessages.serviceUrlEmpty);
7342
7011
  return;
7343
7012
  }
7344
7013
  /* Allow relative URL's */
@@ -7350,7 +7019,7 @@ const WMJSGetCapabilities = (service, succes, fail, options, disableCache = fals
7350
7019
  }
7351
7020
  if (!service.startsWith('http://') && !service.startsWith('https:') && !service.startsWith('//')) {
7352
7021
  debugLogger(DebugType.Error);
7353
- fail(I18n.service_url_empty.text);
7022
+ fail(consoleErrorMessages.serviceUrlEmpty);
7354
7023
  return;
7355
7024
  }
7356
7025
  if (service.indexOf('?') === -1) {
@@ -7425,10 +7094,10 @@ class WMJSService {
7425
7094
  throw new Error(message);
7426
7095
  }
7427
7096
  if (!jsonData.WMT_MS_Capabilities.Capability) {
7428
- throw new Error(I18n.no_wms_capability_element_found.text);
7097
+ throw new Error(consoleErrorMessages.noWmsCapabilityElementFound);
7429
7098
  }
7430
7099
  if (!jsonData.WMT_MS_Capabilities.Capability.Layer) {
7431
- throw new Error(I18n.no_wms_layer_element_found.text);
7100
+ throw new Error(consoleErrorMessages.noWmsLayerElementFound);
7432
7101
  }
7433
7102
  }
7434
7103
  }
@@ -7444,10 +7113,10 @@ class WMJSService {
7444
7113
  throw new Error(message);
7445
7114
  }
7446
7115
  if (!jsonData.WMS_Capabilities.Capability) {
7447
- throw new Error(I18n.no_wms_capability_element_found.text);
7116
+ throw new Error(consoleErrorMessages.noWmsCapabilityElementFound);
7448
7117
  }
7449
7118
  if (!jsonData.WMS_Capabilities.Capability.Layer) {
7450
- throw new Error(I18n.no_wms_layer_element_found.text);
7119
+ throw new Error(consoleErrorMessages.noWmsLayerElementFound);
7451
7120
  }
7452
7121
  }
7453
7122
  }
@@ -7460,7 +7129,7 @@ class WMJSService {
7460
7129
  try {
7461
7130
  capabilityObject = jsonData.WMS_Capabilities.Capability;
7462
7131
  } catch (_a) {
7463
- throw new Error(I18n.no_capability_element_found.text);
7132
+ throw new Error(consoleErrorMessages.noCapabilityElementFound);
7464
7133
  }
7465
7134
  }
7466
7135
  return capabilityObject;
@@ -7564,13 +7233,13 @@ class WMJSService {
7564
7233
  try {
7565
7234
  this.abstract = WMSCapabilities.Service.Abstract.value;
7566
7235
  } catch (e) {
7567
- this.abstract = I18n.not_available_message.text;
7236
+ this.abstract = consoleErrorMessages.notAvailableMessage;
7568
7237
  }
7569
7238
  // Get Title
7570
7239
  try {
7571
7240
  this.title = WMSCapabilities.Service.Title.value;
7572
7241
  } catch (e) {
7573
- this.title = I18n.not_available_message.text;
7242
+ this.title = consoleErrorMessages.notAvailableMessage;
7574
7243
  }
7575
7244
  // Get OnlineResource
7576
7245
  try {
@@ -7582,7 +7251,7 @@ class WMJSService {
7582
7251
  WMSCapabilities.Service.OnlineResource.attr['xlink:href'];
7583
7252
  }
7584
7253
  } catch (e) {
7585
- this.onlineresource = I18n.not_available_message.text;
7254
+ this.onlineresource = consoleErrorMessages.notAvailableMessage;
7586
7255
  }
7587
7256
  // Fill in flatlayer object
7588
7257
  this.getLayerObjectsFlat(() => null, () => null, false, options);
@@ -7617,7 +7286,7 @@ class WMJSService {
7617
7286
  return `Exception: ${code}.\n${value}`;
7618
7287
  }
7619
7288
  }
7620
- return I18n.wms_service_exception_code.text + code;
7289
+ return `${consoleErrorMessages.wmsServiceExceptionCode} ${code}`;
7621
7290
  }
7622
7291
  } catch (e) {
7623
7292
  // do nothing
@@ -11702,6 +11371,33 @@ class WMCanvasBuffer {
11702
11371
  }
11703
11372
  }
11704
11373
 
11374
+ const WEBMAP_NAMESPACE = 'webmap';
11375
+ // do not use `initReactI18next` as this is not a react library
11376
+ i18n.init({
11377
+ lng: 'en',
11378
+ ns: WEBMAP_NAMESPACE,
11379
+ interpolation: {
11380
+ escapeValue: false
11381
+ },
11382
+ resources: {
11383
+ en: {
11384
+ [WEBMAP_NAMESPACE]: webmapTranslations.en
11385
+ },
11386
+ fi: {
11387
+ [WEBMAP_NAMESPACE]: webmapTranslations.fi
11388
+ },
11389
+ no: {
11390
+ [WEBMAP_NAMESPACE]: webmapTranslations.no
11391
+ },
11392
+ nl: {
11393
+ [WEBMAP_NAMESPACE]: webmapTranslations.nl
11394
+ }
11395
+ }
11396
+ });
11397
+ const translateKeyOutsideComponents = (key, params = undefined) => i18n.t(key, Object.assign({
11398
+ ns: WEBMAP_NAMESPACE
11399
+ }, params));
11400
+
11705
11401
  const getBBOXandProjString = (layer, projection) => {
11706
11402
  let request = '';
11707
11403
  const {
@@ -12005,10 +11701,13 @@ const getErrorsToDisplay = (canvasErrors, getLayerByServiceAndName) => {
12005
11701
  // Only show if layer is present and enabled
12006
11702
  if (layer && layer.enabled) {
12007
11703
  const message = error.linkedInfo.message ? `, ${error.linkedInfo.message}` : '';
12008
- return list.concat(`Layer with title ${error.linkedInfo.layer.title} failed to load${message}`);
11704
+ return list.concat(translateKeyOutsideComponents('layer-failed-to-load-message', {
11705
+ title: error.linkedInfo.layer.title || '',
11706
+ message
11707
+ }));
12009
11708
  }
12010
11709
  } else {
12011
- return list.concat('Layer failed to load.');
11710
+ return list.concat(translateKeyOutsideComponents('layer-failed-to-load'));
12012
11711
  }
12013
11712
  return list;
12014
11713
  }, []);
@@ -13421,33 +13120,33 @@ const drawScaleBar = (scaleBarProps, ctx) => {
13421
13120
  ctx.lineTo(offsetX + scaleBarProps.width * 2 + 1, scaleBarHeight - 2 - 7 + offsetY);
13422
13121
  let units = '';
13423
13122
  if (srs === PROJECTION.EPSG_3411.value) {
13424
- units = 'meter';
13123
+ units = 'm';
13425
13124
  }
13426
13125
  if (srs === PROJECTION.EPSG_3412.value) {
13427
- units = 'meter';
13126
+ units = 'm';
13428
13127
  }
13429
13128
  if (srs === PROJECTION.EPSG_3575.value) {
13430
- units = 'meter';
13129
+ units = 'm';
13431
13130
  }
13432
13131
  if (srs === PROJECTION.EPSG_4326.value) {
13433
- units = 'degrees';
13132
+ units = 'deg';
13434
13133
  }
13435
13134
  if (srs === PROJECTION.EPSG_28992.value) {
13436
- units = 'meter';
13135
+ units = 'm';
13437
13136
  }
13438
13137
  if (srs === PROJECTION.EPSG_32661.value) {
13439
- units = 'meter';
13138
+ units = 'm';
13440
13139
  }
13441
13140
  if (srs === PROJECTION.EPSG_3857.value) {
13442
- units = 'meter';
13141
+ units = 'm';
13443
13142
  }
13444
13143
  if (srs === PROJECTION.EPSG_900913.value) {
13445
- units = 'meter';
13144
+ units = 'm';
13446
13145
  }
13447
13146
  if (srs === PROJECTION.EPSG_102100.value) {
13448
- units = 'meter';
13147
+ units = 'm';
13449
13148
  }
13450
- if (units === 'meter') {
13149
+ if (units === 'm') {
13451
13150
  if (scaleBarProps.mapunits > 1000) {
13452
13151
  scaleBarProps.mapunits /= 1000;
13453
13152
  units = 'km';
@@ -13660,21 +13359,21 @@ class WMJSMap {
13660
13359
  this.canvasErrors.push({
13661
13360
  linkedInfo: {
13662
13361
  layer,
13663
- message: 'Time outside range'
13362
+ message: translateKeyOutsideComponents('time-outside-range')
13664
13363
  }
13665
13364
  });
13666
13365
  } else if (dimension.currentValue === WMDateTooEarlyString) {
13667
13366
  this.canvasErrors.push({
13668
13367
  linkedInfo: {
13669
13368
  layer,
13670
- message: 'Time too early'
13369
+ message: translateKeyOutsideComponents('time-too-early')
13671
13370
  }
13672
13371
  });
13673
13372
  } else if (dimension.currentValue === WMDateTooLateString) {
13674
13373
  this.canvasErrors.push({
13675
13374
  linkedInfo: {
13676
13375
  layer,
13677
- message: 'Time too late'
13376
+ message: translateKeyOutsideComponents('time-too-late')
13678
13377
  }
13679
13378
  });
13680
13379
  }
@@ -13732,7 +13431,7 @@ class WMJSMap {
13732
13431
  const yText = Math.round(this.mouseGeoCoordXY.y * roundingFactor) / roundingFactor;
13733
13432
  let units = '';
13734
13433
  if (this._srs === PROJECTION.EPSG_3857.value) {
13735
- units = 'meter';
13434
+ units = 'm';
13736
13435
  }
13737
13436
  ctx.fillText(`CoordYX: (${yText}, ${xText}) ${units}`, 5, this._height - 50);
13738
13437
  }
@@ -13744,11 +13443,11 @@ class WMJSMap {
13744
13443
  ctx.fillStyle = '#000000';
13745
13444
  const xText = Math.round(llCoord.x * roundingFactor) / roundingFactor;
13746
13445
  const yText = Math.round(llCoord.y * roundingFactor) / roundingFactor;
13747
- ctx.fillText(`Lat/Lon: (${yText.toFixed(2)}, ${xText.toFixed(2)}) degrees`, 5, this._height - 38);
13446
+ ctx.fillText(`Lat/Lon: (${yText.toFixed(2)}, ${xText.toFixed(2)}) deg`, 5, this._height - 38);
13748
13447
  }
13749
13448
  }
13750
13449
  ctx.fillStyle = '#000000';
13751
- ctx.fillText(`Map projection: ${this._srs}`, 5, this._height - 26);
13450
+ ctx.fillText(`${translateKeyOutsideComponents('map-projection')}: ${this._srs}`, 5, this._height - 26);
13752
13451
  }
13753
13452
  /* Show layer metadata */
13754
13453
  if (this.showLayerInfo === true) {
@@ -14558,7 +14257,7 @@ class WMJSMap {
14558
14257
  }
14559
14258
  _mouseWheelEvent(event) {
14560
14259
  if (this.holdShiftToScroll && !event.shiftKey) {
14561
- this.setMessageValue = 'Hold SHIFT to zoom';
14260
+ this.setMessageValue = translateKeyOutsideComponents('hold-shift-to-zoom');
14562
14261
  this.draw();
14563
14262
  // Clear text after 500ms
14564
14263
  setTimeout(() => {
@@ -15896,7 +15595,7 @@ class WMLayer {
15896
15595
  if (options.title) {
15897
15596
  this.title = options.title;
15898
15597
  }
15899
- this.abstract = I18n.not_available_message.text;
15598
+ this.abstract = consoleErrorMessages.notAvailableMessage;
15900
15599
  if (options.enabled === false) {
15901
15600
  this.enabled = false;
15902
15601
  }
@@ -16010,9 +15709,9 @@ class WMLayer {
16010
15709
  }
16011
15710
  __parseGetCapForLayer(getcapabilitiesjson, layerDoneCallback, fail) {
16012
15711
  if (!getcapabilitiesjson) {
16013
- this.title = I18n.service_has_error.text;
16014
- this.abstract = I18n.not_available_message.text;
16015
- fail(this, I18n.unable_to_connect_server.text);
15712
+ this.title = consoleErrorMessages.serviceHasError;
15713
+ this.abstract = consoleErrorMessages.notAvailableMessage;
15714
+ fail(this, consoleErrorMessages.unableToConnectServer);
16016
15715
  return;
16017
15716
  }
16018
15717
  const wmjsService = WMGetServiceFromStore(this.service);
@@ -16053,7 +15752,7 @@ class WMLayer {
16053
15752
  }
16054
15753
  if (this.name === undefined || this.name.length < 1) {
16055
15754
  this.title = WMEmptyLayerTitle;
16056
- this.abstract = I18n.not_available_message.text;
15755
+ this.abstract = consoleErrorMessages.notAvailableMessage;
16057
15756
  layerDoneCallback(this);
16058
15757
  return;
16059
15758
  }
@@ -16099,7 +15798,7 @@ class WMLayer {
16099
15798
  // Function will be called when the layer with the right name is found in the getcap doc
16100
15799
  const populateLayerFromTreeElement = jsonlayer => {
16101
15800
  this.title = jsonlayer.title || jsonlayer.name || '';
16102
- this.abstract = jsonlayer.abstract || I18n.not_available_message.text;
15801
+ this.abstract = jsonlayer.abstract || consoleErrorMessages.notAvailableMessage;
16103
15802
  this.path = jsonlayer.path.join('/');
16104
15803
  /** ***************** Go through styles **************** */
16105
15804
  configureStyles(jsonlayer, this);
@@ -16150,7 +15849,7 @@ class WMLayer {
16150
15849
  message = `Unable to find layer '${this.title}' in service '${this.service}'`;
16151
15850
  }
16152
15851
  this.title = '--- layer not found in service ---';
16153
- this.abstract = I18n.not_available_message.text;
15852
+ this.abstract = consoleErrorMessages.notAvailableMessage;
16154
15853
  fail(this, message);
16155
15854
  return;
16156
15855
  }
@@ -16183,7 +15882,7 @@ class WMLayer {
16183
15882
  const fail = (_layer, message) => {
16184
15883
  this.hasError = true;
16185
15884
  this.lastError = message;
16186
- this.title = I18n.service_has_error.text;
15885
+ this.title = consoleErrorMessages.serviceHasError;
16187
15886
  layerDoneCallback(_layer);
16188
15887
  if (isDefined(this._options.failure)) {
16189
15888
  this._options.failure(_layer, message);
@@ -16193,7 +15892,7 @@ class WMLayer {
16193
15892
  this.__parseGetCapForLayer(data, layerDoneCallback, fail);
16194
15893
  };
16195
15894
  const requestfail = () => {
16196
- fail(this, I18n.no_capability_element_found.text);
15895
+ fail(this, consoleErrorMessages.noCapabilityElementFound);
16197
15896
  };
16198
15897
  const options = {
16199
15898
  headers: {}
@@ -16407,13 +16106,13 @@ const defaultTimeSpan = 24 * 3600;
16407
16106
  const speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
16408
16107
 
16409
16108
  var mapConstants = /*#__PURE__*/Object.freeze({
16410
- __proto__: null,
16411
- defaultAnimationDelayAtStart: defaultAnimationDelayAtStart,
16412
- defaultDelay: defaultDelay,
16413
- defaultSecondsPerPx: defaultSecondsPerPx,
16414
- defaultTimeSpan: defaultTimeSpan,
16415
- defaultTimeStep: defaultTimeStep,
16416
- speedFactors: speedFactors
16109
+ __proto__: null,
16110
+ defaultAnimationDelayAtStart: defaultAnimationDelayAtStart,
16111
+ defaultDelay: defaultDelay,
16112
+ defaultSecondsPerPx: defaultSecondsPerPx,
16113
+ defaultTimeSpan: defaultTimeSpan,
16114
+ defaultTimeStep: defaultTimeStep,
16115
+ speedFactors: speedFactors
16417
16116
  });
16418
16117
 
16419
16118
  /* *
@@ -16591,23 +16290,23 @@ const getSpeedDelay = speedFactor => {
16591
16290
  };
16592
16291
 
16593
16292
  var utils = /*#__PURE__*/Object.freeze({
16594
- __proto__: null,
16595
- clearImageCacheForAllMaps: clearImageCacheForAllMaps,
16596
- generateLayerId: generateLayerId,
16597
- generateMapId: generateMapId,
16598
- generateTimesliderId: generateTimesliderId,
16599
- getSpeedDelay: getSpeedDelay,
16600
- getWMJSDimensionForLayerAndDimension: getWMJSDimensionForLayerAndDimension,
16601
- getWMJSMapById: getWMJSMapById,
16602
- getWMJSMapIds: getWMJSMapIds,
16603
- getWMJSTimeDimensionForLayerId: getWMJSTimeDimensionForLayerId,
16604
- getWMLayerById: getWMLayerById,
16605
- registerWMJSMap: registerWMJSMap,
16606
- registerWMLayer: registerWMLayer,
16607
- roundWithTimeStep: roundWithTimeStep,
16608
- unRegisterAllWMJSLayersAndMaps: unRegisterAllWMJSLayersAndMaps,
16609
- unRegisterWMJSLayer: unRegisterWMJSLayer,
16610
- unRegisterWMJSMap: unRegisterWMJSMap
16293
+ __proto__: null,
16294
+ clearImageCacheForAllMaps: clearImageCacheForAllMaps,
16295
+ generateLayerId: generateLayerId,
16296
+ generateMapId: generateMapId,
16297
+ generateTimesliderId: generateTimesliderId,
16298
+ getSpeedDelay: getSpeedDelay,
16299
+ getWMJSDimensionForLayerAndDimension: getWMJSDimensionForLayerAndDimension,
16300
+ getWMJSMapById: getWMJSMapById,
16301
+ getWMJSMapIds: getWMJSMapIds,
16302
+ getWMJSTimeDimensionForLayerId: getWMJSTimeDimensionForLayerId,
16303
+ getWMLayerById: getWMLayerById,
16304
+ registerWMJSMap: registerWMJSMap,
16305
+ registerWMLayer: registerWMLayer,
16306
+ roundWithTimeStep: roundWithTimeStep,
16307
+ unRegisterAllWMJSLayersAndMaps: unRegisterAllWMJSLayersAndMaps,
16308
+ unRegisterWMJSLayer: unRegisterWMJSLayer,
16309
+ unRegisterWMJSMap: unRegisterWMJSMap
16611
16310
  });
16612
16311
 
16613
16312
  /* *
@@ -16986,18 +16685,18 @@ const multiDimensionLayer3 = {
16986
16685
  };
16987
16686
 
16988
16687
  var testSettings = /*#__PURE__*/Object.freeze({
16989
- __proto__: null,
16990
- WmLayerWithoutTimeDimension: WmLayerWithoutTimeDimension,
16991
- WmMultiDimensionLayer: WmMultiDimensionLayer,
16992
- WmdefaultReduxLayerRadarKNMI: WmdefaultReduxLayerRadarKNMI,
16993
- crsListForRADNL25PCPCMLayer: crsListForRADNL25PCPCMLayer,
16994
- defaultReduxLayerRadarColor: defaultReduxLayerRadarColor,
16995
- defaultReduxLayerRadarKNMI: defaultReduxLayerRadarKNMI$1,
16996
- layerWithoutTimeDimension: layerWithoutTimeDimension,
16997
- makeGeoservicesRadarLayer: makeGeoservicesRadarLayer,
16998
- multiDimensionLayer: multiDimensionLayer$1,
16999
- multiDimensionLayer3: multiDimensionLayer3,
17000
- styleListForRADNL25PCPCMLayer: styleListForRADNL25PCPCMLayer
16688
+ __proto__: null,
16689
+ WmLayerWithoutTimeDimension: WmLayerWithoutTimeDimension,
16690
+ WmMultiDimensionLayer: WmMultiDimensionLayer,
16691
+ WmdefaultReduxLayerRadarKNMI: WmdefaultReduxLayerRadarKNMI,
16692
+ crsListForRADNL25PCPCMLayer: crsListForRADNL25PCPCMLayer,
16693
+ defaultReduxLayerRadarColor: defaultReduxLayerRadarColor,
16694
+ defaultReduxLayerRadarKNMI: defaultReduxLayerRadarKNMI$1,
16695
+ layerWithoutTimeDimension: layerWithoutTimeDimension,
16696
+ makeGeoservicesRadarLayer: makeGeoservicesRadarLayer,
16697
+ multiDimensionLayer: multiDimensionLayer$1,
16698
+ multiDimensionLayer3: multiDimensionLayer3,
16699
+ styleListForRADNL25PCPCMLayer: styleListForRADNL25PCPCMLayer
17001
16700
  });
17002
16701
 
17003
16702
  /* *
@@ -17820,27 +17519,27 @@ const mockGetLayersFlattenedFromService = url => __awaiter(void 0, void 0, void
17820
17519
  });
17821
17520
 
17822
17521
  var getCapabilities$1 = /*#__PURE__*/Object.freeze({
17823
- __proto__: null,
17824
- MOCK_URL_DEFAULT: MOCK_URL_DEFAULT,
17825
- MOCK_URL_DEFAULT2: MOCK_URL_DEFAULT2,
17826
- MOCK_URL_HTTP: MOCK_URL_HTTP,
17827
- MOCK_URL_INVALID: MOCK_URL_INVALID,
17828
- MOCK_URL_NO_CHILDREN: MOCK_URL_NO_CHILDREN,
17829
- MOCK_URL_SLOW: MOCK_URL_SLOW,
17830
- MOCK_URL_SLOW_FAILS: MOCK_URL_SLOW_FAILS,
17831
- MOCK_URL_WITH_CHILDREN: MOCK_URL_WITH_CHILDREN,
17832
- MOCK_URL_WITH_NO_TITLE: MOCK_URL_WITH_NO_TITLE,
17833
- MOCK_URL_WITH_NO_TITLE_OR_NAME: MOCK_URL_WITH_NO_TITLE_OR_NAME,
17834
- MOCK_URL_WITH_SUBCATEGORY: MOCK_URL_WITH_SUBCATEGORY,
17835
- mockGetLayersFlattenedFromService: mockGetLayersFlattenedFromService,
17836
- mockGetLayersFromService: mockGetLayersFromService,
17837
- mockLayersDefault: mockLayersDefault,
17838
- mockLayersDefault2: mockLayersDefault2,
17839
- mockLayersNoChildren: mockLayersNoChildren,
17840
- mockLayersWithChildren: mockLayersWithChildren,
17841
- mockLayersWithNoTitle: mockLayersWithNoTitle,
17842
- mockLayersWithNoTitleOrName: mockLayersWithNoTitleOrName,
17843
- mockLayersWithSubcategory: mockLayersWithSubcategory
17522
+ __proto__: null,
17523
+ MOCK_URL_DEFAULT: MOCK_URL_DEFAULT,
17524
+ MOCK_URL_DEFAULT2: MOCK_URL_DEFAULT2,
17525
+ MOCK_URL_HTTP: MOCK_URL_HTTP,
17526
+ MOCK_URL_INVALID: MOCK_URL_INVALID,
17527
+ MOCK_URL_NO_CHILDREN: MOCK_URL_NO_CHILDREN,
17528
+ MOCK_URL_SLOW: MOCK_URL_SLOW,
17529
+ MOCK_URL_SLOW_FAILS: MOCK_URL_SLOW_FAILS,
17530
+ MOCK_URL_WITH_CHILDREN: MOCK_URL_WITH_CHILDREN,
17531
+ MOCK_URL_WITH_NO_TITLE: MOCK_URL_WITH_NO_TITLE,
17532
+ MOCK_URL_WITH_NO_TITLE_OR_NAME: MOCK_URL_WITH_NO_TITLE_OR_NAME,
17533
+ MOCK_URL_WITH_SUBCATEGORY: MOCK_URL_WITH_SUBCATEGORY,
17534
+ mockGetLayersFlattenedFromService: mockGetLayersFlattenedFromService,
17535
+ mockGetLayersFromService: mockGetLayersFromService,
17536
+ mockLayersDefault: mockLayersDefault,
17537
+ mockLayersDefault2: mockLayersDefault2,
17538
+ mockLayersNoChildren: mockLayersNoChildren,
17539
+ mockLayersWithChildren: mockLayersWithChildren,
17540
+ mockLayersWithNoTitle: mockLayersWithNoTitle,
17541
+ mockLayersWithNoTitleOrName: mockLayersWithNoTitleOrName,
17542
+ mockLayersWithSubcategory: mockLayersWithSubcategory
17844
17543
  });
17845
17544
 
17846
17545
  const mockGetCapabilities = Object.assign(Object.assign({}, getCapabilities$1), {
@@ -17905,10 +17604,10 @@ const getLayersFlattenedFromService = (serviceUrl, forceReload = false) => {
17905
17604
  };
17906
17605
 
17907
17606
  var getCapabilities = /*#__PURE__*/Object.freeze({
17908
- __proto__: null,
17909
- getLayersFlattenedFromService: getLayersFlattenedFromService,
17910
- getLayersFromService: getLayersFromService,
17911
- recurseNodes: recurseNodes
17607
+ __proto__: null,
17608
+ getLayersFlattenedFromService: getLayersFlattenedFromService,
17609
+ getLayersFromService: getLayersFromService,
17610
+ recurseNodes: recurseNodes
17912
17611
  });
17913
17612
 
17914
- export { DateInterval, DebugType, EVENT_GETCAPABILITIES_READY, EVENT_GETCAPABILITIES_START, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMAP_LONLAT_EPSGCODE, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMListener, WMProj4Defs, WMProjection, WMSJSMAP_MINIMUM_MAP_HEIGHT, WMSJSMAP_MINIMUM_MAP_WIDTH, WMSVersion, bgImageStoreLength, buildMapLayerDims, buildWMSGetMapRequest, clearImageCacheForAllMaps, debugLogger, defaultReduxLayerRadarKNMI, detectLeftButton, detectRightButton, drawScaleBar, drawTextBG, generateLayerId, generateMapId, generateTimesliderId, getBBOXandProjString, getCapabilities, getErrorsToDisplay, getGeoCoordFromLatLong, getGeoCoordFromPixelCoord, getLatLongFromPixelCoord, getLayerIndex, getLegendGraphicURLForLayer, getPixelCoordFromGeoCoord, getPixelCoordFromLatLong, getScaleBarProperties, getSpeedDelay, getUriWithParam, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSMapIds, getWMJSTimeDimensionForLayerId, getWMLayerById, getWMSGetFeatureInfoRequestURL, getWMSRequests, handleDateUtilsISOString, isDefined, isProjectionSupported, legendImageStore, legendImageStoreLength, mapConstants, mapImageStoreLength, mockGetCapabilities, multiDimensionLayer, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, registerWMJSMap, registerWMLayer, roundWithTimeStep, speedFactors, tilesettings, toArray, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, testSettings as webmapTestSettings, utils as webmapUtils, wmServiceListener };
17613
+ export { DateInterval, DebugType, EVENT_GETCAPABILITIES_READY, EVENT_GETCAPABILITIES_START, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WEBMAP_NAMESPACE, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMAP_LONLAT_EPSGCODE, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMListener, WMProj4Defs, WMProjection, WMSJSMAP_MINIMUM_MAP_HEIGHT, WMSJSMAP_MINIMUM_MAP_WIDTH, WMSVersion, bgImageStoreLength, buildMapLayerDims, buildWMSGetMapRequest, clearImageCacheForAllMaps, debugLogger, defaultReduxLayerRadarKNMI, detectLeftButton, detectRightButton, drawScaleBar, drawTextBG, generateLayerId, generateMapId, generateTimesliderId, getBBOXandProjString, getCapabilities, getErrorsToDisplay, getGeoCoordFromLatLong, getGeoCoordFromPixelCoord, getLatLongFromPixelCoord, getLayerIndex, getLegendGraphicURLForLayer, getPixelCoordFromGeoCoord, getPixelCoordFromLatLong, getScaleBarProperties, getSpeedDelay, getUriWithParam, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSMapIds, getWMJSTimeDimensionForLayerId, getWMLayerById, getWMSGetFeatureInfoRequestURL, getWMSRequests, handleDateUtilsISOString, isDefined, isProjectionSupported, legendImageStore, legendImageStoreLength, mapConstants, mapImageStoreLength, mockGetCapabilities, multiDimensionLayer, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, registerWMJSMap, registerWMLayer, roundWithTimeStep, speedFactors, tilesettings, toArray, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, testSettings as webmapTestSettings, webmapTranslations, utils as webmapUtils, wmServiceListener };