@opengeoweb/webmap-react 12.1.2 → 12.3.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 +264 -145
- package/package.json +6 -6
- package/src/lib/components/OpenLayers/OlStyles.d.ts +4 -2
- package/src/lib/components/OpenLayers/component/OpenLayersMapView.d.ts +1 -0
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.d.ts +2 -1
- package/src/lib/components/ReactMapView/types.d.ts +3 -0
- package/src/lib/hooks/useAnimationForLayer.d.ts +7 -1
- package/src/lib/hooks/useAnimationForLayer.spec.d.ts +1 -0
- package/src/lib/hooks/useViewFromLayer.spec.d.ts +1 -0
- package/src/lib/utils/i18n.d.ts +3 -3
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,
|
|
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,13 +21,13 @@ 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
|
|
28
|
-
import { t } from 'i18next';
|
|
28
|
+
import 'i18next';
|
|
29
29
|
import { useTranslation } from 'react-i18next';
|
|
30
|
-
import { Paper, Box, Typography,
|
|
30
|
+
import { Paper, Box, Typography, Grid, 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';
|
|
32
32
|
import * as turf from '@turf/turf';
|
|
33
33
|
import { polygonToLine, booleanClockwise, rewind } from '@turf/turf';
|
|
@@ -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 ||
|
|
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:
|
|
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:
|
|
305
|
+
done: true
|
|
306
306
|
} : {
|
|
307
|
-
done:
|
|
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 =
|
|
321
|
-
u =
|
|
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 =
|
|
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:
|
|
346
|
-
configurable:
|
|
347
|
-
writable:
|
|
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:
|
|
361
|
-
configurable:
|
|
360
|
+
writable: true,
|
|
361
|
+
configurable: true
|
|
362
362
|
}
|
|
363
363
|
}), Object.defineProperty(t, "prototype", {
|
|
364
|
-
writable:
|
|
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 =
|
|
387
|
-
o =
|
|
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 =
|
|
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),
|
|
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)
|
|
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)
|
|
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:
|
|
476
|
-
configurable:
|
|
477
|
-
writable:
|
|
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:
|
|
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(
|
|
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 =
|
|
632
|
-
return next.value = t, next.done =
|
|
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:
|
|
641
|
+
configurable: true
|
|
642
642
|
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
643
643
|
value: GeneratorFunction,
|
|
644
|
-
configurable:
|
|
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 =
|
|
673
|
+
if (t in e) return next.value = t, next.done = false, next;
|
|
674
674
|
}
|
|
675
|
-
return next.done =
|
|
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 =
|
|
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 =
|
|
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,
|
|
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,
|
|
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
|
|
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 (
|
|
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.
|
|
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.
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
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",
|
|
@@ -2081,7 +2086,8 @@ var WMSLayer = function WMSLayer(_ref) {
|
|
|
2081
2086
|
LAYERS: layerName,
|
|
2082
2087
|
STYLES: styleName
|
|
2083
2088
|
}
|
|
2084
|
-
})
|
|
2089
|
+
}),
|
|
2090
|
+
projection: projection
|
|
2085
2091
|
})
|
|
2086
2092
|
});
|
|
2087
2093
|
map.addLayer(layer);
|
|
@@ -2138,10 +2144,7 @@ var baseLayerGrey = {
|
|
|
2138
2144
|
};
|
|
2139
2145
|
// Over Layers List
|
|
2140
2146
|
var KNMIgeoservicesBaselayers = {
|
|
2141
|
-
|
|
2142
|
-
url: 'https://geoservices.knmi.nl/wms?DATASET=baselayers&',
|
|
2143
|
-
id: 'KNMIgeoservicesBaselayers'
|
|
2144
|
-
};
|
|
2147
|
+
url: 'https://geoservices.knmi.nl/wms?DATASET=baselayers&'};
|
|
2145
2148
|
var overLayer = {
|
|
2146
2149
|
service: KNMIgeoservicesBaselayers.url,
|
|
2147
2150
|
name: 'countryborders',
|
|
@@ -2801,24 +2804,37 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
|
|
|
2801
2804
|
* See the License for the specific language governing permissions and
|
|
2802
2805
|
* limitations under the License.
|
|
2803
2806
|
*
|
|
2804
|
-
* Copyright
|
|
2805
|
-
* Copyright
|
|
2806
|
-
* Copyright
|
|
2807
|
+
* Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
2808
|
+
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
2809
|
+
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
2807
2810
|
* */
|
|
2811
|
+
initializeOpenLayersProjections();
|
|
2808
2812
|
var useViewFromLayer = function useViewFromLayer(layerProps) {
|
|
2809
2813
|
var baseView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
2810
2814
|
projection: 'EPSG:3857',
|
|
2811
2815
|
zoom: 1,
|
|
2812
2816
|
center: [0, 0]
|
|
2813
2817
|
};
|
|
2814
|
-
var viewRef = useRef(
|
|
2818
|
+
var viewRef = useRef(null);
|
|
2819
|
+
if (viewRef.current === null) {
|
|
2820
|
+
try {
|
|
2821
|
+
viewRef.current = new View(baseView);
|
|
2822
|
+
} catch (e) {
|
|
2823
|
+
viewRef.current = new View({
|
|
2824
|
+
projection: 'EPSG:3857',
|
|
2825
|
+
zoom: 1,
|
|
2826
|
+
center: [0, 0]
|
|
2827
|
+
});
|
|
2828
|
+
console.warn('Projection not supported');
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2815
2831
|
var wmLayer = useGetWMLayerInstance(layerProps.service, layerProps.name, layerProps.id);
|
|
2816
2832
|
useEffect(function () {
|
|
2817
2833
|
if (!wmLayer) {
|
|
2818
2834
|
return;
|
|
2819
2835
|
}
|
|
2820
2836
|
var layerProjectionForCode = wmLayer.getProjection(viewRef.current.getProjection().getCode());
|
|
2821
|
-
if (!layerProjectionForCode) {
|
|
2837
|
+
if (!layerProjectionForCode || !layerProjectionForCode.bbox) {
|
|
2822
2838
|
return;
|
|
2823
2839
|
}
|
|
2824
2840
|
viewRef.current.fit(layerProjectionForCode.bbox.getExtent());
|
|
@@ -2826,14 +2842,30 @@ var useViewFromLayer = function useViewFromLayer(layerProps) {
|
|
|
2826
2842
|
return viewRef.current;
|
|
2827
2843
|
};
|
|
2828
2844
|
|
|
2845
|
+
var USEANIMATIONFORLAYER_DEFAULT_NUMSTEPS = 48;
|
|
2846
|
+
var USEANIMATIONFORLAYER_DEFAULT_UPDATEINTERVALMS = 60000;
|
|
2847
|
+
var USEANIMATIONFORLAYER_DEFAULT_MSINHOUR = 3600000;
|
|
2848
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
2829
2849
|
var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInMs) {
|
|
2830
|
-
var numStepsTillLatest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :
|
|
2831
|
-
var checkForUpdatesMs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] :
|
|
2850
|
+
var numStepsTillLatest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : USEANIMATIONFORLAYER_DEFAULT_NUMSTEPS;
|
|
2851
|
+
var checkForUpdatesMs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : USEANIMATIONFORLAYER_DEFAULT_UPDATEINTERVALMS;
|
|
2852
|
+
var now = dateUtils.getNowUtc().getTime();
|
|
2832
2853
|
var animationStep = useRef(0);
|
|
2833
2854
|
var _React$useState = React__default.useState(''),
|
|
2834
2855
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2835
2856
|
timeValue = _React$useState2[0],
|
|
2836
2857
|
setTimeValue = _React$useState2[1];
|
|
2858
|
+
var _React$useState3 = React__default.useState({
|
|
2859
|
+
timespan: {
|
|
2860
|
+
start: now - USEANIMATIONFORLAYER_DEFAULT_MSINHOUR,
|
|
2861
|
+
end: now,
|
|
2862
|
+
step: USEANIMATIONFORLAYER_DEFAULT_MSINHOUR
|
|
2863
|
+
},
|
|
2864
|
+
isAnimating: true
|
|
2865
|
+
}),
|
|
2866
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
2867
|
+
timeSpan = _React$useState4[0],
|
|
2868
|
+
setTimeSpan = _React$useState4[1];
|
|
2837
2869
|
var wmLayer = useGetWMLayerInstance(layerProps.service, layerProps.name, layerProps.id);
|
|
2838
2870
|
var trigger = React__default.useCallback(function () {
|
|
2839
2871
|
animationStep.current += 1;
|
|
@@ -2850,6 +2882,36 @@ var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInM
|
|
|
2850
2882
|
}
|
|
2851
2883
|
}, [numStepsTillLatest, wmLayer]);
|
|
2852
2884
|
useSetIntervalWhenVisible(trigger, intervalInMs);
|
|
2885
|
+
var calculateTimeSpan = React__default.useCallback(function () {
|
|
2886
|
+
var timeDim = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.getDimension('time');
|
|
2887
|
+
if (!timeDim || timeDim.size() < 2) {
|
|
2888
|
+
return;
|
|
2889
|
+
}
|
|
2890
|
+
var animStartTimeStep = Math.max(0, timeDim.size() - numStepsTillLatest);
|
|
2891
|
+
var lastTimeStep = Math.max(0, timeDim.size() - 1);
|
|
2892
|
+
// There are no timesteps available
|
|
2893
|
+
if (lastTimeStep <= animStartTimeStep) {
|
|
2894
|
+
return;
|
|
2895
|
+
}
|
|
2896
|
+
var secondTolastTimeStep = Math.max(0, timeDim.size() - 2);
|
|
2897
|
+
var timeResolution = timeDim.getValueForIndexAsTime(lastTimeStep) - timeDim.getValueForIndexAsTime(secondTolastTimeStep);
|
|
2898
|
+
var newTimeSpan = {
|
|
2899
|
+
timespan: {
|
|
2900
|
+
start: timeDim.getValueForIndexAsTime(animStartTimeStep),
|
|
2901
|
+
end: timeDim.getValueForIndexAsTime(lastTimeStep),
|
|
2902
|
+
step: timeResolution
|
|
2903
|
+
},
|
|
2904
|
+
isAnimating: true
|
|
2905
|
+
};
|
|
2906
|
+
if (timeValue === '') {
|
|
2907
|
+
setTimeValue(timeDim.getValueForIndex(animStartTimeStep));
|
|
2908
|
+
}
|
|
2909
|
+
setTimeSpan(newTimeSpan);
|
|
2910
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2911
|
+
}, [numStepsTillLatest, wmLayer]);
|
|
2912
|
+
useEffect(function () {
|
|
2913
|
+
calculateTimeSpan();
|
|
2914
|
+
}, [calculateTimeSpan, wmLayer]);
|
|
2853
2915
|
var refetchLayer = React__default.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
2854
2916
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2855
2917
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -2857,16 +2919,22 @@ var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInM
|
|
|
2857
2919
|
_context.next = 2;
|
|
2858
2920
|
return wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.parseLayer(true);
|
|
2859
2921
|
case 2:
|
|
2922
|
+
calculateTimeSpan();
|
|
2923
|
+
case 3:
|
|
2860
2924
|
case "end":
|
|
2861
2925
|
return _context.stop();
|
|
2862
2926
|
}
|
|
2863
2927
|
}, _callee);
|
|
2864
|
-
})), [wmLayer]);
|
|
2928
|
+
})), [calculateTimeSpan, wmLayer]);
|
|
2929
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
2865
2930
|
useSetIntervalWhenVisible(refetchLayer, checkForUpdatesMs);
|
|
2866
|
-
return
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2931
|
+
return {
|
|
2932
|
+
dimensions: [{
|
|
2933
|
+
name: 'time',
|
|
2934
|
+
currentValue: timeValue
|
|
2935
|
+
}],
|
|
2936
|
+
timeContext: timeSpan
|
|
2937
|
+
};
|
|
2870
2938
|
};
|
|
2871
2939
|
|
|
2872
2940
|
var TiledWMSLayer = function TiledWMSLayer(_ref) {
|
|
@@ -3209,7 +3277,8 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
3209
3277
|
|
|
3210
3278
|
var WEBMAP_REACT_NAMESPACE = 'webmapreact';
|
|
3211
3279
|
var useWebmapReactTranslation = function useWebmapReactTranslation() {
|
|
3212
|
-
|
|
3280
|
+
var ns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : WEBMAP_REACT_NAMESPACE;
|
|
3281
|
+
return useTranslation(ns);
|
|
3213
3282
|
};
|
|
3214
3283
|
|
|
3215
3284
|
var LegendLayout = function LegendLayout(_ref) {
|
|
@@ -3543,7 +3612,7 @@ var MapControls = function MapControls(_ref) {
|
|
|
3543
3612
|
userSelect: 'none'
|
|
3544
3613
|
}
|
|
3545
3614
|
}, props), {}, {
|
|
3546
|
-
children: jsx(
|
|
3615
|
+
children: jsx(Grid, {
|
|
3547
3616
|
sx: {
|
|
3548
3617
|
'& > button': {
|
|
3549
3618
|
marginBottom: 1
|
|
@@ -6013,7 +6082,7 @@ var GeoJSONTextField = function GeoJSONTextField(_ref) {
|
|
|
6013
6082
|
setValidity(false);
|
|
6014
6083
|
}
|
|
6015
6084
|
};
|
|
6016
|
-
return jsx(
|
|
6085
|
+
return jsx(Grid, {
|
|
6017
6086
|
size: {
|
|
6018
6087
|
xs: 12
|
|
6019
6088
|
},
|
|
@@ -6055,7 +6124,7 @@ var FeatureLayers = function FeatureLayers(_ref) {
|
|
|
6055
6124
|
label: "".concat(index + 1, ": ").concat(geojson.features[index].geometry.type)
|
|
6056
6125
|
};
|
|
6057
6126
|
}) : [];
|
|
6058
|
-
return jsx(
|
|
6127
|
+
return jsx(Grid, {
|
|
6059
6128
|
size: {
|
|
6060
6129
|
sm: 12
|
|
6061
6130
|
},
|
|
@@ -6100,7 +6169,7 @@ var EditModeButton = function EditModeButton(_ref) {
|
|
|
6100
6169
|
var isInEditMode = _ref.isInEditMode,
|
|
6101
6170
|
drawMode = _ref.drawMode,
|
|
6102
6171
|
onToggleEditMode = _ref.onToggleEditMode;
|
|
6103
|
-
return jsx(
|
|
6172
|
+
return jsx(Grid, {
|
|
6104
6173
|
size: {
|
|
6105
6174
|
xs: 12
|
|
6106
6175
|
},
|
|
@@ -6648,7 +6717,7 @@ var StoryLayoutGrid = function StoryLayoutGrid(_ref) {
|
|
|
6648
6717
|
height: '100%',
|
|
6649
6718
|
padding: 2
|
|
6650
6719
|
},
|
|
6651
|
-
children: jsx(
|
|
6720
|
+
children: jsx(Grid, {
|
|
6652
6721
|
spacing: 2,
|
|
6653
6722
|
container: true,
|
|
6654
6723
|
children: children
|
|
@@ -6712,7 +6781,7 @@ var IntersectionSelect = function IntersectionSelect(_ref) {
|
|
|
6712
6781
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
6713
6782
|
activeIntersection = _React$useState2[0],
|
|
6714
6783
|
setActiveIntersection = _React$useState2[1];
|
|
6715
|
-
return jsx(
|
|
6784
|
+
return jsx(Grid, {
|
|
6716
6785
|
size: {
|
|
6717
6786
|
sm: 12
|
|
6718
6787
|
},
|
|
@@ -7714,13 +7783,9 @@ var shapeButtonNL = {
|
|
|
7714
7783
|
selectionType: firSelectionType
|
|
7715
7784
|
};
|
|
7716
7785
|
var shapeButtonBE = {
|
|
7717
|
-
drawModeId: 'fir-tool-BE',
|
|
7718
7786
|
value: DRAWMODE.POLYGON,
|
|
7719
7787
|
title: 'Custom FIR BE polygon',
|
|
7720
|
-
shape: intersectionShapeBE
|
|
7721
|
-
isSelectable: false,
|
|
7722
|
-
selectionType: firSelectionType
|
|
7723
|
-
};
|
|
7788
|
+
shape: intersectionShapeBE};
|
|
7724
7789
|
var exampleIntersectionsMultiDrawTool = [{
|
|
7725
7790
|
title: 'NL',
|
|
7726
7791
|
geojson: shapeButtonNL.shape
|
|
@@ -9103,7 +9168,10 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
|
|
|
9103
9168
|
origin: origin,
|
|
9104
9169
|
layerId: wmLayer.id,
|
|
9105
9170
|
dimensions: layerDimensions
|
|
9106
|
-
}
|
|
9171
|
+
},
|
|
9172
|
+
error: wmLayer.hasError ? {
|
|
9173
|
+
layerId: wmLayer.id
|
|
9174
|
+
} : undefined
|
|
9107
9175
|
};
|
|
9108
9176
|
return updateObject;
|
|
9109
9177
|
};
|
|
@@ -10407,6 +10475,7 @@ var MapWarningProperties = function MapWarningProperties(_ref) {
|
|
|
10407
10475
|
display: 'flex',
|
|
10408
10476
|
justifyContent: 'center',
|
|
10409
10477
|
left: '50px',
|
|
10478
|
+
top: '70px',
|
|
10410
10479
|
zIndex: 10
|
|
10411
10480
|
},
|
|
10412
10481
|
children: jsxs("div", {
|
|
@@ -10555,7 +10624,7 @@ var DimensionSelectDialog = function DimensionSelectDialog(_ref) {
|
|
|
10555
10624
|
style: {
|
|
10556
10625
|
padding: 4
|
|
10557
10626
|
},
|
|
10558
|
-
children: jsx(
|
|
10627
|
+
children: jsx(Grid, {
|
|
10559
10628
|
container: true,
|
|
10560
10629
|
direction: "row",
|
|
10561
10630
|
children: children
|
|
@@ -10700,7 +10769,7 @@ var MapDimensionSelect = function MapDimensionSelect(_ref2) {
|
|
|
10700
10769
|
var marks = marksByDimension(t, wmsDimension);
|
|
10701
10770
|
var isLayerDimensionSynced = layerDimension.synced !== undefined && layerDimension.synced === true;
|
|
10702
10771
|
var tooltipTitle = isLayerDimensionSynced ? t('webmap-react-click-disconnect') : t('webmap-react-click-connect');
|
|
10703
|
-
return jsxs(
|
|
10772
|
+
return jsxs(Grid, {
|
|
10704
10773
|
size: {
|
|
10705
10774
|
xs: 'auto'
|
|
10706
10775
|
},
|
|
@@ -10786,15 +10855,15 @@ var LayerInfoList = function LayerInfoList(_ref) {
|
|
|
10786
10855
|
variant: "body2",
|
|
10787
10856
|
sx: textStyleWithMargin,
|
|
10788
10857
|
children: "-"
|
|
10789
|
-
}) : jsx(
|
|
10858
|
+
}) : jsx(Grid, {
|
|
10790
10859
|
container: true,
|
|
10791
10860
|
direction: "column",
|
|
10792
10861
|
children: list.map(function (item) {
|
|
10793
10862
|
return jsxs("div", {
|
|
10794
|
-
children: [jsxs(
|
|
10863
|
+
children: [jsxs(Grid, {
|
|
10795
10864
|
container: true,
|
|
10796
10865
|
direction: "row",
|
|
10797
|
-
children: [item.icon, jsx(
|
|
10866
|
+
children: [item.icon, jsx(Grid, {
|
|
10798
10867
|
sx: {
|
|
10799
10868
|
marginLeft: '10px'
|
|
10800
10869
|
},
|
|
@@ -10804,7 +10873,7 @@ var LayerInfoList = function LayerInfoList(_ref) {
|
|
|
10804
10873
|
children: [item.label, ":"]
|
|
10805
10874
|
})
|
|
10806
10875
|
})]
|
|
10807
|
-
}), jsx(
|
|
10876
|
+
}), jsx(Grid, {
|
|
10808
10877
|
container: true,
|
|
10809
10878
|
direction: "row",
|
|
10810
10879
|
sx: {
|
|
@@ -11108,6 +11177,8 @@ var HoldShiftToZoomMessage = function HoldShiftToZoomMessage() {
|
|
|
11108
11177
|
showMessage = _useState2[0],
|
|
11109
11178
|
setShowMessage = _useState2[1];
|
|
11110
11179
|
var timerRef = useRef();
|
|
11180
|
+
var _useWebmapReactTransl = useWebmapReactTranslation(WEBMAP_NAMESPACE),
|
|
11181
|
+
t = _useWebmapReactTransl.t;
|
|
11111
11182
|
useEffect(function () {
|
|
11112
11183
|
var updateScroll = function updateScroll(e) {
|
|
11113
11184
|
if (e.deltaY) {
|
|
@@ -11157,7 +11228,8 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11157
11228
|
_ref$passiveMap = _ref.passiveMap,
|
|
11158
11229
|
passiveMap = _ref$passiveMap === void 0 ? false : _ref$passiveMap,
|
|
11159
11230
|
_ref$holdShiftToScrol = _ref.holdShiftToScroll,
|
|
11160
|
-
holdShiftToScroll = _ref$holdShiftToScrol === void 0 ? false : _ref$holdShiftToScrol
|
|
11231
|
+
holdShiftToScroll = _ref$holdShiftToScrol === void 0 ? false : _ref$holdShiftToScrol,
|
|
11232
|
+
mapId = _ref.mapId;
|
|
11161
11233
|
var mapRef = useRef(null);
|
|
11162
11234
|
var _useState = useState(null),
|
|
11163
11235
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -11169,7 +11241,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11169
11241
|
zoom: 1,
|
|
11170
11242
|
center: [0, 0]
|
|
11171
11243
|
}));
|
|
11172
|
-
var mapView = view
|
|
11244
|
+
var mapView = view && view.getCenter() ? view : viewRef.current;
|
|
11173
11245
|
useEffect(function () {
|
|
11174
11246
|
if (!mapRef.current) {
|
|
11175
11247
|
return function () {};
|
|
@@ -11248,6 +11320,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
11248
11320
|
return jsx(MapContext.Provider, {
|
|
11249
11321
|
value: memoizedMapContext,
|
|
11250
11322
|
children: jsxs("div", {
|
|
11323
|
+
id: "mapcontainer_".concat(mapId),
|
|
11251
11324
|
ref: mapRef,
|
|
11252
11325
|
"data-testid": "openlayers-mapview",
|
|
11253
11326
|
role: "application",
|
|
@@ -11526,7 +11599,7 @@ var FEATURE_VERTICE_HANDLE_IMAGE = new Circle({
|
|
|
11526
11599
|
});
|
|
11527
11600
|
var ICON_LOCATIONMARKER = createIconStyle(locationPath, {
|
|
11528
11601
|
render: {
|
|
11529
|
-
fillStyle: '#
|
|
11602
|
+
fillStyle: '#051039'
|
|
11530
11603
|
},
|
|
11531
11604
|
icon: {
|
|
11532
11605
|
anchor: [0.5, 1]
|
|
@@ -11612,6 +11685,29 @@ var FEATURE_EDR_HOVER = [new Style$1({
|
|
|
11612
11685
|
width: 1.5
|
|
11613
11686
|
})
|
|
11614
11687
|
})];
|
|
11688
|
+
var FEATURE_MY_LOCATION = new Style$1({
|
|
11689
|
+
renderer: function renderer(pixelCoordinates, state) {
|
|
11690
|
+
var ctx = state.context;
|
|
11691
|
+
var coord = pixelCoordinates;
|
|
11692
|
+
ctx.save();
|
|
11693
|
+
// Draw outer circle with shadow
|
|
11694
|
+
ctx.strokeStyle = '#fff';
|
|
11695
|
+
ctx.fillStyle = '#fff';
|
|
11696
|
+
ctx.shadowColor = '#00000080';
|
|
11697
|
+
ctx.shadowBlur = 10;
|
|
11698
|
+
ctx.beginPath();
|
|
11699
|
+
ctx.arc(coord[0], coord[1], 24, 0, 2 * Math.PI);
|
|
11700
|
+
ctx.fill();
|
|
11701
|
+
ctx.shadowBlur = 0;
|
|
11702
|
+
// Draw inner circle
|
|
11703
|
+
ctx.fillStyle = '#186dff';
|
|
11704
|
+
ctx.beginPath();
|
|
11705
|
+
ctx.arc(coord[0], coord[1], 18, 0, 2 * Math.PI);
|
|
11706
|
+
ctx.fill();
|
|
11707
|
+
// Reset transformations
|
|
11708
|
+
ctx.restore();
|
|
11709
|
+
}
|
|
11710
|
+
});
|
|
11615
11711
|
var labelOptions = {
|
|
11616
11712
|
font: '16px Roboto',
|
|
11617
11713
|
padding: [8, 8, 8, 8],
|
|
@@ -11646,6 +11742,17 @@ var multiPolygonLabelBaseStyle = new Style$1({
|
|
|
11646
11742
|
return largestPolygon.getInteriorPoint();
|
|
11647
11743
|
}
|
|
11648
11744
|
});
|
|
11745
|
+
// MultiLineStrings need separate handling to only draw single label
|
|
11746
|
+
var multiLineStringLabelBaseStyle = new Style$1({
|
|
11747
|
+
text: new Text(labelOptions),
|
|
11748
|
+
geometry: function geometry(feature) {
|
|
11749
|
+
var lines = feature.getGeometry().getLineStrings();
|
|
11750
|
+
var longestLine = lines.reduce(function (prev, curr) {
|
|
11751
|
+
return prev.getLength() > curr.getLength() ? prev : curr;
|
|
11752
|
+
});
|
|
11753
|
+
return longestLine;
|
|
11754
|
+
}
|
|
11755
|
+
});
|
|
11649
11756
|
var textLabelStyle = function textLabelStyle(text) {
|
|
11650
11757
|
var _labelBaseStyle$getTe;
|
|
11651
11758
|
(_labelBaseStyle$getTe = labelBaseStyle.getText()) === null || _labelBaseStyle$getTe === void 0 || _labelBaseStyle$getTe.setText(text);
|
|
@@ -11656,31 +11763,16 @@ var multiPolygonLabelStyle = function multiPolygonLabelStyle(text) {
|
|
|
11656
11763
|
(_multiPolygonLabelBas = multiPolygonLabelBaseStyle.getText()) === null || _multiPolygonLabelBas === void 0 || _multiPolygonLabelBas.setText(text);
|
|
11657
11764
|
return multiPolygonLabelBaseStyle;
|
|
11658
11765
|
};
|
|
11766
|
+
var multiLineStringLabelStyle = function multiLineStringLabelStyle(text) {
|
|
11767
|
+
var _multiLineStringLabel;
|
|
11768
|
+
(_multiLineStringLabel = multiLineStringLabelBaseStyle.getText()) === null || _multiLineStringLabel === void 0 || _multiLineStringLabel.setText(text);
|
|
11769
|
+
return multiLineStringLabelBaseStyle;
|
|
11770
|
+
};
|
|
11659
11771
|
var stylesByMapFeatureClass = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, MapFeatureClass.GenericMarker, function (f) {
|
|
11660
11772
|
return !f.get('hover') ? ICON_LOCATIONMARKER : [ICON_LOCATIONMARKER, textLabelStyle(f.getProperties().name)];
|
|
11661
|
-
}), MapFeatureClass.MyLocation,
|
|
11662
|
-
|
|
11663
|
-
|
|
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) {
|
|
11773
|
+
}), MapFeatureClass.MyLocation, function (feature) {
|
|
11774
|
+
return !feature.get('hover') ? FEATURE_MY_LOCATION : [FEATURE_MY_LOCATION, textLabelStyle(feature.getProperties().name)];
|
|
11775
|
+
}), MapFeatureClass.ObservationStation, function (f) {
|
|
11684
11776
|
return !f.get('hover') ? FEATURE_OBSERVATIONSTATION : [].concat(FEATURE_OBSERVATIONSTATION_HOVER, [textLabelStyle(f.getProperties().name)]);
|
|
11685
11777
|
}), MapFeatureClass.EDRFeature, function (f) {
|
|
11686
11778
|
return !f.get('hover') ? FEATURE_EDR : [].concat(FEATURE_EDR_HOVER, [textLabelStyle(f.getProperties().name)]);
|
|
@@ -11751,22 +11843,49 @@ var inlineFeatureStyle = function inlineFeatureStyle(f) {
|
|
|
11751
11843
|
return styles;
|
|
11752
11844
|
};
|
|
11753
11845
|
var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(f, resolution) {
|
|
11754
|
-
var
|
|
11755
|
-
|
|
11756
|
-
fill =
|
|
11757
|
-
stroke =
|
|
11846
|
+
var props = f.getProperties();
|
|
11847
|
+
var hidden = props.hidden,
|
|
11848
|
+
fill = props.fill,
|
|
11849
|
+
stroke = props.stroke,
|
|
11850
|
+
hover = props.hover,
|
|
11851
|
+
mapFeatureClass = props.mapFeatureClass,
|
|
11852
|
+
showNameOnHover = props.showNameOnHover,
|
|
11853
|
+
name = props.name,
|
|
11854
|
+
geometry = props.geometry,
|
|
11855
|
+
selectionType = props.selectionType;
|
|
11758
11856
|
if (hidden === true) {
|
|
11759
11857
|
return [];
|
|
11760
11858
|
}
|
|
11859
|
+
var shouldHighlight = mapFeatureClass !== MapFeatureClass.ObservationStation && !showNameOnHover && selectionType !== 'fir';
|
|
11860
|
+
// Highlight map polygons on hover
|
|
11861
|
+
if (hover && shouldHighlight) {
|
|
11862
|
+
return new Style$1({
|
|
11863
|
+
stroke: new Stroke({
|
|
11864
|
+
color: stroke || '#E27D00',
|
|
11865
|
+
width: 3
|
|
11866
|
+
}),
|
|
11867
|
+
fill: new Fill({
|
|
11868
|
+
color: fill || 'rgba(226, 125, 0, 0.6)'
|
|
11869
|
+
}),
|
|
11870
|
+
zIndex: 9999
|
|
11871
|
+
});
|
|
11872
|
+
}
|
|
11873
|
+
if (hover && showNameOnHover && (fill || stroke)) {
|
|
11874
|
+
var type = geometry.getType();
|
|
11875
|
+
switch (type) {
|
|
11876
|
+
case 'MultiPolygon':
|
|
11877
|
+
return [].concat(_toConsumableArray(inlineFeatureStyle(f)), [multiPolygonLabelStyle(name)]);
|
|
11878
|
+
case 'MultiLineString':
|
|
11879
|
+
return [].concat(_toConsumableArray(inlineFeatureStyle(f)), [multiLineStringLabelStyle(name)]);
|
|
11880
|
+
default:
|
|
11881
|
+
return [].concat(_toConsumableArray(inlineFeatureStyle(f)), [textLabelStyle(name)]);
|
|
11882
|
+
}
|
|
11883
|
+
}
|
|
11761
11884
|
if (fill || stroke) {
|
|
11762
11885
|
return inlineFeatureStyle(f);
|
|
11763
11886
|
}
|
|
11764
|
-
var
|
|
11765
|
-
|
|
11766
|
-
if (typeof styleOrFunction === 'function') {
|
|
11767
|
-
return styleOrFunction(f, resolution);
|
|
11768
|
-
}
|
|
11769
|
-
return styleOrFunction;
|
|
11887
|
+
var styleOrFunction = stylesByMapFeatureClass[mapFeatureClass || MapFeatureClass["default"]];
|
|
11888
|
+
return typeof styleOrFunction === 'function' ? styleOrFunction(f, resolution) : styleOrFunction;
|
|
11770
11889
|
};
|
|
11771
11890
|
// Used for polygons, boxes and linestrings
|
|
11772
11891
|
var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(f) {
|
|
@@ -12121,4 +12240,4 @@ var isOpenLayersEnabled = function isOpenLayersEnabled() {
|
|
|
12121
12240
|
return _useOpenLayers;
|
|
12122
12241
|
};
|
|
12123
12242
|
|
|
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 };
|
|
12243
|
+
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.
|
|
3
|
+
"version": "12.3.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.
|
|
11
|
+
"@opengeoweb/webmap": "12.3.0",
|
|
12
12
|
"axios": "^1.7.7",
|
|
13
|
-
"@opengeoweb/theme": "12.
|
|
14
|
-
"@opengeoweb/shared": "12.
|
|
13
|
+
"@opengeoweb/theme": "12.3.0",
|
|
14
|
+
"@opengeoweb/shared": "12.3.0",
|
|
15
15
|
"lodash": "^4.17.21",
|
|
16
16
|
"ol": "^10.4.0",
|
|
17
17
|
"proj4": "^2.9.2",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"immer": "^10.0.3",
|
|
20
20
|
"react-resize-detector": "^9.1.0",
|
|
21
21
|
"i18next": "^23.11.5",
|
|
22
|
-
"@mui/material": "^
|
|
22
|
+
"@mui/material": "^7.0.1",
|
|
23
23
|
"react-i18next": "^15.1.1",
|
|
24
|
-
"@tanstack/react-query": "^5.
|
|
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:
|
|
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;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { Dimension } from '@opengeoweb/webmap';
|
|
2
2
|
import type { OpenLayersLayerProps } from '../components/OpenLayers/layers';
|
|
3
|
-
|
|
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 {};
|
package/src/lib/utils/i18n.d.ts
CHANGED
|
@@ -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<
|
|
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 };
|