@opengeoweb/webmap-react 20.0.1 → 20.1.0-nightly-20261018
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 +453 -71
- package/dist/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +14 -0
- package/dist/src/lib/components/OpenLayers/layers/OpenLayersLayer.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/layers/TimeawareImageSourceWMSLayer.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/utils/TimeAwareImageWrapper.d.ts +8 -1
- package/dist/src/lib/components/OpenLayers/utils/TimeawareImageSource.d.ts +7 -1
- package/dist/src/lib/components/OpenLayers/utils/constants.d.ts +1 -0
- package/dist/src/lib/edr-layer-api/api.d.ts +2 -0
- package/dist/src/lib/edr-layer-api/hooks.d.ts +1 -1
- package/dist/src/lib/edr-layer-api/index.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -420,6 +420,15 @@ function _defineProperty(e, r, t) {
|
|
|
420
420
|
writable: true
|
|
421
421
|
}) : e[r] = t, e;
|
|
422
422
|
}
|
|
423
|
+
function _get() {
|
|
424
|
+
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
|
|
425
|
+
var p = _superPropBase(e, t);
|
|
426
|
+
if (p) {
|
|
427
|
+
var n = Object.getOwnPropertyDescriptor(p, t);
|
|
428
|
+
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
|
|
429
|
+
}
|
|
430
|
+
}, _get.apply(null, arguments);
|
|
431
|
+
}
|
|
423
432
|
function _getPrototypeOf(t) {
|
|
424
433
|
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
425
434
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
@@ -643,6 +652,16 @@ function _setPrototypeOf(t, e) {
|
|
|
643
652
|
function _slicedToArray(r, e) {
|
|
644
653
|
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
645
654
|
}
|
|
655
|
+
function _superPropBase(t, o) {
|
|
656
|
+
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
|
|
657
|
+
return t;
|
|
658
|
+
}
|
|
659
|
+
function _superPropGet(t, o, e, r) {
|
|
660
|
+
var p = _get(_getPrototypeOf(t.prototype ), o, e);
|
|
661
|
+
return "function" == typeof p ? function (t) {
|
|
662
|
+
return p.apply(e, t);
|
|
663
|
+
} : p;
|
|
664
|
+
}
|
|
646
665
|
function _toConsumableArray(r) {
|
|
647
666
|
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
648
667
|
}
|
|
@@ -699,6 +718,7 @@ var MAX_NUMBER_STEPS_IN_TIME_SLIDER_TO_PREFETCH = 10000;
|
|
|
699
718
|
var NUMBER_PREFETCH_WORKERS = 4;
|
|
700
719
|
var NUM_IMAGES_TO_CACHE = 10000;
|
|
701
720
|
var WMS_EXTENT_RATIO_TO_VIEWPORT = 1.2;
|
|
721
|
+
var FAILED_IMAGE_RETRY_CHECK_INTERVAL_MS = 10000;
|
|
702
722
|
var TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = 'Image did not load succesfully';
|
|
703
723
|
// // To debug what dimensions are actually being used in the map, use:
|
|
704
724
|
// export const ADD_SHOW_DIMS_OPTION = true;
|
|
@@ -843,6 +863,50 @@ var openLayersGetMapImageStore = new WMImageStore(NUM_IMAGES_TO_CACHE, {
|
|
|
843
863
|
var clearImageCacheForAllMaps = function clearImageCacheForAllMaps() {
|
|
844
864
|
openLayersGetMapImageStore.clear();
|
|
845
865
|
};
|
|
866
|
+
var splitExtentAtWorldSeams = function splitExtentAtWorldSeams(extent, worldExtent) {
|
|
867
|
+
var worldWidth = worldExtent[2] - worldExtent[0];
|
|
868
|
+
if (worldWidth <= 0 || extent[2] <= extent[0]) {
|
|
869
|
+
return [{
|
|
870
|
+
requestExtent: extent,
|
|
871
|
+
displayExtent: extent
|
|
872
|
+
}];
|
|
873
|
+
}
|
|
874
|
+
var segments = [];
|
|
875
|
+
var segmentStart = extent[0];
|
|
876
|
+
var worldIndex = Math.floor((segmentStart - worldExtent[0]) / worldWidth);
|
|
877
|
+
while (segmentStart < extent[2]) {
|
|
878
|
+
var worldEnd = worldExtent[0] + (worldIndex + 1) * worldWidth;
|
|
879
|
+
while (worldEnd <= segmentStart) {
|
|
880
|
+
worldIndex += 1;
|
|
881
|
+
worldEnd = worldExtent[0] + (worldIndex + 1) * worldWidth;
|
|
882
|
+
}
|
|
883
|
+
var segmentEnd = Math.min(extent[2], worldEnd);
|
|
884
|
+
var worldOffset = worldIndex * worldWidth;
|
|
885
|
+
segments.push({
|
|
886
|
+
requestExtent: [segmentStart - worldOffset, extent[1], segmentEnd - worldOffset, extent[3]],
|
|
887
|
+
displayExtent: [segmentStart, extent[1], segmentEnd, extent[3]]
|
|
888
|
+
});
|
|
889
|
+
segmentStart = segmentEnd;
|
|
890
|
+
worldIndex += 1;
|
|
891
|
+
}
|
|
892
|
+
return segments;
|
|
893
|
+
};
|
|
894
|
+
var combineExtents = function combineExtents(extents) {
|
|
895
|
+
return [Math.min.apply(Math, _toConsumableArray(extents.map(function (extent) {
|
|
896
|
+
return extent[0];
|
|
897
|
+
}))), Math.min.apply(Math, _toConsumableArray(extents.map(function (extent) {
|
|
898
|
+
return extent[1];
|
|
899
|
+
}))), Math.max.apply(Math, _toConsumableArray(extents.map(function (extent) {
|
|
900
|
+
return extent[2];
|
|
901
|
+
}))), Math.max.apply(Math, _toConsumableArray(extents.map(function (extent) {
|
|
902
|
+
return extent[3];
|
|
903
|
+
})))];
|
|
904
|
+
};
|
|
905
|
+
var getExtentOverlapArea = function getExtentOverlapArea(extentA, extentB) {
|
|
906
|
+
var width = Math.max(0, Math.min(extentA[2], extentB[2]) - Math.max(extentA[0], extentB[0]));
|
|
907
|
+
var height = Math.max(0, Math.min(extentA[3], extentB[3]) - Math.max(extentA[1], extentB[1]));
|
|
908
|
+
return width * height;
|
|
909
|
+
};
|
|
846
910
|
var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
847
911
|
function TimeAwareImageWrapper(extent, resolution, pixelRatio) {
|
|
848
912
|
var _this;
|
|
@@ -855,6 +919,9 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
855
919
|
_this._resolvers = [];
|
|
856
920
|
_this._styleName = 'default';
|
|
857
921
|
_this._layerName = null;
|
|
922
|
+
_this._extentRatio = WMS_EXTENT_RATIO_TO_VIEWPORT;
|
|
923
|
+
_this._compositeImageKey = '';
|
|
924
|
+
_this._compositeImage = null;
|
|
858
925
|
_this.extent = extent;
|
|
859
926
|
_this.resolution = resolution;
|
|
860
927
|
_this.state = ImageState.IDLE;
|
|
@@ -872,6 +939,11 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
872
939
|
}
|
|
873
940
|
_inherits(TimeAwareImageWrapper, _ImageWrapper);
|
|
874
941
|
return _createClass(TimeAwareImageWrapper, [{
|
|
942
|
+
key: "setExtentRatio",
|
|
943
|
+
value: function setExtentRatio(extentRatio) {
|
|
944
|
+
this._extentRatio = extentRatio;
|
|
945
|
+
}
|
|
946
|
+
}, {
|
|
875
947
|
key: "getWMSGetMapRequestURL",
|
|
876
948
|
value: function getWMSGetMapRequestURL(extentToLoad, resolutionToLoad, __pixelRatio, projection, getMapUrl, params, layerName, styleName, dimProps) {
|
|
877
949
|
var pixelRatio = 1; // TODO?
|
|
@@ -888,8 +960,8 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
888
960
|
var resolution = resolutionToLoad;
|
|
889
961
|
var requestResolution = Array.isArray(resolution) ? resolution[0] : resolution || 1;
|
|
890
962
|
var newPixelRatio = pixelRatio;
|
|
891
|
-
// Load
|
|
892
|
-
var ratio =
|
|
963
|
+
// Load extentRatio^2 % larger WMS extents than the current view (default 1.2, see WMS_EXTENT_RATIO_TO_VIEWPORT)
|
|
964
|
+
var ratio = this._extentRatio;
|
|
893
965
|
var extent = extentToLoad;
|
|
894
966
|
var newExtent = getRequestExtent(extent, requestResolution, newPixelRatio, ratio);
|
|
895
967
|
// Feature in adaguc-server to display actually used dimensions in the map.
|
|
@@ -907,44 +979,184 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
907
979
|
}, {
|
|
908
980
|
key: "getAlternativeImage",
|
|
909
981
|
value: function getAlternativeImage(extent, resolution, pixelRatio, projection, getMapUrl, params, layerName, styleName, dimsProps) {
|
|
910
|
-
var
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
982
|
+
var requests = this.getWMSGetMapRequestURLs(extent, resolution, pixelRatio, projection, getMapUrl, params, layerName, styleName, dimsProps);
|
|
983
|
+
var images = requests.map(function (request) {
|
|
984
|
+
var _candidates$filter$ma;
|
|
985
|
+
var candidates = openLayersGetMapImageStore.getAltGeoReferencedImages(request.src, request.extent, request.resolution);
|
|
986
|
+
return (_candidates$filter$ma = candidates.filter(function (image) {
|
|
987
|
+
return image.isLoadedWithoutErrors() && image.geoReference;
|
|
988
|
+
}).map(function (image) {
|
|
989
|
+
return {
|
|
990
|
+
image: image,
|
|
991
|
+
overlapArea: getExtentOverlapArea(image.geoReference.extent, request.extent)
|
|
992
|
+
};
|
|
993
|
+
}).filter(function (_ref) {
|
|
994
|
+
var overlapArea = _ref.overlapArea;
|
|
995
|
+
return overlapArea > 0;
|
|
996
|
+
}).sort(function (imageA, imageB) {
|
|
997
|
+
return imageB.overlapArea - imageA.overlapArea;
|
|
998
|
+
})[0]) === null || _candidates$filter$ma === void 0 ? void 0 : _candidates$filter$ma.image;
|
|
999
|
+
});
|
|
1000
|
+
if (images.some(function (image) {
|
|
1001
|
+
return !image;
|
|
1002
|
+
})) {
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
var completeImages = images;
|
|
1006
|
+
if (completeImages.length > 1) {
|
|
1007
|
+
var uniqueImages = _toConsumableArray(new Set(completeImages));
|
|
1008
|
+
if (uniqueImages.length !== completeImages.length) {
|
|
1009
|
+
if (uniqueImages.length !== 1) {
|
|
1010
|
+
return false;
|
|
1011
|
+
}
|
|
1012
|
+
var _uniqueImages = _slicedToArray(uniqueImages, 1),
|
|
1013
|
+
_image = _uniqueImages[0];
|
|
1014
|
+
var imageExtent = _image.geoReference.extent;
|
|
1015
|
+
var requestedExtent = combineExtents(requests.map(function (request) {
|
|
1016
|
+
return request.extent;
|
|
1017
|
+
}));
|
|
1018
|
+
if (imageExtent[0] > requestedExtent[0] || imageExtent[1] > requestedExtent[1] || imageExtent[2] < requestedExtent[2] || imageExtent[3] < requestedExtent[3]) {
|
|
1019
|
+
return false;
|
|
1020
|
+
}
|
|
1021
|
+
return {
|
|
1022
|
+
el: _image.getElement(),
|
|
1023
|
+
extent: imageExtent,
|
|
1024
|
+
resolution: _image.geoReference.resolution,
|
|
1025
|
+
isLoaded: _image.isLoaded(),
|
|
1026
|
+
isLoadedWithoutErrors: _image.isLoadedWithoutErrors(),
|
|
1027
|
+
hasError: _image.hasError(),
|
|
1028
|
+
isLoading: _image.isLoading()
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
var imageRequests = completeImages.map(function (image, index) {
|
|
1032
|
+
return _objectSpread2(_objectSpread2({}, requests[index]), {}, {
|
|
1033
|
+
extent: image.geoReference.extent,
|
|
1034
|
+
resolution: image.geoReference.resolution
|
|
1035
|
+
});
|
|
1036
|
+
});
|
|
1037
|
+
var image = this.createCompositeImage(completeImages, imageRequests);
|
|
1038
|
+
if (!image) {
|
|
1039
|
+
return false;
|
|
1040
|
+
}
|
|
916
1041
|
return {
|
|
917
|
-
el:
|
|
918
|
-
extent:
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1042
|
+
el: image,
|
|
1043
|
+
extent: combineExtents(imageRequests.map(function (request) {
|
|
1044
|
+
return request.extent;
|
|
1045
|
+
})),
|
|
1046
|
+
resolution: imageRequests[0].resolution,
|
|
1047
|
+
isLoaded: completeImages.every(function (loadedImage) {
|
|
1048
|
+
return loadedImage.isLoaded();
|
|
1049
|
+
}),
|
|
1050
|
+
isLoadedWithoutErrors: completeImages.every(function (loadedImage) {
|
|
1051
|
+
return loadedImage.isLoadedWithoutErrors();
|
|
1052
|
+
}),
|
|
1053
|
+
hasError: completeImages.some(function (loadedImage) {
|
|
1054
|
+
return loadedImage.hasError();
|
|
1055
|
+
}),
|
|
1056
|
+
isLoading: completeImages.some(function (loadedImage) {
|
|
1057
|
+
return loadedImage.isLoading();
|
|
1058
|
+
})
|
|
924
1059
|
};
|
|
925
1060
|
}
|
|
926
|
-
|
|
1061
|
+
var _completeImages = _slicedToArray(completeImages, 1),
|
|
1062
|
+
geoRef = _completeImages[0];
|
|
1063
|
+
return {
|
|
1064
|
+
el: geoRef.getElement(),
|
|
1065
|
+
extent: geoRef.geoReference.extent,
|
|
1066
|
+
resolution: geoRef.geoReference.resolution,
|
|
1067
|
+
isLoaded: geoRef.isLoaded(),
|
|
1068
|
+
isLoadedWithoutErrors: geoRef.isLoadedWithoutErrors(),
|
|
1069
|
+
hasError: geoRef.hasError(),
|
|
1070
|
+
isLoading: geoRef.isLoading()
|
|
1071
|
+
};
|
|
927
1072
|
}
|
|
928
1073
|
}, {
|
|
929
1074
|
key: "hasImage",
|
|
930
1075
|
value: function hasImage(extent, resolution, pixelRatio, projection, getMapUrl, params, layerName, styleName, dimsProps) {
|
|
931
|
-
var
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1076
|
+
var requests = this.getWMSGetMapRequestURLs(extent, resolution, pixelRatio, projection, getMapUrl, params, layerName, styleName, dimsProps);
|
|
1077
|
+
var images = requests.map(function (request) {
|
|
1078
|
+
return openLayersGetMapImageStore.getImage(request.src);
|
|
1079
|
+
});
|
|
1080
|
+
if (images.some(function (image) {
|
|
1081
|
+
return !image;
|
|
1082
|
+
})) {
|
|
1083
|
+
return false;
|
|
1084
|
+
}
|
|
1085
|
+
if (images.length === 1) {
|
|
1086
|
+
var _images = _slicedToArray(images, 1),
|
|
1087
|
+
imageEl = _images[0];
|
|
937
1088
|
return {
|
|
938
1089
|
el: imageEl.getElement(),
|
|
939
|
-
extent:
|
|
940
|
-
resolution:
|
|
1090
|
+
extent: requests[0].extent,
|
|
1091
|
+
resolution: requests[0].resolution,
|
|
941
1092
|
isLoaded: imageEl.isLoaded(),
|
|
942
1093
|
isLoadedWithoutErrors: imageEl.isLoadedWithoutErrors(),
|
|
943
1094
|
hasError: imageEl.hasError(),
|
|
944
1095
|
isLoading: imageEl.isLoading()
|
|
945
1096
|
};
|
|
946
1097
|
}
|
|
947
|
-
|
|
1098
|
+
var completeImages = images;
|
|
1099
|
+
if (!completeImages.every(function (image) {
|
|
1100
|
+
return image.isLoaded();
|
|
1101
|
+
})) {
|
|
1102
|
+
return false;
|
|
1103
|
+
}
|
|
1104
|
+
var image = this.createCompositeImage(completeImages, requests);
|
|
1105
|
+
if (!image) {
|
|
1106
|
+
return false;
|
|
1107
|
+
}
|
|
1108
|
+
return {
|
|
1109
|
+
el: image,
|
|
1110
|
+
extent: combineExtents(requests.map(function (request) {
|
|
1111
|
+
return request.extent;
|
|
1112
|
+
})),
|
|
1113
|
+
resolution: requests[0].resolution,
|
|
1114
|
+
isLoaded: true,
|
|
1115
|
+
isLoadedWithoutErrors: completeImages.every(function (loadedImage) {
|
|
1116
|
+
return loadedImage.isLoadedWithoutErrors();
|
|
1117
|
+
}),
|
|
1118
|
+
hasError: completeImages.some(function (loadedImage) {
|
|
1119
|
+
return loadedImage.hasError();
|
|
1120
|
+
}),
|
|
1121
|
+
isLoading: completeImages.some(function (loadedImage) {
|
|
1122
|
+
return loadedImage.isLoading();
|
|
1123
|
+
})
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
}, {
|
|
1127
|
+
key: "createCompositeImage",
|
|
1128
|
+
value: function createCompositeImage(images, requests) {
|
|
1129
|
+
var extent = combineExtents(requests.map(function (request) {
|
|
1130
|
+
return request.extent;
|
|
1131
|
+
}));
|
|
1132
|
+
var resolution = requests[0].resolution;
|
|
1133
|
+
var imageKey = JSON.stringify([images.map(function (image) {
|
|
1134
|
+
return image.getElement().src;
|
|
1135
|
+
}), requests.map(function (request) {
|
|
1136
|
+
return request.extent;
|
|
1137
|
+
}), resolution]);
|
|
1138
|
+
if (this._compositeImage && this._compositeImageKey === imageKey) {
|
|
1139
|
+
return this._compositeImage;
|
|
1140
|
+
}
|
|
1141
|
+
var canvas = document.createElement('canvas');
|
|
1142
|
+
canvas.width = Math.ceil((extent[2] - extent[0]) / resolution);
|
|
1143
|
+
canvas.height = Math.ceil((extent[3] - extent[1]) / resolution);
|
|
1144
|
+
var context = canvas.getContext('2d');
|
|
1145
|
+
if (!context) {
|
|
1146
|
+
return false;
|
|
1147
|
+
}
|
|
1148
|
+
images.forEach(function (image, index) {
|
|
1149
|
+
if (image.hasError()) {
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
var imageExtent = requests[index].extent;
|
|
1153
|
+
var overlapsNextSegment = index < images.length - 1;
|
|
1154
|
+
var destinationWidth = (imageExtent[2] - imageExtent[0]) / resolution + (overlapsNextSegment ? 1 : 0);
|
|
1155
|
+
context.drawImage(image.getElement(), (imageExtent[0] - extent[0]) / resolution, (extent[3] - imageExtent[3]) / resolution, destinationWidth, (imageExtent[3] - imageExtent[1]) / resolution);
|
|
1156
|
+
});
|
|
1157
|
+
this._compositeImageKey = imageKey;
|
|
1158
|
+
this._compositeImage = canvas;
|
|
1159
|
+
return canvas;
|
|
948
1160
|
}
|
|
949
1161
|
}, {
|
|
950
1162
|
key: "setGeoReferencedImage",
|
|
@@ -960,22 +1172,33 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
960
1172
|
key: "load",
|
|
961
1173
|
value: function load() {
|
|
962
1174
|
var _this2 = this;
|
|
963
|
-
var
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
resolution: newResolution
|
|
1175
|
+
var requests = this.getWMSGetMapRequestURLs(this._extentToLoad, this._resolutionToLoad, this._pixelRatioToLoad, this.projection, this._getMapUrl, this._paramsToLoad, this._layerName, this._styleName, this._dimPropsToLoad);
|
|
1176
|
+
var images = requests.map(function (request) {
|
|
1177
|
+
return openLayersGetMapImageStore.getImageAndSetGeoReference(request.src, {
|
|
1178
|
+
extent: request.extent,
|
|
1179
|
+
resolution: request.resolution
|
|
1180
|
+
});
|
|
970
1181
|
});
|
|
971
|
-
if (
|
|
1182
|
+
if (images.some(function (image) {
|
|
1183
|
+
return !image;
|
|
1184
|
+
})) {
|
|
972
1185
|
return;
|
|
973
1186
|
}
|
|
974
|
-
if (
|
|
1187
|
+
if (images.length === 1) {
|
|
1188
|
+
var _images2 = _slicedToArray(images, 1),
|
|
1189
|
+
imageEl = _images2[0];
|
|
1190
|
+
if (!imageEl.isLoaded()) {
|
|
1191
|
+
this.state = ImageState.LOADING;
|
|
1192
|
+
this.changed();
|
|
1193
|
+
void imageEl.loadAwait()["finally"](function () {
|
|
1194
|
+
return _this2.load();
|
|
1195
|
+
});
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
975
1198
|
this.state = ImageState.LOADED;
|
|
976
1199
|
this.setImage(imageEl.getElement());
|
|
977
|
-
this.extent =
|
|
978
|
-
this.resolution =
|
|
1200
|
+
this.extent = requests[0].extent;
|
|
1201
|
+
this.resolution = requests[0].resolution;
|
|
979
1202
|
this.changed();
|
|
980
1203
|
if (imageEl.hasError()) {
|
|
981
1204
|
this._rejectAll(imageEl.getSrc());
|
|
@@ -984,10 +1207,50 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
984
1207
|
}
|
|
985
1208
|
return;
|
|
986
1209
|
}
|
|
1210
|
+
var loadedImages = images;
|
|
1211
|
+
if (loadedImages.every(function (image) {
|
|
1212
|
+
return image.isLoaded();
|
|
1213
|
+
})) {
|
|
1214
|
+
this.state = ImageState.LOADED;
|
|
1215
|
+
var image = this.createCompositeImage(loadedImages, requests);
|
|
1216
|
+
if (!image) {
|
|
1217
|
+
this.state = ImageState.ERROR;
|
|
1218
|
+
this.changed();
|
|
1219
|
+
this._rejectAll(loadedImages[0].getSrc());
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
this.setImage(image);
|
|
1223
|
+
this.extent = combineExtents(requests.map(function (request) {
|
|
1224
|
+
return request.extent;
|
|
1225
|
+
}));
|
|
1226
|
+
this.resolution = requests[0].resolution;
|
|
1227
|
+
this.changed();
|
|
1228
|
+
var failedImage = loadedImages.find(function (loadedImage) {
|
|
1229
|
+
return loadedImage.hasError();
|
|
1230
|
+
});
|
|
1231
|
+
if (failedImage) {
|
|
1232
|
+
this._rejectAll(failedImage.getSrc());
|
|
1233
|
+
} else {
|
|
1234
|
+
this._resolveAll(loadedImages[0]);
|
|
1235
|
+
}
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
987
1238
|
this.state = ImageState.LOADING;
|
|
988
1239
|
this.changed();
|
|
989
|
-
void
|
|
990
|
-
|
|
1240
|
+
void Promise.all(loadedImages.map(/*#__PURE__*/function () {
|
|
1241
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(image) {
|
|
1242
|
+
return _regenerator().w(function (_context) {
|
|
1243
|
+
while (1) switch (_context.n) {
|
|
1244
|
+
case 0:
|
|
1245
|
+
return _context.a(2, image.loadAwait());
|
|
1246
|
+
}
|
|
1247
|
+
}, _callee);
|
|
1248
|
+
}));
|
|
1249
|
+
return function (_x) {
|
|
1250
|
+
return _ref2.apply(this, arguments);
|
|
1251
|
+
};
|
|
1252
|
+
}()))["finally"](function () {
|
|
1253
|
+
return _this2.load();
|
|
991
1254
|
});
|
|
992
1255
|
}
|
|
993
1256
|
}, {
|
|
@@ -1017,10 +1280,10 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1017
1280
|
}, {
|
|
1018
1281
|
key: "loadAndResolve",
|
|
1019
1282
|
value: function () {
|
|
1020
|
-
var _loadAndResolve = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1283
|
+
var _loadAndResolve = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(extentToLoad, resolutionToLoad, pixelRatio, projection, getMapUrl, params, layerName, styleName, dimProps) {
|
|
1021
1284
|
var _this3 = this;
|
|
1022
|
-
return _regenerator().w(function (
|
|
1023
|
-
while (1) switch (
|
|
1285
|
+
return _regenerator().w(function (_context2) {
|
|
1286
|
+
while (1) switch (_context2.n) {
|
|
1024
1287
|
case 0:
|
|
1025
1288
|
this._extentToLoad = _toConsumableArray(extentToLoad || []);
|
|
1026
1289
|
this._resolutionToLoad = resolutionToLoad;
|
|
@@ -1031,7 +1294,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1031
1294
|
this.projection = projection;
|
|
1032
1295
|
this._styleName = styleName;
|
|
1033
1296
|
this._dimPropsToLoad = _objectSpread2({}, dimProps);
|
|
1034
|
-
return
|
|
1297
|
+
return _context2.a(2, new Promise(function (resolve, reject) {
|
|
1035
1298
|
_this3._resolvers.push({
|
|
1036
1299
|
resolve: resolve,
|
|
1037
1300
|
reject: reject
|
|
@@ -1039,13 +1302,41 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1039
1302
|
_this3.load();
|
|
1040
1303
|
}));
|
|
1041
1304
|
}
|
|
1042
|
-
},
|
|
1305
|
+
}, _callee2, this);
|
|
1043
1306
|
}));
|
|
1044
|
-
function loadAndResolve(
|
|
1307
|
+
function loadAndResolve(_x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0) {
|
|
1045
1308
|
return _loadAndResolve.apply(this, arguments);
|
|
1046
1309
|
}
|
|
1047
1310
|
return loadAndResolve;
|
|
1048
1311
|
}()
|
|
1312
|
+
}, {
|
|
1313
|
+
key: "getWMSGetMapRequestURLs",
|
|
1314
|
+
value: function getWMSGetMapRequestURLs(extentToLoad, resolutionToLoad, pixelRatio, projection, getMapUrl, params, layerName, styleName, dimProps) {
|
|
1315
|
+
var request = this.getWMSGetMapRequestURL(extentToLoad, resolutionToLoad, pixelRatio, projection, getMapUrl, params, layerName, styleName, dimProps);
|
|
1316
|
+
var worldExtent = projection !== null && projection !== void 0 && projection.canWrapX() ? projection.getExtent() : null;
|
|
1317
|
+
if (!request.src || !worldExtent) {
|
|
1318
|
+
return [request];
|
|
1319
|
+
}
|
|
1320
|
+
var segments = splitExtentAtWorldSeams(request.extent, worldExtent);
|
|
1321
|
+
if (segments.length === 1 && segments[0].requestExtent.every(function (value, index) {
|
|
1322
|
+
return value === request.extent[index];
|
|
1323
|
+
})) {
|
|
1324
|
+
return [request];
|
|
1325
|
+
}
|
|
1326
|
+
var paramsToUse = _objectSpread2({}, params);
|
|
1327
|
+
return segments.map(function (_ref3) {
|
|
1328
|
+
var requestExtent = _ref3.requestExtent,
|
|
1329
|
+
displayExtent = _ref3.displayExtent;
|
|
1330
|
+
return {
|
|
1331
|
+
src: getImageSrc(requestExtent, request.resolution, 1, projection, getMapUrl, getRequestParams(_objectSpread2(_objectSpread2(_objectSpread2({}, paramsToUse), dimProps), {}, {
|
|
1332
|
+
LAYERS: layerName,
|
|
1333
|
+
STYLES: styleName
|
|
1334
|
+
}), 'GetMap'), 'mapserver'),
|
|
1335
|
+
extent: displayExtent,
|
|
1336
|
+
resolution: request.resolution
|
|
1337
|
+
};
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1049
1340
|
}]);
|
|
1050
1341
|
}(ImageWrapper);
|
|
1051
1342
|
|
|
@@ -1137,9 +1428,11 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1137
1428
|
styleName = _ref.styleName,
|
|
1138
1429
|
dimProps = _ref.dimProps,
|
|
1139
1430
|
params = _ref.params,
|
|
1140
|
-
visible = _ref.visible
|
|
1431
|
+
visible = _ref.visible,
|
|
1432
|
+
extentRatio = _ref.extentRatio;
|
|
1141
1433
|
_classCallCheck(this, TimeawareImageSource);
|
|
1142
1434
|
_this = _callSuper(this, TimeawareImageSource, [{}]);
|
|
1435
|
+
_this._failedImageRetryTimer = null;
|
|
1143
1436
|
_this._wmsUrl = wmsUrl;
|
|
1144
1437
|
_this._extraWMSParams = _objectSpread2({}, params);
|
|
1145
1438
|
_this._layerName = layerName;
|
|
@@ -1148,6 +1441,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1148
1441
|
_this._timeStampsToPrefetch = _toConsumableArray(timeStampsToPrefetch || []);
|
|
1149
1442
|
_this._previousPrefetchExtent = null;
|
|
1150
1443
|
_this._prefetchWorkers = new WorkerQueue(NUMBER_PREFETCH_WORKERS);
|
|
1444
|
+
_this._extentRatio = extentRatio !== null && extentRatio !== void 0 ? extentRatio : WMS_EXTENT_RATIO_TO_VIEWPORT;
|
|
1151
1445
|
_this.prefetch = _this.prefetch.bind(_this);
|
|
1152
1446
|
_this.isImageLoadingForTimestep = _this.isImageLoadingForTimestep.bind(_this);
|
|
1153
1447
|
_this.hasImageLoadedForTimeValue = _this.hasImageLoadedForTimeValue.bind(_this);
|
|
@@ -1173,6 +1467,8 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1173
1467
|
_this._imWrapperEmptyButLoading = initImageWrapper();
|
|
1174
1468
|
_this._imWrapperForOlSource = initImageWrapper();
|
|
1175
1469
|
_this._imWrapperForAltImage = initImageWrapper();
|
|
1470
|
+
_this._imWrapperForOlSource.setExtentRatio(_this._extentRatio);
|
|
1471
|
+
_this._imWrapperForAltImage.setExtentRatio(_this._extentRatio);
|
|
1176
1472
|
_this.set(LayerProperty.VISIBLE, !!visible);
|
|
1177
1473
|
return _this;
|
|
1178
1474
|
}
|
|
@@ -1244,17 +1540,21 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1244
1540
|
cancelled: false,
|
|
1245
1541
|
task: function () {
|
|
1246
1542
|
var _task = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
1247
|
-
var
|
|
1248
|
-
var jobWrapper, dimPropsWithTime, _jobWrapper$getWMSGet, src;
|
|
1543
|
+
var jobWrapper, dimPropsWithTime, requests;
|
|
1249
1544
|
return _regenerator().w(function (_context) {
|
|
1250
1545
|
while (1) switch (_context.n) {
|
|
1251
1546
|
case 0:
|
|
1252
1547
|
jobWrapper = new TimeAwareImageWrapper([0, 0, 0, 0], 1, 1);
|
|
1548
|
+
jobWrapper.setExtentRatio(_this3._extentRatio);
|
|
1253
1549
|
dimPropsWithTime = _objectSpread2(_objectSpread2({}, _this3._dimProperties), {}, {
|
|
1254
1550
|
TIME: dimValue
|
|
1255
1551
|
});
|
|
1256
|
-
|
|
1257
|
-
(
|
|
1552
|
+
requests = jobWrapper.getWMSGetMapRequestURLs(extent, resolution, pixelRatio, projection, _this3._wmsUrl, _this3._extraWMSParams, _this3._layerName, _this3._styleName, dimPropsWithTime);
|
|
1553
|
+
requests.forEach(function (_ref2) {
|
|
1554
|
+
var _openLayersGetMapImag;
|
|
1555
|
+
var src = _ref2.src;
|
|
1556
|
+
(_openLayersGetMapImag = openLayersGetMapImageStore.getImage(src)) === null || _openLayersGetMapImag === void 0 || _openLayersGetMapImag.clearError();
|
|
1557
|
+
});
|
|
1258
1558
|
_context.n = 1;
|
|
1259
1559
|
return jobWrapper.loadAndResolve(extent, resolution, pixelRatio, projection, _this3._wmsUrl, _this3._extraWMSParams, _this3._layerName, _this3._styleName, dimPropsWithTime)["catch"](function (e) {
|
|
1260
1560
|
// Do not log errors, as they are not very useful and can better be inspected via the network console
|
|
@@ -1296,8 +1596,13 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1296
1596
|
var requestedImageHasWantedExtent = (this._loadedExtent && containsExtent$1(this._loadedExtent, requestExtent) || containsExtent$1(this._imWrapperForOlSource.getExtent(), requestExtent)) && (this._loadedResolution && fromResolutionLike(this._loadedResolution) === requestResolution || fromResolutionLike(this._imWrapperForOlSource.getResolution()) === requestResolution);
|
|
1297
1597
|
var hasExactImage = this._loadedExtent && this._imWrapperForOlSource.hasImage(this._loadedExtent, this._loadedResolution, pixelRatio, projection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, requestDimProperties);
|
|
1298
1598
|
if (hasExactImage && hasExactImage.isLoaded && requestedImageHasWantedExtent) {
|
|
1299
|
-
|
|
1300
|
-
|
|
1599
|
+
if (!hasExactImage.hasError) {
|
|
1600
|
+
this._imWrapperForOlSource.setGeoReferencedImage(hasExactImage);
|
|
1601
|
+
return this._imWrapperForOlSource;
|
|
1602
|
+
}
|
|
1603
|
+
// The image failed to load. Do not display the broken image, but check again later: the image is reloaded once it becomes stale.
|
|
1604
|
+
this._scheduleFailedImageRetry();
|
|
1605
|
+
return this._getAltImageOrEmpty(requestExtent, requestResolution, pixelRatio, projection, requestDimProperties);
|
|
1301
1606
|
}
|
|
1302
1607
|
this._lastRequestedExtent = requestExtent;
|
|
1303
1608
|
this._lastRequestedResolution = requestResolution;
|
|
@@ -1305,7 +1610,12 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1305
1610
|
this._lastRequestedProjection = projection;
|
|
1306
1611
|
this.throttledImageLoad();
|
|
1307
1612
|
// While we are loading, check if there is an alternative image available
|
|
1308
|
-
|
|
1613
|
+
return this._getAltImageOrEmpty(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, requestDimProperties);
|
|
1614
|
+
}
|
|
1615
|
+
}, {
|
|
1616
|
+
key: "_getAltImageOrEmpty",
|
|
1617
|
+
value: function _getAltImageOrEmpty(extent, resolution, pixelRatio, projection, dimProperties) {
|
|
1618
|
+
var altImage = this._loadedExtent && this._imWrapperForOlSource.getAlternativeImage(extent, resolution, pixelRatio, projection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimProperties);
|
|
1309
1619
|
if (altImage && altImage.isLoaded) {
|
|
1310
1620
|
// A similar image is available for display, show it
|
|
1311
1621
|
this._imWrapperForAltImage.setGeoReferencedImage(altImage);
|
|
@@ -1314,6 +1624,28 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1314
1624
|
// This thing is has nothing to show yet.
|
|
1315
1625
|
return this._imWrapperEmptyButLoading;
|
|
1316
1626
|
}
|
|
1627
|
+
}, {
|
|
1628
|
+
key: "_scheduleFailedImageRetry",
|
|
1629
|
+
value: function _scheduleFailedImageRetry() {
|
|
1630
|
+
var _this4 = this;
|
|
1631
|
+
if (this._failedImageRetryTimer) {
|
|
1632
|
+
return;
|
|
1633
|
+
}
|
|
1634
|
+
this._failedImageRetryTimer = setTimeout(function () {
|
|
1635
|
+
_this4._failedImageRetryTimer = null;
|
|
1636
|
+
_this4.changed();
|
|
1637
|
+
}, FAILED_IMAGE_RETRY_CHECK_INTERVAL_MS);
|
|
1638
|
+
}
|
|
1639
|
+
}, {
|
|
1640
|
+
key: "disposeInternal",
|
|
1641
|
+
value: function disposeInternal() {
|
|
1642
|
+
if (this._failedImageRetryTimer) {
|
|
1643
|
+
clearTimeout(this._failedImageRetryTimer);
|
|
1644
|
+
this._failedImageRetryTimer = null;
|
|
1645
|
+
}
|
|
1646
|
+
this.cancelPrefetch();
|
|
1647
|
+
_superPropGet(TimeawareImageSource, "disposeInternal", this)([]);
|
|
1648
|
+
}
|
|
1317
1649
|
}, {
|
|
1318
1650
|
key: "setDimProps",
|
|
1319
1651
|
value: function setDimProps(params) {
|
|
@@ -1358,12 +1690,13 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1358
1690
|
}
|
|
1359
1691
|
var dimPropWithRequestedDate = _objectSpread2({}, this._dimProperties);
|
|
1360
1692
|
dimPropWithRequestedDate['TIME'] = isoTime;
|
|
1361
|
-
var
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1693
|
+
var requests = this._imWrapperForOlSource.getWMSGetMapRequestURLs(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimPropWithRequestedDate);
|
|
1694
|
+
return requests.flatMap(function (_ref3) {
|
|
1695
|
+
var src = _ref3.src,
|
|
1696
|
+
extent = _ref3.extent,
|
|
1697
|
+
resolution = _ref3.resolution;
|
|
1698
|
+
return openLayersGetMapImageStore.getAltGeoReferencedImages(src, extent, resolution);
|
|
1699
|
+
});
|
|
1367
1700
|
}
|
|
1368
1701
|
/**
|
|
1369
1702
|
* This function can be used to determine if the animation can proceed to the next step.
|
|
@@ -1727,6 +2060,36 @@ var fetchEDRParameter = /*#__PURE__*/function () {
|
|
|
1727
2060
|
return _ref6.apply(this, arguments);
|
|
1728
2061
|
};
|
|
1729
2062
|
}();
|
|
2063
|
+
var fetchEDRJson = /*#__PURE__*/function () {
|
|
2064
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(url) {
|
|
2065
|
+
var response;
|
|
2066
|
+
return _regenerator().w(function (_context7) {
|
|
2067
|
+
while (1) switch (_context7.n) {
|
|
2068
|
+
case 0:
|
|
2069
|
+
_context7.n = 1;
|
|
2070
|
+
return fetch(withJsonFormat(url));
|
|
2071
|
+
case 1:
|
|
2072
|
+
response = _context7.v;
|
|
2073
|
+
return _context7.a(2, handleResponse(response));
|
|
2074
|
+
}
|
|
2075
|
+
}, _callee7);
|
|
2076
|
+
}));
|
|
2077
|
+
return function fetchEDRJson(_x1) {
|
|
2078
|
+
return _ref7.apply(this, arguments);
|
|
2079
|
+
};
|
|
2080
|
+
}();
|
|
2081
|
+
// EDR labels can be plain strings or language maps (e.g. { en: 'Temperature' }).
|
|
2082
|
+
var normalizeEDRLabel = function normalizeEDRLabel(label, fallback) {
|
|
2083
|
+
if (typeof label === 'string' && label) {
|
|
2084
|
+
return label;
|
|
2085
|
+
}
|
|
2086
|
+
if (label && _typeof(label) === 'object' && 'en' in label) {
|
|
2087
|
+
if (typeof label.en === 'string' && label.en) {
|
|
2088
|
+
return label.en;
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
return fallback;
|
|
2092
|
+
};
|
|
1730
2093
|
|
|
1731
2094
|
/* *
|
|
1732
2095
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1853,13 +2216,14 @@ var useEDRGetCollectionDetails = function useEDRGetCollectionDetails(edrBaseUrlW
|
|
|
1853
2216
|
return useQuery(webmapEDRQueryOptions.getCollectionDetailsQuery(edrBaseUrlWithCollection, enabled, instanceId));
|
|
1854
2217
|
};
|
|
1855
2218
|
var useEDRGetParameterData = function useEDRGetParameterData(edrBaseUrlWithCollection, parameterName) {
|
|
2219
|
+
var _datetime$length;
|
|
1856
2220
|
var datetime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
1857
2221
|
var instanceId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
1858
2222
|
var _useEDRGetCollectionD = useEDRGetCollectionDetails(edrBaseUrlWithCollection, instanceId),
|
|
1859
2223
|
collection = _useEDRGetCollectionD.data;
|
|
1860
2224
|
return useQuery({
|
|
1861
2225
|
staleTime: DEFAULT_STALE_TIME$1,
|
|
1862
|
-
queryKey: generateWebmapQueryKeys(['get-parameter-data', edrBaseUrlWithCollection, instanceId, parameterName, datetime]),
|
|
2226
|
+
queryKey: generateWebmapQueryKeys(['get-parameter-data', edrBaseUrlWithCollection, instanceId, parameterName, datetime !== null && datetime !== void 0 ? datetime : '']),
|
|
1863
2227
|
queryFn: function () {
|
|
1864
2228
|
var _queryFn2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
1865
2229
|
var data;
|
|
@@ -1867,7 +2231,7 @@ var useEDRGetParameterData = function useEDRGetParameterData(edrBaseUrlWithColle
|
|
|
1867
2231
|
while (1) switch (_context2.n) {
|
|
1868
2232
|
case 0:
|
|
1869
2233
|
_context2.n = 1;
|
|
1870
|
-
return fetchEDRParameter(collection, edrBaseUrlWithCollection, parameterName, datetime, instanceId);
|
|
2234
|
+
return fetchEDRParameter(collection, edrBaseUrlWithCollection, parameterName, datetime !== null && datetime !== void 0 ? datetime : '', instanceId);
|
|
1871
2235
|
case 1:
|
|
1872
2236
|
data = _context2.v;
|
|
1873
2237
|
return _context2.a(2, coverageCollectionToFeatureCollection(data, parameterName));
|
|
@@ -1879,7 +2243,7 @@ var useEDRGetParameterData = function useEDRGetParameterData(edrBaseUrlWithColle
|
|
|
1879
2243
|
}
|
|
1880
2244
|
return queryFn;
|
|
1881
2245
|
}(),
|
|
1882
|
-
enabled: collection !== undefined && parameterName.length > 0 && datetime.length > 0
|
|
2246
|
+
enabled: collection !== undefined && parameterName.length > 0 && ((_datetime$length = datetime === null || datetime === void 0 ? void 0 : datetime.length) !== null && _datetime$length !== void 0 ? _datetime$length : 0) > 0
|
|
1883
2247
|
});
|
|
1884
2248
|
};
|
|
1885
2249
|
|
|
@@ -3464,7 +3828,7 @@ var getDimensionsList = function getDimensionsList(dimensions) {
|
|
|
3464
3828
|
};
|
|
3465
3829
|
|
|
3466
3830
|
var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
3467
|
-
var _layer$styles, _layer$styles2, _layer$path, _layer$keywords;
|
|
3831
|
+
var _layer$styles, _layer$styles2, _edrParameterMetadata, _edrParameterMetadata2, _edrParameterMetadata3, _layer$path, _layer$keywords;
|
|
3468
3832
|
var onClose = _ref.onClose,
|
|
3469
3833
|
layer = _ref.layer,
|
|
3470
3834
|
serviceName = _ref.serviceName,
|
|
@@ -3484,7 +3848,8 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
3484
3848
|
} : _ref$startPosition,
|
|
3485
3849
|
selectedStyle = _ref.selectedStyle,
|
|
3486
3850
|
showLayerLegend = _ref.showLayerLegend,
|
|
3487
|
-
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility
|
|
3851
|
+
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility,
|
|
3852
|
+
edrParameterMetadata = _ref.edrParameterMetadata;
|
|
3488
3853
|
var styles = getLayerStyles(layer);
|
|
3489
3854
|
var dimensions = getDimensionsList(layer.dimensions);
|
|
3490
3855
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
@@ -3517,6 +3882,17 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
3517
3882
|
}), jsx(LayerInfoText, {
|
|
3518
3883
|
label: t('webmap-react-name'),
|
|
3519
3884
|
value: layer.name
|
|
3885
|
+
}), !!edrParameterMetadata && jsxs(Fragment, {
|
|
3886
|
+
children: [jsx(LayerInfoText, {
|
|
3887
|
+
label: "EDR parameter",
|
|
3888
|
+
value: edrParameterMetadata.id || layer.name
|
|
3889
|
+
}), jsx(LayerInfoText, {
|
|
3890
|
+
label: "Observed property",
|
|
3891
|
+
value: ((_edrParameterMetadata = edrParameterMetadata.observedProperty) === null || _edrParameterMetadata === void 0 ? void 0 : _edrParameterMetadata.label) || '-'
|
|
3892
|
+
}), jsx(LayerInfoText, {
|
|
3893
|
+
label: "Unit",
|
|
3894
|
+
value: ((_edrParameterMetadata2 = edrParameterMetadata.unit) === null || _edrParameterMetadata2 === void 0 || (_edrParameterMetadata2 = _edrParameterMetadata2.symbol) === null || _edrParameterMetadata2 === void 0 ? void 0 : _edrParameterMetadata2.value) || ((_edrParameterMetadata3 = edrParameterMetadata.unit) === null || _edrParameterMetadata3 === void 0 ? void 0 : _edrParameterMetadata3.label) || '-'
|
|
3895
|
+
})]
|
|
3520
3896
|
}), jsx(LayerInfoText, {
|
|
3521
3897
|
label: t('webmap-react-service'),
|
|
3522
3898
|
value: serviceName
|
|
@@ -6931,7 +7307,8 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
6931
7307
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
6932
7308
|
onInitializeLayer = _ref.onInitializeLayer,
|
|
6933
7309
|
onLayerReady = _ref.onLayerReady,
|
|
6934
|
-
onLayerError = _ref.onLayerError
|
|
7310
|
+
onLayerError = _ref.onLayerError,
|
|
7311
|
+
extentRatio = _ref.extentRatio;
|
|
6935
7312
|
var _useContext = useContext(MapContext),
|
|
6936
7313
|
map = _useContext.map;
|
|
6937
7314
|
var _useContext2 = useContext(TimeContext),
|
|
@@ -6974,7 +7351,8 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
6974
7351
|
styleName: styleName && styleName !== 'default' ? styleName : '',
|
|
6975
7352
|
dimProps: dimensionsValues,
|
|
6976
7353
|
timeStampsToPrefetch: [],
|
|
6977
|
-
visible: visible
|
|
7354
|
+
visible: visible,
|
|
7355
|
+
extentRatio: extentRatio
|
|
6978
7356
|
})
|
|
6979
7357
|
});
|
|
6980
7358
|
map.addLayer(olLayer);
|
|
@@ -6982,11 +7360,12 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
6982
7360
|
// Assign olSource in wmlayer for metronome
|
|
6983
7361
|
wmLayer.olSource = olLayer === null || olLayer === void 0 ? void 0 : olLayer.getSource();
|
|
6984
7362
|
return function () {
|
|
6985
|
-
var
|
|
6986
|
-
|
|
7363
|
+
var olSource = olLayer.getSource();
|
|
7364
|
+
olSource === null || olSource === void 0 || olSource.cancelPrefetch();
|
|
6987
7365
|
wmLayer.olSource = null;
|
|
6988
7366
|
map.removeLayer(olLayer);
|
|
6989
7367
|
olLayer.dispose();
|
|
7368
|
+
olSource === null || olSource === void 0 || olSource.dispose();
|
|
6990
7369
|
};
|
|
6991
7370
|
// The dependency list should only contain the map, wmLayer, visible and dimensionValues. Other prop changes are handled by other effects.
|
|
6992
7371
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -10993,7 +11372,8 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
10993
11372
|
layerType = _layerProps$layerType === void 0 ? LayerType.mapLayer : _layerProps$layerType,
|
|
10994
11373
|
_layerProps$tileServe = layerProps.tileServerSettings,
|
|
10995
11374
|
tileServerSettings = _layerProps$tileServe === void 0 ? tilesettings : _layerProps$tileServe,
|
|
10996
|
-
options = layerProps.options
|
|
11375
|
+
options = layerProps.options,
|
|
11376
|
+
extentRatio = layerProps.extentRatio;
|
|
10997
11377
|
var isBaseLayer = layerType === LayerType.baseLayer;
|
|
10998
11378
|
var isOverlay = layerType === LayerType.overLayer;
|
|
10999
11379
|
var layerOptions = useMemo(function () {
|
|
@@ -11011,6 +11391,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
11011
11391
|
return jsx(TimeawareImageSourceWMSLayer, {
|
|
11012
11392
|
debugMode: debugMode,
|
|
11013
11393
|
dimensions: dimensions,
|
|
11394
|
+
extentRatio: extentRatio,
|
|
11014
11395
|
getCapsURL: service,
|
|
11015
11396
|
layerId: id,
|
|
11016
11397
|
layerName: name,
|
|
@@ -11528,8 +11909,9 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
11528
11909
|
}
|
|
11529
11910
|
// Transform back to orig
|
|
11530
11911
|
var splitResultAsGeoJson = geojsonFormatter.writeFeaturesObject(geojsonFormatterNoTransform.readFeatures(splitResult));
|
|
11531
|
-
//
|
|
11532
|
-
|
|
11912
|
+
// Round like updateFeature does, so a later edit of one part does not
|
|
11913
|
+
// move the shared edge away from the other part.
|
|
11914
|
+
var splitFeatures = keepIdentityOnFirstSplitFeature(splitResultAsGeoJson.features.map(roundFeatureCoordinates), selectedFeature);
|
|
11533
11915
|
// Assemble the result.
|
|
11534
11916
|
var newGeoJson = _objectSpread2(_objectSpread2({}, geojson), {}, {
|
|
11535
11917
|
features: [].concat(_toConsumableArray(geojson.features.slice(0, selectedFeatureIndex)), _toConsumableArray(splitFeatures), _toConsumableArray(geojson.features.slice(selectedFeatureIndex + 1)))
|
|
@@ -14470,4 +14852,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
|
|
|
14470
14852
|
return updateObject;
|
|
14471
14853
|
};
|
|
14472
14854
|
|
|
14473
|
-
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, POINTER_CLICK_TOLERANCE_PX, SELECTED_FEATURE_COLOR, SELECTED_POINT_HALO_STYLE, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, connectSharedVertices, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createModifyFeatures, createMoveFeatures, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSplit, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureMultiPoint, featurePoint, featurePolygon, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFrameItemsToRender, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getTimeDimension, getToolIcon, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, keepIdentityOnFirstSplitFeature, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, toMovedFeatures, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useModifyFeatures, useMoveFeatures, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|
|
14855
|
+
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, POINTER_CLICK_TOLERANCE_PX, SELECTED_FEATURE_COLOR, SELECTED_POINT_HALO_STYLE, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, connectSharedVertices, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createModifyFeatures, createMoveFeatures, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSplit, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureMultiPoint, featurePoint, featurePolygon, fetchEDRArea, fetchEDRCollectionDetails, fetchEDRCube, fetchEDRJson, fetchEDRParameter, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFrameItemsToRender, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getTimeDimension, getToolIcon, handleResponse, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, joinUrlParams, keepIdentityOnFirstSplitFeature, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, normalizeEDRLabel, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, toMovedFeatures, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useModifyFeatures, useMoveFeatures, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|
|
@@ -14,5 +14,19 @@ export interface LayerInfoDialogProps {
|
|
|
14
14
|
selectedStyle?: string;
|
|
15
15
|
showLayerLegend: boolean;
|
|
16
16
|
onToggleLayerLegendVisibility: (showLegend: boolean) => void;
|
|
17
|
+
edrParameterMetadata?: {
|
|
18
|
+
id?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
observedProperty?: {
|
|
22
|
+
label?: string;
|
|
23
|
+
};
|
|
24
|
+
unit?: {
|
|
25
|
+
label?: string;
|
|
26
|
+
symbol?: {
|
|
27
|
+
value?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
17
31
|
}
|
|
18
32
|
export declare const LayerInfoDialog: React.FC<LayerInfoDialogProps>;
|
|
@@ -16,5 +16,6 @@ export interface OpenLayersLayerProps extends LayerFoundation {
|
|
|
16
16
|
onClickFeature?: (event?: FeatureEvent) => void;
|
|
17
17
|
onHoverFeature?: (event: FeatureEvent) => void;
|
|
18
18
|
tileServerSettings?: TileServerSettings;
|
|
19
|
+
extentRatio?: number;
|
|
19
20
|
}
|
|
20
21
|
export declare const OpenLayersLayer: (layerProps: OpenLayersLayerProps) => React.ReactElement | null;
|
|
@@ -13,6 +13,7 @@ interface TimeawareImageSourceWMSLayerProps {
|
|
|
13
13
|
onLayerReady?: (layerId: string) => void;
|
|
14
14
|
onLayerError?: (layerId: string, message: string) => void;
|
|
15
15
|
debugMode?: boolean;
|
|
16
|
+
extentRatio?: number;
|
|
16
17
|
}
|
|
17
18
|
export declare const TimeawareImageSourceWMSLayer: React.FC<TimeawareImageSourceWMSLayerProps>;
|
|
18
19
|
export {};
|
|
@@ -11,7 +11,7 @@ interface TimeAwareGeoreferencedImageSrc {
|
|
|
11
11
|
resolution: number;
|
|
12
12
|
}
|
|
13
13
|
interface TimeAwareGeoreferencedImage {
|
|
14
|
-
el: HTMLImageElement;
|
|
14
|
+
el: HTMLImageElement | HTMLCanvasElement;
|
|
15
15
|
extent: Extent;
|
|
16
16
|
resolution: number;
|
|
17
17
|
isLoaded: boolean;
|
|
@@ -19,6 +19,7 @@ interface TimeAwareGeoreferencedImage {
|
|
|
19
19
|
isLoadedWithoutErrors: boolean;
|
|
20
20
|
isLoading: boolean;
|
|
21
21
|
}
|
|
22
|
+
type TimeAwareGeoreferencedImageRequest = TimeAwareGeoreferencedImageSrc;
|
|
22
23
|
declare class TimeAwareImageWrapper extends ImageWrapper {
|
|
23
24
|
private _extentToLoad;
|
|
24
25
|
private _resolutionToLoad;
|
|
@@ -30,15 +31,21 @@ declare class TimeAwareImageWrapper extends ImageWrapper {
|
|
|
30
31
|
private _resolvers;
|
|
31
32
|
private _styleName;
|
|
32
33
|
private _layerName;
|
|
34
|
+
private _extentRatio;
|
|
35
|
+
private _compositeImageKey;
|
|
36
|
+
private _compositeImage;
|
|
33
37
|
constructor(extent: Extent, resolution: number, pixelRatio: number);
|
|
38
|
+
setExtentRatio(extentRatio: number): void;
|
|
34
39
|
getWMSGetMapRequestURL(extentToLoad: Extent, resolutionToLoad: number, __pixelRatio: number, projection: Projection | null, getMapUrl: string | null, params: Record<string, string>, layerName: string | null, styleName: string, dimProps: Record<string, string>): TimeAwareGeoreferencedImageSrc;
|
|
35
40
|
getAlternativeImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection, getMapUrl: string, params: Record<string, string>, layerName: string, styleName: string, dimsProps: Record<string, string>): TimeAwareGeoreferencedImage | false;
|
|
36
41
|
hasImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection, getMapUrl: string, params: Record<string, string>, layerName: string, styleName: string, dimsProps: Record<string, string>): TimeAwareGeoreferencedImage | false;
|
|
42
|
+
private createCompositeImage;
|
|
37
43
|
setGeoReferencedImage(image: TimeAwareGeoreferencedImage): void;
|
|
38
44
|
load(): void;
|
|
39
45
|
setState(state: number): void;
|
|
40
46
|
private _rejectAll;
|
|
41
47
|
private _resolveAll;
|
|
42
48
|
loadAndResolve(extentToLoad: Extent, resolutionToLoad: number, pixelRatio: number, projection: Projection, getMapUrl: string, params: Record<string, string>, layerName: string, styleName: string, dimProps: Record<string, string>): Promise<WMImage>;
|
|
49
|
+
getWMSGetMapRequestURLs(extentToLoad: Extent, resolutionToLoad: number, pixelRatio: number, projection: Projection | null, getMapUrl: string | null, params: Record<string, string>, layerName: string | null, styleName: string, dimProps: Record<string, string>): TimeAwareGeoreferencedImageRequest[];
|
|
43
50
|
}
|
|
44
51
|
export default TimeAwareImageWrapper;
|
|
@@ -14,6 +14,7 @@ interface TimeawareImageSourceOptions {
|
|
|
14
14
|
styleName?: string | undefined;
|
|
15
15
|
timeStampsToPrefetch?: string[];
|
|
16
16
|
visible?: boolean;
|
|
17
|
+
extentRatio?: number;
|
|
17
18
|
}
|
|
18
19
|
export declare class TimeawareImageSource extends ImageSource {
|
|
19
20
|
private _wmsUrl;
|
|
@@ -38,13 +39,18 @@ export declare class TimeawareImageSource extends ImageSource {
|
|
|
38
39
|
private throttledPrefetch;
|
|
39
40
|
private throttledImageLoad;
|
|
40
41
|
private _layerId;
|
|
41
|
-
|
|
42
|
+
private _failedImageRetryTimer;
|
|
43
|
+
private _extentRatio;
|
|
44
|
+
constructor({ wmsUrl, timeStampsToPrefetch, layerName, layerId, styleName, dimProps, params, visible, extentRatio, }: TimeawareImageSourceOptions);
|
|
42
45
|
private _conditionalPrefetch;
|
|
43
46
|
private _loadImagery;
|
|
44
47
|
private prefetch;
|
|
45
48
|
triggerPrefetch(): void;
|
|
46
49
|
cancelPrefetch(): void;
|
|
47
50
|
getImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection): ImageWrapper;
|
|
51
|
+
private _getAltImageOrEmpty;
|
|
52
|
+
private _scheduleFailedImageRetry;
|
|
53
|
+
disposeInternal(): void;
|
|
48
54
|
setDimProps(params: Record<string, string>): void;
|
|
49
55
|
/**
|
|
50
56
|
* Check if an image is available and loaded for requested date. Used for showlayerinfo to proceed.
|
|
@@ -5,4 +5,5 @@ export declare const ENABLE_PREFETCH = true;
|
|
|
5
5
|
export declare const ADD_SHOW_DIMS_OPTION = false;
|
|
6
6
|
export declare const NUM_IMAGES_TO_CACHE = 10000;
|
|
7
7
|
export declare const WMS_EXTENT_RATIO_TO_VIEWPORT = 1.2;
|
|
8
|
+
export declare const FAILED_IMAGE_RETRY_CHECK_INTERVAL_MS = 10000;
|
|
8
9
|
export declare const TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = "Image did not load succesfully";
|
|
@@ -5,3 +5,5 @@ export declare const fetchEDRCollectionDetails: (edrBaseUrlWithCollection: strin
|
|
|
5
5
|
export declare const fetchEDRCube: (edrBaseUrlWithCollection: string, parameterName: string, datetime?: string, instanceId?: string, bbox?: string) => Promise<CoverageCollection<PointDomain | PointSeriesDomain> | Coverage<PointDomain | PointSeriesDomain>>;
|
|
6
6
|
export declare const fetchEDRArea: (edrBaseUrlWithCollection: string, parameterName: string, datetime?: string, instanceId?: string, coords?: string) => Promise<CoverageCollection<PointDomain | PointSeriesDomain> | Coverage<PointDomain | PointSeriesDomain>>;
|
|
7
7
|
export declare const fetchEDRParameter: (collection: EDRInstance | undefined, edrBaseUrlWithCollection: string, parameterName: string, datetime?: string, instanceId?: string) => Promise<CoverageCollection<PointDomain | PointSeriesDomain> | Coverage<PointDomain | PointSeriesDomain> | undefined>;
|
|
8
|
+
export declare const fetchEDRJson: <T>(url: string) => Promise<T>;
|
|
9
|
+
export declare const normalizeEDRLabel: (label: unknown, fallback: string) => string;
|
|
@@ -11,4 +11,4 @@ export declare const webmapEDRQueryOptions: {
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
export declare const useEDRGetCollectionDetails: (edrBaseUrlWithCollection: string, instanceId?: string, enabled?: boolean) => UseQueryResult<EDRInstance>;
|
|
14
|
-
export declare const useEDRGetParameterData: (edrBaseUrlWithCollection: string, parameterName: string, datetime?: string, instanceId?: string) => UseQueryResult<GeoJSON.FeatureCollection | undefined>;
|
|
14
|
+
export declare const useEDRGetParameterData: (edrBaseUrlWithCollection: string, parameterName: string, datetime?: string | null, instanceId?: string) => UseQueryResult<GeoJSON.FeatureCollection | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "20.0
|
|
3
|
+
"version": "20.1.0-nightly-20261018",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opengeoweb/webmap": "20.0
|
|
24
|
-
"@opengeoweb/theme": "20.0
|
|
25
|
-
"@opengeoweb/shared": "20.0
|
|
23
|
+
"@opengeoweb/webmap": "20.1.0-nightly-20261018",
|
|
24
|
+
"@opengeoweb/theme": "20.1.0-nightly-20261018",
|
|
25
|
+
"@opengeoweb/shared": "20.1.0-nightly-20261018",
|
|
26
26
|
"lodash": "^4.18.1",
|
|
27
27
|
"ol": "^10.4.0",
|
|
28
28
|
"proj4": "^2.9.2",
|