@opengeoweb/webmap-react 12.1.2 → 12.2.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
@@ -1,4 +1,4 @@
1
- import { WMImageStore, privateWebMapUtils, webmapUtils, WMLayer, LayerType, WMInvalidDateValues, getCorrectWMSDimName, WMProj4Defs, tilesettings, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, getPixelCoordFromLatLong, WMJSMAP_LONLAT_EPSGCODE, getLatLongFromPixelCoord, getWMJSMapById, debugLogger, DebugType, registerWMLayer, WMBBOX, getWMLayerById, WMJSMap } from '@opengeoweb/webmap';
1
+ import { WMImageStore, privateWebMapUtils, webmapUtils, WMLayer, LayerType, WMInvalidDateValues, getCorrectWMSDimName, WMProj4Defs, tilesettings, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, getPixelCoordFromLatLong, WMJSMAP_LONLAT_EPSGCODE, getLatLongFromPixelCoord, getWMJSMapById, debugLogger, DebugType, registerWMLayer, WMBBOX, getWMLayerById, WMJSMap, WEBMAP_NAMESPACE } from '@opengeoweb/webmap';
2
2
  export { WEBMAP_NAMESPACE, webmapTranslations } from '@opengeoweb/webmap';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import * as React from 'react';
@@ -9,7 +9,7 @@ import LayerProperty from 'ol/layer/Property';
9
9
  import ImageSource, { getRequestExtent } from 'ol/source/Image';
10
10
  import ImageState from 'ol/ImageState';
11
11
  import { fromResolutionLike } from 'ol/resolution';
12
- import { without, isEqual, debounce, memoize, range, cloneDeep } from 'lodash';
12
+ import { without, isEqual, throttle, memoize, range, debounce, cloneDeep } from 'lodash';
13
13
  import ImageWrapper, { load } from 'ol/Image';
14
14
  import { getImageSrc, getRequestParams, createLoader } from 'ol/source/wms';
15
15
  import { useQuery } from '@tanstack/react-query';
@@ -21,11 +21,11 @@ import { register } from 'ol/proj/proj4';
21
21
  import WMTSCapabilities from 'ol/format/WMTSCapabilities';
22
22
  import { optionsFromCapabilities } from 'ol/source/WMTS';
23
23
  import { View, Map, Feature, Collection } from 'ol';
24
+ import { dateUtils, CustomTooltip, CanvasComponent, useWheelStopPropagation, ToolContainerDraggable, CustomIconButton, PROJECTION } from '@opengeoweb/shared';
24
25
  import { Vector } from 'ol/layer';
25
26
  import VectorSource from 'ol/source/Vector';
26
27
  import GeoJSON from 'ol/format/GeoJSON';
27
- import { CustomTooltip, CanvasComponent, useWheelStopPropagation, ToolContainerDraggable, CustomIconButton, dateUtils, PROJECTION } from '@opengeoweb/shared';
28
- import { t } from 'i18next';
28
+ import 'i18next';
29
29
  import { useTranslation } from 'react-i18next';
30
30
  import { Paper, Box, Typography, Grid2, TextField, FormControl, InputLabel, Select, MenuItem, Icon as Icon$1, FormLabel, Switch, styled, Slider, useTheme } from '@mui/material';
31
31
  import { Home, Add, Minus, List, Delete, Edit, DrawRegion, DrawPolygon, Location, DrawFIRLand, ArrowUp, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath } from '@opengeoweb/theme';
@@ -283,18 +283,18 @@ function _classCallCheck(a, n) {
283
283
  function _defineProperties(e, r) {
284
284
  for (var t = 0; t < r.length; t++) {
285
285
  var o = r[t];
286
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
286
+ o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, _toPropertyKey(o.key), o);
287
287
  }
288
288
  }
289
289
  function _createClass(e, r, t) {
290
290
  return r && _defineProperties(e.prototype, r), Object.defineProperty(e, "prototype", {
291
- writable: !1
291
+ writable: false
292
292
  }), e;
293
293
  }
294
294
  function _createForOfIteratorHelper(r, e) {
295
295
  var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
296
296
  if (!t) {
297
- if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e ) {
297
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) {
298
298
  t && (r = t);
299
299
  var n = 0,
300
300
  F = function () {};
@@ -302,9 +302,9 @@ function _createForOfIteratorHelper(r, e) {
302
302
  s: F,
303
303
  n: function () {
304
304
  return n >= r.length ? {
305
- done: !0
305
+ done: true
306
306
  } : {
307
- done: !1,
307
+ done: false,
308
308
  value: r[n++]
309
309
  };
310
310
  },
@@ -317,8 +317,8 @@ function _createForOfIteratorHelper(r, e) {
317
317
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
318
318
  }
319
319
  var o,
320
- a = !0,
321
- u = !1;
320
+ a = true,
321
+ u = false;
322
322
  return {
323
323
  s: function () {
324
324
  t = t.call(r);
@@ -328,7 +328,7 @@ function _createForOfIteratorHelper(r, e) {
328
328
  return a = r.done, r;
329
329
  },
330
330
  e: function (r) {
331
- u = !0, o = r;
331
+ u = true, o = r;
332
332
  },
333
333
  f: function () {
334
334
  try {
@@ -342,9 +342,9 @@ function _createForOfIteratorHelper(r, e) {
342
342
  function _defineProperty(e, r, t) {
343
343
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
344
344
  value: t,
345
- enumerable: !0,
346
- configurable: !0,
347
- writable: !0
345
+ enumerable: true,
346
+ configurable: true,
347
+ writable: true
348
348
  }) : e[r] = t, e;
349
349
  }
350
350
  function _getPrototypeOf(t) {
@@ -357,11 +357,11 @@ function _inherits(t, e) {
357
357
  t.prototype = Object.create(e && e.prototype, {
358
358
  constructor: {
359
359
  value: t,
360
- writable: !0,
361
- configurable: !0
360
+ writable: true,
361
+ configurable: true
362
362
  }
363
363
  }), Object.defineProperty(t, "prototype", {
364
- writable: !1
364
+ writable: false
365
365
  }), e && _setPrototypeOf(t, e);
366
366
  }
367
367
  function _isNativeReflectConstruct() {
@@ -383,15 +383,15 @@ function _iterableToArrayLimit(r, l) {
383
383
  i,
384
384
  u,
385
385
  a = [],
386
- f = !0,
387
- o = !1;
386
+ f = true,
387
+ o = false;
388
388
  try {
389
389
  if (i = (t = t.call(r)).next, 0 === l) {
390
390
  if (Object(t) !== t) return;
391
391
  f = !1;
392
392
  } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
393
393
  } catch (r) {
394
- o = !0, n = r;
394
+ o = true, n = r;
395
395
  } finally {
396
396
  try {
397
397
  if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
@@ -421,7 +421,7 @@ function ownKeys(e, r) {
421
421
  function _objectSpread2(e) {
422
422
  for (var r = 1; r < arguments.length; r++) {
423
423
  var t = null != arguments[r] ? arguments[r] : {};
424
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
424
+ r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
425
425
  _defineProperty(e, r, t[r]);
426
426
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
427
427
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
@@ -436,7 +436,7 @@ function _objectWithoutProperties(e, t) {
436
436
  i = _objectWithoutPropertiesLoose(e, t);
437
437
  if (Object.getOwnPropertySymbols) {
438
438
  var n = Object.getOwnPropertySymbols(e);
439
- for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
439
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
440
440
  }
441
441
  return i;
442
442
  }
@@ -444,7 +444,7 @@ function _objectWithoutPropertiesLoose(r, e) {
444
444
  if (null == r) return {};
445
445
  var t = {};
446
446
  for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
447
- if (e.indexOf(n) >= 0) continue;
447
+ if (-1 !== e.indexOf(n)) continue;
448
448
  t[n] = r[n];
449
449
  }
450
450
  return t;
@@ -472,9 +472,9 @@ function _regeneratorRuntime() {
472
472
  function define(t, e, r) {
473
473
  return Object.defineProperty(t, e, {
474
474
  value: r,
475
- enumerable: !0,
476
- configurable: !0,
477
- writable: !0
475
+ enumerable: true,
476
+ configurable: true,
477
+ writable: true
478
478
  }), t[e];
479
479
  }
480
480
  try {
@@ -567,7 +567,7 @@ function _regeneratorRuntime() {
567
567
  if ("throw" === i) throw a;
568
568
  return {
569
569
  value: t,
570
- done: !0
570
+ done: true
571
571
  };
572
572
  }
573
573
  for (n.method = i, n.arg = a;;) {
@@ -618,7 +618,7 @@ function _regeneratorRuntime() {
618
618
  function Context(t) {
619
619
  this.tryEntries = [{
620
620
  tryLoc: "root"
621
- }], t.forEach(pushTryEntry, this), this.reset(!0);
621
+ }], t.forEach(pushTryEntry, this), this.reset(true);
622
622
  }
623
623
  function values(e) {
624
624
  if (e || "" === e) {
@@ -628,8 +628,8 @@ function _regeneratorRuntime() {
628
628
  if (!isNaN(e.length)) {
629
629
  var o = -1,
630
630
  i = function next() {
631
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
632
- return next.value = t, next.done = !0, next;
631
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = false, next;
632
+ return next.value = t, next.done = true, next;
633
633
  };
634
634
  return i.next = i;
635
635
  }
@@ -638,10 +638,10 @@ function _regeneratorRuntime() {
638
638
  }
639
639
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
640
640
  value: GeneratorFunctionPrototype,
641
- configurable: !0
641
+ configurable: true
642
642
  }), o(GeneratorFunctionPrototype, "constructor", {
643
643
  value: GeneratorFunction,
644
- configurable: !0
644
+ configurable: true
645
645
  }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
646
646
  var e = "function" == typeof t && t.constructor;
647
647
  return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
@@ -670,17 +670,17 @@ function _regeneratorRuntime() {
670
670
  return r.reverse(), function next() {
671
671
  for (; r.length;) {
672
672
  var t = r.pop();
673
- if (t in e) return next.value = t, next.done = !1, next;
673
+ if (t in e) return next.value = t, next.done = false, next;
674
674
  }
675
- return next.done = !0, next;
675
+ return next.done = true, next;
676
676
  };
677
677
  }, e.values = values, Context.prototype = {
678
678
  constructor: Context,
679
679
  reset: function (e) {
680
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
680
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
681
681
  },
682
682
  stop: function () {
683
- this.done = !0;
683
+ this.done = true;
684
684
  var t = this.tryEntries[0].completion;
685
685
  if ("throw" === t.type) throw t.arg;
686
686
  return this.rval;
@@ -699,10 +699,10 @@ function _regeneratorRuntime() {
699
699
  var c = n.call(i, "catchLoc"),
700
700
  u = n.call(i, "finallyLoc");
701
701
  if (c && u) {
702
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
702
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
703
703
  if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
704
704
  } else if (c) {
705
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
705
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, true);
706
706
  } else {
707
707
  if (!u) throw Error("try statement without catch or finally");
708
708
  if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
@@ -770,11 +770,11 @@ function _toPrimitive(t, r) {
770
770
  if ("object" != typeof t || !t) return t;
771
771
  var e = t[Symbol.toPrimitive];
772
772
  if (void 0 !== e) {
773
- var i = e.call(t, r || "default");
773
+ var i = e.call(t, r);
774
774
  if ("object" != typeof i) return i;
775
775
  throw new TypeError("@@toPrimitive must return a primitive value.");
776
776
  }
777
- return ("string" === r ? String : Number)(t);
777
+ return (String )(t);
778
778
  }
779
779
  function _toPropertyKey(t) {
780
780
  var i = _toPrimitive(t, "string");
@@ -970,7 +970,6 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
970
970
  };
971
971
  }
972
972
  var options = {
973
- hidpi: false,
974
973
  serverType: 'mapserver'
975
974
  };
976
975
  var resolution = resolutionToLoad;
@@ -1147,27 +1146,6 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1147
1146
  visible = _ref.visible;
1148
1147
  _classCallCheck(this, TimeawareImageSource);
1149
1148
  _this = _callSuper(this, TimeawareImageSource, [{}]);
1150
- // Debounce prefetch to add a slight delay before prefetching commences
1151
- _this.debouncedPrefetch = debounce(function (_ref2) {
1152
- var _this$_previousPrefet;
1153
- var extent = _ref2.extent,
1154
- resolution = _ref2.resolution,
1155
- pixelRatio = _ref2.pixelRatio,
1156
- projection = _ref2.projection;
1157
- // If the extent has changed => trigger prefetching
1158
- if (!_this._previousPrefetchExtent || !((_this$_previousPrefet = _this._previousPrefetchExtent) !== null && _this$_previousPrefet !== void 0 && _this$_previousPrefet.extent) || !equals(extent, _this._previousPrefetchExtent.extent) || _this._previousPrefetchExtent.layerName !== _this._layerName || _this._previousPrefetchExtent.styleName !== _this._styleName || _this._previousPrefetchExtent.timeStampsToPrefetch !== _this._timeStampsToPrefetch || _this._previousPrefetchExtent.dimProperties !== _this._dimProperties) {
1159
- _this._previousPrefetchExtent = {
1160
- extent: extent,
1161
- layerName: _this._layerName,
1162
- styleName: _this._styleName,
1163
- timeStampsToPrefetch: _this._timeStampsToPrefetch,
1164
- dimProperties: _this._dimProperties
1165
- };
1166
- // Clear old jobs
1167
- _this._prefetchWorkers.clearJobs();
1168
- _this.prefetch(extent, resolution, pixelRatio, projection);
1169
- }
1170
- }, 500);
1171
1149
  _this._wmsUrl = wmsUrl;
1172
1150
  _this._extraWMSParams = _objectSpread2({}, params);
1173
1151
  _this._layerName = layerName;
@@ -1179,7 +1157,11 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1179
1157
  _this.prefetch = _this.prefetch.bind(_this);
1180
1158
  _this.hasImageForTimeValue = _this.hasImageForTimeValue.bind(_this);
1181
1159
  _this.loadImageForTimeValue = _this.loadImageForTimeValue.bind(_this);
1182
- _this.debouncedPrefetch = _this.debouncedPrefetch.bind(_this);
1160
+ _this._conditionalPrefetch = _this._conditionalPrefetch.bind(_this);
1161
+ _this.throttledPrefetch = throttle(_this._conditionalPrefetch, 500, {
1162
+ leading: true,
1163
+ trailing: true
1164
+ });
1183
1165
  _this.triggerPrefetch = _this.triggerPrefetch.bind(_this);
1184
1166
  _this._imWrapperEmptyButLoading = initImageWrapper();
1185
1167
  _this._imWrapperForOlSource = initImageWrapper();
@@ -1190,6 +1172,28 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1190
1172
  }
1191
1173
  _inherits(TimeawareImageSource, _ImageSource);
1192
1174
  return _createClass(TimeawareImageSource, [{
1175
+ key: "_conditionalPrefetch",
1176
+ value: function _conditionalPrefetch(_ref2) {
1177
+ var _this$_previousPrefet;
1178
+ var extent = _ref2.extent,
1179
+ resolution = _ref2.resolution,
1180
+ pixelRatio = _ref2.pixelRatio,
1181
+ projection = _ref2.projection;
1182
+ // If the extent has changed => trigger prefetching
1183
+ if (!this._previousPrefetchExtent || !((_this$_previousPrefet = this._previousPrefetchExtent) !== null && _this$_previousPrefet !== void 0 && _this$_previousPrefet.extent) || !equals(extent, this._previousPrefetchExtent.extent) || this._previousPrefetchExtent.layerName !== this._layerName || this._previousPrefetchExtent.styleName !== this._styleName || this._previousPrefetchExtent.timeStampsToPrefetch !== this._timeStampsToPrefetch || this._previousPrefetchExtent.dimProperties !== this._dimProperties) {
1184
+ this._previousPrefetchExtent = {
1185
+ extent: extent,
1186
+ layerName: this._layerName,
1187
+ styleName: this._styleName,
1188
+ timeStampsToPrefetch: this._timeStampsToPrefetch,
1189
+ dimProperties: this._dimProperties
1190
+ };
1191
+ // Clear old jobs
1192
+ this._prefetchWorkers.clearJobs();
1193
+ this.prefetch(extent, resolution, pixelRatio, projection);
1194
+ }
1195
+ }
1196
+ }, {
1193
1197
  key: "prefetch",
1194
1198
  value: function prefetch(extent, resolution, pixelRatio, projection) {
1195
1199
  var _this2 = this;
@@ -1211,13 +1215,14 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1211
1215
  }, {
1212
1216
  key: "triggerPrefetch",
1213
1217
  value: function triggerPrefetch(extent, resolution, pixelRatio, projection) {
1214
- this.debouncedPrefetch({
1215
- that: this,
1216
- extent: extent,
1217
- resolution: resolution,
1218
- pixelRatio: pixelRatio,
1219
- projection: projection
1220
- });
1218
+ if (this._timeStampsToPrefetch.length > 0) {
1219
+ this.throttledPrefetch({
1220
+ extent: extent,
1221
+ resolution: resolution,
1222
+ pixelRatio: pixelRatio,
1223
+ projection: projection
1224
+ });
1225
+ }
1221
1226
  }
1222
1227
  }, {
1223
1228
  key: "getImage",
@@ -2138,10 +2143,7 @@ var baseLayerGrey = {
2138
2143
  };
2139
2144
  // Over Layers List
2140
2145
  var KNMIgeoservicesBaselayers = {
2141
- name: 'KNMIgeoservicesBaselayers',
2142
- url: 'https://geoservices.knmi.nl/wms?DATASET=baselayers&',
2143
- id: 'KNMIgeoservicesBaselayers'
2144
- };
2146
+ url: 'https://geoservices.knmi.nl/wms?DATASET=baselayers&'};
2145
2147
  var overLayer = {
2146
2148
  service: KNMIgeoservicesBaselayers.url,
2147
2149
  name: 'countryborders',
@@ -2801,24 +2803,37 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
2801
2803
  * See the License for the specific language governing permissions and
2802
2804
  * limitations under the License.
2803
2805
  *
2804
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2805
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
2806
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
2806
+ * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2807
+ * Copyright 2025 - Finnish Meteorological Institute (FMI)
2808
+ * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
2807
2809
  * */
2810
+ initializeOpenLayersProjections();
2808
2811
  var useViewFromLayer = function useViewFromLayer(layerProps) {
2809
2812
  var baseView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
2810
2813
  projection: 'EPSG:3857',
2811
2814
  zoom: 1,
2812
2815
  center: [0, 0]
2813
2816
  };
2814
- var viewRef = useRef(new View(baseView));
2817
+ var viewRef = useRef(null);
2818
+ if (viewRef.current === null) {
2819
+ try {
2820
+ viewRef.current = new View(baseView);
2821
+ } catch (e) {
2822
+ viewRef.current = new View({
2823
+ projection: 'EPSG:3857',
2824
+ zoom: 1,
2825
+ center: [0, 0]
2826
+ });
2827
+ console.warn('Projection not supported');
2828
+ }
2829
+ }
2815
2830
  var wmLayer = useGetWMLayerInstance(layerProps.service, layerProps.name, layerProps.id);
2816
2831
  useEffect(function () {
2817
2832
  if (!wmLayer) {
2818
2833
  return;
2819
2834
  }
2820
2835
  var layerProjectionForCode = wmLayer.getProjection(viewRef.current.getProjection().getCode());
2821
- if (!layerProjectionForCode) {
2836
+ if (!layerProjectionForCode || !layerProjectionForCode.bbox) {
2822
2837
  return;
2823
2838
  }
2824
2839
  viewRef.current.fit(layerProjectionForCode.bbox.getExtent());
@@ -2826,14 +2841,30 @@ var useViewFromLayer = function useViewFromLayer(layerProps) {
2826
2841
  return viewRef.current;
2827
2842
  };
2828
2843
 
2844
+ var USEANIMATIONFORLAYER_DEFAULT_NUMSTEPS = 48;
2845
+ var USEANIMATIONFORLAYER_DEFAULT_UPDATEINTERVALMS = 60000;
2846
+ var USEANIMATIONFORLAYER_DEFAULT_MSINHOUR = 3600000;
2847
+ // eslint-disable-next-line import/prefer-default-export
2829
2848
  var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInMs) {
2830
- var numStepsTillLatest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 48;
2831
- var checkForUpdatesMs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 60000;
2849
+ var numStepsTillLatest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : USEANIMATIONFORLAYER_DEFAULT_NUMSTEPS;
2850
+ var checkForUpdatesMs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : USEANIMATIONFORLAYER_DEFAULT_UPDATEINTERVALMS;
2851
+ var now = dateUtils.getNowUtc().getTime();
2832
2852
  var animationStep = useRef(0);
2833
2853
  var _React$useState = React__default.useState(''),
2834
2854
  _React$useState2 = _slicedToArray(_React$useState, 2),
2835
2855
  timeValue = _React$useState2[0],
2836
2856
  setTimeValue = _React$useState2[1];
2857
+ var _React$useState3 = React__default.useState({
2858
+ timespan: {
2859
+ start: now - USEANIMATIONFORLAYER_DEFAULT_MSINHOUR,
2860
+ end: now,
2861
+ step: USEANIMATIONFORLAYER_DEFAULT_MSINHOUR
2862
+ },
2863
+ isAnimating: true
2864
+ }),
2865
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
2866
+ timeSpan = _React$useState4[0],
2867
+ setTimeSpan = _React$useState4[1];
2837
2868
  var wmLayer = useGetWMLayerInstance(layerProps.service, layerProps.name, layerProps.id);
2838
2869
  var trigger = React__default.useCallback(function () {
2839
2870
  animationStep.current += 1;
@@ -2850,6 +2881,36 @@ var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInM
2850
2881
  }
2851
2882
  }, [numStepsTillLatest, wmLayer]);
2852
2883
  useSetIntervalWhenVisible(trigger, intervalInMs);
2884
+ var calculateTimeSpan = React__default.useCallback(function () {
2885
+ var timeDim = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.getDimension('time');
2886
+ if (!timeDim || timeDim.size() < 2) {
2887
+ return;
2888
+ }
2889
+ var animStartTimeStep = Math.max(0, timeDim.size() - numStepsTillLatest);
2890
+ var lastTimeStep = Math.max(0, timeDim.size() - 1);
2891
+ // There are no timesteps available
2892
+ if (lastTimeStep <= animStartTimeStep) {
2893
+ return;
2894
+ }
2895
+ var secondTolastTimeStep = Math.max(0, timeDim.size() - 2);
2896
+ var timeResolution = timeDim.getValueForIndexAsTime(lastTimeStep) - timeDim.getValueForIndexAsTime(secondTolastTimeStep);
2897
+ var newTimeSpan = {
2898
+ timespan: {
2899
+ start: timeDim.getValueForIndexAsTime(animStartTimeStep),
2900
+ end: timeDim.getValueForIndexAsTime(lastTimeStep),
2901
+ step: timeResolution
2902
+ },
2903
+ isAnimating: true
2904
+ };
2905
+ if (timeValue === '') {
2906
+ setTimeValue(timeDim.getValueForIndex(animStartTimeStep));
2907
+ }
2908
+ setTimeSpan(newTimeSpan);
2909
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2910
+ }, [numStepsTillLatest, wmLayer]);
2911
+ useEffect(function () {
2912
+ calculateTimeSpan();
2913
+ }, [calculateTimeSpan, wmLayer]);
2853
2914
  var refetchLayer = React__default.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
2854
2915
  return _regeneratorRuntime().wrap(function _callee$(_context) {
2855
2916
  while (1) switch (_context.prev = _context.next) {
@@ -2857,16 +2918,22 @@ var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInM
2857
2918
  _context.next = 2;
2858
2919
  return wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.parseLayer(true);
2859
2920
  case 2:
2921
+ calculateTimeSpan();
2922
+ case 3:
2860
2923
  case "end":
2861
2924
  return _context.stop();
2862
2925
  }
2863
2926
  }, _callee);
2864
- })), [wmLayer]);
2927
+ })), [calculateTimeSpan, wmLayer]);
2928
+ // eslint-disable-next-line @typescript-eslint/no-misused-promises
2865
2929
  useSetIntervalWhenVisible(refetchLayer, checkForUpdatesMs);
2866
- return [{
2867
- name: 'time',
2868
- currentValue: timeValue
2869
- }];
2930
+ return {
2931
+ dimensions: [{
2932
+ name: 'time',
2933
+ currentValue: timeValue
2934
+ }],
2935
+ timeContext: timeSpan
2936
+ };
2870
2937
  };
2871
2938
 
2872
2939
  var TiledWMSLayer = function TiledWMSLayer(_ref) {
@@ -3209,7 +3276,8 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
3209
3276
 
3210
3277
  var WEBMAP_REACT_NAMESPACE = 'webmapreact';
3211
3278
  var useWebmapReactTranslation = function useWebmapReactTranslation() {
3212
- return useTranslation(WEBMAP_REACT_NAMESPACE);
3279
+ var ns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : WEBMAP_REACT_NAMESPACE;
3280
+ return useTranslation(ns);
3213
3281
  };
3214
3282
 
3215
3283
  var LegendLayout = function LegendLayout(_ref) {
@@ -7714,13 +7782,9 @@ var shapeButtonNL = {
7714
7782
  selectionType: firSelectionType
7715
7783
  };
7716
7784
  var shapeButtonBE = {
7717
- drawModeId: 'fir-tool-BE',
7718
7785
  value: DRAWMODE.POLYGON,
7719
7786
  title: 'Custom FIR BE polygon',
7720
- shape: intersectionShapeBE,
7721
- isSelectable: false,
7722
- selectionType: firSelectionType
7723
- };
7787
+ shape: intersectionShapeBE};
7724
7788
  var exampleIntersectionsMultiDrawTool = [{
7725
7789
  title: 'NL',
7726
7790
  geojson: shapeButtonNL.shape
@@ -9103,7 +9167,10 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
9103
9167
  origin: origin,
9104
9168
  layerId: wmLayer.id,
9105
9169
  dimensions: layerDimensions
9106
- }
9170
+ },
9171
+ error: wmLayer.hasError ? {
9172
+ layerId: wmLayer.id
9173
+ } : undefined
9107
9174
  };
9108
9175
  return updateObject;
9109
9176
  };
@@ -11108,6 +11175,8 @@ var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
11108
11175
  showMessage = _useState2[0],
11109
11176
  setShowMessage = _useState2[1];
11110
11177
  var timerRef = useRef();
11178
+ var _useWebmapReactTransl = useWebmapReactTranslation(WEBMAP_NAMESPACE),
11179
+ t = _useWebmapReactTransl.t;
11111
11180
  useEffect(function () {
11112
11181
  var updateScroll = function updateScroll(e) {
11113
11182
  if (e.deltaY) {
@@ -11526,7 +11595,7 @@ var FEATURE_VERTICE_HANDLE_IMAGE = new Circle({
11526
11595
  });
11527
11596
  var ICON_LOCATIONMARKER = createIconStyle(locationPath, {
11528
11597
  render: {
11529
- fillStyle: '#000'
11598
+ fillStyle: '#051039'
11530
11599
  },
11531
11600
  icon: {
11532
11601
  anchor: [0.5, 1]
@@ -11612,6 +11681,29 @@ var FEATURE_EDR_HOVER = [new Style$1({
11612
11681
  width: 1.5
11613
11682
  })
11614
11683
  })];
11684
+ var FEATURE_MY_LOCATION = new Style$1({
11685
+ renderer: function renderer(pixelCoordinates, state) {
11686
+ var ctx = state.context;
11687
+ var coord = pixelCoordinates;
11688
+ ctx.save();
11689
+ // Draw outer circle with shadow
11690
+ ctx.strokeStyle = '#fff';
11691
+ ctx.fillStyle = '#fff';
11692
+ ctx.shadowColor = '#00000080';
11693
+ ctx.shadowBlur = 10;
11694
+ ctx.beginPath();
11695
+ ctx.arc(coord[0], coord[1], 24, 0, 2 * Math.PI);
11696
+ ctx.fill();
11697
+ ctx.shadowBlur = 0;
11698
+ // Draw inner circle
11699
+ ctx.fillStyle = '#186dff';
11700
+ ctx.beginPath();
11701
+ ctx.arc(coord[0], coord[1], 18, 0, 2 * Math.PI);
11702
+ ctx.fill();
11703
+ // Reset transformations
11704
+ ctx.restore();
11705
+ }
11706
+ });
11615
11707
  var labelOptions = {
11616
11708
  font: '16px Roboto',
11617
11709
  padding: [8, 8, 8, 8],
@@ -11646,6 +11738,17 @@ var multiPolygonLabelBaseStyle = new Style$1({
11646
11738
  return largestPolygon.getInteriorPoint();
11647
11739
  }
11648
11740
  });
11741
+ // MultiLineStrings need separate handling to only draw single label
11742
+ var multiLineStringLabelBaseStyle = new Style$1({
11743
+ text: new Text(labelOptions),
11744
+ geometry: function geometry(feature) {
11745
+ var lines = feature.getGeometry().getLineStrings();
11746
+ var longestLine = lines.reduce(function (prev, curr) {
11747
+ return prev.getLength() > curr.getLength() ? prev : curr;
11748
+ });
11749
+ return longestLine;
11750
+ }
11751
+ });
11649
11752
  var textLabelStyle = function textLabelStyle(text) {
11650
11753
  var _labelBaseStyle$getTe;
11651
11754
  (_labelBaseStyle$getTe = labelBaseStyle.getText()) === null || _labelBaseStyle$getTe === void 0 || _labelBaseStyle$getTe.setText(text);
@@ -11656,31 +11759,16 @@ var multiPolygonLabelStyle = function multiPolygonLabelStyle(text) {
11656
11759
  (_multiPolygonLabelBas = multiPolygonLabelBaseStyle.getText()) === null || _multiPolygonLabelBas === void 0 || _multiPolygonLabelBas.setText(text);
11657
11760
  return multiPolygonLabelBaseStyle;
11658
11761
  };
11762
+ var multiLineStringLabelStyle = function multiLineStringLabelStyle(text) {
11763
+ var _multiLineStringLabel;
11764
+ (_multiLineStringLabel = multiLineStringLabelBaseStyle.getText()) === null || _multiLineStringLabel === void 0 || _multiLineStringLabel.setText(text);
11765
+ return multiLineStringLabelBaseStyle;
11766
+ };
11659
11767
  var stylesByMapFeatureClass = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, MapFeatureClass.GenericMarker, function (f) {
11660
11768
  return !f.get('hover') ? ICON_LOCATIONMARKER : [ICON_LOCATIONMARKER, textLabelStyle(f.getProperties().name)];
11661
- }), MapFeatureClass.MyLocation, [
11662
- // Outer circle
11663
- new Style$1({
11664
- image: new Circle({
11665
- radius: 12,
11666
- stroke: new Stroke({
11667
- color: 'black',
11668
- width: 1
11669
- }),
11670
- fill: new Fill({
11671
- color: '#8888ff'
11672
- })
11673
- })
11674
- }),
11675
- // Inner circle
11676
- new Style$1({
11677
- image: new Circle({
11678
- radius: 2,
11679
- fill: new Fill({
11680
- color: '#000'
11681
- })
11682
- })
11683
- })]), MapFeatureClass.ObservationStation, function (f) {
11769
+ }), MapFeatureClass.MyLocation, function (feature) {
11770
+ return !feature.get('hover') ? FEATURE_MY_LOCATION : [FEATURE_MY_LOCATION, textLabelStyle(feature.getProperties().name)];
11771
+ }), MapFeatureClass.ObservationStation, function (f) {
11684
11772
  return !f.get('hover') ? FEATURE_OBSERVATIONSTATION : [].concat(FEATURE_OBSERVATIONSTATION_HOVER, [textLabelStyle(f.getProperties().name)]);
11685
11773
  }), MapFeatureClass.EDRFeature, function (f) {
11686
11774
  return !f.get('hover') ? FEATURE_EDR : [].concat(FEATURE_EDR_HOVER, [textLabelStyle(f.getProperties().name)]);
@@ -11751,22 +11839,49 @@ var inlineFeatureStyle = function inlineFeatureStyle(f) {
11751
11839
  return styles;
11752
11840
  };
11753
11841
  var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(f, resolution) {
11754
- var _f$getProperties = f.getProperties(),
11755
- hidden = _f$getProperties.hidden,
11756
- fill = _f$getProperties.fill,
11757
- stroke = _f$getProperties.stroke;
11842
+ var props = f.getProperties();
11843
+ var hidden = props.hidden,
11844
+ fill = props.fill,
11845
+ stroke = props.stroke,
11846
+ hover = props.hover,
11847
+ mapFeatureClass = props.mapFeatureClass,
11848
+ showNameOnHover = props.showNameOnHover,
11849
+ name = props.name,
11850
+ geometry = props.geometry,
11851
+ selectionType = props.selectionType;
11758
11852
  if (hidden === true) {
11759
11853
  return [];
11760
11854
  }
11855
+ var shouldHighlight = mapFeatureClass !== MapFeatureClass.ObservationStation && !showNameOnHover && selectionType !== 'fir';
11856
+ // Highlight map polygons on hover
11857
+ if (hover && shouldHighlight) {
11858
+ return new Style$1({
11859
+ stroke: new Stroke({
11860
+ color: stroke || '#E27D00',
11861
+ width: 3
11862
+ }),
11863
+ fill: new Fill({
11864
+ color: fill || 'rgba(226, 125, 0, 0.6)'
11865
+ }),
11866
+ zIndex: 9999
11867
+ });
11868
+ }
11869
+ if (hover && showNameOnHover && (fill || stroke)) {
11870
+ var type = geometry.getType();
11871
+ switch (type) {
11872
+ case 'MultiPolygon':
11873
+ return [].concat(_toConsumableArray(inlineFeatureStyle(f)), [multiPolygonLabelStyle(name)]);
11874
+ case 'MultiLineString':
11875
+ return [].concat(_toConsumableArray(inlineFeatureStyle(f)), [multiLineStringLabelStyle(name)]);
11876
+ default:
11877
+ return [].concat(_toConsumableArray(inlineFeatureStyle(f)), [textLabelStyle(name)]);
11878
+ }
11879
+ }
11761
11880
  if (fill || stroke) {
11762
11881
  return inlineFeatureStyle(f);
11763
11882
  }
11764
- var mapFeatureClass = f.getProperties().mapFeatureClass || MapFeatureClass["default"];
11765
- var styleOrFunction = stylesByMapFeatureClass[mapFeatureClass];
11766
- if (typeof styleOrFunction === 'function') {
11767
- return styleOrFunction(f, resolution);
11768
- }
11769
- return styleOrFunction;
11883
+ var styleOrFunction = stylesByMapFeatureClass[mapFeatureClass || MapFeatureClass["default"]];
11884
+ return typeof styleOrFunction === 'function' ? styleOrFunction(f, resolution) : styleOrFunction;
11770
11885
  };
11771
11886
  // Used for polygons, boxes and linestrings
11772
11887
  var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(f) {
@@ -12121,4 +12236,4 @@ var isOpenLayersEnabled = function isOpenLayersEnabled() {
12121
12236
  return _useOpenLayers;
12122
12237
  };
12123
12238
 
12124
- export { ClickOnMapTool, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDITMODE, EditModeButton as EditModeButtonField, FEATURE_FILL, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayers, GeoJSONTextField, ICON_LOCATIONMARKER, ICON_LOCATIONMARKER_MODIFY, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MINUTE_TO_MILLISECOND, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapDrawContainer, MapFeatureClass, MapTime, MapView, MapViewLayer, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION, ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, Proj4js, radarGetCapabilities_spec as RadarGetCapabilities, ReactMapView, ReactMapViewLayer, SelectField, StoryLayoutGrid, TimeContext, TimeawareImageSource, WEBMAP_REACT_NAMESPACE, WMSLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, addWMLayerPropsBasedOnChildProps, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, checkHoverFeatures, convertGeoCoordsToScreenCoords, createIconStyle, createInterSections, currentlySupportedDrawModes, defaultBox, defaultDelete, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultModes, defaultPoint, defaultPolygon, defaultTimeFormat, dimensionConfig, distance, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureBox, featureMultiPoint, featurePoint, featurePolygon, fillOptions, findClosestCoords, firSelectionType, formatTime, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getCurrentDimensionValue, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawFunctionFromStore, getFeatureCollection, getFeatureExtent, getFeatureLayers, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getPixelCoordFromGeoCoord, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isAGeoJSONLayer, isAMapLayer, isBetween, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isOpenLayersEnabled, isPointFeatureCollection, lineString, lineStringCollection, makeLayerPropListFromChildren, makeView, marksByDimension, modifyStyles, moveFeature, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, orderLayers, parseWMJSLayer, projectorCache, publicLayers, publicServices, registerDrawFunction, removeWMLayerFromMap, rewindGeometry, selectPreferredWMSProjection, setMapCenter, setOpenLayersEnabled, setViewFromExtent, setViewFromFeature, setWMLayerPropsBasedOnChildProps, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useViewFromLayer, viewUtils, webmapReactTranslations };
12239
+ export { ClickOnMapTool, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDITMODE, EditModeButton as EditModeButtonField, FEATURE_FILL, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayers, GeoJSONTextField, ICON_LOCATIONMARKER, ICON_LOCATIONMARKER_MODIFY, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MINUTE_TO_MILLISECOND, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapDrawContainer, MapFeatureClass, MapTime, MapView, MapViewLayer, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION, ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, Proj4js, radarGetCapabilities_spec as RadarGetCapabilities, ReactMapView, ReactMapViewLayer, SelectField, StoryLayoutGrid, TimeContext, TimeawareImageSource, WEBMAP_REACT_NAMESPACE, WMSLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, addWMLayerPropsBasedOnChildProps, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, checkHoverFeatures, convertGeoCoordsToScreenCoords, createIconStyle, createInterSections, currentlySupportedDrawModes, defaultBox, defaultDelete, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultModes, defaultPoint, defaultPolygon, defaultTimeFormat, dimensionConfig, distance, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureBox, featureMultiPoint, featurePoint, featurePolygon, fillOptions, findClosestCoords, firSelectionType, formatTime, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getCurrentDimensionValue, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawFunctionFromStore, getFeatureCollection, getFeatureExtent, getFeatureLayers, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getPixelCoordFromGeoCoord, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isAGeoJSONLayer, isAMapLayer, isBetween, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isOpenLayersEnabled, isPointFeatureCollection, lineString, lineStringCollection, makeLayerPropListFromChildren, makeView, marksByDimension, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, orderLayers, parseWMJSLayer, projectorCache, publicLayers, publicServices, registerDrawFunction, removeWMLayerFromMap, rewindGeometry, selectPreferredWMSProjection, setMapCenter, setOpenLayersEnabled, setViewFromExtent, setViewFromFeature, setWMLayerPropsBasedOnChildProps, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useViewFromLayer, viewUtils, webmapReactTranslations };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap-react",
3
- "version": "12.1.2",
3
+ "version": "12.2.0",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -8,10 +8,10 @@
8
8
  "url": "git@gitlab.com:opengeoweb/opengeoweb.git"
9
9
  },
10
10
  "dependencies": {
11
- "@opengeoweb/webmap": "12.1.2",
11
+ "@opengeoweb/webmap": "12.2.0",
12
12
  "axios": "^1.7.7",
13
- "@opengeoweb/theme": "12.1.2",
14
- "@opengeoweb/shared": "12.1.2",
13
+ "@opengeoweb/theme": "12.2.0",
14
+ "@opengeoweb/shared": "12.2.0",
15
15
  "lodash": "^4.17.21",
16
16
  "ol": "^10.4.0",
17
17
  "proj4": "^2.9.2",
@@ -21,7 +21,7 @@
21
21
  "i18next": "^23.11.5",
22
22
  "@mui/material": "^6.1.1",
23
23
  "react-i18next": "^15.1.1",
24
- "@tanstack/react-query": "^5.62.7"
24
+ "@tanstack/react-query": "^5.69.2"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "18",
@@ -1,6 +1,7 @@
1
+ import { ColorLike } from 'ol/colorlike';
2
+ import { FeatureLike } from 'ol/Feature';
1
3
  import { Circle, Fill, Stroke } from 'ol/style';
2
4
  import Style, { StyleFunction, StyleLike } from 'ol/style/Style';
3
- import { ColorLike } from 'ol/colorlike';
4
5
  import { DrawModeValue } from '../MapDrawTool';
5
6
  export declare enum MapFeatureClass {
6
7
  MyLocation = "MyLocation",
@@ -20,8 +21,9 @@ export declare const ICON_LOCATIONMARKER_MODIFY: Style;
20
21
  export declare const FEATURE_VERTICES_EDIT_HANDLES: Style;
21
22
  export declare const textLabelStyle: (text: string) => Style;
22
23
  export declare const multiPolygonLabelStyle: (text: string) => Style;
24
+ export declare const multiLineStringLabelStyle: (text: string) => Style;
23
25
  export declare const geowebColorToOpenLayersColor: (color: string, opacity?: string | number) => ColorLike;
24
- export declare const inlineFeatureStyle: StyleFunction;
26
+ export declare const inlineFeatureStyle: (f: FeatureLike) => Style[];
25
27
  export declare const genericOpenLayersFeatureStyle: StyleFunction;
26
28
  export declare const drawStyles: Record<DrawModeValue, StyleLike>;
27
29
  export declare const modifyStyles: Record<DrawModeValue, Style[]>;
@@ -27,11 +27,12 @@ export declare class TimeawareImageSource extends ImageSource {
27
27
  private _imWrapperForAltImage;
28
28
  private _styleName;
29
29
  private _layerName;
30
- private debouncedPrefetch;
31
30
  private _wantedPixelRatio;
32
31
  private _wantedProjection;
33
32
  private _imWrapperForPrefetch;
33
+ private throttledPrefetch;
34
34
  constructor({ wmsUrl, timeStampsToPrefetch, layerName, styleName, dimProps, params, visible, }: TimeawareImageSourceOptions);
35
+ private _conditionalPrefetch;
35
36
  private prefetch;
36
37
  triggerPrefetch(extent: Extent, resolution: number, pixelRatio: number, projection: Projection): void;
37
38
  getImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection): ImageWrapper;
@@ -92,4 +92,7 @@ export interface UpdateLayerInfoPayload {
92
92
  mapDimensions?: UpdateAllMapDimensionsPayload;
93
93
  layerStyle?: SetLayerStylePayload;
94
94
  layerDimensions?: SetLayerDimensionsPayload;
95
+ error?: {
96
+ layerId: string;
97
+ } | undefined;
95
98
  }
@@ -1,3 +1,9 @@
1
1
  import { Dimension } from '@opengeoweb/webmap';
2
2
  import type { OpenLayersLayerProps } from '../components/OpenLayers/layers';
3
- export declare const useAnimationForLayer: (layerProps: OpenLayersLayerProps, intervalInMs: number, numStepsTillLatest?: number, checkForUpdatesMs?: number) => Dimension[];
3
+ import { TimeContextType } from '../components/OpenLayers/types/Timespan';
4
+ interface UseAnimationForLayerProps {
5
+ dimensions: Dimension[];
6
+ timeContext: TimeContextType;
7
+ }
8
+ export declare const useAnimationForLayer: (layerProps: OpenLayersLayerProps, intervalInMs: number, numStepsTillLatest?: number, checkForUpdatesMs?: number) => UseAnimationForLayerProps;
9
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
- import i18n from 'i18next';
1
+ import i18n, { Namespace } from 'i18next';
2
2
  import { UseTranslationResponse } from 'react-i18next';
3
3
  export declare const WEBMAP_REACT_NAMESPACE = "webmapreact";
4
4
  export declare const initWebmapReactTestI18n: () => void;
5
- export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined) => string;
6
- export declare const useWebmapReactTranslation: () => UseTranslationResponse<typeof WEBMAP_REACT_NAMESPACE, typeof i18n>;
5
+ export declare const translateKeyOutsideComponents: (key: string, params?: Record<string, string | number> | undefined, ns?: string) => string;
6
+ export declare const useWebmapReactTranslation: (ns?: Namespace) => UseTranslationResponse<Namespace, import("i18next").i18n>;
7
7
  export { i18n };