@opengeoweb/webmap 20.0.1 → 20.1.0-nightly-20261017
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/dist/index.esm.js
CHANGED
|
@@ -745,13 +745,13 @@ var makeNodeLayerFromWMSGetCapabilityLayer = function makeNodeLayerFromWMSGetCap
|
|
|
745
745
|
if (nestedLayerPath === void 0) {
|
|
746
746
|
nestedLayerPath = [];
|
|
747
747
|
}
|
|
748
|
-
// geographicBoundingBox and styles resolve nearest-parent-first, so reduce over
|
|
748
|
+
// geographicBoundingBox, dimensions and styles resolve nearest-parent-first, so reduce over
|
|
749
749
|
// a reversed copy of nestedLayerPath without mutating the original parameter
|
|
750
750
|
var reversedLayerPath = nestedLayerPath.slice().reverse();
|
|
751
751
|
var geographicBoundingBox = reversedLayerPath.reduce(function (npath, lprops) {
|
|
752
752
|
return npath || lprops.geographicBoundingBox;
|
|
753
753
|
}, addBoundingBoxForLayer(layer));
|
|
754
|
-
var dimensions =
|
|
754
|
+
var dimensions = reversedLayerPath.reduce(function (dims, props) {
|
|
755
755
|
var parentDims = (props.dimensions || []).filter(function (dim) {
|
|
756
756
|
return !dims.some(function (dimit) {
|
|
757
757
|
return dimit.name === dim.name;
|
|
@@ -810,6 +810,9 @@ var getFirstPartOfDimensionValueSet = function getFirstPartOfDimensionValueSet(i
|
|
|
810
810
|
var getCurrentImageTime = function getCurrentImageTime() {
|
|
811
811
|
return new Date().getTime();
|
|
812
812
|
};
|
|
813
|
+
// A failed image becomes stale after this delay, so it is retried. The delay doubles with every failed attempt, up to the max.
|
|
814
|
+
var WMIMAGE_ERROR_RETRY_DELAY_MS = 10000;
|
|
815
|
+
var WMIMAGE_ERROR_RETRY_MAX_DELAY_MS = 300000;
|
|
813
816
|
/**
|
|
814
817
|
* WMImage provides an API to the HTML image element. It is used for caching and easier access to images.
|
|
815
818
|
*/
|
|
@@ -864,8 +867,6 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
864
867
|
_this._loadEvent(false);
|
|
865
868
|
});
|
|
866
869
|
this.el.addEventListener('error', function () {
|
|
867
|
-
_this._imageTimeStampAtError = getCurrentImageTime();
|
|
868
|
-
_this._numFailedAttempts += 1;
|
|
869
870
|
_this._loadEvent(true);
|
|
870
871
|
});
|
|
871
872
|
this.el.onselectstart = function () {
|
|
@@ -914,7 +915,14 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
914
915
|
return !this._isLoaded && !this._isLoading;
|
|
915
916
|
};
|
|
916
917
|
_proto.isStale = function isStale() {
|
|
917
|
-
if (!this._isLoaded
|
|
918
|
+
if (!this._isLoaded) {
|
|
919
|
+
return false;
|
|
920
|
+
}
|
|
921
|
+
if (this._hasError) {
|
|
922
|
+
// Retry failed images after a delay, otherwise a temporary server error would hide the image permanently
|
|
923
|
+
return this.getLastErrorMSecondsAgo() >= this.getErrorRetryDelay();
|
|
924
|
+
}
|
|
925
|
+
if (this._loadedAtTime === undefined) {
|
|
918
926
|
return false;
|
|
919
927
|
}
|
|
920
928
|
if (this._maxAgeSeconds === null || this._maxAgeSeconds === undefined) {
|
|
@@ -943,6 +951,13 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
943
951
|
_proto.getNumFailedAttempts = function getNumFailedAttempts() {
|
|
944
952
|
return this._numFailedAttempts;
|
|
945
953
|
}
|
|
954
|
+
/**
|
|
955
|
+
* @returns The amount of milliseconds after which a failed image becomes stale and should be retried
|
|
956
|
+
*/;
|
|
957
|
+
_proto.getErrorRetryDelay = function getErrorRetryDelay() {
|
|
958
|
+
var numRetries = Math.max(this._numFailedAttempts - 1, 0);
|
|
959
|
+
return Math.min(WMIMAGE_ERROR_RETRY_DELAY_MS * Math.pow(2, numRetries), WMIMAGE_ERROR_RETRY_MAX_DELAY_MS);
|
|
960
|
+
}
|
|
946
961
|
/**
|
|
947
962
|
* Set source of image, but it will not load the image yet.
|
|
948
963
|
* @param src URL of the image to load
|
|
@@ -1065,6 +1080,12 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
1065
1080
|
};
|
|
1066
1081
|
var request = new Request(url);
|
|
1067
1082
|
authFetch(request, options).then(function (response) {
|
|
1083
|
+
if (!response.ok) {
|
|
1084
|
+
var _response$body;
|
|
1085
|
+
void ((_response$body = response.body) == null ? void 0 : _response$body.cancel());
|
|
1086
|
+
_this3._loadEvent(true);
|
|
1087
|
+
return;
|
|
1088
|
+
}
|
|
1068
1089
|
_this3._setMaxAgeFromResponseHeaders(response);
|
|
1069
1090
|
response.blob().then(function (imageBlob) {
|
|
1070
1091
|
_this3.el.src = URL.createObjectURL(imageBlob);
|
|
@@ -1079,15 +1100,15 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
1079
1100
|
};
|
|
1080
1101
|
_proto._load = function _load() {
|
|
1081
1102
|
this._loadStartTime = getCurrentImageTime();
|
|
1082
|
-
this._hasError = false;
|
|
1083
1103
|
if (this._isLoaded) {
|
|
1084
|
-
if (!this.isStale()) {
|
|
1104
|
+
if (!this._hasError && !this.isStale()) {
|
|
1085
1105
|
this._loadEvent(false);
|
|
1086
1106
|
return;
|
|
1087
1107
|
}
|
|
1088
1108
|
this._isLoaded = false;
|
|
1089
1109
|
this._srcLoaded = undefined;
|
|
1090
1110
|
}
|
|
1111
|
+
this._hasError = false;
|
|
1091
1112
|
this._isLoading = true;
|
|
1092
1113
|
if (!this.srcToLoad) {
|
|
1093
1114
|
this._loadEvent(true);
|
|
@@ -1114,6 +1135,12 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
1114
1135
|
_proto._loadEvent = function _loadEvent(hasError) {
|
|
1115
1136
|
var _this$loadEventCallba;
|
|
1116
1137
|
this._loadDuration = hasError ? undefined : getCurrentImageTime() - this._loadStartTime;
|
|
1138
|
+
if (hasError) {
|
|
1139
|
+
this._imageTimeStampAtError = getCurrentImageTime();
|
|
1140
|
+
this._numFailedAttempts += 1;
|
|
1141
|
+
} else {
|
|
1142
|
+
this._numFailedAttempts = 0;
|
|
1143
|
+
}
|
|
1117
1144
|
this._hasError = hasError;
|
|
1118
1145
|
this._isLoading = false;
|
|
1119
1146
|
this._isLoaded = true;
|
|
@@ -1122,7 +1149,9 @@ var WMImage = /*#__PURE__*/function () {
|
|
|
1122
1149
|
this._resolveAll();
|
|
1123
1150
|
(_this$loadEventCallba = this.loadEventCallback) == null || _this$loadEventCallba.call(this, this);
|
|
1124
1151
|
// Free up memory
|
|
1125
|
-
|
|
1152
|
+
if (this.el.src.startsWith('blob:')) {
|
|
1153
|
+
URL.revokeObjectURL(this.el.src);
|
|
1154
|
+
}
|
|
1126
1155
|
};
|
|
1127
1156
|
_proto.getLoadDuration = function getLoadDuration() {
|
|
1128
1157
|
return this._loadDuration;
|
|
@@ -16,6 +16,8 @@ export interface WMGeoReference {
|
|
|
16
16
|
* @returns the current time in ms
|
|
17
17
|
*/
|
|
18
18
|
export declare const getCurrentImageTime: () => number;
|
|
19
|
+
export declare const WMIMAGE_ERROR_RETRY_DELAY_MS = 10000;
|
|
20
|
+
export declare const WMIMAGE_ERROR_RETRY_MAX_DELAY_MS = 300000;
|
|
19
21
|
/**
|
|
20
22
|
* WMImage provides an API to the HTML image element. It is used for caching and easier access to images.
|
|
21
23
|
*/
|
|
@@ -68,6 +70,10 @@ export default class WMImage {
|
|
|
68
70
|
* @returns The number of failed attempts for this image
|
|
69
71
|
*/
|
|
70
72
|
getNumFailedAttempts(): number;
|
|
73
|
+
/**
|
|
74
|
+
* @returns The amount of milliseconds after which a failed image becomes stale and should be retried
|
|
75
|
+
*/
|
|
76
|
+
getErrorRetryDelay(): number;
|
|
71
77
|
/**
|
|
72
78
|
* Set source of image, but it will not load the image yet.
|
|
73
79
|
* @param src URL of the image to load
|
|
@@ -18,6 +18,20 @@ export interface TiledLayerFoundation {
|
|
|
18
18
|
export interface EDRFeatureLayerOptions {
|
|
19
19
|
collectionId: string;
|
|
20
20
|
parameterNames: string[];
|
|
21
|
+
parameterMetadata?: {
|
|
22
|
+
id?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
observedProperty?: {
|
|
26
|
+
label?: string;
|
|
27
|
+
};
|
|
28
|
+
unit?: {
|
|
29
|
+
label?: string;
|
|
30
|
+
symbol?: {
|
|
31
|
+
value?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
21
35
|
}
|
|
22
36
|
export interface STACGeoTIFFLayerOptions {
|
|
23
37
|
assetKey?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap",
|
|
3
|
-
"version": "20.0
|
|
3
|
+
"version": "20.1.0-nightly-20261017",
|
|
4
4
|
"description": "GeoWeb webmap library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opengeoweb/shared": "20.0
|
|
24
|
-
"@opengeoweb/authentication": "20.0
|
|
23
|
+
"@opengeoweb/shared": "20.1.0-nightly-20261017",
|
|
24
|
+
"@opengeoweb/authentication": "20.1.0-nightly-20261017",
|
|
25
25
|
"@tanstack/query-core": "^5.69.2",
|
|
26
26
|
"lodash": "^4.18.1",
|
|
27
27
|
"i18next": "^25.0.1",
|