@opengeoweb/webmap-react 21.1.0 → 21.2.0-nightly-20261113
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 +617 -115
- package/dist/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +3 -16
- package/dist/src/lib/components/LayerInfo/LayerInfoLegend.d.ts +1 -1
- package/dist/src/lib/components/OpenLayers/layers/GeoTIFFLayer.d.ts +4 -0
- package/dist/src/lib/components/OpenLayers/layers/TimeAwareEDRLocationLayer.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/utils/ShowLayerInfo.d.ts +10 -0
- package/dist/src/lib/edr-layer-api/api.d.ts +2 -0
- package/dist/src/lib/edr-layer-api/colormaps/edrOlLegendUtils.d.ts +3 -0
- package/dist/src/lib/edr-layer-api/index.d.ts +1 -0
- package/dist/src/lib/edr-layer-api/serviceLayers.d.ts +20 -0
- package/dist/src/lib/edr-layer-api/utils/useEDRWMLayer.d.ts +10 -0
- package/dist/src/lib/geotiff-layer-api/index.d.ts +1 -0
- package/dist/src/lib/geotiff-layer-api/utils/stacFeatureInfo.d.ts +33 -0
- package/package.json +6 -5
package/dist/index.esm.js
CHANGED
|
@@ -16,6 +16,8 @@ import { Visibility, VisibilityOff, arrowUpPath, Home, Add, Minus, List, Equaliz
|
|
|
16
16
|
import 'i18next';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
18
|
import { useQuery, queryOptions } from '@tanstack/react-query';
|
|
19
|
+
import { toLonLat, fromLonLat, get, equivalent, transformExtent, transform } from 'ol/proj';
|
|
20
|
+
import { getDistance, getLength } from 'ol/sphere.js';
|
|
19
21
|
import { Point, MultiPoint, Polygon, LineString } from 'ol/geom';
|
|
20
22
|
import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
|
|
21
23
|
import Box$1 from '@mui/material/Box';
|
|
@@ -26,7 +28,6 @@ import 'ol/ol.css';
|
|
|
26
28
|
import { listen, unlistenByKey } from 'ol/events';
|
|
27
29
|
import { unByKey } from 'ol/Observable';
|
|
28
30
|
import EventType from 'ol/pointer/EventType';
|
|
29
|
-
import { toLonLat, get, equivalent, fromLonLat, transformExtent, transform } from 'ol/proj';
|
|
30
31
|
import { equals as equals$1, closestOnSegment } from 'ol/coordinate';
|
|
31
32
|
import { noModifierKeys, never, platformModifierKeyOnly, always } from 'ol/events/condition';
|
|
32
33
|
import Modify from 'ol/interaction/Modify';
|
|
@@ -49,7 +50,6 @@ import TileLayer$1 from 'ol/layer/WebGLTile';
|
|
|
49
50
|
import { fromCircle } from 'ol/geom/Polygon';
|
|
50
51
|
import { createBox, createRegularPolygon } from 'ol/interaction/Draw';
|
|
51
52
|
import VectorLayer from 'ol/layer/Vector';
|
|
52
|
-
import { getLength } from 'ol/sphere.js';
|
|
53
53
|
|
|
54
54
|
var en = {
|
|
55
55
|
"webmap-react-event": "event:",
|
|
@@ -62,6 +62,9 @@ var en = {
|
|
|
62
62
|
"webmap-react-legend": "Legend",
|
|
63
63
|
"webmap-react-title": "Title",
|
|
64
64
|
"webmap-react-name": "Name",
|
|
65
|
+
"webmap-react-edr-parameter": "EDR parameter",
|
|
66
|
+
"webmap-react-edr-observed-property": "Observed property",
|
|
67
|
+
"webmap-react-edr-unit": "Unit",
|
|
65
68
|
"webmap-react-service": "Service",
|
|
66
69
|
"webmap-react-service-url": "Service URL",
|
|
67
70
|
"webmap-react-abstract": "Abstract",
|
|
@@ -124,6 +127,9 @@ var fi = {
|
|
|
124
127
|
"webmap-react-legend": "Selite",
|
|
125
128
|
"webmap-react-title": "Otsikko",
|
|
126
129
|
"webmap-react-name": "Nimi",
|
|
130
|
+
"webmap-react-edr-parameter": "EDR-parametri",
|
|
131
|
+
"webmap-react-edr-observed-property": "Havaittu suure",
|
|
132
|
+
"webmap-react-edr-unit": "Yksikkö",
|
|
127
133
|
"webmap-react-service": "Palvelu",
|
|
128
134
|
"webmap-react-service-url": "Palvelun URL",
|
|
129
135
|
"webmap-react-abstract": "Tiivistelmä",
|
|
@@ -136,7 +142,7 @@ var fi = {
|
|
|
136
142
|
"webmap-react-zoom-in": "Lähennä",
|
|
137
143
|
"webmap-react-zoom-out": "Loitonna",
|
|
138
144
|
"webmap-react-show": "Näytä",
|
|
139
|
-
"webmap-react-click-disconnect": "
|
|
145
|
+
"webmap-react-click-disconnect": "Irrota karttataso napsauttamalla",
|
|
140
146
|
"webmap-react-click-connect": "Yhdistä karttataso napsauttamalla",
|
|
141
147
|
"webmap-react-layer-info": "Karttatason tiedot",
|
|
142
148
|
"webmap-react-vertical-level": "pystytaso",
|
|
@@ -158,7 +164,15 @@ var fi = {
|
|
|
158
164
|
"webmap-react-box": "Laatikko",
|
|
159
165
|
"webmap-react-rotatable-box": "Laatikko",
|
|
160
166
|
"webmap-react-linestring": "Viivajono",
|
|
167
|
+
"webmap-react-circle": "Ympyrä",
|
|
168
|
+
"webmap-react-square": "Neliö",
|
|
169
|
+
"webmap-react-freehand": "Vapaalla kädellä",
|
|
170
|
+
"webmap-react-oval": "Soikio",
|
|
171
|
+
"webmap-react-location": "Sijainti",
|
|
161
172
|
"webmap-react-delete": "Poista",
|
|
173
|
+
"webmap-react-split": "Jaa",
|
|
174
|
+
"webmap-react-legend-no-image": "Selitekuvaa ei ole saatavilla",
|
|
175
|
+
"webmap-react-map-measure-help-tooltip": "Mittaa napsauttamalla",
|
|
162
176
|
"clock-show": "Näytä kello",
|
|
163
177
|
"clock-hide": "Piilota kello",
|
|
164
178
|
"clock-animation-options": "Animoinnin asetukset",
|
|
@@ -177,6 +191,9 @@ var no = {
|
|
|
177
191
|
"webmap-react-legend": "Tegnforklaring",
|
|
178
192
|
"webmap-react-title": "Tittel",
|
|
179
193
|
"webmap-react-name": "Navn",
|
|
194
|
+
"webmap-react-edr-parameter": "EDR-parameter",
|
|
195
|
+
"webmap-react-edr-observed-property": "Observert egenskap",
|
|
196
|
+
"webmap-react-edr-unit": "Enhet",
|
|
180
197
|
"webmap-react-service": "Service",
|
|
181
198
|
"webmap-react-service-url": "Service URL",
|
|
182
199
|
"webmap-react-abstract": "Abstrakt",
|
|
@@ -230,6 +247,9 @@ var nl = {
|
|
|
230
247
|
"webmap-react-legend": "Legenda",
|
|
231
248
|
"webmap-react-title": "Titel",
|
|
232
249
|
"webmap-react-name": "Naam",
|
|
250
|
+
"webmap-react-edr-parameter": "EDR-parameter",
|
|
251
|
+
"webmap-react-edr-observed-property": "Waargenomen grootheid",
|
|
252
|
+
"webmap-react-edr-unit": "Eenheid",
|
|
233
253
|
"webmap-react-service": "Service",
|
|
234
254
|
"webmap-react-service-url": "Service-URL",
|
|
235
255
|
"webmap-react-abstract": "Abstract",
|
|
@@ -2986,6 +3006,280 @@ var resolvePreferredStyleName$1 = function resolvePreferredStyleName(styleNames,
|
|
|
2986
3006
|
return styleNames[0];
|
|
2987
3007
|
};
|
|
2988
3008
|
|
|
3009
|
+
var emptySources = [];
|
|
3010
|
+
var sources = new WeakMap();
|
|
3011
|
+
var listeners = new WeakMap();
|
|
3012
|
+
var readyLayers = new WeakMap();
|
|
3013
|
+
var notifyListeners = function notifyListeners(map) {
|
|
3014
|
+
var _listeners$get;
|
|
3015
|
+
(_listeners$get = listeners.get(map)) === null || _listeners$get === void 0 || _listeners$get.forEach(function (listener) {
|
|
3016
|
+
return listener();
|
|
3017
|
+
});
|
|
3018
|
+
};
|
|
3019
|
+
/** A layer is ready once its active frames are resolved; until then, no sources does not mean no data. */
|
|
3020
|
+
var isStacFeatureInfoReady = function isStacFeatureInfoReady(map, layerId) {
|
|
3021
|
+
var _readyLayers$get;
|
|
3022
|
+
return Boolean(map && ((_readyLayers$get = readyLayers.get(map)) === null || _readyLayers$get === void 0 ? void 0 : _readyLayers$get.has(layerId)));
|
|
3023
|
+
};
|
|
3024
|
+
var setStacFeatureInfoReady = function setStacFeatureInfoReady(map, layerId, ready) {
|
|
3025
|
+
var _readyLayers$get2;
|
|
3026
|
+
var mapReadyLayers = (_readyLayers$get2 = readyLayers.get(map)) !== null && _readyLayers$get2 !== void 0 ? _readyLayers$get2 : new Set();
|
|
3027
|
+
readyLayers.set(map, mapReadyLayers);
|
|
3028
|
+
if (mapReadyLayers.has(layerId) === ready) {
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
if (ready) {
|
|
3032
|
+
mapReadyLayers.add(layerId);
|
|
3033
|
+
} else {
|
|
3034
|
+
mapReadyLayers["delete"](layerId);
|
|
3035
|
+
}
|
|
3036
|
+
notifyListeners(map);
|
|
3037
|
+
};
|
|
3038
|
+
var getStacFeatureInfoSources = function getStacFeatureInfoSources(map, layerId) {
|
|
3039
|
+
var _sources$get;
|
|
3040
|
+
return map && ((_sources$get = sources.get(map)) === null || _sources$get === void 0 ? void 0 : _sources$get.get(layerId)) || emptySources;
|
|
3041
|
+
};
|
|
3042
|
+
var subscribeStacFeatureInfoSources = function subscribeStacFeatureInfoSources(map, listener) {
|
|
3043
|
+
var _listeners$get2;
|
|
3044
|
+
if (!map) {
|
|
3045
|
+
return function () {};
|
|
3046
|
+
}
|
|
3047
|
+
var mapListeners = (_listeners$get2 = listeners.get(map)) !== null && _listeners$get2 !== void 0 ? _listeners$get2 : new Set();
|
|
3048
|
+
listeners.set(map, mapListeners);
|
|
3049
|
+
mapListeners.add(listener);
|
|
3050
|
+
return function () {
|
|
3051
|
+
mapListeners["delete"](listener);
|
|
3052
|
+
};
|
|
3053
|
+
};
|
|
3054
|
+
/** Register only active raster frames; preloaded frames must not be queried. */
|
|
3055
|
+
var registerStacFeatureInfoSource = function registerStacFeatureInfoSource(map, layerId, source) {
|
|
3056
|
+
var _sources$get2, _mapSources$get;
|
|
3057
|
+
var mapSources = (_sources$get2 = sources.get(map)) !== null && _sources$get2 !== void 0 ? _sources$get2 : new Map();
|
|
3058
|
+
sources.set(map, mapSources);
|
|
3059
|
+
mapSources.set(layerId, [].concat(_toConsumableArray((_mapSources$get = mapSources.get(layerId)) !== null && _mapSources$get !== void 0 ? _mapSources$get : []), [source]));
|
|
3060
|
+
notifyListeners(map);
|
|
3061
|
+
return function () {
|
|
3062
|
+
var _mapSources$get2;
|
|
3063
|
+
var remaining = ((_mapSources$get2 = mapSources.get(layerId)) !== null && _mapSources$get2 !== void 0 ? _mapSources$get2 : []).filter(function (entry) {
|
|
3064
|
+
return entry !== source;
|
|
3065
|
+
});
|
|
3066
|
+
if (remaining.length) {
|
|
3067
|
+
mapSources.set(layerId, remaining);
|
|
3068
|
+
} else {
|
|
3069
|
+
mapSources["delete"](layerId);
|
|
3070
|
+
}
|
|
3071
|
+
notifyListeners(map);
|
|
3072
|
+
};
|
|
3073
|
+
};
|
|
3074
|
+
var MAX_OPEN_TIFFS = 16;
|
|
3075
|
+
var openTiffs = new Map();
|
|
3076
|
+
var loadTiff = /*#__PURE__*/function () {
|
|
3077
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(url) {
|
|
3078
|
+
var _yield$import, fromUrl;
|
|
3079
|
+
return _regenerator().w(function (_context) {
|
|
3080
|
+
while (1) switch (_context.n) {
|
|
3081
|
+
case 0:
|
|
3082
|
+
_context.n = 1;
|
|
3083
|
+
return import('geotiff');
|
|
3084
|
+
case 1:
|
|
3085
|
+
_yield$import = _context.v;
|
|
3086
|
+
fromUrl = _yield$import.fromUrl;
|
|
3087
|
+
return _context.a(2, fromUrl(url));
|
|
3088
|
+
}
|
|
3089
|
+
}, _callee);
|
|
3090
|
+
}));
|
|
3091
|
+
return function loadTiff(_x) {
|
|
3092
|
+
return _ref.apply(this, arguments);
|
|
3093
|
+
};
|
|
3094
|
+
}();
|
|
3095
|
+
// Remote GeoTIFF sources hold no resources, so evicted entries need no close().
|
|
3096
|
+
var openTiff = /*#__PURE__*/function () {
|
|
3097
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(url) {
|
|
3098
|
+
var cached, tiff, _t;
|
|
3099
|
+
return _regenerator().w(function (_context2) {
|
|
3100
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
3101
|
+
case 0:
|
|
3102
|
+
cached = openTiffs.get(url);
|
|
3103
|
+
if (!cached) {
|
|
3104
|
+
_context2.n = 1;
|
|
3105
|
+
break;
|
|
3106
|
+
}
|
|
3107
|
+
openTiffs["delete"](url);
|
|
3108
|
+
openTiffs.set(url, cached);
|
|
3109
|
+
return _context2.a(2, cached);
|
|
3110
|
+
case 1:
|
|
3111
|
+
tiff = loadTiff(url);
|
|
3112
|
+
openTiffs.set(url, tiff);
|
|
3113
|
+
if (openTiffs.size > MAX_OPEN_TIFFS) {
|
|
3114
|
+
openTiffs["delete"](openTiffs.keys().next().value);
|
|
3115
|
+
}
|
|
3116
|
+
_context2.p = 2;
|
|
3117
|
+
_context2.n = 3;
|
|
3118
|
+
return tiff;
|
|
3119
|
+
case 3:
|
|
3120
|
+
return _context2.a(2, _context2.v);
|
|
3121
|
+
case 4:
|
|
3122
|
+
_context2.p = 4;
|
|
3123
|
+
_t = _context2.v;
|
|
3124
|
+
if (openTiffs.get(url) === tiff) {
|
|
3125
|
+
openTiffs["delete"](url);
|
|
3126
|
+
}
|
|
3127
|
+
throw _t;
|
|
3128
|
+
case 5:
|
|
3129
|
+
return _context2.a(2);
|
|
3130
|
+
}
|
|
3131
|
+
}, _callee2, null, [[2, 4]]);
|
|
3132
|
+
}));
|
|
3133
|
+
return function openTiff(_x2) {
|
|
3134
|
+
return _ref2.apply(this, arguments);
|
|
3135
|
+
};
|
|
3136
|
+
}();
|
|
3137
|
+
var clearStacFeatureInfoCache = function clearStacFeatureInfoCache() {
|
|
3138
|
+
openTiffs.clear();
|
|
3139
|
+
};
|
|
3140
|
+
var getPixel = function getPixel(image, x, y) {
|
|
3141
|
+
var matrix = image.getFileDirectory().getValue('ModelTransformation');
|
|
3142
|
+
if (matrix) {
|
|
3143
|
+
var determinant = matrix[0] * matrix[5] - matrix[1] * matrix[4];
|
|
3144
|
+
if (!determinant) {
|
|
3145
|
+
throw new Error('GeoTIFF has an invalid coordinate transform');
|
|
3146
|
+
}
|
|
3147
|
+
var dx = x - matrix[3];
|
|
3148
|
+
var dy = y - matrix[7];
|
|
3149
|
+
return [Math.floor((matrix[5] * dx - matrix[1] * dy) / determinant), Math.floor((matrix[0] * dy - matrix[4] * dx) / determinant)];
|
|
3150
|
+
}
|
|
3151
|
+
var _image$getOrigin = image.getOrigin(),
|
|
3152
|
+
_image$getOrigin2 = _slicedToArray(_image$getOrigin, 2),
|
|
3153
|
+
originX = _image$getOrigin2[0],
|
|
3154
|
+
originY = _image$getOrigin2[1];
|
|
3155
|
+
var _image$getResolution = image.getResolution(),
|
|
3156
|
+
_image$getResolution2 = _slicedToArray(_image$getResolution, 2),
|
|
3157
|
+
resolutionX = _image$getResolution2[0],
|
|
3158
|
+
resolutionY = _image$getResolution2[1];
|
|
3159
|
+
return [Math.floor((x - originX) / resolutionX), Math.floor((y - originY) / resolutionY)];
|
|
3160
|
+
};
|
|
3161
|
+
var getPixelCenter = function getPixelCenter(image, column, row) {
|
|
3162
|
+
var matrix = image.getFileDirectory().getValue('ModelTransformation');
|
|
3163
|
+
var pixelCenterX = column + 0.5;
|
|
3164
|
+
var pixelCenterY = row + 0.5;
|
|
3165
|
+
if (matrix) {
|
|
3166
|
+
return [matrix[0] * pixelCenterX + matrix[1] * pixelCenterY + matrix[3], matrix[4] * pixelCenterX + matrix[5] * pixelCenterY + matrix[7]];
|
|
3167
|
+
}
|
|
3168
|
+
var _image$getOrigin3 = image.getOrigin(),
|
|
3169
|
+
_image$getOrigin4 = _slicedToArray(_image$getOrigin3, 2),
|
|
3170
|
+
originX = _image$getOrigin4[0],
|
|
3171
|
+
originY = _image$getOrigin4[1];
|
|
3172
|
+
var _image$getResolution3 = image.getResolution(),
|
|
3173
|
+
_image$getResolution4 = _slicedToArray(_image$getResolution3, 2),
|
|
3174
|
+
resolutionX = _image$getResolution4[0],
|
|
3175
|
+
resolutionY = _image$getResolution4[1];
|
|
3176
|
+
return [originX + pixelCenterX * resolutionX, originY + pixelCenterY * resolutionY];
|
|
3177
|
+
};
|
|
3178
|
+
/** Read the original first-band sample, not an overview or normalized display value. */
|
|
3179
|
+
var readStacPointValue = /*#__PURE__*/function () {
|
|
3180
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(source, location, signal) {
|
|
3181
|
+
var _source$bbox, _geoKeys$ProjectedCST, _source$projection, _ref4, _source$nodata, _source$band, _source$band$scale, _source$band2, _source$band$offset, _source$band3, _source$band4;
|
|
3182
|
+
var _source$bbox2, west, south, east, north, outsideLongitude, tiff, image, geoKeys, epsg, projection, _fromLonLat, _fromLonLat2, x, y, _getPixel, _getPixel2, column, row, raster, raw, nodata, value, _toLonLat, _toLonLat2, gridLon, gridLat, gridPoint;
|
|
3183
|
+
return _regenerator().w(function (_context3) {
|
|
3184
|
+
while (1) switch (_context3.n) {
|
|
3185
|
+
case 0:
|
|
3186
|
+
if (!(((_source$bbox = source.bbox) === null || _source$bbox === void 0 ? void 0 : _source$bbox.length) === 4)) {
|
|
3187
|
+
_context3.n = 1;
|
|
3188
|
+
break;
|
|
3189
|
+
}
|
|
3190
|
+
_source$bbox2 = _slicedToArray(source.bbox, 4), west = _source$bbox2[0], south = _source$bbox2[1], east = _source$bbox2[2], north = _source$bbox2[3]; // A bbox crossing the antimeridian covers either side of +/-180 degrees.
|
|
3191
|
+
outsideLongitude = west > east ? location.lon < west && location.lon > east : location.lon < west || location.lon > east;
|
|
3192
|
+
if (!(outsideLongitude || location.lat < south || location.lat > north)) {
|
|
3193
|
+
_context3.n = 1;
|
|
3194
|
+
break;
|
|
3195
|
+
}
|
|
3196
|
+
return _context3.a(2, undefined);
|
|
3197
|
+
case 1:
|
|
3198
|
+
signal === null || signal === void 0 || signal.throwIfAborted();
|
|
3199
|
+
// The shared TIFF is not tied to this query's signal, so aborting one
|
|
3200
|
+
// click cannot poison the cached header read for later clicks.
|
|
3201
|
+
_context3.n = 2;
|
|
3202
|
+
return openTiff(source.url);
|
|
3203
|
+
case 2:
|
|
3204
|
+
tiff = _context3.v;
|
|
3205
|
+
signal === null || signal === void 0 || signal.throwIfAborted();
|
|
3206
|
+
_context3.n = 3;
|
|
3207
|
+
return tiff.getImage();
|
|
3208
|
+
case 3:
|
|
3209
|
+
image = _context3.v;
|
|
3210
|
+
signal === null || signal === void 0 || signal.throwIfAborted();
|
|
3211
|
+
geoKeys = image.getGeoKeys();
|
|
3212
|
+
epsg = (_geoKeys$ProjectedCST = geoKeys === null || geoKeys === void 0 ? void 0 : geoKeys.ProjectedCSTypeGeoKey) !== null && _geoKeys$ProjectedCST !== void 0 ? _geoKeys$ProjectedCST : geoKeys === null || geoKeys === void 0 ? void 0 : geoKeys.GeographicTypeGeoKey;
|
|
3213
|
+
projection = (_source$projection = source.projection) !== null && _source$projection !== void 0 ? _source$projection : epsg && epsg !== 32767 ? "EPSG:".concat(epsg) : undefined;
|
|
3214
|
+
if (projection) {
|
|
3215
|
+
_context3.n = 4;
|
|
3216
|
+
break;
|
|
3217
|
+
}
|
|
3218
|
+
throw new Error('GeoTIFF projection is unavailable');
|
|
3219
|
+
case 4:
|
|
3220
|
+
if (get(projection)) {
|
|
3221
|
+
_context3.n = 5;
|
|
3222
|
+
break;
|
|
3223
|
+
}
|
|
3224
|
+
throw new Error("GeoTIFF projection ".concat(projection, " is not registered"));
|
|
3225
|
+
case 5:
|
|
3226
|
+
_fromLonLat = fromLonLat([location.lon, location.lat], projection), _fromLonLat2 = _slicedToArray(_fromLonLat, 2), x = _fromLonLat2[0], y = _fromLonLat2[1];
|
|
3227
|
+
_getPixel = getPixel(image, x, y), _getPixel2 = _slicedToArray(_getPixel, 2), column = _getPixel2[0], row = _getPixel2[1];
|
|
3228
|
+
if (!(!Number.isFinite(column) || !Number.isFinite(row) || column < 0 || row < 0 || column >= image.getWidth() || row >= image.getHeight())) {
|
|
3229
|
+
_context3.n = 6;
|
|
3230
|
+
break;
|
|
3231
|
+
}
|
|
3232
|
+
return _context3.a(2, undefined);
|
|
3233
|
+
case 6:
|
|
3234
|
+
if (!(!source.band && image.getSamplesPerPixel() > 1)) {
|
|
3235
|
+
_context3.n = 7;
|
|
3236
|
+
break;
|
|
3237
|
+
}
|
|
3238
|
+
return _context3.a(2, undefined);
|
|
3239
|
+
case 7:
|
|
3240
|
+
_context3.n = 8;
|
|
3241
|
+
return image.readRasters({
|
|
3242
|
+
window: [column, row, column + 1, row + 1],
|
|
3243
|
+
samples: [0],
|
|
3244
|
+
interleave: true,
|
|
3245
|
+
signal: signal
|
|
3246
|
+
});
|
|
3247
|
+
case 8:
|
|
3248
|
+
raster = _context3.v;
|
|
3249
|
+
raw = Number(raster[0]);
|
|
3250
|
+
nodata = (_ref4 = (_source$nodata = source.nodata) !== null && _source$nodata !== void 0 ? _source$nodata : (_source$band = source.band) === null || _source$band === void 0 ? void 0 : _source$band.nodata) !== null && _ref4 !== void 0 ? _ref4 : image.getGDALNoData();
|
|
3251
|
+
if (!(!Number.isFinite(raw) || nodata !== null && nodata !== undefined && raw === Number(nodata))) {
|
|
3252
|
+
_context3.n = 9;
|
|
3253
|
+
break;
|
|
3254
|
+
}
|
|
3255
|
+
return _context3.a(2, undefined);
|
|
3256
|
+
case 9:
|
|
3257
|
+
value = raw * ((_source$band$scale = (_source$band2 = source.band) === null || _source$band2 === void 0 ? void 0 : _source$band2.scale) !== null && _source$band$scale !== void 0 ? _source$band$scale : 1) + ((_source$band$offset = (_source$band3 = source.band) === null || _source$band3 === void 0 ? void 0 : _source$band3.offset) !== null && _source$band$offset !== void 0 ? _source$band$offset : 0);
|
|
3258
|
+
if (Number.isFinite(value)) {
|
|
3259
|
+
_context3.n = 10;
|
|
3260
|
+
break;
|
|
3261
|
+
}
|
|
3262
|
+
return _context3.a(2, undefined);
|
|
3263
|
+
case 10:
|
|
3264
|
+
_toLonLat = toLonLat(getPixelCenter(image, column, row), projection), _toLonLat2 = _slicedToArray(_toLonLat, 2), gridLon = _toLonLat2[0], gridLat = _toLonLat2[1];
|
|
3265
|
+
gridPoint = {
|
|
3266
|
+
lon: gridLon,
|
|
3267
|
+
lat: gridLat
|
|
3268
|
+
};
|
|
3269
|
+
return _context3.a(2, {
|
|
3270
|
+
value: value,
|
|
3271
|
+
unit: (_source$band4 = source.band) === null || _source$band4 === void 0 ? void 0 : _source$band4.unit,
|
|
3272
|
+
gridPoint: gridPoint,
|
|
3273
|
+
distanceKm: getDistance([location.lon, location.lat], [gridLon, gridLat]) / 1000
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
}, _callee3);
|
|
3277
|
+
}));
|
|
3278
|
+
return function readStacPointValue(_x3, _x4, _x5) {
|
|
3279
|
+
return _ref3.apply(this, arguments);
|
|
3280
|
+
};
|
|
3281
|
+
}();
|
|
3282
|
+
|
|
2989
3283
|
/* *
|
|
2990
3284
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2991
3285
|
* you may not use this file except in compliance with the License.
|
|
@@ -3266,6 +3560,12 @@ var normalizeEDRLabel = function normalizeEDRLabel(label, fallback) {
|
|
|
3266
3560
|
}
|
|
3267
3561
|
return fallback;
|
|
3268
3562
|
};
|
|
3563
|
+
var getEDRUnitLabel = function getEDRUnitLabel(parameter) {
|
|
3564
|
+
var _parameter$unit, _parameter$unit2;
|
|
3565
|
+
var symbol = parameter === null || parameter === void 0 || (_parameter$unit = parameter.unit) === null || _parameter$unit === void 0 ? void 0 : _parameter$unit.symbol;
|
|
3566
|
+
var symbolValue = typeof symbol === 'string' ? symbol : symbol === null || symbol === void 0 ? void 0 : symbol.value;
|
|
3567
|
+
return symbolValue || normalizeEDRLabel(parameter === null || parameter === void 0 || (_parameter$unit2 = parameter.unit) === null || _parameter$unit2 === void 0 ? void 0 : _parameter$unit2.label, '');
|
|
3568
|
+
};
|
|
3269
3569
|
|
|
3270
3570
|
/* *
|
|
3271
3571
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -3497,6 +3797,7 @@ var useIconStyle = function useIconStyle(_ref) {
|
|
|
3497
3797
|
};
|
|
3498
3798
|
};
|
|
3499
3799
|
|
|
3800
|
+
var EDR_PLAIN_NUMBERS_STYLE = 'plainNumbers';
|
|
3500
3801
|
var makeLegendFromStyleName = function makeLegendFromStyleName(styleName) {
|
|
3501
3802
|
var minMaxPartFromNumericIndex = styleName.indexOf(':');
|
|
3502
3803
|
var legMinMax = minMaxPartFromNumericIndex > 0 ? styleName.substring(minMaxPartFromNumericIndex + 1).split(',').map(function (stringValue) {
|
|
@@ -3705,13 +4006,20 @@ var makeFeatureStyleWind = function makeFeatureStyleWind(feature) {
|
|
|
3705
4006
|
});
|
|
3706
4007
|
return [speedStyle, arrowStyle];
|
|
3707
4008
|
};
|
|
4009
|
+
var formatEDRValue = function formatEDRValue(value) {
|
|
4010
|
+
if (value === null || value === undefined || value === '') {
|
|
4011
|
+
return '-';
|
|
4012
|
+
}
|
|
4013
|
+
var numericValue = Number(value);
|
|
4014
|
+
return Number.isFinite(numericValue) ? String(Math.round(numericValue * 10) / 10) : String(value);
|
|
4015
|
+
};
|
|
3708
4016
|
var makeFeatureStyleMultiParam = function makeFeatureStyleMultiParam(feature) {
|
|
3709
4017
|
var _feature$getPropertie2 = feature.getProperties(),
|
|
3710
4018
|
values = _feature$getPropertie2.values;
|
|
3711
|
-
var paramValues = Object.values(values);
|
|
4019
|
+
var paramValues = Object.values(values).map(formatEDRValue);
|
|
3712
4020
|
// Determine offset between columns (long strings need more space)
|
|
3713
4021
|
var maxLength = Math.max.apply(Math, _toConsumableArray(paramValues.map(function (el) {
|
|
3714
|
-
return el
|
|
4022
|
+
return el.length;
|
|
3715
4023
|
})));
|
|
3716
4024
|
var factor = maxLength > 5 ? 1.4 : 1;
|
|
3717
4025
|
var offsetValues = getOffsetValues(factor);
|
|
@@ -3720,7 +4028,7 @@ var makeFeatureStyleMultiParam = function makeFeatureStyleMultiParam(feature) {
|
|
|
3720
4028
|
return params.map(function (paramVal, index) {
|
|
3721
4029
|
return new Style({
|
|
3722
4030
|
text: new Text({
|
|
3723
|
-
text: paramVal
|
|
4031
|
+
text: paramVal,
|
|
3724
4032
|
offsetX: offsetValues[index][0],
|
|
3725
4033
|
offsetY: offsetValues[index][1],
|
|
3726
4034
|
scale: 1.0,
|
|
@@ -3769,9 +4077,26 @@ var makeFeatureStyleDisc = function makeFeatureStyleDisc(feature, legend) {
|
|
|
3769
4077
|
})
|
|
3770
4078
|
});
|
|
3771
4079
|
};
|
|
3772
|
-
var
|
|
4080
|
+
var makeFeatureStylePlainNumber = function makeFeatureStylePlainNumber(feature) {
|
|
3773
4081
|
var _feature$getPropertie4 = feature.getProperties(),
|
|
3774
4082
|
values = _feature$getPropertie4.values;
|
|
4083
|
+
return new Style({
|
|
4084
|
+
text: new Text({
|
|
4085
|
+
font: 'bold 12px Arial',
|
|
4086
|
+
text: formatEDRValue(Object.values(values !== null && values !== void 0 ? values : {})[0]),
|
|
4087
|
+
stroke: new Stroke({
|
|
4088
|
+
color: '#ffffff',
|
|
4089
|
+
width: 3
|
|
4090
|
+
}),
|
|
4091
|
+
fill: new Fill({
|
|
4092
|
+
color: '#000000'
|
|
4093
|
+
})
|
|
4094
|
+
})
|
|
4095
|
+
});
|
|
4096
|
+
};
|
|
4097
|
+
var makeFeatureStyleLoading = function makeFeatureStyleLoading(feature) {
|
|
4098
|
+
var _feature$getPropertie5 = feature.getProperties(),
|
|
4099
|
+
values = _feature$getPropertie5.values;
|
|
3775
4100
|
var textValue = Object.values(values)[0];
|
|
3776
4101
|
return new Style({
|
|
3777
4102
|
image: new Circle({
|
|
@@ -3815,13 +4140,23 @@ var styleNameToStyleLikeNotMemoed = function styleNameToStyleLikeNotMemoed(style
|
|
|
3815
4140
|
return makeFeatureStyleMultiParam(feature);
|
|
3816
4141
|
};
|
|
3817
4142
|
}
|
|
4143
|
+
if (styleName === EDR_PLAIN_NUMBERS_STYLE) {
|
|
4144
|
+
return makeFeatureStylePlainNumber;
|
|
4145
|
+
}
|
|
3818
4146
|
var legend = makeLegendFromStyleName(styleName) || defaultLegend$1;
|
|
3819
4147
|
return function (feature) {
|
|
3820
4148
|
return makeFeatureStyleDisc(feature, legend);
|
|
3821
4149
|
};
|
|
3822
4150
|
};
|
|
3823
|
-
var styleNameToStyleLike = memoize(styleNameToStyleLikeNotMemoed)
|
|
4151
|
+
var styleNameToStyleLike = memoize(styleNameToStyleLikeNotMemoed, function (styleName, multiParam) {
|
|
4152
|
+
return "".concat(styleName, ":").concat(!!multiParam);
|
|
4153
|
+
});
|
|
3824
4154
|
var defaultEdrStyles = [{
|
|
4155
|
+
name: EDR_PLAIN_NUMBERS_STYLE,
|
|
4156
|
+
title: 'Plain numbers',
|
|
4157
|
+
"abstract": '',
|
|
4158
|
+
legendURL: ''
|
|
4159
|
+
}, {
|
|
3825
4160
|
name: 'temperatureLegendColorsWoW:-18,38',
|
|
3826
4161
|
title: 'WOW Legend -18 till 18 degrees',
|
|
3827
4162
|
"abstract": 'temperatureLegendColorsWoW',
|
|
@@ -3858,6 +4193,98 @@ var defaultEdrStyles = [{
|
|
|
3858
4193
|
legendURL: ''
|
|
3859
4194
|
}];
|
|
3860
4195
|
|
|
4196
|
+
var getEDRParameters = function getEDRParameters(collection) {
|
|
4197
|
+
var _collection$parameter;
|
|
4198
|
+
if (Array.isArray(collection.parameter_names)) {
|
|
4199
|
+
return collection.parameter_names.map(function (parameter, index) {
|
|
4200
|
+
var _parameter$id;
|
|
4201
|
+
return [(_parameter$id = parameter.id) !== null && _parameter$id !== void 0 ? _parameter$id : String(index), parameter];
|
|
4202
|
+
});
|
|
4203
|
+
}
|
|
4204
|
+
return Object.entries((_collection$parameter = collection.parameter_names) !== null && _collection$parameter !== void 0 ? _collection$parameter : {});
|
|
4205
|
+
};
|
|
4206
|
+
var getEDRCollectionPath = function getEDRCollectionPath(collection) {
|
|
4207
|
+
var _ref, _collection$path, _collection$title;
|
|
4208
|
+
return [].concat(_toConsumableArray((_ref = (_collection$path = collection.path) !== null && _collection$path !== void 0 ? _collection$path : collection.groups) !== null && _ref !== void 0 ? _ref : collection.group ? [collection.group] : []), [(_collection$title = collection.title) !== null && _collection$title !== void 0 ? _collection$title : collection.id]);
|
|
4209
|
+
};
|
|
4210
|
+
/**
|
|
4211
|
+
* Converts EDR collections to service layers, one layer per collection parameter.
|
|
4212
|
+
* Layers are grouped by collection in the Layer Select using their path.
|
|
4213
|
+
*/
|
|
4214
|
+
var edrCollectionsToServiceLayers = function edrCollectionsToServiceLayers(collections) {
|
|
4215
|
+
return collections.flatMap(function (collection) {
|
|
4216
|
+
return getEDRParameters(collection).map(function (_ref2) {
|
|
4217
|
+
var _parameter$observedPr;
|
|
4218
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
4219
|
+
parameterId = _ref3[0],
|
|
4220
|
+
parameter = _ref3[1];
|
|
4221
|
+
var observedPropertyLabel = (_parameter$observedPr = parameter.observedProperty) === null || _parameter$observedPr === void 0 ? void 0 : _parameter$observedPr.label;
|
|
4222
|
+
var label = normalizeEDRLabel(parameter.label, parameterId);
|
|
4223
|
+
return {
|
|
4224
|
+
name: parameterId,
|
|
4225
|
+
leaf: true,
|
|
4226
|
+
path: getEDRCollectionPath(collection),
|
|
4227
|
+
title: normalizeEDRLabel(parameter.label, normalizeEDRLabel(observedPropertyLabel, parameterId)),
|
|
4228
|
+
"abstract": normalizeEDRLabel(parameter.description, ''),
|
|
4229
|
+
keywords: observedPropertyLabel ? [normalizeEDRLabel(observedPropertyLabel, label)] : [],
|
|
4230
|
+
edrCollectionId: collection.id,
|
|
4231
|
+
edrParameter: parameter,
|
|
4232
|
+
styles: defaultEdrStyles
|
|
4233
|
+
};
|
|
4234
|
+
});
|
|
4235
|
+
});
|
|
4236
|
+
};
|
|
4237
|
+
var fetchEDRServiceLayers = /*#__PURE__*/function () {
|
|
4238
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(serviceUrl) {
|
|
4239
|
+
var _yield$fetchEDRJson, collections;
|
|
4240
|
+
return _regenerator().w(function (_context) {
|
|
4241
|
+
while (1) switch (_context.n) {
|
|
4242
|
+
case 0:
|
|
4243
|
+
_context.n = 1;
|
|
4244
|
+
return fetchEDRJson("".concat(serviceUrl.replace(/\/+$/, ''), "/collections"));
|
|
4245
|
+
case 1:
|
|
4246
|
+
_yield$fetchEDRJson = _context.v;
|
|
4247
|
+
collections = _yield$fetchEDRJson.collections;
|
|
4248
|
+
return _context.a(2, edrCollectionsToServiceLayers(collections !== null && collections !== void 0 ? collections : []));
|
|
4249
|
+
}
|
|
4250
|
+
}, _callee);
|
|
4251
|
+
}));
|
|
4252
|
+
return function fetchEDRServiceLayers(_x) {
|
|
4253
|
+
return _ref4.apply(this, arguments);
|
|
4254
|
+
};
|
|
4255
|
+
}();
|
|
4256
|
+
|
|
4257
|
+
var defaultTimeStepInMinutes = 10;
|
|
4258
|
+
var minuteInMs = 60 * 1000;
|
|
4259
|
+
var toISOTime = function toISOTime(timeInMs) {
|
|
4260
|
+
return new Date(timeInMs).toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
4261
|
+
};
|
|
4262
|
+
/**
|
|
4263
|
+
* Makes the ISO 8601 time dimension values (start/end/step) for an EDR collection.
|
|
4264
|
+
* The time step is read from the temporal values, e.g. R780526/2012-01-01T00:00:00Z/PT10M
|
|
4265
|
+
* or 2012-01-01T00:00:00Z/2026-01-01T00:00:00Z/PT10M. When there is no time step,
|
|
4266
|
+
* 10 minute steps aligned to whole 10 minutes are used, as is common for observations.
|
|
4267
|
+
*/
|
|
4268
|
+
var getEDRTimeDimensionValues = function getEDRTimeDimensionValues(temporal) {
|
|
4269
|
+
var _temporal$interval$, _temporal$interval, _temporal$values, _timeStepMatch$;
|
|
4270
|
+
var _ref = (_temporal$interval$ = temporal === null || temporal === void 0 || (_temporal$interval = temporal.interval) === null || _temporal$interval === void 0 ? void 0 : _temporal$interval[0]) !== null && _temporal$interval$ !== void 0 ? _temporal$interval$ : [],
|
|
4271
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
4272
|
+
start = _ref2[0],
|
|
4273
|
+
end = _ref2[1];
|
|
4274
|
+
var startInMs = new Date(start !== null && start !== void 0 ? start : '').getTime();
|
|
4275
|
+
var endInMs = Math.floor(new Date(end !== null && end !== void 0 ? end : '').getTime() / minuteInMs) * minuteInMs;
|
|
4276
|
+
if (Number.isNaN(startInMs) || Number.isNaN(endInMs)) {
|
|
4277
|
+
return undefined;
|
|
4278
|
+
}
|
|
4279
|
+
var timeStepMatch = temporal === null || temporal === void 0 || (_temporal$values = temporal.values) === null || _temporal$values === void 0 || (_temporal$values = _temporal$values[0]) === null || _temporal$values === void 0 ? void 0 : _temporal$values.match(/^(?:R\d*\/)?([^/]+)\/(?:[^/]+\/)?(P[^/]+)$/);
|
|
4280
|
+
var stepStartInMs = new Date((_timeStepMatch$ = timeStepMatch === null || timeStepMatch === void 0 ? void 0 : timeStepMatch[1]) !== null && _timeStepMatch$ !== void 0 ? _timeStepMatch$ : '').getTime();
|
|
4281
|
+
if (timeStepMatch && !Number.isNaN(stepStartInMs)) {
|
|
4282
|
+
return "".concat(toISOTime(stepStartInMs), "/").concat(toISOTime(Math.max(stepStartInMs, endInMs)), "/").concat(timeStepMatch[2]);
|
|
4283
|
+
}
|
|
4284
|
+
var timeStepInMs = defaultTimeStepInMinutes * minuteInMs;
|
|
4285
|
+
var alignedStartInMs = Math.min(Math.ceil(startInMs / timeStepInMs) * timeStepInMs, endInMs);
|
|
4286
|
+
return "".concat(toISOTime(alignedStartInMs), "/").concat(toISOTime(endInMs), "/PT").concat(defaultTimeStepInMinutes, "M");
|
|
4287
|
+
};
|
|
3861
4288
|
/**
|
|
3862
4289
|
* Returns WMLayer instance in EDR mode. The layer will contains parsed dimensions and styles and keeps a state for these properties.
|
|
3863
4290
|
*
|
|
@@ -3904,17 +4331,21 @@ var useEDRWMLayer = function useEDRWMLayer(edrBaseUrl, parameter, layerId, onIni
|
|
|
3904
4331
|
setTimeRangeDuration = _React$useState4[1];
|
|
3905
4332
|
React.useEffect(function () {
|
|
3906
4333
|
if (wmLayer && collectionInfo.data && collectionInfo.isFetched) {
|
|
3907
|
-
var _collectionInfo$data
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
4334
|
+
var _collectionInfo$data$;
|
|
4335
|
+
var timeRangeDurationFromEdrCollection = getEDRTimeDimensionValues((_collectionInfo$data$ = collectionInfo.data.extent) === null || _collectionInfo$data$ === void 0 ? void 0 : _collectionInfo$data$.temporal);
|
|
4336
|
+
if (!timeRangeDurationFromEdrCollection) {
|
|
4337
|
+
wmLayer.dimensions = wmLayer.dimensions.filter(function (dimension) {
|
|
4338
|
+
return dimension.name !== 'time';
|
|
4339
|
+
});
|
|
4340
|
+
setTimeRangeDuration(null);
|
|
4341
|
+
wmLayer.isConfigured = true;
|
|
4342
|
+
return;
|
|
4343
|
+
}
|
|
3913
4344
|
if (!wmLayer.getDimension('time')) {
|
|
3914
|
-
var _collectionInfo$
|
|
4345
|
+
var _collectionInfo$data;
|
|
3915
4346
|
var dim = new WMJSDimension({
|
|
3916
4347
|
name: 'time',
|
|
3917
|
-
currentValue: (_collectionInfo$
|
|
4348
|
+
currentValue: (_collectionInfo$data = collectionInfo.data) === null || _collectionInfo$data === void 0 || (_collectionInfo$data = _collectionInfo$data.extent) === null || _collectionInfo$data === void 0 || (_collectionInfo$data = _collectionInfo$data.temporal) === null || _collectionInfo$data === void 0 ? void 0 : _collectionInfo$data.interval[0][1],
|
|
3918
4349
|
units: 'ISO8601',
|
|
3919
4350
|
values: timeRangeDurationFromEdrCollection
|
|
3920
4351
|
});
|
|
@@ -3927,10 +4358,10 @@ var useEDRWMLayer = function useEDRWMLayer(edrBaseUrl, parameter, layerId, onIni
|
|
|
3927
4358
|
setTimeRangeDuration(timeRangeDurationFromEdrCollection);
|
|
3928
4359
|
wmLayer.isConfigured = true;
|
|
3929
4360
|
}
|
|
3930
|
-
}, [collectionInfo.data, collectionInfo.isFetched, wmLayer
|
|
4361
|
+
}, [collectionInfo.data, collectionInfo.isFetched, wmLayer]);
|
|
3931
4362
|
React.useEffect(function () {
|
|
3932
4363
|
var initializeLayer = /*#__PURE__*/function () {
|
|
3933
|
-
var
|
|
4364
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
3934
4365
|
var _wmLayer$dimensions, wmTimeDim, timeValueToInitialize, layerProps;
|
|
3935
4366
|
return _regenerator().w(function (_context) {
|
|
3936
4367
|
while (1) switch (_context.n) {
|
|
@@ -3966,10 +4397,10 @@ var useEDRWMLayer = function useEDRWMLayer(edrBaseUrl, parameter, layerId, onIni
|
|
|
3966
4397
|
}, _callee);
|
|
3967
4398
|
}));
|
|
3968
4399
|
return function initializeLayer() {
|
|
3969
|
-
return
|
|
4400
|
+
return _ref3.apply(this, arguments);
|
|
3970
4401
|
};
|
|
3971
4402
|
}();
|
|
3972
|
-
timeRangeDuration && initializeLayer()["catch"](function (e) {
|
|
4403
|
+
timeRangeDuration !== undefined && initializeLayer()["catch"](function (e) {
|
|
3973
4404
|
return window.console.error(e);
|
|
3974
4405
|
});
|
|
3975
4406
|
return function () {};
|
|
@@ -4884,7 +5315,7 @@ var LayerInfoLegend = function LayerInfoLegend(_ref) {
|
|
|
4884
5315
|
sx: textStyleWithMargin,
|
|
4885
5316
|
variant: "subtitle2",
|
|
4886
5317
|
children: t('webmap-react-legend')
|
|
4887
|
-
}), jsx(FormGroup, {
|
|
5318
|
+
}), !!onToggleLayerLegendVisibility && jsx(FormGroup, {
|
|
4888
5319
|
children: jsx(FormControlLabel, {
|
|
4889
5320
|
control: jsx(Checkbox, {
|
|
4890
5321
|
checked: showLayerLegend,
|
|
@@ -5040,7 +5471,7 @@ var getDimensionsList = function getDimensionsList(dimensions) {
|
|
|
5040
5471
|
};
|
|
5041
5472
|
|
|
5042
5473
|
var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
5043
|
-
var _layer$styles, _layer$styles2, _layer$styles3, _edrParameterMetadata,
|
|
5474
|
+
var _layer$styles, _layer$styles2, _layer$styles3, _edrParameterMetadata, _layer$path, _layer$keywords;
|
|
5044
5475
|
var onClose = _ref.onClose,
|
|
5045
5476
|
layer = _ref.layer,
|
|
5046
5477
|
serviceName = _ref.serviceName,
|
|
@@ -5100,14 +5531,14 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
5100
5531
|
value: layer.name
|
|
5101
5532
|
}), !!edrParameterMetadata && jsxs(Fragment, {
|
|
5102
5533
|
children: [jsx(LayerInfoText, {
|
|
5103
|
-
label:
|
|
5534
|
+
label: t('webmap-react-edr-parameter'),
|
|
5104
5535
|
value: edrParameterMetadata.id || layer.name
|
|
5105
5536
|
}), jsx(LayerInfoText, {
|
|
5106
|
-
label:
|
|
5107
|
-
value: ((_edrParameterMetadata = edrParameterMetadata.observedProperty) === null || _edrParameterMetadata === void 0 ? void 0 : _edrParameterMetadata.label
|
|
5537
|
+
label: t('webmap-react-edr-observed-property'),
|
|
5538
|
+
value: normalizeEDRLabel((_edrParameterMetadata = edrParameterMetadata.observedProperty) === null || _edrParameterMetadata === void 0 ? void 0 : _edrParameterMetadata.label, '-')
|
|
5108
5539
|
}), jsx(LayerInfoText, {
|
|
5109
|
-
label:
|
|
5110
|
-
value: (
|
|
5540
|
+
label: t('webmap-react-edr-unit'),
|
|
5541
|
+
value: getEDRUnitLabel(edrParameterMetadata) || '-'
|
|
5111
5542
|
})]
|
|
5112
5543
|
}), jsx(LayerInfoText, {
|
|
5113
5544
|
label: t('webmap-react-service'),
|
|
@@ -8432,11 +8863,86 @@ var formatDimensionVal = function formatDimensionVal(dimName, dimVal) {
|
|
|
8432
8863
|
}
|
|
8433
8864
|
}
|
|
8434
8865
|
};
|
|
8435
|
-
var getDimensionInfo = function getDimensionInfo(
|
|
8436
|
-
var dimensionName = getShortenedDimensionName(
|
|
8437
|
-
var formattedValue = formatDimensionVal(
|
|
8866
|
+
var getDimensionInfo = function getDimensionInfo(dimension) {
|
|
8867
|
+
var dimensionName = getShortenedDimensionName(dimension.name);
|
|
8868
|
+
var formattedValue = formatDimensionVal(dimension.name, dimension.currentValue);
|
|
8438
8869
|
return "".concat(dimensionName, " ").concat(formattedValue);
|
|
8439
8870
|
};
|
|
8871
|
+
/** Debug overlay row with the layer title and its current dimension values. */
|
|
8872
|
+
var ShowLayerInfo = function ShowLayerInfo(_ref) {
|
|
8873
|
+
var title = _ref.title,
|
|
8874
|
+
dimensions = _ref.dimensions,
|
|
8875
|
+
children = _ref.children;
|
|
8876
|
+
var tooltipText = jsxs("span", {
|
|
8877
|
+
children: [title, ": ", jsx("br", {}), dimensions.map(function (dim, index) {
|
|
8878
|
+
return jsxs("span", {
|
|
8879
|
+
children: [dim.name, ": ", formatDimensionVal(dim.name, dim.currentValue), index < dimensions.length - 1 && jsx("br", {})]
|
|
8880
|
+
}, "".concat(dim.name, "-").concat(dim.currentValue));
|
|
8881
|
+
})]
|
|
8882
|
+
});
|
|
8883
|
+
return jsx(CustomTooltip, {
|
|
8884
|
+
title: tooltipText,
|
|
8885
|
+
children: jsxs("div", {
|
|
8886
|
+
"data-testid": "debug-info",
|
|
8887
|
+
style: {
|
|
8888
|
+
position: 'relative',
|
|
8889
|
+
width: 'calc(100% - 60px)',
|
|
8890
|
+
left: '50px',
|
|
8891
|
+
right: '10px',
|
|
8892
|
+
marginTop: '12px',
|
|
8893
|
+
marginBottom: '-10px'
|
|
8894
|
+
},
|
|
8895
|
+
children: [children, jsxs("div", {
|
|
8896
|
+
style: {
|
|
8897
|
+
left: '10px',
|
|
8898
|
+
paddingTop: '3px',
|
|
8899
|
+
fontSize: '12px',
|
|
8900
|
+
fontFamily: 'Roboto',
|
|
8901
|
+
opacity: 0.85,
|
|
8902
|
+
width: '100%'
|
|
8903
|
+
},
|
|
8904
|
+
children: [jsx("span", {
|
|
8905
|
+
style: {
|
|
8906
|
+
display: 'inline-block',
|
|
8907
|
+
verticalAlign: 'top',
|
|
8908
|
+
width: '25%',
|
|
8909
|
+
overflow: 'hidden',
|
|
8910
|
+
textOverflow: 'ellipsis',
|
|
8911
|
+
whiteSpace: 'nowrap',
|
|
8912
|
+
fontSize: '12px',
|
|
8913
|
+
paddingRight: '4px',
|
|
8914
|
+
paddingLeft: '4px',
|
|
8915
|
+
color: '#051039',
|
|
8916
|
+
backgroundColor: 'rgba(236, 237, 238, 0.7)',
|
|
8917
|
+
borderRadius: 2
|
|
8918
|
+
},
|
|
8919
|
+
children: title
|
|
8920
|
+
}), jsx("span", {
|
|
8921
|
+
style: {
|
|
8922
|
+
display: 'inline-block',
|
|
8923
|
+
width: '75%',
|
|
8924
|
+
opacity: '0.7'
|
|
8925
|
+
},
|
|
8926
|
+
children: dimensions.map(function (dimension) {
|
|
8927
|
+
return jsx("span", {
|
|
8928
|
+
style: {
|
|
8929
|
+
margin: '0 0 0 0px',
|
|
8930
|
+
padding: '1px 5px',
|
|
8931
|
+
background: 'blue',
|
|
8932
|
+
borderRadius: 2,
|
|
8933
|
+
color: 'white',
|
|
8934
|
+
fontSize: '11px'
|
|
8935
|
+
},
|
|
8936
|
+
title: "".concat(dimension.name, " ").concat(formatDimensionVal(dimension.name, dimension.currentValue)),
|
|
8937
|
+
children: getDimensionInfo(dimension)
|
|
8938
|
+
}, dimension.name);
|
|
8939
|
+
})
|
|
8940
|
+
})]
|
|
8941
|
+
})]
|
|
8942
|
+
})
|
|
8943
|
+
});
|
|
8944
|
+
};
|
|
8945
|
+
|
|
8440
8946
|
var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
8441
8947
|
var _wmLayer$dimensions;
|
|
8442
8948
|
var wmLayer = _ref.wmLayer,
|
|
@@ -8495,84 +9001,22 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
8495
9001
|
});
|
|
8496
9002
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8497
9003
|
}, [layer, timeStepsToCheck, visible, wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.currentValue, render]);
|
|
8498
|
-
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8502
|
-
}, "".concat(dim.name, "-").concat(dim.currentValue));
|
|
8503
|
-
})]
|
|
8504
|
-
});
|
|
8505
|
-
return jsx(CustomTooltip, {
|
|
8506
|
-
title: tooltipText,
|
|
8507
|
-
children: jsxs("div", {
|
|
8508
|
-
"data-testid": "debug-info",
|
|
9004
|
+
return jsx(ShowLayerInfo, {
|
|
9005
|
+
dimensions: wmLayer.dimensions,
|
|
9006
|
+
title: wmLayer.title,
|
|
9007
|
+
children: jsx("div", {
|
|
8509
9008
|
style: {
|
|
8510
|
-
|
|
8511
|
-
width: 'calc(100% - 60px)',
|
|
8512
|
-
left: '50px',
|
|
8513
|
-
right: '10px',
|
|
8514
|
-
marginTop: '12px',
|
|
8515
|
-
marginBottom: '-10px'
|
|
9009
|
+
width: '100%'
|
|
8516
9010
|
},
|
|
8517
|
-
children:
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
},
|
|
8521
|
-
children: jsx("div", {
|
|
8522
|
-
children: items
|
|
8523
|
-
})
|
|
8524
|
-
}), jsxs("div", {
|
|
8525
|
-
style: {
|
|
8526
|
-
left: '10px',
|
|
8527
|
-
paddingTop: '3px',
|
|
8528
|
-
fontSize: '12px',
|
|
8529
|
-
fontFamily: 'Roboto',
|
|
8530
|
-
opacity: 0.85,
|
|
8531
|
-
width: '100%'
|
|
8532
|
-
},
|
|
8533
|
-
children: [jsx("span", {
|
|
8534
|
-
style: {
|
|
8535
|
-
display: 'inline-block',
|
|
8536
|
-
verticalAlign: 'top',
|
|
8537
|
-
width: '25%',
|
|
8538
|
-
overflow: 'hidden',
|
|
8539
|
-
textOverflow: 'ellipsis',
|
|
8540
|
-
whiteSpace: 'nowrap',
|
|
8541
|
-
fontSize: '12px',
|
|
8542
|
-
paddingRight: '4px',
|
|
8543
|
-
paddingLeft: '4px',
|
|
8544
|
-
color: '#051039',
|
|
8545
|
-
backgroundColor: 'rgba(236, 237, 238, 0.7)',
|
|
8546
|
-
borderRadius: 2
|
|
8547
|
-
},
|
|
8548
|
-
children: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title
|
|
8549
|
-
}), jsx("span", {
|
|
8550
|
-
style: {
|
|
8551
|
-
display: 'inline-block',
|
|
8552
|
-
width: '75%',
|
|
8553
|
-
opacity: '0.7'
|
|
8554
|
-
},
|
|
8555
|
-
children: wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions.map(function (wmLayerDimension) {
|
|
8556
|
-
return jsx("span", {
|
|
8557
|
-
style: {
|
|
8558
|
-
margin: '0 0 0 0px',
|
|
8559
|
-
padding: '1px 5px',
|
|
8560
|
-
background: 'blue',
|
|
8561
|
-
borderRadius: 2,
|
|
8562
|
-
color: 'white',
|
|
8563
|
-
fontSize: '11px'
|
|
8564
|
-
},
|
|
8565
|
-
title: "".concat(wmLayerDimension.name, " ").concat(formatDimensionVal(wmLayerDimension.name, wmLayerDimension.currentValue)),
|
|
8566
|
-
children: getDimensionInfo(wmLayerDimension)
|
|
8567
|
-
}, wmLayerDimension.name);
|
|
8568
|
-
})
|
|
8569
|
-
})]
|
|
8570
|
-
})]
|
|
9011
|
+
children: jsx("div", {
|
|
9012
|
+
children: items
|
|
9013
|
+
})
|
|
8571
9014
|
})
|
|
8572
9015
|
}, wmLayer.id);
|
|
8573
9016
|
};
|
|
8574
9017
|
|
|
8575
9018
|
var getWMSStyleName = function getWMSStyleName(styleName, styles) {
|
|
9019
|
+
var _styles$0$name, _styles$;
|
|
8576
9020
|
if (styleName && styles.some(function (style) {
|
|
8577
9021
|
return style.name === styleName;
|
|
8578
9022
|
})) {
|
|
@@ -8580,7 +9024,7 @@ var getWMSStyleName = function getWMSStyleName(styleName, styles) {
|
|
|
8580
9024
|
}
|
|
8581
9025
|
return styles.some(function (style) {
|
|
8582
9026
|
return style.name === WMDefaultStyleName;
|
|
8583
|
-
}) ? WMDefaultStyleName : '';
|
|
9027
|
+
}) ? WMDefaultStyleName : (_styles$0$name = (_styles$ = styles[0]) === null || _styles$ === void 0 ? void 0 : _styles$.name) !== null && _styles$0$name !== void 0 ? _styles$0$name : '';
|
|
8584
9028
|
};
|
|
8585
9029
|
var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
8586
9030
|
var _wmLayer$dimensions$f, _wmLayer$dimensions4;
|
|
@@ -8754,13 +9198,13 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
8754
9198
|
// After a layer name change, this waits until the wmLayer is parsed for the new name. Until then the wmLayer still has the styles and dimensions of the previous layer.
|
|
8755
9199
|
// Name, style and dimensions are set in the source at once, so it never requests the new layer with the style or dimensions of the previous one.
|
|
8756
9200
|
useEffect(function () {
|
|
8757
|
-
var
|
|
9201
|
+
var _layer$getSource;
|
|
8758
9202
|
if (!wmLayer || !isParsedForName) {
|
|
8759
9203
|
return;
|
|
8760
9204
|
}
|
|
8761
9205
|
var styles = wmLayer.getStyles();
|
|
8762
9206
|
var style = getWMSStyleName(styleName, styles);
|
|
8763
|
-
wmLayer.setStyle(style
|
|
9207
|
+
wmLayer.setStyle(style);
|
|
8764
9208
|
dimensionsValues && (layer === null || layer === void 0 || (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 ? void 0 : _layer$getSource.setLayerProps({
|
|
8765
9209
|
layerName: layerName,
|
|
8766
9210
|
styleName: style,
|
|
@@ -9820,8 +10264,15 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
9820
10264
|
});
|
|
9821
10265
|
};
|
|
9822
10266
|
|
|
10267
|
+
var makeEDRLayerInfoTitle = function makeEDRLayerInfoTitle(edrBaseUrl, parameter) {
|
|
10268
|
+
var _edrBaseUrl$split = edrBaseUrl.split('/collections/'),
|
|
10269
|
+
_edrBaseUrl$split2 = _slicedToArray(_edrBaseUrl$split, 2),
|
|
10270
|
+
serviceUrl = _edrBaseUrl$split2[0],
|
|
10271
|
+
collectionId = _edrBaseUrl$split2[1];
|
|
10272
|
+
return "".concat(parameter, " | ").concat(collectionId, " | ").concat(serviceUrl);
|
|
10273
|
+
};
|
|
9823
10274
|
var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
9824
|
-
var _wmLayer$getDimension, _wmLayer$getDimension2;
|
|
10275
|
+
var _wmLayer$getDimension, _wmLayer$getDimension2, _wmLayer$dimensions;
|
|
9825
10276
|
var edrBaseUrl = _ref.edrBaseUrl,
|
|
9826
10277
|
parameter = _ref.parameter,
|
|
9827
10278
|
style = _ref.style,
|
|
@@ -9832,7 +10283,8 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
9832
10283
|
layerId = _ref.layerId,
|
|
9833
10284
|
_ref$visible = _ref.visible,
|
|
9834
10285
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
9835
|
-
onInitializeLayer = _ref.onInitializeLayer
|
|
10286
|
+
onInitializeLayer = _ref.onInitializeLayer,
|
|
10287
|
+
debugMode = _ref.debugMode;
|
|
9836
10288
|
// get a wmLayer instance
|
|
9837
10289
|
var wmLayer = useEDRWMLayer(edrBaseUrl, parameter, layerId, onInitializeLayer);
|
|
9838
10290
|
// dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests. We re-use it here for EDR.
|
|
@@ -9850,13 +10302,18 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
9850
10302
|
};
|
|
9851
10303
|
// Don't show anything if no parameter is selected
|
|
9852
10304
|
var isVisible = visible && parameter.length > 0;
|
|
9853
|
-
return
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
10305
|
+
return jsxs(Fragment, {
|
|
10306
|
+
children: [jsx(OpenLayersFeatureLayer, {
|
|
10307
|
+
declutter: true,
|
|
10308
|
+
featureCollection: featureCollection,
|
|
10309
|
+
opacity: opacity,
|
|
10310
|
+
style: isFetching ? loadingStyle : style,
|
|
10311
|
+
visible: isVisible,
|
|
10312
|
+
zIndex: zIndex
|
|
10313
|
+
}), !!debugMode && jsx(ShowLayerInfo, {
|
|
10314
|
+
dimensions: (_wmLayer$dimensions = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.dimensions) !== null && _wmLayer$dimensions !== void 0 ? _wmLayer$dimensions : [],
|
|
10315
|
+
title: makeEDRLayerInfoTitle(edrBaseUrl, parameter)
|
|
10316
|
+
})]
|
|
9860
10317
|
});
|
|
9861
10318
|
};
|
|
9862
10319
|
|
|
@@ -9873,7 +10330,8 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
9873
10330
|
normalize = _ref$normalize === void 0 ? false : _ref$normalize,
|
|
9874
10331
|
nodata = _ref.nodata,
|
|
9875
10332
|
min = _ref.min,
|
|
9876
|
-
max = _ref.max
|
|
10333
|
+
max = _ref.max,
|
|
10334
|
+
featureInfo = _ref.featureInfo;
|
|
9877
10335
|
var _useContext = useContext(MapContext),
|
|
9878
10336
|
map = _useContext.map;
|
|
9879
10337
|
var layerRef = useRef(undefined);
|
|
@@ -9882,6 +10340,27 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
9882
10340
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9883
10341
|
initialized = _useState2[0],
|
|
9884
10342
|
setInitialized = _useState2[1];
|
|
10343
|
+
var featureInfoLayerId = featureInfo === null || featureInfo === void 0 ? void 0 : featureInfo.layerId;
|
|
10344
|
+
var featureInfoItemId = featureInfo === null || featureInfo === void 0 ? void 0 : featureInfo.itemId;
|
|
10345
|
+
var featureInfoBand = featureInfo === null || featureInfo === void 0 ? void 0 : featureInfo.band;
|
|
10346
|
+
var featureInfoDatetime = featureInfo === null || featureInfo === void 0 ? void 0 : featureInfo.datetime;
|
|
10347
|
+
var featureInfoNodata = featureInfo === null || featureInfo === void 0 ? void 0 : featureInfo.nodata;
|
|
10348
|
+
var featureInfoBbox = featureInfo === null || featureInfo === void 0 ? void 0 : featureInfo.bbox;
|
|
10349
|
+
var enabled = layerProps === null || layerProps === void 0 ? void 0 : layerProps.enabled;
|
|
10350
|
+
useEffect(function () {
|
|
10351
|
+
if (!map || !shouldRender || !enabled || !featureInfoLayerId || !featureInfoItemId) {
|
|
10352
|
+
return undefined;
|
|
10353
|
+
}
|
|
10354
|
+
return registerStacFeatureInfoSource(map, featureInfoLayerId, {
|
|
10355
|
+
itemId: featureInfoItemId,
|
|
10356
|
+
url: url,
|
|
10357
|
+
projection: projection,
|
|
10358
|
+
band: featureInfoBand,
|
|
10359
|
+
datetime: featureInfoDatetime,
|
|
10360
|
+
nodata: featureInfoNodata,
|
|
10361
|
+
bbox: featureInfoBbox
|
|
10362
|
+
});
|
|
10363
|
+
}, [map, shouldRender, enabled, featureInfoLayerId, featureInfoItemId, featureInfoBand, featureInfoDatetime, featureInfoNodata, featureInfoBbox, url, projection]);
|
|
9885
10364
|
// Only create the layer once
|
|
9886
10365
|
useEffect(function () {
|
|
9887
10366
|
if (!map || !layerName || layerRef.current || !url || !shouldRender) {
|
|
@@ -11091,6 +11570,20 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref6) {
|
|
|
11091
11570
|
return rasterAssetKeys.has(itemId);
|
|
11092
11571
|
}));
|
|
11093
11572
|
}, [rasterAssetKeys, rasterFrameItems]);
|
|
11573
|
+
var isFeatureInfoReady = Boolean(collectionData) && Boolean(items !== null && items !== void 0 ? items : displayedItems) && !(isFetching && !isTiledCollection) && !isWaitingForRasterQuery && !isWaitingForManualSelectionQuery && !isWaitingForRasterSelection;
|
|
11574
|
+
React.useEffect(function () {
|
|
11575
|
+
if (!map || !layerId) {
|
|
11576
|
+
return undefined;
|
|
11577
|
+
}
|
|
11578
|
+
return function () {
|
|
11579
|
+
setStacFeatureInfoReady(map, layerId, false);
|
|
11580
|
+
};
|
|
11581
|
+
}, [map, layerId]);
|
|
11582
|
+
React.useEffect(function () {
|
|
11583
|
+
if (map && layerId) {
|
|
11584
|
+
setStacFeatureInfoReady(map, layerId, isFeatureInfoReady);
|
|
11585
|
+
}
|
|
11586
|
+
}, [map, layerId, isFeatureInfoReady]);
|
|
11094
11587
|
var getFrameBand = React.useCallback(function (item, resolvedAssetKey) {
|
|
11095
11588
|
var _ref10, _getStacRasterBands$, _getStacRasterBands, _collectionData$item_, _collectionData$summa;
|
|
11096
11589
|
return (_ref10 = (_getStacRasterBands$ = (_getStacRasterBands = getStacRasterBands(item, resolvedAssetKey)) === null || _getStacRasterBands === void 0 ? void 0 : _getStacRasterBands[0]) !== null && _getStacRasterBands$ !== void 0 ? _getStacRasterBands$ : collectionData === null || collectionData === void 0 || (_collectionData$item_ = collectionData.item_assets) === null || _collectionData$item_ === void 0 || (_collectionData$item_ = _collectionData$item_[resolvedAssetKey]) === null || _collectionData$item_ === void 0 || (_collectionData$item_ = _collectionData$item_['raster:bands']) === null || _collectionData$item_ === void 0 ? void 0 : _collectionData$item_[0]) !== null && _ref10 !== void 0 ? _ref10 : collectionData === null || collectionData === void 0 || (_collectionData$summa = collectionData.summaries) === null || _collectionData$summa === void 0 || (_collectionData$summa = _collectionData$summa['raster:bands']) === null || _collectionData$summa === void 0 ? void 0 : _collectionData$summa[0];
|
|
@@ -11249,6 +11742,14 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref6) {
|
|
|
11249
11742
|
var nodata = (_renderEntry$nodata = renderEntry === null || renderEntry === void 0 ? void 0 : renderEntry.nodata) !== null && _renderEntry$nodata !== void 0 ? _renderEntry$nodata : band === null || band === void 0 ? void 0 : band.nodata;
|
|
11250
11743
|
var projection = (_ref16 = (_item$properties$proj = item.properties['proj:wkt2']) !== null && _item$properties$proj !== void 0 ? _item$properties$proj : item.properties['proj:code']) !== null && _ref16 !== void 0 ? _ref16 : item.properties['proj:epsg'] ? "EPSG:".concat(item.properties['proj:epsg']) : undefined;
|
|
11251
11744
|
return jsx(GeoTIFFLayer, {
|
|
11745
|
+
featureInfo: isSelected && layerId ? {
|
|
11746
|
+
layerId: layerId,
|
|
11747
|
+
itemId: item.id,
|
|
11748
|
+
band: band,
|
|
11749
|
+
datetime: item.properties.datetime,
|
|
11750
|
+
nodata: renderEntry === null || renderEntry === void 0 ? void 0 : renderEntry.nodata,
|
|
11751
|
+
bbox: item.bbox
|
|
11752
|
+
} : undefined,
|
|
11252
11753
|
geotiffStyle: geotiffStyle,
|
|
11253
11754
|
layerName: "".concat(item.id, "-").concat(resolvedAssetKey),
|
|
11254
11755
|
layerOptions: {
|
|
@@ -12103,6 +12604,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
12103
12604
|
var multiParam = Array.isArray(edrOptions === null || edrOptions === void 0 ? void 0 : edrOptions.parameterNames) && edrOptions.parameterNames.length > 1;
|
|
12104
12605
|
var styleLike = style !== undefined ? styleNameToStyleLike(style, multiParam) : undefined;
|
|
12105
12606
|
return jsx(TimeAwareEDRLocationLayer, {
|
|
12607
|
+
debugMode: debugMode,
|
|
12106
12608
|
dimensions: dimensions,
|
|
12107
12609
|
edrBaseUrl: service,
|
|
12108
12610
|
layerId: id,
|
|
@@ -15552,4 +16054,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
|
|
|
15552
16054
|
return updateObject;
|
|
15553
16055
|
};
|
|
15554
16056
|
|
|
15555
|
-
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, StacLegendCanvas, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, applyStacNodataMask, 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, getStacGrayscaleRange, getStacGrayscaleSampleRange, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getStacLegendMetadata, getStacLegendWidth, getStacRasterBands, getTimeDimension, getToolIcon, getWMSStyleName, 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, makeStacLegendModel, 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, renderStacLegend, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, selectPreferredWMTSTileMatrixSet, 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 };
|
|
16057
|
+
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDR_PLAIN_NUMBERS_STYLE, 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, StacLegendCanvas, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, applyStacNodataMask, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, clearStacFeatureInfoCache, 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, edrCollectionsToServiceLayers, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureMultiPoint, featurePoint, featurePolygon, fetchEDRArea, fetchEDRCollectionDetails, fetchEDRCube, fetchEDRJson, fetchEDRParameter, fetchEDRServiceLayers, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatEDRValue, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getEDRUnitLabel, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFeatureInfoSources, getStacFrameItemsToRender, getStacGrayscaleRange, getStacGrayscaleSampleRange, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getStacLegendMetadata, getStacLegendWidth, getStacRasterBands, getTimeDimension, getToolIcon, getWMSStyleName, handleResponse, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, isStacFeatureInfoReady, joinUrlParams, keepIdentityOnFirstSplitFeature, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStylePlainNumber, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeStacLegendModel, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, normalizeEDRLabel, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, readStacPointValue, registerStacFeatureInfoSource, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, renderStacLegend, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, selectPreferredWMTSTileMatrixSet, setMapCenter, setStacFeatureInfoReady, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, subscribeStacFeatureInfoSources, 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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Position, Source } from '@opengeoweb/shared';
|
|
2
2
|
import { LayerType } from '@opengeoweb/webmap';
|
|
3
|
-
import type { LayerFoundation, LayerProps } from '@opengeoweb/webmap';
|
|
3
|
+
import type { EDRParameterMetadata, LayerFoundation, LayerProps } from '@opengeoweb/webmap';
|
|
4
4
|
export interface LayerInfoDialogProps {
|
|
5
5
|
layer: LayerProps;
|
|
6
6
|
serviceName: string;
|
|
@@ -17,20 +17,7 @@ export interface LayerInfoDialogProps {
|
|
|
17
17
|
layerOpacity?: number;
|
|
18
18
|
stacLayer?: Pick<LayerFoundation, 'service' | 'id' | 'style'>;
|
|
19
19
|
showLayerLegend: boolean;
|
|
20
|
-
onToggleLayerLegendVisibility
|
|
21
|
-
edrParameterMetadata?:
|
|
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
|
-
};
|
|
20
|
+
onToggleLayerLegendVisibility?: (showLegend: boolean) => void;
|
|
21
|
+
edrParameterMetadata?: EDRParameterMetadata;
|
|
35
22
|
}
|
|
36
23
|
export declare const LayerInfoDialog: React.FC<LayerInfoDialogProps>;
|
|
@@ -4,7 +4,7 @@ export interface LayerInfoLegendProps {
|
|
|
4
4
|
title: string;
|
|
5
5
|
legendURL?: string;
|
|
6
6
|
showLayerLegend: boolean;
|
|
7
|
-
onToggleLayerLegendVisibility
|
|
7
|
+
onToggleLayerLegendVisibility?: (showLegend: boolean) => void;
|
|
8
8
|
layerType?: LayerType;
|
|
9
9
|
stacLayer?: Pick<LayerFoundation, 'service' | 'id' | 'style'>;
|
|
10
10
|
layerOpacity?: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type ImageLayer from 'ol/layer/Image';
|
|
2
2
|
import type { LayerFoundation } from '@opengeoweb/webmap';
|
|
3
|
+
import type { STACFeatureInfoSource } from '../../../geotiff-layer-api/utils/stacFeatureInfo';
|
|
3
4
|
export interface TiledWMSLayerProps {
|
|
4
5
|
url: string;
|
|
5
6
|
layerName: string;
|
|
@@ -12,5 +13,8 @@ export interface TiledWMSLayerProps {
|
|
|
12
13
|
nodata?: number;
|
|
13
14
|
min?: number;
|
|
14
15
|
max?: number;
|
|
16
|
+
featureInfo?: Omit<STACFeatureInfoSource, 'url' | 'projection'> & {
|
|
17
|
+
layerId: string;
|
|
18
|
+
};
|
|
15
19
|
}
|
|
16
20
|
export declare const GeoTIFFLayer: React.FC<TiledWMSLayerProps>;
|
|
@@ -9,6 +9,7 @@ interface TimeAwareEDRLocationLayerProps extends OpenLayersFeatureLayerProps {
|
|
|
9
9
|
onInitializeLayer?: (payload: OnInitializeLayerProps) => void;
|
|
10
10
|
opacity?: number;
|
|
11
11
|
visible?: boolean;
|
|
12
|
+
debugMode?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare const TimeAwareEDRLocationLayer: React.FC<TimeAwareEDRLocationLayerProps>;
|
|
14
15
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WMJSDimension } from '@opengeoweb/webmap';
|
|
2
|
+
type LayerInfoDimension = Pick<WMJSDimension, 'name' | 'currentValue'>;
|
|
3
|
+
export interface ShowLayerInfoProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
dimensions: LayerInfoDimension[];
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** Debug overlay row with the layer title and its current dimension values. */
|
|
9
|
+
export declare const ShowLayerInfo: React.FC<ShowLayerInfoProps>;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Coverage, CoverageCollection, EDRInstance, PointDomain, PointSeriesDomain } from '@opengeoweb/shared';
|
|
2
|
+
import type { EDRParameterMetadata } from '@opengeoweb/webmap';
|
|
2
3
|
export declare const handleResponse: (response: Response) => Promise<unknown>;
|
|
3
4
|
export declare const joinUrlParams: (params: string[]) => string;
|
|
4
5
|
export declare const fetchEDRCollectionDetails: (edrBaseUrlWithCollection: string, instanceId?: string) => Promise<EDRInstance>;
|
|
@@ -7,3 +8,4 @@ export declare const fetchEDRArea: (edrBaseUrlWithCollection: string, parameterN
|
|
|
7
8
|
export declare const fetchEDRParameter: (collection: EDRInstance | undefined, edrBaseUrlWithCollection: string, parameterName: string, datetime?: string, instanceId?: string) => Promise<CoverageCollection<PointDomain | PointSeriesDomain> | Coverage<PointDomain | PointSeriesDomain> | undefined>;
|
|
8
9
|
export declare const fetchEDRJson: <T>(url: string) => Promise<T>;
|
|
9
10
|
export declare const normalizeEDRLabel: (label: unknown, fallback: string) => string;
|
|
11
|
+
export declare const getEDRUnitLabel: (parameter: EDRParameterMetadata | undefined) => string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { FeatureLike } from 'ol/Feature';
|
|
2
2
|
import { Circle, Style } from 'ol/style';
|
|
3
3
|
import type { ColorMap } from './colormaps';
|
|
4
|
+
export declare const EDR_PLAIN_NUMBERS_STYLE = "plainNumbers";
|
|
4
5
|
export interface EdrMapLegendEntry {
|
|
5
6
|
min: number;
|
|
6
7
|
max: number;
|
|
@@ -19,9 +20,11 @@ export declare const makeLegendFromColorMap: (props: {
|
|
|
19
20
|
export declare const generateImageFromLegend: (edrColorLegend: EdrOlColorLegend, ctx: CanvasRenderingContext2D, opacity?: number) => number;
|
|
20
21
|
export declare const getLegendClass: (edrColorLegend: EdrOlColorLegend, value: number, clip?: boolean) => EdrMapLegendEntry | undefined;
|
|
21
22
|
export declare const makeFeatureStyleWind: (feature: FeatureLike) => Style[];
|
|
23
|
+
export declare const formatEDRValue: (value: unknown) => string;
|
|
22
24
|
export declare const makeFeatureStyleMultiParam: (feature: FeatureLike) => Style[];
|
|
23
25
|
export declare const makeFeatureStyleMultiParamLoading: () => Style;
|
|
24
26
|
export declare const makeFeatureStyleDisc: (feature: FeatureLike, legend: EdrOlColorLegend) => Style;
|
|
27
|
+
export declare const makeFeatureStylePlainNumber: (feature: FeatureLike) => Style;
|
|
25
28
|
export declare const makeFeatureStyleLoading: (feature: FeatureLike) => Style;
|
|
26
29
|
export declare const styleNameToStyleLike: ((styleName: string, multiParam?: boolean) => ((feature: FeatureLike) => Style | Style[])) & import("lodash").MemoizedFunction;
|
|
27
30
|
export declare const defaultEdrStyles: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { EDRParameterMetadata, LayerProps } from '@opengeoweb/webmap';
|
|
2
|
+
export interface EDRCollectionMetadata {
|
|
3
|
+
id: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
path?: string[];
|
|
7
|
+
groups?: string[];
|
|
8
|
+
group?: string;
|
|
9
|
+
parameter_names?: Record<string, EDRParameterMetadata> | EDRParameterMetadata[];
|
|
10
|
+
}
|
|
11
|
+
export interface EDRServiceLayer extends LayerProps {
|
|
12
|
+
edrCollectionId: string;
|
|
13
|
+
edrParameter: EDRParameterMetadata;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Converts EDR collections to service layers, one layer per collection parameter.
|
|
17
|
+
* Layers are grouped by collection in the Layer Select using their path.
|
|
18
|
+
*/
|
|
19
|
+
export declare const edrCollectionsToServiceLayers: (collections: EDRCollectionMetadata[]) => EDRServiceLayer[];
|
|
20
|
+
export declare const fetchEDRServiceLayers: (serviceUrl: string) => Promise<EDRServiceLayer[]>;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { WMLayer } from '@opengeoweb/webmap';
|
|
2
2
|
import type { OnInitializeLayerProps } from '../../components/OpenLayers/utils/types';
|
|
3
|
+
/**
|
|
4
|
+
* Makes the ISO 8601 time dimension values (start/end/step) for an EDR collection.
|
|
5
|
+
* The time step is read from the temporal values, e.g. R780526/2012-01-01T00:00:00Z/PT10M
|
|
6
|
+
* or 2012-01-01T00:00:00Z/2026-01-01T00:00:00Z/PT10M. When there is no time step,
|
|
7
|
+
* 10 minute steps aligned to whole 10 minutes are used, as is common for observations.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getEDRTimeDimensionValues: (temporal: {
|
|
10
|
+
interval?: string[][];
|
|
11
|
+
values?: string[];
|
|
12
|
+
} | undefined) => string | undefined;
|
|
3
13
|
/**
|
|
4
14
|
* Returns WMLayer instance in EDR mode. The layer will contains parsed dimensions and styles and keeps a state for these properties.
|
|
5
15
|
*
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Map as OlMap } from 'ol';
|
|
2
|
+
import type { STACRasterBand } from '../api';
|
|
3
|
+
export interface STACFeatureInfoSource {
|
|
4
|
+
itemId: string;
|
|
5
|
+
url: string;
|
|
6
|
+
projection?: string;
|
|
7
|
+
band?: STACRasterBand;
|
|
8
|
+
datetime?: string | null;
|
|
9
|
+
nodata?: number | string;
|
|
10
|
+
bbox?: number[];
|
|
11
|
+
}
|
|
12
|
+
export interface STACPointValue {
|
|
13
|
+
value: number;
|
|
14
|
+
unit?: string;
|
|
15
|
+
gridPoint?: {
|
|
16
|
+
lon: number;
|
|
17
|
+
lat: number;
|
|
18
|
+
};
|
|
19
|
+
distanceKm?: number;
|
|
20
|
+
}
|
|
21
|
+
/** A layer is ready once its active frames are resolved; until then, no sources does not mean no data. */
|
|
22
|
+
export declare const isStacFeatureInfoReady: (map: OlMap | null, layerId: string) => boolean;
|
|
23
|
+
export declare const setStacFeatureInfoReady: (map: OlMap, layerId: string, ready: boolean) => void;
|
|
24
|
+
export declare const getStacFeatureInfoSources: (map: OlMap | null, layerId: string) => STACFeatureInfoSource[];
|
|
25
|
+
export declare const subscribeStacFeatureInfoSources: (map: OlMap | null, listener: () => void) => (() => void);
|
|
26
|
+
/** Register only active raster frames; preloaded frames must not be queried. */
|
|
27
|
+
export declare const registerStacFeatureInfoSource: (map: OlMap, layerId: string, source: STACFeatureInfoSource) => (() => void);
|
|
28
|
+
export declare const clearStacFeatureInfoCache: () => void;
|
|
29
|
+
/** Read the original first-band sample, not an overview or normalized display value. */
|
|
30
|
+
export declare const readStacPointValue: (source: STACFeatureInfoSource, location: {
|
|
31
|
+
lon: number;
|
|
32
|
+
lat: number;
|
|
33
|
+
}, signal?: AbortSignal) => Promise<STACPointValue | undefined>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.2.0-nightly-20261113",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,11 +20,12 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opengeoweb/webmap": "21.
|
|
24
|
-
"@opengeoweb/theme": "21.
|
|
25
|
-
"@opengeoweb/shared": "21.
|
|
23
|
+
"@opengeoweb/webmap": "21.2.0-nightly-20261113",
|
|
24
|
+
"@opengeoweb/theme": "21.2.0-nightly-20261113",
|
|
25
|
+
"@opengeoweb/shared": "21.2.0-nightly-20261113",
|
|
26
26
|
"lodash": "^4.18.1",
|
|
27
27
|
"ol": "^10.4.0",
|
|
28
|
+
"geotiff": "^3.0.5",
|
|
28
29
|
"proj4": "^2.9.2",
|
|
29
30
|
"@turf/turf": "^7.1.0",
|
|
30
31
|
"immer": "^10.0.3",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"@emotion/styled": "*"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"eslint-plugin-storybook": "10.3.3"
|
|
44
|
+
"eslint-plugin-storybook": "^10.3.3"
|
|
44
45
|
},
|
|
45
46
|
"files": [
|
|
46
47
|
"dist",
|