@opengeoweb/webmap 4.17.0 → 4.18.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.
package/index.esm.js CHANGED
@@ -248,7 +248,9 @@ var debug = function debug(type, message) {
248
248
  */
249
249
 
250
250
  var isDefined = function isDefined(variable) {
251
- if (variable === null) return false;
251
+ if (variable === null) {
252
+ return false;
253
+ }
252
254
 
253
255
  if (typeof variable === 'undefined') {
254
256
  return false;
@@ -263,7 +265,9 @@ var isDefined = function isDefined(variable) {
263
265
  */
264
266
 
265
267
  var toArray = function toArray(array) {
266
- if (array === null || typeof array === 'undefined') return [];
268
+ if (array === null || typeof array === 'undefined') {
269
+ return [];
270
+ }
267
271
 
268
272
  if (array instanceof Array) {
269
273
  return array;
@@ -281,7 +285,10 @@ var toArray = function toArray(array) {
281
285
  */
282
286
 
283
287
  var WMJScheckURL = function WMJScheckURL(url) {
284
- if (!isDefined(url)) return '?';
288
+ if (!isDefined(url)) {
289
+ return '?';
290
+ }
291
+
285
292
  var trimmedUrl = url.trim();
286
293
 
287
294
  if (trimmedUrl.indexOf('?') === -1) {
@@ -308,14 +315,26 @@ var getMouseYCoordinate = function getMouseYCoordinate(event) {
308
315
  return event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
309
316
  };
310
317
  var URLDecode = function URLDecode(encodedURL) {
311
- if (!isDefined(encodedURL)) return '';
318
+ if (!isDefined(encodedURL)) {
319
+ return '';
320
+ }
321
+
312
322
  return encodedURL.replace('+', ' ').replace('%2B', '+').replace('%20', ' ').replace('%5E', '^').replace('%26', '&').replace('%3F', '?').replace('%3E', '>').replace('%3C', '<').replace('%5C', '\\').replace('%2F', '/').replace('%25', '%').replace('%3A', ':').replace('%27', "'").replace('%24', '$');
313
323
  }; // Encodes plain text to URL encoding
314
324
 
315
325
  var URLEncode = function URLEncode(plaintext) {
316
- if (!plaintext) return plaintext;
317
- if (plaintext === undefined) return plaintext;
318
- if (plaintext === '') return plaintext;
326
+ if (!plaintext) {
327
+ return plaintext;
328
+ }
329
+
330
+ if (plaintext === undefined) {
331
+ return plaintext;
332
+ }
333
+
334
+ if (plaintext === '') {
335
+ return plaintext;
336
+ }
337
+
319
338
  var SAFECHARS = '0123456789' + // Numeric
320
339
  'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + // Alphabetic
321
340
  'abcdefghijklmnopqrstuvwxyz' + "%-_.!~*'()"; // RFC2396 Mark characters
@@ -354,8 +373,15 @@ var URLEncode = function URLEncode(plaintext) {
354
373
  var getCorrectWMSDimName = function getCorrectWMSDimName(origDimName) {
355
374
  /* Adds DIM_ for dimensions other than height or time */
356
375
  var upperCaseDimName = origDimName.toUpperCase();
357
- if (upperCaseDimName === 'TIME') return upperCaseDimName;
358
- if (upperCaseDimName === 'ELEVATION') return upperCaseDimName;
376
+
377
+ if (upperCaseDimName === 'TIME') {
378
+ return upperCaseDimName;
379
+ }
380
+
381
+ if (upperCaseDimName === 'ELEVATION') {
382
+ return upperCaseDimName;
383
+ }
384
+
359
385
  return "DIM_".concat(upperCaseDimName);
360
386
  };
361
387
  /* Returns all dimensions with its current values as URL */
@@ -465,7 +491,10 @@ var dateToISO8601 = function dateToISO8601(date) {
465
491
 
466
492
  var addStylesForLayer = function addStylesForLayer(layerObjectFromWMS) {
467
493
  /* Get the Style object */
468
- if (!layerObjectFromWMS.Style) return [];
494
+ if (!layerObjectFromWMS.Style) {
495
+ return [];
496
+ }
497
+
469
498
  var layerStyles = toArray(layerObjectFromWMS.Style);
470
499
  /* Loop through the list of styles from the document, create a default object and try to fill in the object with the props from the WMS GetCapabilities document */
471
500
 
@@ -505,7 +534,10 @@ var addStylesForLayer = function addStylesForLayer(layerObjectFromWMS) {
505
534
  });
506
535
  };
507
536
  var addDimensionsForLayer = function addDimensionsForLayer(layerObjectFromWMS) {
508
- if (!layerObjectFromWMS.Dimension) return [];
537
+ if (!layerObjectFromWMS.Dimension) {
538
+ return [];
539
+ }
540
+
509
541
  var layerDimensions = toArray(layerObjectFromWMS.Dimension);
510
542
  var layerDimensionsExtents = toArray(layerObjectFromWMS.Extent);
511
543
  var dimensionList = layerDimensions.map(function (layerDimension) {
@@ -566,10 +598,19 @@ function sortArrayOfObjectsByKey(array, key) {
566
598
  var spreadArray = _toConsumableArray(array);
567
599
 
568
600
  return spreadArray.sort(function (a, b) {
569
- var x = a[key];
601
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
602
+ var x = a[key]; // eslint-disable-next-line @typescript-eslint/no-explicit-any
603
+
570
604
  var y = b[key];
571
- if (x < y) return -1;
572
- if (x > y) return 1;
605
+
606
+ if (x < y) {
607
+ return -1;
608
+ }
609
+
610
+ if (x > y) {
611
+ return 1;
612
+ }
613
+
573
614
  return 0;
574
615
  });
575
616
  }
@@ -784,7 +825,10 @@ var WMImage = /*#__PURE__*/function () {
784
825
  }, {
785
826
  key: "isLoaded",
786
827
  value: function isLoaded() {
787
- if (this._isLoading) return false;
828
+ if (this._isLoading) {
829
+ return false;
830
+ }
831
+
788
832
  return this._isLoaded;
789
833
  }
790
834
  /**
@@ -887,7 +931,8 @@ var WMImage = /*#__PURE__*/function () {
887
931
  this._srcLoaded = undefined;
888
932
 
889
933
  this._load();
890
- }
934
+ } // eslint-disable-next-line @typescript-eslint/no-explicit-any
935
+
891
936
  }, {
892
937
  key: "_getImageWithHeaders",
893
938
  value: function _getImageWithHeaders(url, headers) {
@@ -1314,7 +1359,10 @@ var WMBBOX = /*#__PURE__*/function () {
1314
1359
  try {
1315
1360
  var _a = left.split(',');
1316
1361
 
1317
- if (_a.length !== 4) return;
1362
+ if (_a.length !== 4) {
1363
+ return;
1364
+ }
1365
+
1318
1366
  this.left = parseFloat(_a[0]);
1319
1367
  this.bottom = parseFloat(_a[1]);
1320
1368
  this.right = parseFloat(_a[2]);
@@ -1327,10 +1375,21 @@ var WMBBOX = /*#__PURE__*/function () {
1327
1375
  /* Apply defaults to invalid values */
1328
1376
 
1329
1377
 
1330
- if (this.left == null) this.left = -180;
1331
- if (this.right == null) this.right = 180;
1332
- if (this.bottom == null) this.bottom = -90;
1333
- if (this.top == null) this.top = 90;
1378
+ if (this.left == null) {
1379
+ this.left = -180;
1380
+ }
1381
+
1382
+ if (this.right == null) {
1383
+ this.right = 180;
1384
+ }
1385
+
1386
+ if (this.bottom == null) {
1387
+ this.bottom = -90;
1388
+ }
1389
+
1390
+ if (this.top == null) {
1391
+ this.top = 90;
1392
+ }
1334
1393
  }
1335
1394
  /*
1336
1395
  * Compares two boundingboxes and returns true if they are equal
@@ -1451,11 +1510,13 @@ var WMListener = /*#__PURE__*/function () {
1451
1510
  }, {
1452
1511
  key: "suspendEvent",
1453
1512
  value: function suspendEvent(name) {
1513
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1454
1514
  this._suspendedEvents[name] = true;
1455
1515
  }
1456
1516
  }, {
1457
1517
  key: "resumeEvent",
1458
1518
  value: function resumeEvent(name) {
1519
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1459
1520
  this._suspendedEvents[name] = false;
1460
1521
  }
1461
1522
  }, {
@@ -1472,7 +1533,8 @@ var WMListener = /*#__PURE__*/function () {
1472
1533
  }, {
1473
1534
  key: "triggerEvent",
1474
1535
  value: function triggerEvent(name, param) {
1475
- if (this._allEventsSuspended === true || this._suspendedEvents[name] === true) {
1536
+ if (this._allEventsSuspended === true || // eslint-disable-next-line @typescript-eslint/no-explicit-any
1537
+ this._suspendedEvents[name] === true) {
1476
1538
  return [];
1477
1539
  }
1478
1540
 
@@ -1655,7 +1717,10 @@ _bbox) {
1655
1717
  var cachedImage = imageStore.getImageForSrc(altImage.imageSource);
1656
1718
  return cachedImage && cachedImage.isLoaded() && !cachedImage.isLoading() && !cachedImage.hasError();
1657
1719
  });
1658
- if (index !== -1) return sortedImagesForUrl[index];
1720
+
1721
+ if (index !== -1) {
1722
+ return sortedImagesForUrl[index];
1723
+ }
1659
1724
  }
1660
1725
 
1661
1726
  return null;
@@ -1875,7 +1940,10 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
1875
1940
  }, {
1876
1941
  key: "finishedLoading",
1877
1942
  value: function finishedLoading() {
1878
- if (this.ready) return;
1943
+ if (this.ready) {
1944
+ return;
1945
+ }
1946
+
1879
1947
  this.ready = true;
1880
1948
 
1881
1949
  for (var j = 0; j < this.layers.length; j += 1) {
@@ -1899,7 +1967,11 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
1899
1967
  value: function resize(w, h) {
1900
1968
  var width = parseInt(w, 10);
1901
1969
  var height = parseInt(h, 10);
1902
- if (this._width === width && this._height === height) return;
1970
+
1971
+ if (this._width === width && this._height === height) {
1972
+ return;
1973
+ }
1974
+
1903
1975
  this._width = width;
1904
1976
  this._height = height;
1905
1977
  this.canvas.width = width;
@@ -2028,7 +2100,10 @@ var WMJSAnimate = /*#__PURE__*/function () {
2028
2100
  _map.isAnimating = false;
2029
2101
 
2030
2102
  _map.setAnimationDelay = function (delay) {
2031
- if (delay < 1) delay = 1;
2103
+ if (delay < 1) {
2104
+ delay = 1;
2105
+ }
2106
+
2032
2107
  _map.animationDelay = delay;
2033
2108
  };
2034
2109
 
@@ -2090,8 +2165,14 @@ var WMJSAnimate = /*#__PURE__*/function () {
2090
2165
  }, {
2091
2166
  key: "_animate",
2092
2167
  value: function _animate() {
2093
- if (this._map.isAnimating === false) return;
2094
- if (this._map.animateBusy === true) return;
2168
+ if (this._map.isAnimating === false) {
2169
+ return;
2170
+ }
2171
+
2172
+ if (this._map.animateBusy === true) {
2173
+ return;
2174
+ }
2175
+
2095
2176
  var animationStep = this._map.animationList[this._map.currentAnimationStep];
2096
2177
 
2097
2178
  if (!animationStep) {
@@ -2212,7 +2293,9 @@ var WMJSAnimate = /*#__PURE__*/function () {
2212
2293
  index -= this._map.animationList.length;
2213
2294
  }
2214
2295
 
2215
- if (index < 0) index = 0;
2296
+ if (index < 0) {
2297
+ index = 0;
2298
+ }
2216
2299
 
2217
2300
  if (index >= 0) {
2218
2301
  var animationStep = this._map.animationList[index];
@@ -2245,7 +2328,10 @@ var WMJSAnimate = /*#__PURE__*/function () {
2245
2328
  }, {
2246
2329
  key: "stopAnimating",
2247
2330
  value: function stopAnimating() {
2248
- if (this._map.isAnimating === false) return;
2331
+ if (this._map.isAnimating === false) {
2332
+ return;
2333
+ }
2334
+
2249
2335
  this._map._animationList = undefined;
2250
2336
  this._divAnimationInfo.style.display = 'none';
2251
2337
  this._map.isAnimating = false;
@@ -2279,9 +2365,18 @@ var WMTileRenderer = /*#__PURE__*/function () {
2279
2365
  /* Temporal mappings from bgmaps.cgi service names to names defined here */
2280
2366
 
2281
2367
 
2282
- if (layerName === 'streetmap') layerName = 'OSM';
2283
- if (layerName === 'pdok') layerName = 'OSM';
2284
- if (layerName === 'naturalearth2') layerName = 'NaturalEarth2';
2368
+ if (layerName === 'streetmap') {
2369
+ layerName = 'OSM';
2370
+ }
2371
+
2372
+ if (layerName === 'pdok') {
2373
+ layerName = 'OSM';
2374
+ }
2375
+
2376
+ if (layerName === 'naturalearth2') {
2377
+ layerName = 'NaturalEarth2';
2378
+ }
2379
+
2285
2380
  var tileLayer = tileOptions[layerName];
2286
2381
 
2287
2382
  if (!tileLayer) {
@@ -2315,10 +2410,23 @@ var WMTileRenderer = /*#__PURE__*/function () {
2315
2410
  var initialResolution = 2 * pi * 6378137 / tileSize;
2316
2411
  var originShiftX = -2 * pi * 6378137 / 2.0;
2317
2412
  var originShiftY = 2 * pi * 6378137 / 2.0;
2318
- if (tileSettings.tileSize) tileSize = tileSettings.tileSize;
2319
- if (tileSettings.resolution) initialResolution = tileSettings.resolution;
2320
- if (tileSettings.origX) originShiftX = tileSettings.origX;
2321
- if (tileSettings.origY) originShiftY = tileSettings.origY;
2413
+
2414
+ if (tileSettings.tileSize) {
2415
+ tileSize = tileSettings.tileSize;
2416
+ }
2417
+
2418
+ if (tileSettings.resolution) {
2419
+ initialResolution = tileSettings.resolution;
2420
+ }
2421
+
2422
+ if (tileSettings.origX) {
2423
+ originShiftX = tileSettings.origX;
2424
+ }
2425
+
2426
+ if (tileSettings.origY) {
2427
+ originShiftY = tileSettings.origY;
2428
+ }
2429
+
2322
2430
  var screenWidth = width;
2323
2431
  var bboxw = currentBBOX.right - currentBBOX.left;
2324
2432
  var originShiftX2 = initialResolution * tileSize + originShiftX;
@@ -2345,8 +2453,14 @@ var WMTileRenderer = /*#__PURE__*/function () {
2345
2453
  var tileServerFormat = tileSettings.tileServerFormat || 'png';
2346
2454
  var tmsEnabled = tileSettings.tms || false; // 'osm' or 'argisonline'
2347
2455
 
2348
- if (level < tileSettings.minLevel) level = tileSettings.minLevel;
2349
- if (level > tileSettings.maxLevel) level = tileSettings.maxLevel;
2456
+ if (level < tileSettings.minLevel) {
2457
+ level = tileSettings.minLevel;
2458
+ }
2459
+
2460
+ if (level > tileSettings.maxLevel) {
2461
+ level = tileSettings.maxLevel;
2462
+ }
2463
+
2350
2464
  var numTilesAtLevel = Math.pow(2, level);
2351
2465
  var numTilesAtLevelX = tileSetWidth / (initialResolution / numTilesAtLevel * tileSize);
2352
2466
  var numTilesAtLevelY = tileSetHeight / (initialResolution / numTilesAtLevel * tileSize);
@@ -2395,7 +2509,7 @@ var WMTileRenderer = /*#__PURE__*/function () {
2395
2509
  x: bounds.right,
2396
2510
  y: bounds.top
2397
2511
  }, newBBOX, width, height);
2398
- var imageURL;
2512
+ var imageURL = '';
2399
2513
 
2400
2514
  if (tileServerType === 'osm') {
2401
2515
  if (tmsEnabled) {
@@ -2458,14 +2572,37 @@ var WMTileRenderer = /*#__PURE__*/function () {
2458
2572
  numTilesAtLevelX *= 2;
2459
2573
  }
2460
2574
 
2461
- if (tilenbottom < 1) tilenbottom = 1;
2462
- if (tilenbottom > numTilesAtLevelY) tilenbottom = numTilesAtLevelY;
2463
- if (tilenleft < 1) tilenleft = 1;
2464
- if (tilenleft > numTilesAtLevelX) tilenleft = numTilesAtLevelX;
2465
- if (tilentop < 1) tilentop = 1;
2466
- if (tilentop > numTilesAtLevelY) tilentop = numTilesAtLevelY;
2467
- if (tilenright < 1) tilenright = 1;
2468
- if (tilenright > numTilesAtLevelX) tilenright = numTilesAtLevelX;
2575
+ if (tilenbottom < 1) {
2576
+ tilenbottom = 1;
2577
+ }
2578
+
2579
+ if (tilenbottom > numTilesAtLevelY) {
2580
+ tilenbottom = numTilesAtLevelY;
2581
+ }
2582
+
2583
+ if (tilenleft < 1) {
2584
+ tilenleft = 1;
2585
+ }
2586
+
2587
+ if (tilenleft > numTilesAtLevelX) {
2588
+ tilenleft = numTilesAtLevelX;
2589
+ }
2590
+
2591
+ if (tilentop < 1) {
2592
+ tilentop = 1;
2593
+ }
2594
+
2595
+ if (tilentop > numTilesAtLevelY) {
2596
+ tilentop = numTilesAtLevelY;
2597
+ }
2598
+
2599
+ if (tilenright < 1) {
2600
+ tilenright = 1;
2601
+ }
2602
+
2603
+ if (tilenright > numTilesAtLevelX) {
2604
+ tilenright = numTilesAtLevelX;
2605
+ }
2469
2606
 
2470
2607
  if (tilentop - tilenbottom > 20) {
2471
2608
  debug(DebugType.Error);
@@ -2486,8 +2623,14 @@ var WMTileRenderer = /*#__PURE__*/function () {
2486
2623
 
2487
2624
  drawBGTiles(level);
2488
2625
  imagesToRender.sort(function (imageA, imageB) {
2489
- if (imageA.level < imageB.level) return -1;
2490
- if (imageA.level > imageB.level) return 1;
2626
+ if (imageA.level < imageB.level) {
2627
+ return -1;
2628
+ }
2629
+
2630
+ if (imageA.level > imageB.level) {
2631
+ return 1;
2632
+ }
2633
+
2491
2634
  return 0;
2492
2635
  });
2493
2636
 
@@ -2537,7 +2680,11 @@ var getLegendGraphicURLForLayer = function getLegendGraphicURLForLayer(layer) {
2537
2680
 
2538
2681
  if (layer) {
2539
2682
  var legendURL = layer.legendGraphic;
2540
- if (!legendURL) return undefined; // For THREDDS WMS we need to add layers=
2683
+
2684
+ if (!legendURL) {
2685
+ return undefined;
2686
+ } // For THREDDS WMS we need to add layers=
2687
+
2541
2688
 
2542
2689
  if (!legendURL.includes('&layers=')) {
2543
2690
  legendURL += "&layers=".concat(URLEncode(layer.name), "&");
@@ -2634,7 +2781,11 @@ var DateInterval = /*#__PURE__*/function () {
2634
2781
  this.minute = parseInt(minute, 10);
2635
2782
  this.second = parseInt(second, 10);
2636
2783
  this.isRegularInterval = false;
2637
- if (this.month === 0 && this.year === 0) this.isRegularInterval = true;
2784
+
2785
+ if (this.month === 0 && this.year === 0) {
2786
+ this.isRegularInterval = true;
2787
+ }
2788
+
2638
2789
  this.getTime = this.getTime.bind(this);
2639
2790
  this.toISO8601 = this.toISO8601.bind(this);
2640
2791
  }
@@ -2646,8 +2797,14 @@ var DateInterval = /*#__PURE__*/function () {
2646
2797
  /* Months and years are unequally distributed in time
2647
2798
  So get time is not possible */
2648
2799
 
2649
- if (this.month !== 0) throw new Error('month !== 0');
2650
- if (this.year !== 0) throw new Error('year !== 0');
2800
+ if (this.month !== 0) {
2801
+ throw new Error('month !== 0');
2802
+ }
2803
+
2804
+ if (this.year !== 0) {
2805
+ throw new Error('year !== 0');
2806
+ }
2807
+
2651
2808
  timeres += this.day * 60 * 60 * 24;
2652
2809
  timeres += this.hour * 60 * 60;
2653
2810
  timeres += this.minute * 60;
@@ -2659,17 +2816,35 @@ var DateInterval = /*#__PURE__*/function () {
2659
2816
  key: "toISO8601",
2660
2817
  value: function toISO8601() {
2661
2818
  var isoTime = 'P';
2662
- if (this.year !== 0) isoTime += "".concat(this.year, "Y");
2663
- if (this.month !== 0) isoTime += "".concat(this.month, "M");
2664
- if (this.day !== 0) isoTime += "".concat(this.day, "D");
2819
+
2820
+ if (this.year !== 0) {
2821
+ isoTime += "".concat(this.year, "Y");
2822
+ }
2823
+
2824
+ if (this.month !== 0) {
2825
+ isoTime += "".concat(this.month, "M");
2826
+ }
2827
+
2828
+ if (this.day !== 0) {
2829
+ isoTime += "".concat(this.day, "D");
2830
+ }
2665
2831
 
2666
2832
  if (this.hour !== 0 && this.minute !== 0 && this.second !== 0) {
2667
2833
  isoTime += 'T';
2668
2834
  }
2669
2835
 
2670
- if (this.hour !== 0) isoTime += "".concat(this.hour, "H");
2671
- if (this.minute !== 0) isoTime += "".concat(this.minute, "M");
2672
- if (this.second !== 0) isoTime += "".concat(this.second, "S");
2836
+ if (this.hour !== 0) {
2837
+ isoTime += "".concat(this.hour, "H");
2838
+ }
2839
+
2840
+ if (this.minute !== 0) {
2841
+ isoTime += "".concat(this.minute, "M");
2842
+ }
2843
+
2844
+ if (this.second !== 0) {
2845
+ isoTime += "".concat(this.second, "S");
2846
+ }
2847
+
2673
2848
  return isoTime;
2674
2849
  }
2675
2850
  }]);
@@ -2721,16 +2896,29 @@ var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime)
2721
2896
  */
2722
2897
  var makeISO8601StringFromFlexibleWMSDateString = function makeISO8601StringFromFlexibleWMSDateString(isoString) {
2723
2898
  // Datestring starting with a - token are not supported.
2724
- if (!isoString || isoString.startsWith('-')) return isoString;
2725
- if (isoString.length === 4) return "".concat(isoString, "-01-01T00:00:00Z"); // YYYY
2899
+ if (!isoString || isoString.startsWith('-')) {
2900
+ return isoString;
2901
+ }
2902
+
2903
+ var trimmed = isoString.trim();
2726
2904
 
2727
- if (isoString.length === 7) return "".concat(isoString, "-01T00:00:00Z"); // YYYY-MM
2905
+ if (trimmed.length === 4) {
2906
+ return "".concat(trimmed, "-01-01T00:00:00Z"); // YYYY
2907
+ }
2908
+
2909
+ if (trimmed.length === 7) {
2910
+ return "".concat(trimmed, "-01T00:00:00Z"); // YYYY-MM
2911
+ }
2728
2912
 
2729
- if (isoString.length === 10) return "".concat(isoString, "T00:00:00Z"); // YYYY-MM-DD
2913
+ if (trimmed.length === 10) {
2914
+ return "".concat(trimmed, "T00:00:00Z"); // YYYY-MM-DD
2915
+ }
2730
2916
 
2731
- if (isoString.length === 14) return "".concat(isoString.slice(0, -1), ":00:00Z"); // YYYY-MM-DDTHHZ
2917
+ if (trimmed.length === 14) {
2918
+ return "".concat(trimmed.slice(0, -1), ":00:00Z"); // YYYY-MM-DDTHHZ
2919
+ }
2732
2920
 
2733
- return isoString;
2921
+ return trimmed;
2734
2922
  };
2735
2923
 
2736
2924
  var isotime = makeISO8601StringFromFlexibleWMSDateString(unvalidatedIsotime);
@@ -2752,7 +2940,9 @@ var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime)
2752
2940
  var date = new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds));
2753
2941
 
2754
2942
  date.add = function (dateInterval) {
2755
- if (!dateInterval) return;
2943
+ if (!dateInterval) {
2944
+ return;
2945
+ }
2756
2946
 
2757
2947
  if (dateInterval.isRegularInterval === false) {
2758
2948
  if (dateInterval.year !== 0) {
@@ -2784,7 +2974,9 @@ var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime)
2784
2974
  };
2785
2975
 
2786
2976
  date.substract = function (dateInterval) {
2787
- if (!dateInterval) return;
2977
+ if (!dateInterval) {
2978
+ return;
2979
+ }
2788
2980
 
2789
2981
  if (dateInterval.isRegularInterval === false) {
2790
2982
  if (dateInterval.year !== 0) {
@@ -2816,7 +3008,9 @@ var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime)
2816
3008
  };
2817
3009
 
2818
3010
  date.addMultipleTimes = function (dateInterval, numberOfSteps) {
2819
- if (!dateInterval) return;
3011
+ if (!dateInterval) {
3012
+ return;
3013
+ }
2820
3014
 
2821
3015
  if (dateInterval.isRegularInterval === false) {
2822
3016
  if (dateInterval.year !== 0) {
@@ -2848,7 +3042,9 @@ var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime)
2848
3042
  };
2849
3043
 
2850
3044
  date.substractMultipleTimes = function (dateInterval, numberOfSteps) {
2851
- if (!dateInterval) return;
3045
+ if (!dateInterval) {
3046
+ return;
3047
+ }
2852
3048
 
2853
3049
  if (dateInterval.isRegularInterval === false) {
2854
3050
  if (dateInterval.year !== 0) {
@@ -2911,8 +3107,17 @@ var parseISO8601DateToDate = function parseISO8601DateToDate(unvalidatedIsotime)
2911
3107
 
2912
3108
  /** ****************************************************** */
2913
3109
 
2914
- var parseISO8601IntervalToDateInterval = function parseISO8601IntervalToDateInterval(isotime) {
2915
- if (!isotime || isotime.charAt(0) !== 'P') return undefined;
3110
+ var parseISO8601IntervalToDateInterval = function parseISO8601IntervalToDateInterval(_isotime) {
3111
+ if (!_isotime) {
3112
+ return undefined;
3113
+ }
3114
+
3115
+ var isotime = _isotime.trim();
3116
+
3117
+ if (isotime.charAt(0) !== 'P') {
3118
+ return undefined;
3119
+ }
3120
+
2916
3121
  var splittedOnT = isotime.split('T');
2917
3122
  var years = '0';
2918
3123
  var months = '0';
@@ -2937,7 +3142,11 @@ var parseISO8601IntervalToDateInterval = function parseISO8601IntervalToDateInte
2937
3142
 
2938
3143
  if (dayIndex !== -1) {
2939
3144
  var start = yearIndex;
2940
- if (monthIndex !== -1) start = monthIndex;
3145
+
3146
+ if (monthIndex !== -1) {
3147
+ start = monthIndex;
3148
+ }
3149
+
2941
3150
  days = YYYYMMDDPart.substring(start + 1, dayIndex);
2942
3151
  }
2943
3152
  } // parse the right part
@@ -2962,7 +3171,11 @@ var parseISO8601IntervalToDateInterval = function parseISO8601IntervalToDateInte
2962
3171
 
2963
3172
  if (secondIndex !== -1) {
2964
3173
  var _start = hourIndex;
2965
- if (minuteIndex !== -1) _start = minuteIndex;
3174
+
3175
+ if (minuteIndex !== -1) {
3176
+ _start = minuteIndex;
3177
+ }
3178
+
2966
3179
  seconds = HHMMSSPart.substring(_start + 1, secondIndex);
2967
3180
  }
2968
3181
  }
@@ -2980,7 +3193,10 @@ var parseISO8601IntervalToDateInterval = function parseISO8601IntervalToDateInte
2980
3193
  /** ******************************************************* */
2981
3194
 
2982
3195
  function getNumberOfTimeSteps(starttime, stoptime, interval) {
2983
- if (!starttime || !stoptime || !interval) return undefined;
3196
+ if (!starttime || !stoptime || !interval) {
3197
+ return undefined;
3198
+ }
3199
+
2984
3200
  var steps = 0;
2985
3201
 
2986
3202
  if (interval.month !== 0 || interval.year !== 0) {
@@ -3011,7 +3227,9 @@ var ParseISOTimeRangeDuration = /*#__PURE__*/function () {
3011
3227
  this.initialized = false;
3012
3228
  var times = isoTimeRangeDuration.split('/'); // Some safety checks
3013
3229
 
3014
- if (times[2] === undefined) times[2] = 'PT1M';
3230
+ if (times[2] === undefined) {
3231
+ times[2] = 'PT1M';
3232
+ }
3015
3233
 
3016
3234
  if (times[1] === undefined) {
3017
3235
  // eslint-disable-next-line prefer-destructuring
@@ -3122,7 +3340,10 @@ var ParseISOTimeRangeDuration = /*#__PURE__*/function () {
3122
3340
  return this.timeSteps - 1;
3123
3341
  }
3124
3342
 
3125
- if (currentDateTime > this.stopTime.getTime()) return this.timeSteps - 1;
3343
+ if (currentDateTime > this.stopTime.getTime()) {
3344
+ return this.timeSteps - 1;
3345
+ }
3346
+
3126
3347
  var timeStep = 0;
3127
3348
 
3128
3349
  if (this.timeInterval.isRegularInterval === false) {
@@ -3317,7 +3538,9 @@ var WMJSDimension = /*#__PURE__*/function () {
3317
3538
 
3318
3539
  if (this._type === 'timestartstopres') {
3319
3540
  /* Compose a new dataString interval and re-initialize the time dimension */
3320
- var dateStringItems = this.values.split('/');
3541
+ var dateStringItems = this.values.split('/').map(function (value) {
3542
+ return value.trim();
3543
+ });
3321
3544
  var dateStringInterval = dateStringItems[2];
3322
3545
  var newValue = "".concat(newStartValueTimeAsMoment.toISOString(), "/").concat(newEndValueTimeAsMoment.toISOString(), "/").concat(dateStringInterval);
3323
3546
  this.defaultValue = newEndValueTimeAsMoment.toISOString();
@@ -3335,7 +3558,10 @@ var WMJSDimension = /*#__PURE__*/function () {
3335
3558
  var newValues = '';
3336
3559
 
3337
3560
  for (var j = 0; j < newArray.length; j += 1) {
3338
- if (j > 0) newValues += ',';
3561
+ if (j > 0) {
3562
+ newValues += ',';
3563
+ }
3564
+
3339
3565
  newValues += newArray[j].toISO8601();
3340
3566
  }
3341
3567
 
@@ -3355,14 +3581,21 @@ var WMJSDimension = /*#__PURE__*/function () {
3355
3581
  value: function initialize() {
3356
3582
  var forceothervalues = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
3357
3583
  var forceReferenceTimeValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3358
- if (this._initialized === true) return;
3584
+
3585
+ if (this._initialized === true) {
3586
+ return;
3587
+ }
3588
+
3359
3589
  var ogcdimvalues = this.values;
3360
3590
 
3361
3591
  if (forceothervalues) {
3362
3592
  ogcdimvalues = forceothervalues;
3363
3593
  }
3364
3594
 
3365
- if (!isDefined(ogcdimvalues)) return;
3595
+ if (!isDefined(ogcdimvalues)) {
3596
+ return;
3597
+ }
3598
+
3366
3599
  this._allValues = [];
3367
3600
  this._initialized = true;
3368
3601
 
@@ -3383,10 +3616,14 @@ var WMJSDimension = /*#__PURE__*/function () {
3383
3616
  var values = ogcdimvalues.split(',');
3384
3617
 
3385
3618
  for (var j = 0; j < values.length; j += 1) {
3386
- var valuesRanged = values[j].split('/');
3619
+ var valuesRangedNoTrim = values[j].split('/');
3387
3620
 
3388
- if (valuesRanged.length === 3) {
3621
+ if (valuesRangedNoTrim.length === 3) {
3622
+ var valuesRanged = valuesRangedNoTrim.map(function (value) {
3623
+ return value.trim();
3624
+ });
3389
3625
  /* Can be either time like '2021-03-17T06:00:00Z/2021-03-21T00:00:00Z/PT6H' or something else, like '0/24/2' */
3626
+
3390
3627
  if (valuesRanged[2].charAt(0) === 'P') {
3391
3628
  var partTimeRanges = new ParseISOTimeRangeDuration(values[j]);
3392
3629
 
@@ -3404,8 +3641,14 @@ var WMJSDimension = /*#__PURE__*/function () {
3404
3641
  var stop = parseFloat(valuesRanged[1]);
3405
3642
  var res = parseFloat(valuesRanged[2]);
3406
3643
  stop += res;
3407
- if (start > stop) stop = start;
3408
- if (res <= 0) res = 1;
3644
+
3645
+ if (start > stop) {
3646
+ stop = start;
3647
+ }
3648
+
3649
+ if (res <= 0) {
3650
+ res = 1;
3651
+ }
3409
3652
 
3410
3653
  for (var j2 = start; j2 < stop; j2 += res) {
3411
3654
  this._allValues.push(String(j2));
@@ -3424,26 +3667,39 @@ var WMJSDimension = /*#__PURE__*/function () {
3424
3667
  }
3425
3668
  }
3426
3669
  }
3670
+ /* If no default value is given, take the last / most recent one */
3427
3671
 
3428
- if (!isDefined(this.defaultValue)) {
3429
- this.defaultValue = this.getValueForIndex(0);
3672
+
3673
+ if (!isDefined(this.defaultValue) || this.defaultValue === '') {
3674
+ this.defaultValue = this.getLastValue();
3675
+ }
3676
+ /* Check if the string 'current' is given, and find the closest value inside the dimension */
3677
+
3678
+
3679
+ if (this.defaultValue === 'current') {
3680
+ this.defaultValue = this.getClosestValue(moment().utc().format('YYYY-MM-DDTHH:mm:ss[Z]'), true);
3430
3681
  }
3431
3682
  /* If no currentvalue is set, set the default */
3432
3683
 
3433
3684
 
3434
- if (!isDefined(this.currentValue)) {
3435
- this.currentValue = this.getFirstValue();
3685
+ if (!this.currentValue || this.currentValue.length === 0) {
3686
+ this.currentValue = this.defaultValue;
3436
3687
  }
3437
3688
  /* Check for out of range values and adjust accordingly to a valid range */
3438
3689
 
3439
3690
 
3440
3691
  var index = this.getIndexForValue(this.currentValue);
3441
- if (index === -2) this.currentValue = this.getLastValue(); // Date is past the latest (-2), so set it to the last value
3442
3692
 
3443
- if (index === -1) this.currentValue = this.getFirstValue(); // Date is past the first (-1), so set it to the first value
3693
+ if (index === -2) {
3694
+ this.currentValue = this.getLastValue(); // Date is past the latest (-2), so set it to the last value
3695
+ }
3444
3696
 
3697
+ if (index === -1) {
3698
+ this.currentValue = this.getFirstValue(); // Date is past the first (-1), so set it to the first value
3699
+ }
3445
3700
  /* In case of reference time, the time dimension range is changed, check if the current time still fits in that range */
3446
3701
 
3702
+
3447
3703
  if (forceReferenceTimeValue) {
3448
3704
  if (this.getIndexForValue(this.currentValue, true) < 0) {
3449
3705
  this.currentValue = this.getClosestValue(this.currentValue);
@@ -3590,7 +3846,11 @@ var WMJSDimension = /*#__PURE__*/function () {
3590
3846
 
3591
3847
  if (newValue === 'middle') {
3592
3848
  var middleIndex = Math.ceil(this.size() / 2) - 1;
3593
- if (middleIndex < 0) middleIndex = 0;
3849
+
3850
+ if (middleIndex < 0) {
3851
+ middleIndex = 0;
3852
+ }
3853
+
3594
3854
  return this.getValueForIndex(middleIndex);
3595
3855
  }
3596
3856
 
@@ -3610,7 +3870,11 @@ var WMJSDimension = /*#__PURE__*/function () {
3610
3870
  value = this.getValueForIndex(index);
3611
3871
  } catch (e) {
3612
3872
  if (typeof e.message === 'number') {
3613
- if (e.message === 0) value = WMDateTooEarlyString;else value = WMDateTooLateString;
3873
+ if (e.message === 0) {
3874
+ value = WMDateTooEarlyString;
3875
+ } else {
3876
+ value = WMDateTooLateString;
3877
+ }
3614
3878
  }
3615
3879
  }
3616
3880
 
@@ -3652,8 +3916,14 @@ var WMJSDimension = /*#__PURE__*/function () {
3652
3916
  return this._timeRangeDurationDate.getDateAtTimeStep(index);
3653
3917
  }
3654
3918
 
3655
- if (this._type === 'timevalues') return this._allValues[index];
3656
- if (this._type === 'anyvalue') return this._allValues[index];
3919
+ if (this._type === 'timevalues') {
3920
+ return this._allValues[index];
3921
+ }
3922
+
3923
+ if (this._type === 'anyvalue') {
3924
+ return this._allValues[index];
3925
+ }
3926
+
3657
3927
  return null;
3658
3928
  }
3659
3929
  /**
@@ -3665,7 +3935,11 @@ var WMJSDimension = /*#__PURE__*/function () {
3665
3935
  key: "getDimInterval",
3666
3936
  value: function getDimInterval() {
3667
3937
  this.initialize();
3668
- if (!this.dimTimeInterval) return undefined;
3938
+
3939
+ if (!this.dimTimeInterval) {
3940
+ return undefined;
3941
+ }
3942
+
3669
3943
  var _this$dimTimeInterval = this.dimTimeInterval,
3670
3944
  year = _this$dimTimeInterval.year,
3671
3945
  month = _this$dimTimeInterval.month,
@@ -3739,7 +4013,10 @@ var WMJSDimension = /*#__PURE__*/function () {
3739
4013
 
3740
4014
  return this._timeRangeDurationDate.getTimeStepFromDate(value, outSideOfRangeFlag);
3741
4015
  } catch (e) {
3742
- if (parseInt(e.message, 10) === 0) return -1;
4016
+ if (parseInt(e.message, 10) === 0) {
4017
+ return -1;
4018
+ }
4019
+
3743
4020
  return -2;
3744
4021
  }
3745
4022
  }
@@ -3747,7 +4024,7 @@ var WMJSDimension = /*#__PURE__*/function () {
3747
4024
  if (this._type === 'timevalues') {
3748
4025
  try {
3749
4026
  var dateToFind = parseISO8601DateToDate(value).getTime();
3750
- var minDistance;
4027
+ var minDistance = null;
3751
4028
  var foundIndex = 0;
3752
4029
  var minTime = null;
3753
4030
  var maxTime = null;
@@ -3755,11 +4032,23 @@ var WMJSDimension = /*#__PURE__*/function () {
3755
4032
  for (var j = 0; j < this._allValues.length; j += 1) {
3756
4033
  var time = this._allDates[j].getTime();
3757
4034
 
3758
- if (time < minTime || minTime === null) minTime = time;
3759
- if (time > maxTime || maxTime === null) maxTime = time;
4035
+ if (time < minTime || minTime === null) {
4036
+ minTime = time;
4037
+ }
4038
+
4039
+ if (time > maxTime || maxTime === null) {
4040
+ maxTime = time;
4041
+ }
4042
+
3760
4043
  var distance = time - dateToFind;
3761
- if (distance < 0) distance = -distance;
3762
- if (j === 0) minDistance = distance;
4044
+
4045
+ if (distance < 0) {
4046
+ distance = -distance;
4047
+ }
4048
+
4049
+ if (j === 0) {
4050
+ minDistance = distance;
4051
+ }
3763
4052
 
3764
4053
  if (distance < minDistance) {
3765
4054
  minDistance = distance;
@@ -3768,8 +4057,13 @@ var WMJSDimension = /*#__PURE__*/function () {
3768
4057
  }
3769
4058
 
3770
4059
  if (outSideOfRangeFlag) {
3771
- if (minTime > dateToFind) return -1;
3772
- if (maxTime < dateToFind) return -2;
4060
+ if (minTime > dateToFind) {
4061
+ return -1;
4062
+ }
4063
+
4064
+ if (maxTime < dateToFind) {
4065
+ return -2;
4066
+ }
3773
4067
  }
3774
4068
 
3775
4069
  return foundIndex;
@@ -3781,7 +4075,9 @@ var WMJSDimension = /*#__PURE__*/function () {
3781
4075
 
3782
4076
  if (this._type === 'anyvalue') {
3783
4077
  for (var _j2 = 0; _j2 < this._allValues.length; _j2 += 1) {
3784
- if (this._allValues[_j2] === value) return _j2;
4078
+ if (this._allValues[_j2] === value) {
4079
+ return _j2;
4080
+ }
3785
4081
  }
3786
4082
  }
3787
4083
 
@@ -3892,7 +4188,9 @@ var MapPin = /*#__PURE__*/function () {
3892
4188
  };
3893
4189
 
3894
4190
  this.repositionMapPin = function (_bbox) {
3895
- if (!_bbox) return;
4191
+ if (!_bbox) {
4192
+ return;
4193
+ }
3896
4194
 
3897
4195
  var newpos = _this._map.getPixelCoordFromGeoCoord({
3898
4196
  x: _this.geoPosX,
@@ -3905,8 +4203,14 @@ var MapPin = /*#__PURE__*/function () {
3905
4203
  this.setMapPin = function (_x, _y, _bbox) {
3906
4204
  var x = _x;
3907
4205
  var y = _y;
3908
- if (!x || !y) return;
3909
- if (_this.disableMapPin && !_bbox) return; // we still want to update the pin position when the bbox changes.
4206
+
4207
+ if (!x || !y) {
4208
+ return;
4209
+ }
4210
+
4211
+ if (_this.disableMapPin && !_bbox) {
4212
+ return; // we still want to update the pin position when the bbox changes.
4213
+ }
3910
4214
 
3911
4215
  _this.x = parseInt(x, 10);
3912
4216
  _this.y = parseInt(y, 10);
@@ -4021,10 +4325,12 @@ var getBBOXandProjString = function getBBOXandProjString(map, layer) {
4021
4325
  }; // Build a valid WMS request for a certain layer
4022
4326
 
4023
4327
  var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
4024
- if (!isDefined(layer.name)) return {
4025
- url: undefined,
4026
- headers: null
4027
- };
4328
+ if (!isDefined(layer.name)) {
4329
+ return {
4330
+ url: undefined,
4331
+ headers: null
4332
+ };
4333
+ }
4028
4334
 
4029
4335
  var _map$getProjection2 = map.getProjection(),
4030
4336
  srs = _map$getProjection2.srs;
@@ -4039,10 +4345,13 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
4039
4345
  layer.format = 'image/png';
4040
4346
  }
4041
4347
 
4042
- if (layer.name.length < 1) return {
4043
- url: undefined,
4044
- headers: null
4045
- }; // GetFeatureInfo timeseries in the mapview
4348
+ if (layer.name.length < 1) {
4349
+ return {
4350
+ url: undefined,
4351
+ headers: null
4352
+ };
4353
+ } // GetFeatureInfo timeseries in the mapview
4354
+
4046
4355
 
4047
4356
  if (srs === 'GFI:TIME_ELEVATION') {
4048
4357
  var x = 707;
@@ -4136,8 +4445,10 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
4136
4445
 
4137
4446
  var SCALE_DELAY = 10;
4138
4447
  var ZOOMED_CALLBACK_DELAY = 500;
4448
+ var THROTTLE_OPTIONS = {
4449
+ noTrailing: true
4450
+ };
4139
4451
  var THROTTLE_WAIT_TIME = 300;
4140
- var THROTTLE_NO_TRAILING = true;
4141
4452
 
4142
4453
  var WMFlyToBBox = function WMFlyToBBox(wmMap) {
4143
4454
  var _this = this;
@@ -4146,7 +4457,6 @@ var WMFlyToBBox = function WMFlyToBBox(wmMap) {
4146
4457
 
4147
4458
  this.flyZoomToBBOXTimerStart = 1;
4148
4459
  this.flyZoomToBBOXTimerSteps = 5;
4149
- this.flyZoomToBBOXDebounced = debounce;
4150
4460
  this.flyZoomToBBOXScaler = 0;
4151
4461
  this.flyZoomToBBOXCurrent = new WMBBOX();
4152
4462
  this.flyZoomToBBOXFly = new WMBBOX();
@@ -4239,9 +4549,9 @@ var WMFlyToBBox = function WMFlyToBBox(wmMap) {
4239
4549
  }
4240
4550
  };
4241
4551
 
4242
- this.startZoomThrottled = throttle(THROTTLE_WAIT_TIME, THROTTLE_NO_TRAILING, function (currentbox, newbox) {
4243
- return _this.flyZoomToBBOXStartZoom(currentbox, newbox);
4244
- });
4552
+ this.startZoomThrottled = throttle(THROTTLE_WAIT_TIME, function (currentbox, newbox) {
4553
+ _this.flyZoomToBBOXStartZoom(currentbox, newbox);
4554
+ }, THROTTLE_OPTIONS);
4245
4555
 
4246
4556
  this.flyZoomToBBOXStartZoomThrottled = function (currentbox, newbox) {
4247
4557
  _this.startZoomThrottled(currentbox, newbox);
@@ -4263,7 +4573,6 @@ var WebMapJSMapNo = 0;
4263
4573
  var bgMapImageStore = new WMImageStore(bgImageStoreLength, {
4264
4574
  id: 'bgMapImageStore'
4265
4575
  });
4266
-
4267
4576
  var detectLeftButton = function detectLeftButton(evt) {
4268
4577
  if (evt.buttons) {
4269
4578
  return evt.buttons === 1;
@@ -4425,7 +4734,6 @@ var WMJSMap = /*#__PURE__*/function () {
4425
4734
  /* pan,zoom,zoomout,info */
4426
4735
 
4427
4736
  this.numGetFeatureInfoRequests = 0;
4428
- this.getFeatureInfoResult = [];
4429
4737
  this.oldMapMode = undefined;
4430
4738
  this.InValidMouseAction = 0;
4431
4739
  this.resizingBBOXCursor = '';
@@ -4441,7 +4749,11 @@ var WMJSMap = /*#__PURE__*/function () {
4441
4749
  this.proj4.srs = 'empty';
4442
4750
  this.proj4.projection = undefined;
4443
4751
  this.longlat = 'EPSG:4326';
4444
- if (proj4) proj4.defs(WMProj4Defs);
4752
+
4753
+ if (proj4) {
4754
+ proj4.defs(WMProj4Defs);
4755
+ }
4756
+
4445
4757
  this.previousMouseButtonState = 'up';
4446
4758
  /* Binds */
4447
4759
 
@@ -4480,7 +4792,6 @@ var WMJSMap = /*#__PURE__*/function () {
4480
4792
  this.setSize = this.setSize.bind(this);
4481
4793
  this._setSize = this._setSize.bind(this);
4482
4794
  this.abort = this.abort.bind(this);
4483
- this.isBusy = this.isBusy.bind(this);
4484
4795
  this._makeInfoHTML = this._makeInfoHTML.bind(this);
4485
4796
  this.showScaleBar = this.showScaleBar.bind(this);
4486
4797
  this.hideScaleBar = this.hideScaleBar.bind(this);
@@ -4782,30 +5093,52 @@ var WMJSMap = /*#__PURE__*/function () {
4782
5093
  do {
4783
5094
  numMapUnits *= 10.0;
4784
5095
  divFactor = a / numMapUnits;
4785
- if (divFactor === 0) return undefined;
5096
+
5097
+ if (divFactor === 0) {
5098
+ return undefined;
5099
+ }
5100
+
4786
5101
  realWidth = desiredWidth / divFactor;
4787
5102
  } while (realWidth < desiredWidth);
4788
5103
 
4789
5104
  do {
4790
5105
  numMapUnits /= 2.0;
4791
5106
  divFactor = a / numMapUnits;
4792
- if (divFactor === 0) return undefined;
5107
+
5108
+ if (divFactor === 0) {
5109
+ return undefined;
5110
+ }
5111
+
4793
5112
  realWidth = desiredWidth / divFactor;
4794
5113
  } while (realWidth > desiredWidth);
4795
5114
 
4796
5115
  do {
4797
5116
  numMapUnits *= 1.2;
4798
5117
  divFactor = a / numMapUnits;
4799
- if (divFactor === 0) return undefined;
5118
+
5119
+ if (divFactor === 0) {
5120
+ return undefined;
5121
+ }
5122
+
4800
5123
  realWidth = desiredWidth / divFactor;
4801
5124
  } while (realWidth < desiredWidth);
4802
5125
 
4803
5126
  var roundedMapUnits = numMapUnits;
4804
5127
  var d = Math.pow(10, Math.round(Math.log10(numMapUnits) + 0.5) - 1);
4805
5128
  roundedMapUnits = Math.round(roundedMapUnits / d);
4806
- if (roundedMapUnits < 2.5) roundedMapUnits = 2.5;
4807
- if (roundedMapUnits > 2.5 && roundedMapUnits < 7.5) roundedMapUnits = 5;
4808
- if (roundedMapUnits > 7.5) roundedMapUnits = 10;
5129
+
5130
+ if (roundedMapUnits < 2.5) {
5131
+ roundedMapUnits = 2.5;
5132
+ }
5133
+
5134
+ if (roundedMapUnits > 2.5 && roundedMapUnits < 7.5) {
5135
+ roundedMapUnits = 5;
5136
+ }
5137
+
5138
+ if (roundedMapUnits > 7.5) {
5139
+ roundedMapUnits = 10;
5140
+ }
5141
+
4809
5142
  roundedMapUnits *= d;
4810
5143
  divFactor = desiredWidth / pixelsPerUnit / roundedMapUnits;
4811
5144
  realWidth = desiredWidth / divFactor;
@@ -4850,15 +5183,42 @@ var WMJSMap = /*#__PURE__*/function () {
4850
5183
  ctx.moveTo(offsetX + scaleBarProps.width * 2 + 1, scaleBarHeight - 2 + offsetY);
4851
5184
  ctx.lineTo(offsetX + scaleBarProps.width * 2 + 1, scaleBarHeight - 2 - 7 + offsetY);
4852
5185
  var units = '';
4853
- if (this.srs === 'EPSG:3411') units = 'meter';
4854
- if (this.srs === 'EPSG:3412') units = 'meter';
4855
- if (this.srs === 'EPSG:3575') units = 'meter';
4856
- if (this.srs === 'EPSG:4326') units = 'degrees';
4857
- if (this.srs === 'EPSG:28992') units = 'meter';
4858
- if (this.srs === 'EPSG:32661') units = 'meter';
4859
- if (this.srs === 'EPSG:3857') units = 'meter';
4860
- if (this.srs === 'EPSG:900913') units = 'meter';
4861
- if (this.srs === 'EPSG:102100') units = 'meter';
5186
+
5187
+ if (this.srs === 'EPSG:3411') {
5188
+ units = 'meter';
5189
+ }
5190
+
5191
+ if (this.srs === 'EPSG:3412') {
5192
+ units = 'meter';
5193
+ }
5194
+
5195
+ if (this.srs === 'EPSG:3575') {
5196
+ units = 'meter';
5197
+ }
5198
+
5199
+ if (this.srs === 'EPSG:4326') {
5200
+ units = 'degrees';
5201
+ }
5202
+
5203
+ if (this.srs === 'EPSG:28992') {
5204
+ units = 'meter';
5205
+ }
5206
+
5207
+ if (this.srs === 'EPSG:32661') {
5208
+ units = 'meter';
5209
+ }
5210
+
5211
+ if (this.srs === 'EPSG:3857') {
5212
+ units = 'meter';
5213
+ }
5214
+
5215
+ if (this.srs === 'EPSG:900913') {
5216
+ units = 'meter';
5217
+ }
5218
+
5219
+ if (this.srs === 'EPSG:102100') {
5220
+ units = 'meter';
5221
+ }
4862
5222
 
4863
5223
  if (units === 'meter') {
4864
5224
  if (scaleBarProps.mapunits > 1000) {
@@ -4884,7 +5244,11 @@ var WMJSMap = /*#__PURE__*/function () {
4884
5244
 
4885
5245
  if (isDefined(this.mouseGeoCoordXY)) {
4886
5246
  var roundingFactor = 1.0 / Math.pow(10, parseInt(Math.log((this.bbox.right - this.bbox.left) / this.width) / Math.log(10), 10) - 2);
4887
- if (roundingFactor < 1) roundingFactor = 1;
5247
+
5248
+ if (roundingFactor < 1) {
5249
+ roundingFactor = 1;
5250
+ }
5251
+
4888
5252
  ctx.fillStyle = '#000000';
4889
5253
  var xText = Math.round(this.mouseGeoCoordXY.x * roundingFactor) / roundingFactor;
4890
5254
  var yText = Math.round(this.mouseGeoCoordXY.y * roundingFactor) / roundingFactor;
@@ -5084,32 +5448,18 @@ var WMJSMap = /*#__PURE__*/function () {
5084
5448
  }, {
5085
5449
  key: "rebuildMapDimensions",
5086
5450
  value: function rebuildMapDimensions() {
5087
- for (var j = 0; j < this.mapdimensions.length; j += 1) {
5088
- this.mapdimensions[j].used = false;
5089
- }
5090
-
5091
5451
  for (var i = 0; i < this.layers.length; i += 1) {
5092
- for (var _j4 = 0; _j4 < this.layers[i].dimensions.length; _j4 += 1) {
5093
- var dim = this.layers[i].dimensions[_j4];
5452
+ for (var j = 0; j < this.layers[i].dimensions.length; j += 1) {
5453
+ var dim = this.layers[i].dimensions[j];
5094
5454
  var mapdim = this.getDimension(dim.name);
5095
5455
 
5096
- if (isDefined(mapdim)) {
5097
- mapdim.used = true;
5098
- } else {
5456
+ if (!isDefined(mapdim)) {
5099
5457
  var newdim = dim.clone();
5100
- newdim.used = true;
5101
5458
  this.mapdimensions.push(newdim);
5102
5459
  }
5103
5460
  }
5104
5461
  }
5105
5462
 
5106
- for (var _j5 = 0; _j5 < this.mapdimensions.length; _j5 += 1) {
5107
- if (this.mapdimensions[_j5].used === false) {
5108
- this.mapdimensions.splice(_j5, 1);
5109
- _j5 -= 1;
5110
- }
5111
- }
5112
-
5113
5463
  this.callBack.triggerEvent('onmapdimupdate');
5114
5464
  }
5115
5465
  }, {
@@ -5200,7 +5550,9 @@ var WMJSMap = /*#__PURE__*/function () {
5200
5550
  value: function toggleLayer(layer) {
5201
5551
  if (layer.enabled === true) {
5202
5552
  layer.enabled = false;
5203
- } else layer.enabled = true;
5553
+ } else {
5554
+ layer.enabled = true;
5555
+ }
5204
5556
 
5205
5557
  this.calculateNumBaseLayers();
5206
5558
  this.rebuildMapDimensions();
@@ -5215,7 +5567,9 @@ var WMJSMap = /*#__PURE__*/function () {
5215
5567
  }, {
5216
5568
  key: "_getLayerIndex",
5217
5569
  value: function _getLayerIndex(layer) {
5218
- if (!layer) return undefined;
5570
+ if (!layer) {
5571
+ return undefined;
5572
+ }
5219
5573
 
5220
5574
  for (var j = 0; j < this.layers.length; j += 1) {
5221
5575
  if (this.layers[j] === layer) {
@@ -5239,7 +5593,10 @@ var WMJSMap = /*#__PURE__*/function () {
5239
5593
  }, {
5240
5594
  key: "deleteLayer",
5241
5595
  value: function deleteLayer(layerToDelete) {
5242
- if (this.layers.length <= 0) return;
5596
+ if (this.layers.length <= 0) {
5597
+ return;
5598
+ }
5599
+
5243
5600
  layerToDelete.setAutoUpdate(false);
5244
5601
 
5245
5602
  var layerIndex = this._getLayerIndex(layerToDelete);
@@ -5397,14 +5754,18 @@ var WMJSMap = /*#__PURE__*/function () {
5397
5754
  }, {
5398
5755
  key: "setProjection",
5399
5756
  value: function setProjection(_srs, _bbox) {
5400
- if (!_srs) _srs = 'EPSG:4326';
5757
+ if (!_srs) {
5758
+ _srs = 'EPSG:4326';
5759
+ }
5401
5760
 
5402
5761
  if (_typeof(_srs) === 'object') {
5403
5762
  _bbox = _srs.bbox;
5404
5763
  _srs = _srs.srs;
5405
5764
  }
5406
5765
 
5407
- if (!_srs) _srs = 'EPSG:4326';
5766
+ if (!_srs) {
5767
+ _srs = 'EPSG:4326';
5768
+ }
5408
5769
 
5409
5770
  if (this.srs !== _srs) {
5410
5771
  this.defaultBBOX.setBBOX(_bbox);
@@ -5506,7 +5867,9 @@ var WMJSMap = /*#__PURE__*/function () {
5506
5867
  }, {
5507
5868
  key: "_setSize",
5508
5869
  value: function _setSize(w, h) {
5509
- if (!w || !h) return;
5870
+ if (!w || !h) {
5871
+ return;
5872
+ }
5510
5873
 
5511
5874
  if (w < 4 || h < 4) {
5512
5875
  return;
@@ -5516,8 +5879,14 @@ var WMJSMap = /*#__PURE__*/function () {
5516
5879
  var projinfo = this.getProjection();
5517
5880
  this.width = w;
5518
5881
  this.height = h;
5519
- if (this.width < 4 || isNaN(this.width)) this.width = 4;
5520
- if (this.height < 4 || isNaN(this.height)) this.height = 4;
5882
+
5883
+ if (this.width < 4 || isNaN(this.width)) {
5884
+ this.width = 4;
5885
+ }
5886
+
5887
+ if (this.height < 4 || isNaN(this.height)) {
5888
+ this.height = 4;
5889
+ }
5521
5890
 
5522
5891
  if (!projinfo.srs || !projinfo.bbox) {
5523
5892
  debug(DebugType.Error);
@@ -5529,12 +5898,19 @@ var WMJSMap = /*#__PURE__*/function () {
5529
5898
  this.setProjection(projinfo.srs, projinfo.bbox);
5530
5899
  }
5531
5900
 
5532
- if (!this.baseDiv || !this.baseDiv.style) return;
5901
+ if (!this.baseDiv || !this.baseDiv.style) {
5902
+ return;
5903
+ }
5904
+
5533
5905
  Object.assign(this.baseDiv.style, {
5534
5906
  width: this.width,
5535
5907
  height: this.height
5536
5908
  });
5537
- if (!this.mainElement || !this.mainElement.style) return;
5909
+
5910
+ if (!this.mainElement || !this.mainElement.style) {
5911
+ return;
5912
+ }
5913
+
5538
5914
  this.mainElement.style.width = "".concat(this.width, "px");
5539
5915
  this.mainElement.style.height = "".concat(this.height, "px");
5540
5916
  this.setBBOX(this.resizeBBOX);
@@ -5554,19 +5930,6 @@ var WMJSMap = /*#__PURE__*/function () {
5554
5930
  this.layersBusy = false;
5555
5931
  this.callBack.triggerEvent('onloadingcomplete');
5556
5932
  }
5557
- }, {
5558
- key: "isBusy",
5559
- value: function isBusy() {
5560
- if (this.suspendDrawing === true || this.mapBusy || this.layersBusy === 1) {
5561
- return true;
5562
- }
5563
-
5564
- if (this.divBuffer[0].ready === false || this.divBuffer[1].ready === false) {
5565
- return true;
5566
- }
5567
-
5568
- return false;
5569
- }
5570
5933
  }, {
5571
5934
  key: "_makeInfoHTML",
5572
5935
  value: function _makeInfoHTML() {
@@ -5618,7 +5981,9 @@ var WMJSMap = /*#__PURE__*/function () {
5618
5981
  }
5619
5982
  }
5620
5983
 
5621
- if (foundDim === false) infoHTML += '<td>-</td>';
5984
+ if (foundDim === false) {
5985
+ infoHTML += '<td>-</td>';
5986
+ }
5622
5987
  }
5623
5988
 
5624
5989
  infoHTML += '</tr>';
@@ -5661,7 +6026,10 @@ var WMJSMap = /*#__PURE__*/function () {
5661
6026
  }, {
5662
6027
  key: "display",
5663
6028
  value: function display() {
5664
- if (!this.divBuffer) return;
6029
+ if (!this.divBuffer) {
6030
+ return;
6031
+ }
6032
+
5665
6033
  this.divBuffer.display();
5666
6034
  this.drawnBBOX.setBBOX(this.bbox);
5667
6035
  }
@@ -5672,9 +6040,7 @@ var WMJSMap = /*#__PURE__*/function () {
5672
6040
  }
5673
6041
  }, {
5674
6042
  key: "draw",
5675
- value: function draw() {
5676
- var animationList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5677
-
6043
+ value: function draw(animationList) {
5678
6044
  if (this.isDestroyed) {
5679
6045
  return;
5680
6046
  }
@@ -5695,7 +6061,6 @@ var WMJSMap = /*#__PURE__*/function () {
5695
6061
  /**
5696
6062
  * API Function called to draw the layers, fires getmap request and shows the layers on the screen
5697
6063
  */
5698
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5699
6064
 
5700
6065
  }, {
5701
6066
  key: "_draw",
@@ -5714,8 +6079,7 @@ var WMJSMap = /*#__PURE__*/function () {
5714
6079
  this.needsRedraw = false;
5715
6080
  this.draw(this._animationList);
5716
6081
  }
5717
- } // eslint-disable-next-line @typescript-eslint/no-explicit-any
5718
-
6082
+ }
5719
6083
  }, {
5720
6084
  key: "_drawAndLoad",
5721
6085
  value: function _drawAndLoad(animationList) {
@@ -5876,9 +6240,17 @@ var WMJSMap = /*#__PURE__*/function () {
5876
6240
  key: "_updateBoundingBox",
5877
6241
  value: function _updateBoundingBox(_mapbbox) {
5878
6242
  var triggerEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
5879
- if (!this.divBuffer) return;
6243
+
6244
+ if (!this.divBuffer) {
6245
+ return;
6246
+ }
6247
+
5880
6248
  var mapbbox = this.bbox;
5881
- if (isDefined(_mapbbox)) mapbbox = _mapbbox;
6249
+
6250
+ if (isDefined(_mapbbox)) {
6251
+ mapbbox = _mapbbox;
6252
+ }
6253
+
5882
6254
  this.updateBBOX.setBBOX(mapbbox);
5883
6255
  this.divBuffer.setBBOX(this.updateBBOX, this.drawnBBOX);
5884
6256
  this.drawnBBOX.setBBOX(mapbbox);
@@ -5911,7 +6283,9 @@ var WMJSMap = /*#__PURE__*/function () {
5911
6283
  }
5912
6284
 
5913
6285
  this.callBack.triggerEvent('onlayeradd');
5914
- } else this.baseLayers = undefined;
6286
+ } else {
6287
+ this.baseLayers = undefined;
6288
+ }
5915
6289
  }
5916
6290
  }, {
5917
6291
  key: "setBaseLayers",
@@ -5929,7 +6303,9 @@ var WMJSMap = /*#__PURE__*/function () {
5929
6303
  }
5930
6304
 
5931
6305
  this.callBack.triggerEvent('onlayerchange');
5932
- } else this.baseLayers = undefined;
6306
+ } else {
6307
+ this.baseLayers = undefined;
6308
+ }
5933
6309
  }
5934
6310
  }, {
5935
6311
  key: "getBaseLayers",
@@ -5950,7 +6326,10 @@ var WMJSMap = /*#__PURE__*/function () {
5950
6326
  key: "mouseWheelEvent",
5951
6327
  value: function mouseWheelEvent(event) {
5952
6328
  preventdefaultEvent(event);
5953
- if (this.mouseWheelBusy === 1) return;
6329
+
6330
+ if (this.mouseWheelBusy === 1) {
6331
+ return;
6332
+ }
5954
6333
 
5955
6334
  var _this$getMouseCoordin = this.getMouseCoordinatesForDocument(event),
5956
6335
  x = _this$getMouseCoordin.x,
@@ -6009,7 +6388,10 @@ var WMJSMap = /*#__PURE__*/function () {
6009
6388
  }, {
6010
6389
  key: "destroy",
6011
6390
  value: function destroy() {
6012
- if (!this.initialized) return;
6391
+ if (!this.initialized) {
6392
+ return;
6393
+ }
6394
+
6013
6395
  this.stopAnimating();
6014
6396
 
6015
6397
  for (var i = this.layers.length - 1; i >= 0; i -= 1) {
@@ -6099,7 +6481,10 @@ var WMJSMap = /*#__PURE__*/function () {
6099
6481
  var format = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'text/html';
6100
6482
 
6101
6483
  /* For invalid layers we cannot build an url */
6102
- if (!layer.name) return '';
6484
+ if (!layer.name) {
6485
+ return '';
6486
+ }
6487
+
6103
6488
  var request = WMJScheckURL(layer.service);
6104
6489
  request += "&SERVICE=WMS&REQUEST=GetFeatureInfo&VERSION=".concat(layer.version);
6105
6490
  request += "&LAYERS=".concat(URLEncode(layer.name));
@@ -6270,7 +6655,10 @@ var WMJSMap = /*#__PURE__*/function () {
6270
6655
  this.oldMapMode = undefined;
6271
6656
  }
6272
6657
  } else {
6273
- if (this.oldMapMode === undefined) this.oldMapMode = this.mapMode;
6658
+ if (this.oldMapMode === undefined) {
6659
+ this.oldMapMode = this.mapMode;
6660
+ }
6661
+
6274
6662
  this.mapMode = 'zoom';
6275
6663
  }
6276
6664
 
@@ -6464,10 +6852,21 @@ var WMJSMap = /*#__PURE__*/function () {
6464
6852
 
6465
6853
  if (foundBBOXRib === true || this.resizingBBOXEnabled !== '' && this.mouseDownPressed === 1) {
6466
6854
  if (this.mouseDownPressed === 1) {
6467
- if (this.resizingBBOXEnabled === 'left') tlpx.x = this.mouseX;
6468
- if (this.resizingBBOXEnabled === 'top') tlpx.y = this.mouseY;
6469
- if (this.resizingBBOXEnabled === 'right') brpx.x = this.mouseX;
6470
- if (this.resizingBBOXEnabled === 'bottom') brpx.y = this.mouseY;
6855
+ if (this.resizingBBOXEnabled === 'left') {
6856
+ tlpx.x = this.mouseX;
6857
+ }
6858
+
6859
+ if (this.resizingBBOXEnabled === 'top') {
6860
+ tlpx.y = this.mouseY;
6861
+ }
6862
+
6863
+ if (this.resizingBBOXEnabled === 'right') {
6864
+ brpx.x = this.mouseX;
6865
+ }
6866
+
6867
+ if (this.resizingBBOXEnabled === 'bottom') {
6868
+ brpx.y = this.mouseY;
6869
+ }
6471
6870
 
6472
6871
  if (this.resizingBBOXEnabled === 'topleft') {
6473
6872
  tlpx.x = this.mouseX;
@@ -6520,10 +6919,15 @@ var WMJSMap = /*#__PURE__*/function () {
6520
6919
 
6521
6920
  this.mouseUpX = this.mouseX;
6522
6921
  this.mouseUpY = this.mouseY;
6523
- if (this.mapPanning === 0) return;
6922
+
6923
+ if (this.mapPanning === 0) {
6924
+ return;
6925
+ }
6524
6926
 
6525
6927
  if (this.mouseDownPressed === 1) {
6526
- if (this.mapMode === 'zoomout') this.zoomOut();
6928
+ if (this.mapMode === 'zoomout') {
6929
+ this.zoomOut();
6930
+ }
6527
6931
  }
6528
6932
 
6529
6933
  this.mouseDownPressed = 0;
@@ -6615,8 +7019,13 @@ var WMJSMap = /*#__PURE__*/function () {
6615
7019
  }, {
6616
7020
  key: "_mouseDragStart",
6617
7021
  value: function _mouseDragStart(x, y) {
6618
- if (this.mapMode === 'pan') this._mapPanStart(x, y);
6619
- if (this.mapMode === 'zoom') this._mapZoomStart();
7022
+ if (this.mapMode === 'pan') {
7023
+ this._mapPanStart(x, y);
7024
+ }
7025
+
7026
+ if (this.mapMode === 'zoom') {
7027
+ this._mapZoomStart();
7028
+ }
6620
7029
  }
6621
7030
  }, {
6622
7031
  key: "mouseDrag",
@@ -6627,16 +7036,31 @@ var WMJSMap = /*#__PURE__*/function () {
6627
7036
  this.mouseDragging = 1;
6628
7037
  }
6629
7038
 
6630
- if (this.mapMode === 'pan') this._mapPan(x, y);
6631
- if (this.mapMode === 'zoom') this._mapZoom();
7039
+ if (this.mapMode === 'pan') {
7040
+ this._mapPan(x, y);
7041
+ }
7042
+
7043
+ if (this.mapMode === 'zoom') {
7044
+ this._mapZoom();
7045
+ }
6632
7046
  }
6633
7047
  }, {
6634
7048
  key: "mouseDragEnd",
6635
7049
  value: function mouseDragEnd(x, y) {
6636
- if (this.mouseDragging === 0) return;
7050
+ if (this.mouseDragging === 0) {
7051
+ return;
7052
+ }
7053
+
6637
7054
  this.mouseDragging = 0;
6638
- if (this.mapMode === 'pan') this._mapPanEnd(x, y);
6639
- if (this.mapMode === 'zoom') this._mapZoomEnd();
7055
+
7056
+ if (this.mapMode === 'pan') {
7057
+ this._mapPanEnd(x, y);
7058
+ }
7059
+
7060
+ if (this.mapMode === 'zoom') {
7061
+ this._mapZoomEnd();
7062
+ }
7063
+
6640
7064
  this.callBack.triggerEvent('mapdragend', {
6641
7065
  map: this,
6642
7066
  x: this.mouseUpX,
@@ -6669,7 +7093,9 @@ var WMJSMap = /*#__PURE__*/function () {
6669
7093
  }, {
6670
7094
  key: "_mapPan",
6671
7095
  value: function _mapPan(x, y) {
6672
- if (this.mapPanning === 0) return;
7096
+ if (this.mapPanning === 0) {
7097
+ return;
7098
+ }
6673
7099
 
6674
7100
  if (this.mouseX < 0 || this.mouseY < 0 || this.mouseX > this.mainElement.clientWidth || this.mouseY > this.mainElement.clientHeight) {
6675
7101
  this._mapPanEnd(x, y);
@@ -6698,7 +7124,11 @@ var WMJSMap = /*#__PURE__*/function () {
6698
7124
  key: "_mapPanEnd",
6699
7125
  value: function _mapPanEnd(x, y) {
6700
7126
  this.baseDiv.style.cursor = 'default';
6701
- if (this.mapPanning === 0) return;
7127
+
7128
+ if (this.mapPanning === 0) {
7129
+ return;
7130
+ }
7131
+
6702
7132
  this.mapPanning = 0;
6703
7133
  var mapPanGeoCoords = this.getGeoCoordFromPixelCoord({
6704
7134
  x: x,
@@ -6756,7 +7186,10 @@ var WMJSMap = /*#__PURE__*/function () {
6756
7186
  }, {
6757
7187
  key: "_mapZoom",
6758
7188
  value: function _mapZoom() {
6759
- if (this.mapZooming === 0) return;
7189
+ if (this.mapZooming === 0) {
7190
+ return;
7191
+ }
7192
+
6760
7193
  var x = this.mouseX - this.mouseDownX;
6761
7194
  var y = this.mouseY - this.mouseDownY;
6762
7195
 
@@ -6773,12 +7206,16 @@ var WMJSMap = /*#__PURE__*/function () {
6773
7206
  if (w < 0) {
6774
7207
  w = -w;
6775
7208
  this.divZoomBox.style.left = "".concat(this.mouseX, "px");
6776
- } else this.divZoomBox.style.left = "".concat(this.mouseDownX, "px");
7209
+ } else {
7210
+ this.divZoomBox.style.left = "".concat(this.mouseDownX, "px");
7211
+ }
6777
7212
 
6778
7213
  if (h < 0) {
6779
7214
  h = -h;
6780
7215
  this.divZoomBox.style.top = "".concat(this.mouseY, "px");
6781
- } else this.divZoomBox.style.top = "".concat(this.mouseDownY, "px");
7216
+ } else {
7217
+ this.divZoomBox.style.top = "".concat(this.mouseDownY, "px");
7218
+ }
6782
7219
 
6783
7220
  this.divZoomBox.style.width = "".concat(w, "px");
6784
7221
  this.divZoomBox.style.height = "".concat(h, "px");
@@ -6789,10 +7226,18 @@ var WMJSMap = /*#__PURE__*/function () {
6789
7226
  var x = this.mouseUpX - this.mouseDownX;
6790
7227
  var y = this.mouseUpY - this.mouseDownY;
6791
7228
  this.baseDiv.style.cursor = 'default';
6792
- if (this.mapZooming === 0) return;
7229
+
7230
+ if (this.mapZooming === 0) {
7231
+ return;
7232
+ }
7233
+
6793
7234
  this.mapZooming = 0;
6794
7235
  this.divZoomBox.style.display = 'none';
6795
- if (x < 0 && y < 0) return;
7236
+
7237
+ if (x < 0 && y < 0) {
7238
+ return;
7239
+ }
7240
+
6796
7241
  var zoomBBOXPixels = new WMBBOX();
6797
7242
 
6798
7243
  if (x < 0) {
@@ -6869,7 +7314,10 @@ var WMJSMap = /*#__PURE__*/function () {
6869
7314
  ratio = 1;
6870
7315
  }
6871
7316
 
6872
- if (ratio < 0) ratio = -ratio;
7317
+ if (ratio < 0) {
7318
+ ratio = -ratio;
7319
+ }
7320
+
6873
7321
  var screenRatio = this.width / this.height; // Is W > H?
6874
7322
 
6875
7323
  if (ratio > screenRatio) {
@@ -6918,8 +7366,14 @@ var WMJSMap = /*#__PURE__*/function () {
6918
7366
  key: "getGeoCoordFromPixelCoord",
6919
7367
  value: function getGeoCoordFromPixelCoord(coordinates, _bbox) {
6920
7368
  var mybbox = this.bbox;
6921
- if (_bbox) mybbox = _bbox;
6922
- if (!isDefined(coordinates)) return undefined;
7369
+
7370
+ if (_bbox) {
7371
+ mybbox = _bbox;
7372
+ }
7373
+
7374
+ if (!isDefined(coordinates)) {
7375
+ return undefined;
7376
+ }
6923
7377
 
6924
7378
  try {
6925
7379
  var lon = coordinates.x / this.width * (mybbox.right - mybbox.left) + mybbox.left;
@@ -7046,9 +7500,19 @@ var WMJSMap = /*#__PURE__*/function () {
7046
7500
  var w = this.width;
7047
7501
  var h = this.height;
7048
7502
  var b = this.updateBBOX;
7049
- if (isDefined(_width)) w = _width;
7050
- if (isDefined(_height)) h = _height;
7051
- if (isDefined(_bbox)) b = _bbox;
7503
+
7504
+ if (isDefined(_width)) {
7505
+ w = _width;
7506
+ }
7507
+
7508
+ if (isDefined(_height)) {
7509
+ h = _height;
7510
+ }
7511
+
7512
+ if (isDefined(_bbox)) {
7513
+ b = _bbox;
7514
+ }
7515
+
7052
7516
  var x = w * (coordinates.x - b.left) / (b.right - b.left);
7053
7517
  var y = h * (coordinates.y - b.top) / (b.bottom - b.top);
7054
7518
  return {
@@ -7066,7 +7530,10 @@ var WMJSMap = /*#__PURE__*/function () {
7066
7530
  }, {
7067
7531
  key: "removeListener",
7068
7532
  value: function removeListener(name, f) {
7069
- if (this.isDestroyed) return;
7533
+ if (this.isDestroyed) {
7534
+ return;
7535
+ }
7536
+
7070
7537
  this.callBack.removeEvents(name, f);
7071
7538
  }
7072
7539
  }, {
@@ -7207,23 +7674,26 @@ var WMJSMap = /*#__PURE__*/function () {
7207
7674
  this.WMProjectionTempUndo[j] = this.WMProjectionUndo[j];
7208
7675
  }
7209
7676
 
7210
- for (var _j6 = 0; _j6 <= this.UndoPointer; _j6 += 1) {
7211
- this.WMProjectionUndo[_j6] = this.WMProjectionTempUndo[this.UndoPointer - _j6];
7677
+ for (var _j4 = 0; _j4 <= this.UndoPointer; _j4 += 1) {
7678
+ this.WMProjectionUndo[_j4] = this.WMProjectionTempUndo[this.UndoPointer - _j4];
7212
7679
  }
7213
7680
 
7214
7681
  this.UndoPointer = 0;
7215
7682
  }
7216
7683
 
7217
- for (var _j7 = this.MaxUndos - 1; _j7 > 0; _j7 -= 1) {
7218
- this.WMProjectionUndo[_j7].bbox.setBBOX(this.WMProjectionUndo[_j7 - 1].bbox);
7684
+ for (var _j5 = this.MaxUndos - 1; _j5 > 0; _j5 -= 1) {
7685
+ this.WMProjectionUndo[_j5].bbox.setBBOX(this.WMProjectionUndo[_j5 - 1].bbox);
7219
7686
 
7220
- this.WMProjectionUndo[_j7].srs = this.WMProjectionUndo[_j7 - 1].srs;
7687
+ this.WMProjectionUndo[_j5].srs = this.WMProjectionUndo[_j5 - 1].srs;
7221
7688
  }
7222
7689
 
7223
7690
  this.WMProjectionUndo[0].bbox.setBBOX(this.bbox);
7224
7691
  this.WMProjectionUndo[0].srs = this.srs;
7225
7692
  this.NrOfUndos += 1;
7226
- if (this.NrOfUndos > this.MaxUndos) this.NrOfUndos = this.MaxUndos;
7693
+
7694
+ if (this.NrOfUndos > this.MaxUndos) {
7695
+ this.NrOfUndos = this.MaxUndos;
7696
+ }
7227
7697
  }
7228
7698
 
7229
7699
  this.DoRedo = 0;
@@ -7250,7 +7720,9 @@ var WMJSMap = /*#__PURE__*/function () {
7250
7720
 
7251
7721
  if (isDefined(ratio) === false) {
7252
7722
  ratio = 1;
7253
- } else if (ratio === 0) return;
7723
+ } else if (ratio === 0) {
7724
+ return;
7725
+ }
7254
7726
 
7255
7727
  a *= ratio;
7256
7728
  this.zoomTo(new WMBBOX(this.resizeBBOX.left - a, this.resizeBBOX.bottom - a, this.resizeBBOX.right + a, this.resizeBBOX.top + a));
@@ -7271,9 +7743,16 @@ var WMJSMap = /*#__PURE__*/function () {
7271
7743
  this.divBoundingBox.displayed = true;
7272
7744
  }
7273
7745
 
7274
- if (this.divBoundingBox.displayed !== true) return;
7746
+ if (this.divBoundingBox.displayed !== true) {
7747
+ return;
7748
+ }
7749
+
7275
7750
  var b = this.bbox;
7276
- if (isDefined(_mapbbox)) b = _mapbbox;
7751
+
7752
+ if (isDefined(_mapbbox)) {
7753
+ b = _mapbbox;
7754
+ }
7755
+
7277
7756
  var coord1 = this.getPixelCoordFromGeoCoord({
7278
7757
  x: this.divBoundingBox.bbox.left,
7279
7758
  y: this.divBoundingBox.bbox.top
@@ -7889,7 +8368,10 @@ var WMJSGetCapabilities = function WMJSGetCapabilities(service, succes, fail, op
7889
8368
 
7890
8369
  /* Make the getCapabilitiesJSONrequest */
7891
8370
  var headers = [];
7892
- if (options && options.headers) headers = options.headers;
8371
+
8372
+ if (options && options.headers) {
8373
+ headers = options.headers;
8374
+ }
7893
8375
 
7894
8376
  if (!isDefined(service)) {
7895
8377
  fail(I18n.no_service_defined.text);
@@ -7993,7 +8475,10 @@ var WMJSService = /*#__PURE__*/function () {
7993
8475
  value: function checkVersion111(jsonData) {
7994
8476
  try {
7995
8477
  var rootLayer = jsonData.WMT_MS_Capabilities.Capability.Layer;
7996
- if (!rootLayer) throw new Error('No 111 layer');
8478
+
8479
+ if (!rootLayer) {
8480
+ throw new Error('No 111 layer');
8481
+ }
7997
8482
  } catch (e) {
7998
8483
  var message = this.checkException(jsonData);
7999
8484
 
@@ -8015,7 +8500,10 @@ var WMJSService = /*#__PURE__*/function () {
8015
8500
  value: function checkVersion130(jsonData) {
8016
8501
  try {
8017
8502
  var rootLayer = jsonData.WMS_Capabilities.Capability.Layer;
8018
- if (!rootLayer) throw new Error('No 130 layer');
8503
+
8504
+ if (!rootLayer) {
8505
+ throw new Error('No 130 layer');
8506
+ }
8019
8507
  } catch (e) {
8020
8508
  var message = this.checkException(jsonData);
8021
8509
 
@@ -8188,7 +8676,8 @@ var WMJSService = /*#__PURE__*/function () {
8188
8676
  if (WMSCapabilities.Service.OnlineResource.value) {
8189
8677
  _this.onlineresource = WMSCapabilities.Service.OnlineResource.value;
8190
8678
  } else {
8191
- _this.onlineresource = WMSCapabilities.Service.OnlineResource.attr['xlink:href'];
8679
+ _this.onlineresource = // eslint-disable-next-line @typescript-eslint/no-explicit-any
8680
+ WMSCapabilities.Service.OnlineResource.attr['xlink:href'];
8192
8681
  }
8193
8682
  } catch (e) {
8194
8683
  _this.onlineresource = I18n.not_available_message.text;
@@ -8225,7 +8714,9 @@ var WMJSService = /*#__PURE__*/function () {
8225
8714
 
8226
8715
  if (se) {
8227
8716
  try {
8228
- if (se.attr.code) code = se.attr.code;
8717
+ if (se.attr.code) {
8718
+ code = se.attr.code;
8719
+ }
8229
8720
  } catch (e) {// do nothing
8230
8721
  }
8231
8722
 
@@ -8252,8 +8743,6 @@ var WMJSService = /*#__PURE__*/function () {
8252
8743
  value: function getNodes(succes, failure, forceReload, options) {
8253
8744
  var _this2 = this;
8254
8745
 
8255
- this.nodeCache = undefined;
8256
-
8257
8746
  if (!failure) {
8258
8747
  // eslint-disable-next-line no-param-reassign
8259
8748
  failure = function failure(msg) {
@@ -8551,7 +9040,13 @@ var WMLayer = /*#__PURE__*/function () {
8551
9040
  this.getmapURL = options.service;
8552
9041
  this.getfeatureinfoURL = options.service;
8553
9042
  this.getlegendgraphicURL = options.service;
8554
- if (options.active === true) this.active = true;else this.active = false;
9043
+
9044
+ if (options.active === true) {
9045
+ this.active = true;
9046
+ } else {
9047
+ this.active = false;
9048
+ }
9049
+
8555
9050
  this.name = options.name;
8556
9051
 
8557
9052
  if (options.getgraphinfoURL) {
@@ -8574,16 +9069,29 @@ var WMLayer = /*#__PURE__*/function () {
8574
9069
  this.id = options.id;
8575
9070
  }
8576
9071
 
8577
- if (options.format) this.format = options.format;else this.format = 'image/png';
9072
+ if (options.format) {
9073
+ this.format = options.format;
9074
+ } else {
9075
+ this.format = 'image/png';
9076
+ }
8578
9077
 
8579
9078
  if (isDefined(options.opacity)) {
8580
9079
  this.opacity = options.opacity;
8581
9080
  }
8582
9081
 
8583
- if (options.title) this.title = options.title;
9082
+ if (options.title) {
9083
+ this.title = options.title;
9084
+ }
9085
+
8584
9086
  this["abstract"] = I18n.not_available_message.text;
8585
- if (options.enabled === false) this.enabled = false;
8586
- if (options.keepOnTop === true) this.keepOnTop = true;
9087
+
9088
+ if (options.enabled === false) {
9089
+ this.enabled = false;
9090
+ }
9091
+
9092
+ if (options.keepOnTop === true) {
9093
+ this.keepOnTop = true;
9094
+ }
8587
9095
 
8588
9096
  if (options.transparent === false) {
8589
9097
  this.transparent = false;
@@ -8775,11 +9283,19 @@ var WMLayer = /*#__PURE__*/function () {
8775
9283
  key: "setDimension",
8776
9284
  value: function setDimension(name, value) {
8777
9285
  var updateMapDimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
8778
- if (!isDefined(value)) return;
9286
+
9287
+ if (!isDefined(value)) {
9288
+ return;
9289
+ }
9290
+
8779
9291
  var dimIndex = this.dimensions.findIndex(function (dim) {
8780
9292
  return dim.name === name;
8781
9293
  });
8782
- if (dimIndex < 0) return;
9294
+
9295
+ if (dimIndex < 0) {
9296
+ return;
9297
+ }
9298
+
8783
9299
  var dim = this.dimensions[dimIndex];
8784
9300
  dim.setValue(value);
8785
9301
  this.handleReferenceTime(name, value, updateMapDimensions);
@@ -9154,10 +9670,22 @@ var WMLayer = /*#__PURE__*/function () {
9154
9670
 
9155
9671
  for (var j = 0; j < this.styles.length; j += 1) {
9156
9672
  if (this.styles[j].name === styleName) {
9157
- if (nextPrev === -1) j -= 1;
9158
- if (nextPrev === 1) j += 1;
9159
- if (j < 0) j = this.styles.length - 1;
9160
- if (j > this.styles.length - 1) j = 0;
9673
+ if (nextPrev === -1) {
9674
+ j -= 1;
9675
+ }
9676
+
9677
+ if (nextPrev === 1) {
9678
+ j += 1;
9679
+ }
9680
+
9681
+ if (j < 0) {
9682
+ j = this.styles.length - 1;
9683
+ }
9684
+
9685
+ if (j > this.styles.length - 1) {
9686
+ j = 0;
9687
+ }
9688
+
9161
9689
  return this.styles[j];
9162
9690
  }
9163
9691
  }
@@ -9179,7 +9707,11 @@ var WMLayer = /*#__PURE__*/function () {
9179
9707
  var dimIndex = this.dimensions.findIndex(function (dim) {
9180
9708
  return dim.name === name;
9181
9709
  });
9182
- if (dimIndex < 0) return undefined;
9710
+
9711
+ if (dimIndex < 0) {
9712
+ return undefined;
9713
+ }
9714
+
9183
9715
  return this.dimensions[dimIndex];
9184
9716
  }
9185
9717
  /**