@opengeoweb/webmap-react 19.4.0 → 19.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1091 -151
- package/dist/src/lib/components/OpenLayers/component/OpenLayersMapView.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/layers/TimeAwareGeoTIFFLayer.d.ts +5 -1
- package/dist/src/lib/components/OpenLayers/layers/TimeAwareGeoTIFFLayerUtils.d.ts +18 -1
- package/dist/src/lib/components/OpenLayers/layers/useStacViewportBbox.d.ts +6 -0
- package/dist/src/lib/components/OpenLayers/utils/types.d.ts +1 -0
- package/dist/src/lib/geotiff-layer-api/api.d.ts +22 -7
- package/dist/src/lib/geotiff-layer-api/hooks.d.ts +4 -2
- package/dist/src/lib/geotiff-layer-api/index.d.ts +1 -0
- package/dist/src/lib/geotiff-layer-api/utils/stacColormapToOlStyle.d.ts +18 -1
- package/dist/src/lib/geotiff-layer-api/utils/stacTimeStepUtils.d.ts +6 -3
- package/dist/src/lib/geotiff-layer-api/utils/styleSelection.d.ts +1 -0
- package/dist/src/lib/geotiff-layer-api/utils/useGetStacGeoTIFFLayerInstance.d.ts +2 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { WMInvalidDateValues, getCorrectWMSDimName, WMImageStore, WMImageStoreLo
|
|
|
2
2
|
export { WEBMAP_NAMESPACE, webmapTranslations } from '@opengeoweb/webmap';
|
|
3
3
|
import React, { createContext, useMemo, useRef, useState, useEffect, useCallback, useContext, useLayoutEffect } from 'react';
|
|
4
4
|
import { memoize, range, without, isEqual, throttle, debounce, cloneDeep } from 'lodash';
|
|
5
|
-
import { equals, containsExtent, getCenter } from 'ol/extent';
|
|
5
|
+
import { equals, containsExtent as containsExtent$1, getCenter } from 'ol/extent';
|
|
6
6
|
import ImageState from 'ol/ImageState';
|
|
7
7
|
import LayerProperty from 'ol/layer/Property';
|
|
8
8
|
import { fromResolutionLike } from 'ol/resolution';
|
|
@@ -10,7 +10,7 @@ import ImageSource, { getRequestExtent } from 'ol/source/Image';
|
|
|
10
10
|
import ImageWrapper, { load } from 'ol/Image';
|
|
11
11
|
import { getImageSrc, getRequestParams, createLoader } from 'ol/source/wms';
|
|
12
12
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
13
|
-
import { CustomTooltip, CanvasComponent, useWheelStopPropagation, ToolContainerDraggable, CustomIconButton, dateUtils, useMakeSureContainerStaysInsideWindow, Draggable, Resizable } from '@opengeoweb/shared';
|
|
13
|
+
import { CustomTooltip, CanvasComponent, useWheelStopPropagation, ToolContainerDraggable, CustomIconButton, dateUtils, isDialogFocused, useMakeSureContainerStaysInsideWindow, Draggable, Resizable } from '@opengeoweb/shared';
|
|
14
14
|
import { useTheme, Card, Box, Typography, Grid, styled, Slider, FormGroup, FormControlLabel, Checkbox, TextField, FormControl, InputLabel, Select, MenuItem, Icon as Icon$2, FormLabel, Switch, Paper, ThemeProvider } from '@mui/material';
|
|
15
15
|
import { Visibility, VisibilityOff, arrowUpPath, Home, Add, Minus, List, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath, rotatePath, DrawToolSplitFeature, Location, DrawToolSmoothLine, DrawToolFreehand, DrawToolOval, DrawToolCircle, DrawToolSquare, Delete, DrawToolLineString, DrawToolRectangle, DrawToolPolygon, DrawToolPoint, DrawFIRLand, ArrowUp, darkTheme, ChevronRight, Options, Clock as Clock$1 } from '@opengeoweb/theme';
|
|
16
16
|
import 'i18next';
|
|
@@ -20,13 +20,13 @@ import { Point, MultiPoint, Polygon, LineString } from 'ol/geom';
|
|
|
20
20
|
import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
|
|
21
21
|
import Box$1 from '@mui/material/Box';
|
|
22
22
|
import Typography$1 from '@mui/material/Typography';
|
|
23
|
-
import { View, Map, Feature, Collection, Overlay } from 'ol';
|
|
23
|
+
import { View, Map as Map$1, Feature, Collection, Overlay } from 'ol';
|
|
24
24
|
import { defaults, MouseWheelZoom, Draw, Modify, Translate, Snap, DragPan } from 'ol/interaction';
|
|
25
25
|
import 'ol/ol.css';
|
|
26
26
|
import { listen, unlistenByKey } from 'ol/events';
|
|
27
27
|
import { unByKey } from 'ol/Observable';
|
|
28
28
|
import EventType from 'ol/pointer/EventType';
|
|
29
|
-
import { toLonLat, fromLonLat, transform } from 'ol/proj';
|
|
29
|
+
import { toLonLat, fromLonLat, transformExtent, transform } from 'ol/proj';
|
|
30
30
|
import { register } from 'ol/proj/proj4';
|
|
31
31
|
import proj4 from 'proj4';
|
|
32
32
|
import { lineSplit, cleanCoords, featureCollection, difference, bbox, feature, simplify, booleanPointInPolygon, intersect, polygonToLine, booleanClockwise, rewind, toWgs84, toMercator, coordEach } from '@turf/turf';
|
|
@@ -1293,7 +1293,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1293
1293
|
var requestExtent = getRequestExtent(extent, resolution, pixelRatio, 1);
|
|
1294
1294
|
var requestResolution = this.findNearestResolution(resolution);
|
|
1295
1295
|
var requestDimProperties = _objectSpread2({}, this._dimProperties);
|
|
1296
|
-
var requestedImageHasWantedExtent = (this._loadedExtent && containsExtent(this._loadedExtent, requestExtent) || containsExtent(this._imWrapperForOlSource.getExtent(), requestExtent)) && (this._loadedResolution && fromResolutionLike(this._loadedResolution) === requestResolution || fromResolutionLike(this._imWrapperForOlSource.getResolution()) === requestResolution);
|
|
1296
|
+
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
1297
|
var hasExactImage = this._loadedExtent && this._imWrapperForOlSource.hasImage(this._loadedExtent, this._loadedResolution, pixelRatio, projection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, requestDimProperties);
|
|
1298
1298
|
if (hasExactImage && hasExactImage.isLoaded && requestedImageHasWantedExtent) {
|
|
1299
1299
|
this._imWrapperForOlSource.setGeoReferencedImage(hasExactImage);
|
|
@@ -2470,7 +2470,6 @@ var renderLegendGraphic = function renderLegendGraphic(wmImage, ctx, width, heig
|
|
|
2470
2470
|
}
|
|
2471
2471
|
};
|
|
2472
2472
|
var Legend = function Legend(_ref) {
|
|
2473
|
-
var _layer$options;
|
|
2474
2473
|
var layer = _ref.layer,
|
|
2475
2474
|
onToggleLayerLegendVisibility = _ref.onToggleLayerLegendVisibility;
|
|
2476
2475
|
/* Variable to remember the previous image */
|
|
@@ -2520,7 +2519,10 @@ var Legend = function Legend(_ref) {
|
|
|
2520
2519
|
like a title and the WMS legendgraphic url */
|
|
2521
2520
|
var wmLayer = webmapUtils.getWMLayerById(layer.id);
|
|
2522
2521
|
var isEdrLayer = layer.layerType === LayerType.edrFeatureLayer;
|
|
2523
|
-
var title =
|
|
2522
|
+
var title = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.title;
|
|
2523
|
+
if (isEdrLayer) {
|
|
2524
|
+
title = layer.options && 'collectionId' in layer.options ? layer.options.collectionId : undefined;
|
|
2525
|
+
}
|
|
2524
2526
|
/* Custom legend toggle for layer */
|
|
2525
2527
|
var toggleLayerLegendVisibility = function toggleLayerLegendVisibility(showLegend) {
|
|
2526
2528
|
return onToggleLayerLegendVisibility(layerId, showLegend);
|
|
@@ -3690,7 +3692,9 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
3690
3692
|
passiveMap = _ref$passiveMap === void 0 ? false : _ref$passiveMap,
|
|
3691
3693
|
_ref$holdShiftToScrol = _ref.holdShiftToScroll,
|
|
3692
3694
|
holdShiftToScroll = _ref$holdShiftToScrol === void 0 ? false : _ref$holdShiftToScrol,
|
|
3693
|
-
mapId = _ref.mapId
|
|
3695
|
+
mapId = _ref.mapId,
|
|
3696
|
+
_ref$showMapMousePosi = _ref.showMapMousePosition,
|
|
3697
|
+
showMapMousePosition = _ref$showMapMousePosi === void 0 ? true : _ref$showMapMousePosi;
|
|
3694
3698
|
var mapRef = useRef(null);
|
|
3695
3699
|
var _useState = useState(null),
|
|
3696
3700
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -3707,7 +3711,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
3707
3711
|
if (!mapRef.current) {
|
|
3708
3712
|
return function () {};
|
|
3709
3713
|
}
|
|
3710
|
-
var mapObject = new Map({
|
|
3714
|
+
var mapObject = new Map$1({
|
|
3711
3715
|
interactions: defaults({
|
|
3712
3716
|
dragPan: true,
|
|
3713
3717
|
mouseWheelZoom: false
|
|
@@ -3731,7 +3735,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
3731
3735
|
return function () {};
|
|
3732
3736
|
}
|
|
3733
3737
|
var handleKeyPress = function handleKeyPress(event) {
|
|
3734
|
-
if (!dispatchingKeyboardEventRef.current && mapRef.current && document.activeElement === document.body && ['+', '-', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
|
3738
|
+
if (!dispatchingKeyboardEventRef.current && mapRef.current && document.activeElement === document.body && !isDialogFocused() && ['+', '-', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
|
3735
3739
|
var newEvent = new KeyboardEvent(event.type, event);
|
|
3736
3740
|
newEvent.preventDefault();
|
|
3737
3741
|
dispatchingKeyboardEventRef.current = true;
|
|
@@ -3791,7 +3795,7 @@ var OpenLayersMapView = function OpenLayersMapView(_ref) {
|
|
|
3791
3795
|
height: '100%',
|
|
3792
3796
|
position: 'relative'
|
|
3793
3797
|
},
|
|
3794
|
-
children: [children, jsx(MapMousePosition, {}), !!holdShiftToScroll && !!isMouseWheelZoomEnabled && jsx(HoldShiftToZoomMessage, {})]
|
|
3798
|
+
children: [children, !!showMapMousePosition && jsx(MapMousePosition, {}), !!holdShiftToScroll && !!isMouseWheelZoomEnabled && jsx(HoldShiftToZoomMessage, {})]
|
|
3795
3799
|
})
|
|
3796
3800
|
});
|
|
3797
3801
|
};
|
|
@@ -6018,13 +6022,17 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
6018
6022
|
};
|
|
6019
6023
|
}, [map, source, hoverSelect, visible]);
|
|
6020
6024
|
useEffect(function () {
|
|
6025
|
+
var _clickOnFeature$event;
|
|
6021
6026
|
if (!map || !source || !clickOnFeature || !visible) {
|
|
6022
6027
|
return function () {};
|
|
6023
6028
|
}
|
|
6024
6029
|
var clickFunction = function clickFunction(evt) {
|
|
6025
6030
|
var _evt$originalEvent$sh;
|
|
6026
6031
|
var features = [];
|
|
6027
|
-
map.forEachFeatureAtPixel(evt.pixel, function (feature) {
|
|
6032
|
+
map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
|
|
6033
|
+
if ((layer === null || layer === void 0 ? void 0 : layer.getSource()) !== source) {
|
|
6034
|
+
return;
|
|
6035
|
+
}
|
|
6028
6036
|
features.push(feature);
|
|
6029
6037
|
}, {
|
|
6030
6038
|
hitTolerance: clickOnFeature.hitTolerance
|
|
@@ -6032,7 +6040,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
6032
6040
|
var isShiftClick = (_evt$originalEvent$sh = evt.originalEvent.shiftKey) !== null && _evt$originalEvent$sh !== void 0 ? _evt$originalEvent$sh : false;
|
|
6033
6041
|
clickOnFeature.onClick(features, isShiftClick);
|
|
6034
6042
|
};
|
|
6035
|
-
var eventKey = map.on('click', clickFunction);
|
|
6043
|
+
var eventKey = map.on((_clickOnFeature$event = clickOnFeature.eventType) !== null && _clickOnFeature$event !== void 0 ? _clickOnFeature$event : 'click', clickFunction);
|
|
6036
6044
|
return function () {
|
|
6037
6045
|
unByKey(eventKey);
|
|
6038
6046
|
};
|
|
@@ -6237,7 +6245,17 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
6237
6245
|
layerRef.current = layer;
|
|
6238
6246
|
setInitialized(true);
|
|
6239
6247
|
return function () {
|
|
6240
|
-
map.removeLayer(
|
|
6248
|
+
map.removeLayer(layer);
|
|
6249
|
+
// Removing a layer does not dispose its renderer or cached data tiles.
|
|
6250
|
+
// Detach and dispose the source immediately to stop in-flight range reads.
|
|
6251
|
+
// Layer disposal must wait for a new frame: OpenLayers nulls the layer in
|
|
6252
|
+
// its cached frame state, which can race with debounced feature hit tests.
|
|
6253
|
+
layer.setSource(null);
|
|
6254
|
+
source.dispose();
|
|
6255
|
+
map.once('postrender', function () {
|
|
6256
|
+
return layer.dispose();
|
|
6257
|
+
});
|
|
6258
|
+
map.render();
|
|
6241
6259
|
layerRef.current = undefined;
|
|
6242
6260
|
setInitialized(false);
|
|
6243
6261
|
};
|
|
@@ -6275,10 +6293,115 @@ var GeoTIFFLayer = function GeoTIFFLayer(_ref) {
|
|
|
6275
6293
|
return null;
|
|
6276
6294
|
};
|
|
6277
6295
|
|
|
6278
|
-
var
|
|
6279
|
-
var
|
|
6280
|
-
|
|
6281
|
-
|
|
6296
|
+
var STAC_VIEWPORT_BUFFER_RATIO = 0.25;
|
|
6297
|
+
var MAX_REUSED_BBOX_SIZE_RATIO = 4;
|
|
6298
|
+
// Only one COG is rendered at a time, so raster rendering can start while the
|
|
6299
|
+
// viewport is still broad enough to provide useful geographic context.
|
|
6300
|
+
var STAC_TILED_MINIMUM_ZOOM = 10;
|
|
6301
|
+
var MAX_STAC_QUERY_WIDTH_DEGREES = 120;
|
|
6302
|
+
var MAX_STAC_QUERY_HEIGHT_DEGREES = 90;
|
|
6303
|
+
var containsExtent = function containsExtent(container, extent) {
|
|
6304
|
+
return container[0] <= extent[0] && container[1] <= extent[1] && container[2] >= extent[2] && container[3] >= extent[3];
|
|
6305
|
+
};
|
|
6306
|
+
var isBboxSizeReusable = function isBboxSizeReusable(currentBbox, viewportBbox) {
|
|
6307
|
+
var currentWidth = currentBbox[2] - currentBbox[0];
|
|
6308
|
+
var currentHeight = currentBbox[3] - currentBbox[1];
|
|
6309
|
+
var viewportWidth = viewportBbox[2] - viewportBbox[0];
|
|
6310
|
+
var viewportHeight = viewportBbox[3] - viewportBbox[1];
|
|
6311
|
+
return currentWidth <= viewportWidth * MAX_REUSED_BBOX_SIZE_RATIO && currentHeight <= viewportHeight * MAX_REUSED_BBOX_SIZE_RATIO;
|
|
6312
|
+
};
|
|
6313
|
+
var roundCoordinate = function roundCoordinate(coordinate) {
|
|
6314
|
+
return Number(coordinate.toFixed(5));
|
|
6315
|
+
};
|
|
6316
|
+
var getViewportBbox = function getViewportBbox(map) {
|
|
6317
|
+
var _map$getSize, _map$getView;
|
|
6318
|
+
var size = (_map$getSize = map.getSize) === null || _map$getSize === void 0 ? void 0 : _map$getSize.call(map);
|
|
6319
|
+
var view = (_map$getView = map.getView) === null || _map$getView === void 0 ? void 0 : _map$getView.call(map);
|
|
6320
|
+
if (!size || !(view !== null && view !== void 0 && view.calculateExtent)) {
|
|
6321
|
+
return undefined;
|
|
6322
|
+
}
|
|
6323
|
+
var projection = view.getProjection();
|
|
6324
|
+
var extent = transformExtent(view.calculateExtent(size), projection, 'EPSG:4326', 8);
|
|
6325
|
+
if (!extent.every(Number.isFinite)) {
|
|
6326
|
+
return undefined;
|
|
6327
|
+
}
|
|
6328
|
+
return extent.map(roundCoordinate);
|
|
6329
|
+
};
|
|
6330
|
+
var bufferBbox = function bufferBbox(extent) {
|
|
6331
|
+
var bufferRatio = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : STAC_VIEWPORT_BUFFER_RATIO;
|
|
6332
|
+
var width = extent[2] - extent[0];
|
|
6333
|
+
var height = extent[3] - extent[1];
|
|
6334
|
+
if (width >= 360) {
|
|
6335
|
+
return [-180, -90, 180, 90];
|
|
6336
|
+
}
|
|
6337
|
+
return [Math.max(-180, extent[0] - width * bufferRatio), Math.max(-90, extent[1] - height * bufferRatio), Math.min(180, extent[2] + width * bufferRatio), Math.min(90, extent[3] + height * bufferRatio)].map(roundCoordinate);
|
|
6338
|
+
};
|
|
6339
|
+
var isStacViewportBboxQueryable = function isStacViewportBboxQueryable(bbox) {
|
|
6340
|
+
return Boolean((bbox === null || bbox === void 0 ? void 0 : bbox.length) === 4 && bbox.every(Number.isFinite) && bbox[2] - bbox[0] <= MAX_STAC_QUERY_WIDTH_DEGREES && bbox[3] - bbox[1] <= MAX_STAC_QUERY_HEIGHT_DEGREES);
|
|
6341
|
+
};
|
|
6342
|
+
var getNextStacViewportBbox = function getNextStacViewportBbox(currentBbox, viewportBbox) {
|
|
6343
|
+
var bufferRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : STAC_VIEWPORT_BUFFER_RATIO;
|
|
6344
|
+
if (bufferRatio === 0) {
|
|
6345
|
+
return viewportBbox;
|
|
6346
|
+
}
|
|
6347
|
+
if (currentBbox && isStacViewportBboxQueryable(currentBbox) && isBboxSizeReusable(currentBbox, viewportBbox) && containsExtent(currentBbox, viewportBbox)) {
|
|
6348
|
+
return currentBbox;
|
|
6349
|
+
}
|
|
6350
|
+
return bufferBbox(viewportBbox, bufferRatio);
|
|
6351
|
+
};
|
|
6352
|
+
var useStacViewportBbox = function useStacViewportBbox(map, enabled, minimumZoom) {
|
|
6353
|
+
var bufferRatio = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : STAC_VIEWPORT_BUFFER_RATIO;
|
|
6354
|
+
var _React$useState = React.useState(),
|
|
6355
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
6356
|
+
bbox = _React$useState2[0],
|
|
6357
|
+
setBbox = _React$useState2[1];
|
|
6358
|
+
React.useEffect(function () {
|
|
6359
|
+
if (!map || !enabled) {
|
|
6360
|
+
setBbox(undefined);
|
|
6361
|
+
return function () {};
|
|
6362
|
+
}
|
|
6363
|
+
var updateBbox = function updateBbox() {
|
|
6364
|
+
var _map$getView2, _map$getView2$call$ge, _map$getView2$call;
|
|
6365
|
+
var zoom = (_map$getView2 = map.getView) === null || _map$getView2 === void 0 || (_map$getView2$call$ge = (_map$getView2$call = _map$getView2.call(map)).getZoom) === null || _map$getView2$call$ge === void 0 ? void 0 : _map$getView2$call$ge.call(_map$getView2$call);
|
|
6366
|
+
if (minimumZoom !== undefined && (zoom === undefined || zoom < minimumZoom)) {
|
|
6367
|
+
setBbox(undefined);
|
|
6368
|
+
return;
|
|
6369
|
+
}
|
|
6370
|
+
var viewportBbox = getViewportBbox(map);
|
|
6371
|
+
if (!viewportBbox) {
|
|
6372
|
+
return;
|
|
6373
|
+
}
|
|
6374
|
+
setBbox(function (currentBbox) {
|
|
6375
|
+
return getNextStacViewportBbox(currentBbox, viewportBbox, bufferRatio);
|
|
6376
|
+
});
|
|
6377
|
+
};
|
|
6378
|
+
updateBbox();
|
|
6379
|
+
var eventKey = map.on('moveend', updateBbox);
|
|
6380
|
+
return function () {
|
|
6381
|
+
eventKey && unByKey(eventKey);
|
|
6382
|
+
};
|
|
6383
|
+
}, [bufferRatio, enabled, map, minimumZoom]);
|
|
6384
|
+
return bbox;
|
|
6385
|
+
};
|
|
6386
|
+
|
|
6387
|
+
/* *
|
|
6388
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6389
|
+
* you may not use this file except in compliance with the License.
|
|
6390
|
+
* You may obtain a copy of the License at
|
|
6391
|
+
*
|
|
6392
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
6393
|
+
*
|
|
6394
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
6395
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6396
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6397
|
+
* See the License for the specific language governing permissions and
|
|
6398
|
+
* limitations under the License.
|
|
6399
|
+
*
|
|
6400
|
+
* Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
6401
|
+
* Copyright 2026 - Finnish Meteorological Institute (FMI)
|
|
6402
|
+
* Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
|
|
6403
|
+
* */
|
|
6404
|
+
var resolvePreferredStyleName$1 = function resolvePreferredStyleName(styleNames, currentStyle) {
|
|
6282
6405
|
if (styleNames.length === 0) {
|
|
6283
6406
|
return WMDefaultStyleName;
|
|
6284
6407
|
}
|
|
@@ -6290,6 +6413,93 @@ var resolvePreferredStyleName = function resolvePreferredStyleName(styleNames, c
|
|
|
6290
6413
|
}
|
|
6291
6414
|
return styleNames[0];
|
|
6292
6415
|
};
|
|
6416
|
+
|
|
6417
|
+
var STAC_ITEM_LOOKUP_WINDOW_MS = 60 * 60 * 1000;
|
|
6418
|
+
var STAC_ITEM_LOOKUP_WINDOW_INTERVAL_MULTIPLIER = 20;
|
|
6419
|
+
// Tiled third-party collections can contain hundreds of spatial items per day.
|
|
6420
|
+
// Only discover the selected interval; adjacent frames are loaded on demand.
|
|
6421
|
+
var STAC_GEOTIFF_FRAME_PRELOAD_RADIUS = 4;
|
|
6422
|
+
var STAC_TILED_ITEM_PAGE_LIMIT = 100;
|
|
6423
|
+
var STAC_TILED_OVERVIEW_ITEM_PAGE_LIMIT = 1000;
|
|
6424
|
+
var isGlobalViewportBbox = function isGlobalViewportBbox(bbox) {
|
|
6425
|
+
return Boolean((bbox === null || bbox === void 0 ? void 0 : bbox.length) === 4 && bbox.every(Number.isFinite) && bbox[0] <= -179 && bbox[1] <= -89 && bbox[2] >= 179 && bbox[3] >= 89);
|
|
6426
|
+
};
|
|
6427
|
+
var resolveStacItemQueryState = function resolveStacItemQueryState(_ref) {
|
|
6428
|
+
var hasCollectionData = _ref.hasCollectionData,
|
|
6429
|
+
isTiledCollection = _ref.isTiledCollection,
|
|
6430
|
+
rasterViewportBbox = _ref.rasterViewportBbox,
|
|
6431
|
+
shouldUseSpatialFilter = _ref.shouldUseSpatialFilter,
|
|
6432
|
+
viewportBbox = _ref.viewportBbox;
|
|
6433
|
+
var isTiledOverview = isTiledCollection && !rasterViewportBbox && Boolean(viewportBbox);
|
|
6434
|
+
var isOverviewViewportQueryable = isStacViewportBboxQueryable(viewportBbox);
|
|
6435
|
+
var itemQueryBbox = viewportBbox;
|
|
6436
|
+
if (isTiledCollection) {
|
|
6437
|
+
itemQueryBbox = isTiledOverview && !isOverviewViewportQueryable ? undefined : rasterViewportBbox !== null && rasterViewportBbox !== void 0 ? rasterViewportBbox : viewportBbox;
|
|
6438
|
+
}
|
|
6439
|
+
var isItemQueryEnabled = hasCollectionData && (!shouldUseSpatialFilter || (isTiledOverview ? isStacViewportBboxQueryable(viewportBbox) || isGlobalViewportBbox(viewportBbox) : isStacViewportBboxQueryable(itemQueryBbox)));
|
|
6440
|
+
return {
|
|
6441
|
+
isItemQueryEnabled: isItemQueryEnabled,
|
|
6442
|
+
isTiledOverview: isTiledOverview,
|
|
6443
|
+
itemQueryBbox: itemQueryBbox
|
|
6444
|
+
};
|
|
6445
|
+
};
|
|
6446
|
+
var getSingleStacRasterItem = function getSingleStacRasterItem(frameItems, selectionBbox, preferredItemId) {
|
|
6447
|
+
var preferredItem = frameItems.find(function (_ref2) {
|
|
6448
|
+
var item = _ref2.item;
|
|
6449
|
+
return item.id === preferredItemId;
|
|
6450
|
+
});
|
|
6451
|
+
if (preferredItem) {
|
|
6452
|
+
return [{
|
|
6453
|
+
item: preferredItem.item,
|
|
6454
|
+
isSelected: true
|
|
6455
|
+
}];
|
|
6456
|
+
}
|
|
6457
|
+
if (frameItems.length <= 1) {
|
|
6458
|
+
return frameItems;
|
|
6459
|
+
}
|
|
6460
|
+
var selectedItems = frameItems.filter(function (_ref3) {
|
|
6461
|
+
var isSelected = _ref3.isSelected;
|
|
6462
|
+
return isSelected;
|
|
6463
|
+
});
|
|
6464
|
+
if ((selectionBbox === null || selectionBbox === void 0 ? void 0 : selectionBbox.length) !== 4) {
|
|
6465
|
+
var _candidates = selectedItems.length > 0 ? selectedItems : frameItems;
|
|
6466
|
+
var selectedCandidate = _toConsumableArray(_candidates).sort(function (first, second) {
|
|
6467
|
+
return first.item.id.localeCompare(second.item.id);
|
|
6468
|
+
})[0];
|
|
6469
|
+
return [{
|
|
6470
|
+
item: selectedCandidate.item,
|
|
6471
|
+
isSelected: true
|
|
6472
|
+
}];
|
|
6473
|
+
}
|
|
6474
|
+
var viewportCenter = [(selectionBbox[0] + selectionBbox[2]) / 2, (selectionBbox[1] + selectionBbox[3]) / 2];
|
|
6475
|
+
var selectedItemsCoverViewportCenter = selectedItems.some(function (_ref4) {
|
|
6476
|
+
var item = _ref4.item;
|
|
6477
|
+
var bbox = item.bbox;
|
|
6478
|
+
return (bbox === null || bbox === void 0 ? void 0 : bbox.length) === 4 && bbox[0] <= viewportCenter[0] && bbox[1] <= viewportCenter[1] && bbox[2] >= viewportCenter[0] && bbox[3] >= viewportCenter[1];
|
|
6479
|
+
});
|
|
6480
|
+
var candidates = selectedItems.length > 0 && selectedItemsCoverViewportCenter ? selectedItems : frameItems;
|
|
6481
|
+
var getItemRank = function getItemRank(_ref5) {
|
|
6482
|
+
var item = _ref5.item;
|
|
6483
|
+
var bbox = item.bbox;
|
|
6484
|
+
if ((bbox === null || bbox === void 0 ? void 0 : bbox.length) !== 4) {
|
|
6485
|
+
return [1, Number.POSITIVE_INFINITY, item.id];
|
|
6486
|
+
}
|
|
6487
|
+
var containsCenter = bbox[0] <= viewportCenter[0] && bbox[1] <= viewportCenter[1] && bbox[2] >= viewportCenter[0] && bbox[3] >= viewportCenter[1];
|
|
6488
|
+
var itemCenter = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
|
|
6489
|
+
var centerDistance = Math.pow(itemCenter[0] - viewportCenter[0], 2) + Math.pow(itemCenter[1] - viewportCenter[1], 2);
|
|
6490
|
+
return [containsCenter ? 0 : 1, centerDistance, item.id];
|
|
6491
|
+
};
|
|
6492
|
+
var sortedCandidates = _toConsumableArray(candidates).sort(function (first, second) {
|
|
6493
|
+
var firstRank = getItemRank(first);
|
|
6494
|
+
var secondRank = getItemRank(second);
|
|
6495
|
+
return firstRank[0] - secondRank[0] || firstRank[1] - secondRank[1] || firstRank[2].localeCompare(secondRank[2]);
|
|
6496
|
+
});
|
|
6497
|
+
return [{
|
|
6498
|
+
item: sortedCandidates[0].item,
|
|
6499
|
+
isSelected: true
|
|
6500
|
+
}];
|
|
6501
|
+
};
|
|
6502
|
+
var resolvePreferredStyleName = resolvePreferredStyleName$1;
|
|
6293
6503
|
var getTimeIntervalInMilliseconds = function getTimeIntervalInMilliseconds(interval) {
|
|
6294
6504
|
var supportedInterval = (interval === null || interval === void 0 ? void 0 : interval.year) === 0 && (interval === null || interval === void 0 ? void 0 : interval.month) === 0 ? interval : undefined;
|
|
6295
6505
|
if (!supportedInterval) {
|
|
@@ -6311,10 +6521,10 @@ var getStacItemLookupWindowForTimes = function getStacItemLookupWindowForTimes(t
|
|
|
6311
6521
|
var halfWindow = windowMs / 2;
|
|
6312
6522
|
return [new Date(Math.min.apply(Math, _toConsumableArray(validTimes)) - halfWindow).toISOString(), new Date(Math.max.apply(Math, _toConsumableArray(validTimes)) + halfWindow).toISOString()];
|
|
6313
6523
|
};
|
|
6314
|
-
var isStacItemLookupWindowValidForTime = function isStacItemLookupWindowValidForTime(
|
|
6315
|
-
var
|
|
6316
|
-
startDate =
|
|
6317
|
-
endDate =
|
|
6524
|
+
var isStacItemLookupWindowValidForTime = function isStacItemLookupWindowValidForTime(_ref6, timeValue, requiredMarginMs) {
|
|
6525
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
6526
|
+
startDate = _ref7[0],
|
|
6527
|
+
endDate = _ref7[1];
|
|
6318
6528
|
if (!startDate || !endDate || !timeValue) {
|
|
6319
6529
|
return false;
|
|
6320
6530
|
}
|
|
@@ -6409,7 +6619,7 @@ var getRequiredLookupMarginInMilliseconds = function getRequiredLookupMarginInMi
|
|
|
6409
6619
|
})));
|
|
6410
6620
|
return requiredMarginMs > 0 ? requiredMarginMs : fallbackMarginMs;
|
|
6411
6621
|
};
|
|
6412
|
-
var getStacFrameItemsToRender = function getStacFrameItemsToRender(items, timeValue, frameTargetTimes) {
|
|
6622
|
+
var getStacFrameItemsToRender = function getStacFrameItemsToRender(items, timeValue, frameTargetTimes, selectionBbox, frameTimeToleranceMs, selectionTimeToleranceMs) {
|
|
6413
6623
|
if (!items || !timeValue) {
|
|
6414
6624
|
return [];
|
|
6415
6625
|
}
|
|
@@ -6437,18 +6647,49 @@ var getStacFrameItemsToRender = function getStacFrameItemsToRender(items, timeVa
|
|
|
6437
6647
|
if (itemsByTime.length === 0) {
|
|
6438
6648
|
return [];
|
|
6439
6649
|
}
|
|
6440
|
-
var
|
|
6650
|
+
var frames = itemsByTime.map(function (itemWithTime) {
|
|
6651
|
+
return {
|
|
6652
|
+
items: [itemWithTime],
|
|
6653
|
+
time: itemWithTime.time
|
|
6654
|
+
};
|
|
6655
|
+
});
|
|
6656
|
+
var selectionCenter = (selectionBbox === null || selectionBbox === void 0 ? void 0 : selectionBbox.length) === 4 ? [(selectionBbox[0] + selectionBbox[2]) / 2, (selectionBbox[1] + selectionBbox[3]) / 2] : undefined;
|
|
6657
|
+
var viewportFrameIndexes = selectionCenter ? frames.flatMap(function (frame, frameIndex) {
|
|
6658
|
+
return (selectionTimeToleranceMs === undefined || Math.abs(frame.time - target) <= selectionTimeToleranceMs) && frame.items.some(function (_ref8) {
|
|
6659
|
+
var item = _ref8.item;
|
|
6660
|
+
var bbox = item.bbox;
|
|
6661
|
+
return (bbox === null || bbox === void 0 ? void 0 : bbox.length) === 4 && bbox[0] <= selectionCenter[0] && bbox[1] <= selectionCenter[1] && bbox[2] >= selectionCenter[0] && bbox[3] >= selectionCenter[1];
|
|
6662
|
+
}) ? [frameIndex] : [];
|
|
6663
|
+
}) : [];
|
|
6664
|
+
var closestViewportFrameIndex = viewportFrameIndexes.length > 0 ? viewportFrameIndexes[getClosestTimeIndex(viewportFrameIndexes.map(function (frameIndex) {
|
|
6665
|
+
return frames[frameIndex];
|
|
6666
|
+
}), target)] : -1;
|
|
6667
|
+
var selectedFrameIndex = getClosestTimeIndex(frames, target);
|
|
6668
|
+
if (closestViewportFrameIndex >= 0) {
|
|
6669
|
+
selectedFrameIndex = closestViewportFrameIndex;
|
|
6670
|
+
}
|
|
6671
|
+
if (selectionTimeToleranceMs !== undefined && Math.abs(frames[selectedFrameIndex].time - target) > selectionTimeToleranceMs) {
|
|
6672
|
+
return [];
|
|
6673
|
+
}
|
|
6441
6674
|
var targetTimes = frameTargetTimes && frameTargetTimes.length > 0 ? frameTargetTimes : [target];
|
|
6442
|
-
var
|
|
6443
|
-
return
|
|
6675
|
+
var nearbyFrameIndexes = frameTimeToleranceMs !== undefined ? frames.map(function (_frame, frameIndex) {
|
|
6676
|
+
return frameIndex;
|
|
6677
|
+
}).filter(function (frameIndex) {
|
|
6678
|
+
return Math.abs(frames[frameIndex].time - target) <= frameTimeToleranceMs;
|
|
6679
|
+
}) : [];
|
|
6680
|
+
var frameIndexesToRender = Array.from(new Set(frameTimeToleranceMs !== undefined ? nearbyFrameIndexes : [selectedFrameIndex].concat(_toConsumableArray(targetTimes.map(function (targetTime) {
|
|
6681
|
+
return getClosestTimeIndex(frames, targetTime);
|
|
6444
6682
|
}))))).sort(function (firstIndex, secondIndex) {
|
|
6445
|
-
return
|
|
6683
|
+
return frames[firstIndex].time - frames[secondIndex].time;
|
|
6446
6684
|
});
|
|
6447
|
-
return
|
|
6448
|
-
return {
|
|
6449
|
-
item
|
|
6450
|
-
|
|
6451
|
-
|
|
6685
|
+
return frameIndexesToRender.flatMap(function (frameIndex) {
|
|
6686
|
+
return frames[frameIndex].items.map(function (_ref9) {
|
|
6687
|
+
var item = _ref9.item;
|
|
6688
|
+
return {
|
|
6689
|
+
item: item,
|
|
6690
|
+
isSelected: frameIndex === selectedFrameIndex
|
|
6691
|
+
};
|
|
6692
|
+
});
|
|
6452
6693
|
});
|
|
6453
6694
|
};
|
|
6454
6695
|
|
|
@@ -6469,6 +6710,24 @@ var getStacFrameItemsToRender = function getStacFrameItemsToRender(items, timeVa
|
|
|
6469
6710
|
* Copyright 2025 - Finnish Meteorological Institute (FMI)
|
|
6470
6711
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
6471
6712
|
* */
|
|
6713
|
+
var STAC_ASSET_STYLE_PREFIX = 'asset:';
|
|
6714
|
+
var getStacAssetKeyFromStyle = function getStacAssetKeyFromStyle(styleName) {
|
|
6715
|
+
return styleName !== null && styleName !== void 0 && styleName.startsWith(STAC_ASSET_STYLE_PREFIX) ? styleName.slice(STAC_ASSET_STYLE_PREFIX.length) : undefined;
|
|
6716
|
+
};
|
|
6717
|
+
var isGeoTIFFAsset = function isGeoTIFFAsset(asset) {
|
|
6718
|
+
var _asset$type$toLowerCa, _asset$type, _asset$href$toLowerCa, _asset$href;
|
|
6719
|
+
var type = (_asset$type$toLowerCa = (_asset$type = asset.type) === null || _asset$type === void 0 ? void 0 : _asset$type.toLowerCase()) !== null && _asset$type$toLowerCa !== void 0 ? _asset$type$toLowerCa : '';
|
|
6720
|
+
var href = (_asset$href$toLowerCa = (_asset$href = asset.href) === null || _asset$href === void 0 ? void 0 : _asset$href.toLowerCase()) !== null && _asset$href$toLowerCa !== void 0 ? _asset$href$toLowerCa : '';
|
|
6721
|
+
return type.includes('geotiff') || /\.tiff?(?:$|[?#])/.test(href);
|
|
6722
|
+
};
|
|
6723
|
+
var isBrowserReadableGeoTIFFAsset = function isBrowserReadableGeoTIFFAsset(asset) {
|
|
6724
|
+
var _exec;
|
|
6725
|
+
if (!asset.href || !isGeoTIFFAsset(asset)) {
|
|
6726
|
+
return false;
|
|
6727
|
+
}
|
|
6728
|
+
var scheme = (_exec = /^([a-z][a-z\d+.-]*):/i.exec(asset.href)) === null || _exec === void 0 ? void 0 : _exec[1].toLowerCase();
|
|
6729
|
+
return !scheme || scheme === 'http' || scheme === 'https';
|
|
6730
|
+
};
|
|
6472
6731
|
/**
|
|
6473
6732
|
* Converts a STAC render extension colormap to an OpenLayers WebGLTile palette style.
|
|
6474
6733
|
*
|
|
@@ -6537,6 +6796,66 @@ var getRendersAsStyles = function getRendersAsStyles(renders) {
|
|
|
6537
6796
|
};
|
|
6538
6797
|
});
|
|
6539
6798
|
};
|
|
6799
|
+
var getStacAssetStyles = function getStacAssetStyles(itemAssets) {
|
|
6800
|
+
return Object.entries(itemAssets !== null && itemAssets !== void 0 ? itemAssets : {}).filter(function (_ref3) {
|
|
6801
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
6802
|
+
asset = _ref4[1];
|
|
6803
|
+
return isGeoTIFFAsset(asset);
|
|
6804
|
+
}).sort(function (_ref5, _ref6) {
|
|
6805
|
+
var _ref7 = _slicedToArray(_ref5, 2),
|
|
6806
|
+
firstKey = _ref7[0],
|
|
6807
|
+
firstAsset = _ref7[1];
|
|
6808
|
+
var _ref8 = _slicedToArray(_ref6, 2),
|
|
6809
|
+
secondKey = _ref8[0],
|
|
6810
|
+
secondAsset = _ref8[1];
|
|
6811
|
+
var priority = function priority(key, roles) {
|
|
6812
|
+
if (roles !== null && roles !== void 0 && roles.includes('visual') || key === 'visual') {
|
|
6813
|
+
return 0;
|
|
6814
|
+
}
|
|
6815
|
+
if (key === 'data') {
|
|
6816
|
+
return 1;
|
|
6817
|
+
}
|
|
6818
|
+
return roles !== null && roles !== void 0 && roles.includes('data') ? 2 : 3;
|
|
6819
|
+
};
|
|
6820
|
+
return priority(firstKey, firstAsset.roles) - priority(secondKey, secondAsset.roles) || firstKey.localeCompare(secondKey);
|
|
6821
|
+
}).map(function (_ref9) {
|
|
6822
|
+
var _asset$title;
|
|
6823
|
+
var _ref0 = _slicedToArray(_ref9, 2),
|
|
6824
|
+
assetKey = _ref0[0],
|
|
6825
|
+
asset = _ref0[1];
|
|
6826
|
+
return {
|
|
6827
|
+
name: "".concat(STAC_ASSET_STYLE_PREFIX).concat(assetKey),
|
|
6828
|
+
title: (_asset$title = asset.title) !== null && _asset$title !== void 0 ? _asset$title : assetKey,
|
|
6829
|
+
legendURL: '',
|
|
6830
|
+
"abstract": ''
|
|
6831
|
+
};
|
|
6832
|
+
});
|
|
6833
|
+
};
|
|
6834
|
+
var getStacCollectionStyles = function getStacCollectionStyles(renders, itemAssets) {
|
|
6835
|
+
return [].concat(_toConsumableArray(renders ? getRendersAsStyles(renders) : []), _toConsumableArray(getStacAssetStyles(itemAssets)));
|
|
6836
|
+
};
|
|
6837
|
+
var resolveStacAssetKey = function resolveStacAssetKey(assets, styleName, renderAssets, configuredAssetKey) {
|
|
6838
|
+
var _Object$entries$find, _Object$entries$find2, _Object$entries$find3;
|
|
6839
|
+
var candidates = [configuredAssetKey, getStacAssetKeyFromStyle(styleName)].concat(_toConsumableArray(renderAssets !== null && renderAssets !== void 0 ? renderAssets : []), [(_Object$entries$find = Object.entries(assets).find(function (_ref1) {
|
|
6840
|
+
var _asset$roles;
|
|
6841
|
+
var _ref10 = _slicedToArray(_ref1, 2),
|
|
6842
|
+
key = _ref10[0],
|
|
6843
|
+
asset = _ref10[1];
|
|
6844
|
+
return key === 'visual' || ((_asset$roles = asset.roles) === null || _asset$roles === void 0 ? void 0 : _asset$roles.includes('visual'));
|
|
6845
|
+
})) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0], assets.data ? 'data' : undefined, (_Object$entries$find2 = Object.entries(assets).find(function (_ref11) {
|
|
6846
|
+
var _asset$roles2;
|
|
6847
|
+
var _ref12 = _slicedToArray(_ref11, 2),
|
|
6848
|
+
asset = _ref12[1];
|
|
6849
|
+
return (_asset$roles2 = asset.roles) === null || _asset$roles2 === void 0 ? void 0 : _asset$roles2.includes('data');
|
|
6850
|
+
})) === null || _Object$entries$find2 === void 0 ? void 0 : _Object$entries$find2[0], (_Object$entries$find3 = Object.entries(assets).find(function (_ref13) {
|
|
6851
|
+
var _ref14 = _slicedToArray(_ref13, 2),
|
|
6852
|
+
asset = _ref14[1];
|
|
6853
|
+
return isBrowserReadableGeoTIFFAsset(asset);
|
|
6854
|
+
})) === null || _Object$entries$find3 === void 0 ? void 0 : _Object$entries$find3[0]]);
|
|
6855
|
+
return candidates.find(function (candidate) {
|
|
6856
|
+
return Boolean(candidate && assets[candidate] && isBrowserReadableGeoTIFFAsset(assets[candidate]));
|
|
6857
|
+
});
|
|
6858
|
+
};
|
|
6540
6859
|
|
|
6541
6860
|
var STAC_ITEM_PAGE_LIMIT = 1000;
|
|
6542
6861
|
var STAC_TEMPORAL_STEP_SAMPLE_LIMIT = 11;
|
|
@@ -6600,15 +6919,31 @@ var fetchStacJson = /*#__PURE__*/function () {
|
|
|
6600
6919
|
return _ref2.apply(this, arguments);
|
|
6601
6920
|
};
|
|
6602
6921
|
}();
|
|
6603
|
-
var getStacItemsUrl = function getStacItemsUrl(stacBaseUrlWithCollection, startDate, endDate) {
|
|
6922
|
+
var getStacItemsUrl = function getStacItemsUrl(stacBaseUrlWithCollection, startDate, endDate, bbox) {
|
|
6604
6923
|
var normalizedUrl = stacBaseUrlWithCollection.trim().replace(/\/+$/, '');
|
|
6605
6924
|
var searchParams = new URLSearchParams();
|
|
6606
6925
|
if (startDate && endDate) {
|
|
6607
6926
|
searchParams.set('datetime', "".concat(startDate, "/").concat(endDate));
|
|
6608
6927
|
}
|
|
6928
|
+
if ((bbox === null || bbox === void 0 ? void 0 : bbox.length) === 4 && bbox.every(Number.isFinite)) {
|
|
6929
|
+
searchParams.set('bbox', bbox.join(','));
|
|
6930
|
+
}
|
|
6609
6931
|
var queryString = searchParams.toString();
|
|
6610
6932
|
return "".concat(normalizedUrl, "/items").concat(queryString ? "?".concat(queryString) : '');
|
|
6611
6933
|
};
|
|
6934
|
+
var STAC_ITEM_SEARCH_FIELDS_CONFORMANCE = 'https://api.stacspec.org/v1.0.0/item-search#fields';
|
|
6935
|
+
var getStacItemSearchUrl = function getStacItemSearchUrl(searchUrl, collectionId, startDate, endDate, bbox) {
|
|
6936
|
+
var url = new URL(searchUrl);
|
|
6937
|
+
url.searchParams.set('collections', collectionId);
|
|
6938
|
+
if (startDate && endDate) {
|
|
6939
|
+
url.searchParams.set('datetime', "".concat(startDate, "/").concat(endDate));
|
|
6940
|
+
}
|
|
6941
|
+
if ((bbox === null || bbox === void 0 ? void 0 : bbox.length) === 4 && bbox.every(Number.isFinite)) {
|
|
6942
|
+
url.searchParams.set('bbox', bbox.join(','));
|
|
6943
|
+
}
|
|
6944
|
+
url.searchParams.set('fields', ['+id', '+bbox', '+geometry', '+properties.datetime', '-assets', '-links'].join(','));
|
|
6945
|
+
return url.toString();
|
|
6946
|
+
};
|
|
6612
6947
|
var getPaginatedStacItemsUrl = function getPaginatedStacItemsUrl(baseUrl, itemLimit, offset) {
|
|
6613
6948
|
var url = new URL(baseUrl);
|
|
6614
6949
|
url.searchParams.set('limit', "".concat(itemLimit));
|
|
@@ -6701,19 +7036,24 @@ var fetchStacItemsPage = /*#__PURE__*/function () {
|
|
|
6701
7036
|
var fetchStacItemsWithPagination = /*#__PURE__*/function () {
|
|
6702
7037
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(baseUrl) {
|
|
6703
7038
|
var itemLimit,
|
|
7039
|
+
signal,
|
|
7040
|
+
maximumPages,
|
|
6704
7041
|
items,
|
|
6705
7042
|
visitedUrls,
|
|
6706
7043
|
_fetchPage,
|
|
6707
|
-
_args8 = arguments
|
|
7044
|
+
_args8 = arguments,
|
|
7045
|
+
_t4;
|
|
6708
7046
|
return _regenerator().w(function (_context8) {
|
|
6709
|
-
while (1) switch (_context8.n) {
|
|
7047
|
+
while (1) switch (_context8.p = _context8.n) {
|
|
6710
7048
|
case 0:
|
|
6711
7049
|
itemLimit = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : STAC_ITEM_PAGE_LIMIT;
|
|
7050
|
+
signal = _args8.length > 2 ? _args8[2] : undefined;
|
|
7051
|
+
maximumPages = _args8.length > 3 ? _args8[3] : undefined;
|
|
6712
7052
|
items = [];
|
|
6713
7053
|
visitedUrls = new Set();
|
|
6714
7054
|
_fetchPage = /*#__PURE__*/function () {
|
|
6715
7055
|
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(requestUrl, offset, isUsingNextLinks, page) {
|
|
6716
|
-
var collection, pageItems, nextUrl, nextOffset;
|
|
7056
|
+
var collection, pageItems, numberMatched, nextUrl, nextOffset;
|
|
6717
7057
|
return _regenerator().w(function (_context7) {
|
|
6718
7058
|
while (1) switch (_context7.n) {
|
|
6719
7059
|
case 0:
|
|
@@ -6731,30 +7071,45 @@ var fetchStacItemsWithPagination = /*#__PURE__*/function () {
|
|
|
6731
7071
|
case 2:
|
|
6732
7072
|
visitedUrls.add(requestUrl);
|
|
6733
7073
|
_context7.n = 3;
|
|
6734
|
-
return
|
|
7074
|
+
return fetchStacJson(requestUrl, {
|
|
7075
|
+
signal: signal
|
|
7076
|
+
});
|
|
6735
7077
|
case 3:
|
|
6736
7078
|
collection = _context7.v;
|
|
6737
7079
|
pageItems = collection.features || [];
|
|
6738
7080
|
items.push.apply(items, _toConsumableArray(pageItems));
|
|
6739
|
-
|
|
6740
|
-
if (!nextUrl) {
|
|
7081
|
+
if (!(maximumPages !== undefined && page + 1 >= maximumPages)) {
|
|
6741
7082
|
_context7.n = 4;
|
|
6742
7083
|
break;
|
|
6743
7084
|
}
|
|
6744
|
-
return _context7.a(2,
|
|
7085
|
+
return _context7.a(2, items);
|
|
6745
7086
|
case 4:
|
|
6746
|
-
|
|
7087
|
+
numberMatched = collection.numberMatched; // Some APIs still return a next link after the reported total is reached.
|
|
7088
|
+
if (!(typeof numberMatched === 'number' && Number.isFinite(numberMatched) && items.length >= numberMatched)) {
|
|
6747
7089
|
_context7.n = 5;
|
|
6748
7090
|
break;
|
|
6749
7091
|
}
|
|
6750
7092
|
return _context7.a(2, items);
|
|
6751
7093
|
case 5:
|
|
6752
|
-
|
|
7094
|
+
nextUrl = getNextLinkUrl(collection, requestUrl);
|
|
7095
|
+
if (!nextUrl) {
|
|
6753
7096
|
_context7.n = 6;
|
|
6754
7097
|
break;
|
|
6755
7098
|
}
|
|
6756
|
-
return _context7.a(2,
|
|
7099
|
+
return _context7.a(2, _fetchPage(nextUrl, offset, true, page + 1));
|
|
6757
7100
|
case 6:
|
|
7101
|
+
if (!isUsingNextLinks) {
|
|
7102
|
+
_context7.n = 7;
|
|
7103
|
+
break;
|
|
7104
|
+
}
|
|
7105
|
+
return _context7.a(2, items);
|
|
7106
|
+
case 7:
|
|
7107
|
+
if (!(pageItems.length < itemLimit)) {
|
|
7108
|
+
_context7.n = 8;
|
|
7109
|
+
break;
|
|
7110
|
+
}
|
|
7111
|
+
return _context7.a(2, items);
|
|
7112
|
+
case 8:
|
|
6758
7113
|
nextOffset = offset + itemLimit;
|
|
6759
7114
|
return _context7.a(2, _fetchPage(getPaginatedStacItemsUrl(baseUrl, itemLimit, nextOffset), nextOffset, false, page + 1));
|
|
6760
7115
|
}
|
|
@@ -6764,9 +7119,23 @@ var fetchStacItemsWithPagination = /*#__PURE__*/function () {
|
|
|
6764
7119
|
return _ref8.apply(this, arguments);
|
|
6765
7120
|
};
|
|
6766
7121
|
}();
|
|
6767
|
-
|
|
7122
|
+
_context8.p = 1;
|
|
7123
|
+
_context8.n = 2;
|
|
7124
|
+
return _fetchPage(getPaginatedStacItemsUrl(baseUrl, itemLimit, 0), 0, false, 0);
|
|
7125
|
+
case 2:
|
|
7126
|
+
return _context8.a(2, _context8.v);
|
|
7127
|
+
case 3:
|
|
7128
|
+
_context8.p = 3;
|
|
7129
|
+
_t4 = _context8.v;
|
|
7130
|
+
if (!(signal !== null && signal !== void 0 && signal.aborted || items.length === 0)) {
|
|
7131
|
+
_context8.n = 4;
|
|
7132
|
+
break;
|
|
7133
|
+
}
|
|
7134
|
+
throw _t4;
|
|
7135
|
+
case 4:
|
|
7136
|
+
return _context8.a(2, items);
|
|
6768
7137
|
}
|
|
6769
|
-
}, _callee8);
|
|
7138
|
+
}, _callee8, null, [[1, 3]]);
|
|
6770
7139
|
}));
|
|
6771
7140
|
return function fetchStacItemsWithPagination(_x8) {
|
|
6772
7141
|
return _ref7.apply(this, arguments);
|
|
@@ -6861,7 +7230,7 @@ var stacCatalogCollectionToLayerProps = function stacCatalogCollectionToLayerPro
|
|
|
6861
7230
|
var _collection$title, _collection$descripti, _collection$keywords;
|
|
6862
7231
|
var geographicBoundingBox = getStacGeographicBoundingBox(collection.extent);
|
|
6863
7232
|
var temporalDimension = getStacTemporalDimension(collection.extent);
|
|
6864
|
-
var styles = collection.renders
|
|
7233
|
+
var styles = getStacCollectionStyles(collection.renders, collection.item_assets);
|
|
6865
7234
|
return _objectSpread2(_objectSpread2(_objectSpread2({
|
|
6866
7235
|
name: collection.id,
|
|
6867
7236
|
title: (_collection$title = collection.title) !== null && _collection$title !== void 0 ? _collection$title : collection.id,
|
|
@@ -6902,22 +7271,17 @@ var useStacCollection = function useStacCollection(stacBaseUrlWithCollection) {
|
|
|
6902
7271
|
enabled: stacBaseUrlWithCollection.length > 0 && enabled
|
|
6903
7272
|
});
|
|
6904
7273
|
};
|
|
6905
|
-
var
|
|
7274
|
+
var useStacCatalogRoot = function useStacCatalogRoot(stacRootUrl) {
|
|
7275
|
+
var enabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
6906
7276
|
return useQuery({
|
|
6907
7277
|
staleTime: DEFAULT_STALE_TIME,
|
|
6908
|
-
queryKey: ['
|
|
7278
|
+
queryKey: [stacRootUrl, 'useStacCatalogRoot'],
|
|
6909
7279
|
queryFn: function () {
|
|
6910
7280
|
var _queryFn2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
6911
|
-
var queryUrl, items;
|
|
6912
7281
|
return _regenerator().w(function (_context2) {
|
|
6913
7282
|
while (1) switch (_context2.n) {
|
|
6914
7283
|
case 0:
|
|
6915
|
-
|
|
6916
|
-
_context2.n = 1;
|
|
6917
|
-
return fetchStacItemsWithPagination(queryUrl);
|
|
6918
|
-
case 1:
|
|
6919
|
-
items = _context2.v;
|
|
6920
|
-
return _context2.a(2, items);
|
|
7284
|
+
return _context2.a(2, fetchStacCatalogRoot(stacRootUrl));
|
|
6921
7285
|
}
|
|
6922
7286
|
}, _callee2);
|
|
6923
7287
|
}));
|
|
@@ -6926,7 +7290,64 @@ var useStacItems = function useStacItems(stacBaseUrlWithCollection, startDate, e
|
|
|
6926
7290
|
}
|
|
6927
7291
|
return queryFn;
|
|
6928
7292
|
}(),
|
|
6929
|
-
enabled:
|
|
7293
|
+
enabled: stacRootUrl.length > 0 && enabled
|
|
7294
|
+
});
|
|
7295
|
+
};
|
|
7296
|
+
var useStacItems = function useStacItems(stacBaseUrlWithCollection, startDate, endDate, bbox) {
|
|
7297
|
+
var enabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
|
7298
|
+
var itemLimit = arguments.length > 5 ? arguments[5] : undefined;
|
|
7299
|
+
var maximumPages = arguments.length > 6 ? arguments[6] : undefined;
|
|
7300
|
+
return useQuery({
|
|
7301
|
+
staleTime: DEFAULT_STALE_TIME,
|
|
7302
|
+
queryKey: ['useStacItems', stacBaseUrlWithCollection, startDate, endDate, bbox, itemLimit, maximumPages],
|
|
7303
|
+
queryFn: function () {
|
|
7304
|
+
var _queryFn3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(_ref) {
|
|
7305
|
+
var signal, queryUrl, items;
|
|
7306
|
+
return _regenerator().w(function (_context3) {
|
|
7307
|
+
while (1) switch (_context3.n) {
|
|
7308
|
+
case 0:
|
|
7309
|
+
signal = _ref.signal;
|
|
7310
|
+
queryUrl = getStacItemsUrl(stacBaseUrlWithCollection, startDate, endDate, bbox);
|
|
7311
|
+
_context3.n = 1;
|
|
7312
|
+
return fetchStacItemsWithPagination(queryUrl, itemLimit, signal, maximumPages);
|
|
7313
|
+
case 1:
|
|
7314
|
+
items = _context3.v;
|
|
7315
|
+
return _context3.a(2, items);
|
|
7316
|
+
}
|
|
7317
|
+
}, _callee3);
|
|
7318
|
+
}));
|
|
7319
|
+
function queryFn(_x) {
|
|
7320
|
+
return _queryFn3.apply(this, arguments);
|
|
7321
|
+
}
|
|
7322
|
+
return queryFn;
|
|
7323
|
+
}(),
|
|
7324
|
+
enabled: stacBaseUrlWithCollection.length > 0 && !!startDate && !!endDate && enabled
|
|
7325
|
+
});
|
|
7326
|
+
};
|
|
7327
|
+
var useStacOverviewItems = function useStacOverviewItems(searchUrl, collectionId, startDate, endDate, bbox) {
|
|
7328
|
+
var enabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;
|
|
7329
|
+
var itemLimit = arguments.length > 6 ? arguments[6] : undefined;
|
|
7330
|
+
return useQuery({
|
|
7331
|
+
staleTime: DEFAULT_STALE_TIME,
|
|
7332
|
+
queryKey: ['useStacOverviewItems', searchUrl, collectionId, startDate, endDate, bbox, itemLimit],
|
|
7333
|
+
queryFn: function () {
|
|
7334
|
+
var _queryFn4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(_ref2) {
|
|
7335
|
+
var signal, queryUrl;
|
|
7336
|
+
return _regenerator().w(function (_context4) {
|
|
7337
|
+
while (1) switch (_context4.n) {
|
|
7338
|
+
case 0:
|
|
7339
|
+
signal = _ref2.signal;
|
|
7340
|
+
queryUrl = getStacItemSearchUrl(searchUrl, collectionId, startDate, endDate, bbox);
|
|
7341
|
+
return _context4.a(2, fetchStacItemsWithPagination(queryUrl, itemLimit, signal));
|
|
7342
|
+
}
|
|
7343
|
+
}, _callee4);
|
|
7344
|
+
}));
|
|
7345
|
+
function queryFn(_x2) {
|
|
7346
|
+
return _queryFn4.apply(this, arguments);
|
|
7347
|
+
}
|
|
7348
|
+
return queryFn;
|
|
7349
|
+
}(),
|
|
7350
|
+
enabled: searchUrl.length > 0 && collectionId.length > 0 && !!startDate && !!endDate && enabled
|
|
6930
7351
|
});
|
|
6931
7352
|
};
|
|
6932
7353
|
var useStacTemporalStepItems = function useStacTemporalStepItems(stacBaseUrlWithCollection, startDate, endDate) {
|
|
@@ -6935,18 +7356,18 @@ var useStacTemporalStepItems = function useStacTemporalStepItems(stacBaseUrlWith
|
|
|
6935
7356
|
staleTime: DEFAULT_STALE_TIME,
|
|
6936
7357
|
queryKey: ['useStacTemporalStepItems', stacBaseUrlWithCollection, startDate, endDate],
|
|
6937
7358
|
queryFn: function () {
|
|
6938
|
-
var
|
|
7359
|
+
var _queryFn5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
6939
7360
|
var queryUrl;
|
|
6940
|
-
return _regenerator().w(function (
|
|
6941
|
-
while (1) switch (
|
|
7361
|
+
return _regenerator().w(function (_context5) {
|
|
7362
|
+
while (1) switch (_context5.n) {
|
|
6942
7363
|
case 0:
|
|
6943
7364
|
queryUrl = getStacItemsUrl(stacBaseUrlWithCollection, startDate, endDate);
|
|
6944
|
-
return
|
|
7365
|
+
return _context5.a(2, fetchStacItemsPage(queryUrl));
|
|
6945
7366
|
}
|
|
6946
|
-
},
|
|
7367
|
+
}, _callee5);
|
|
6947
7368
|
}));
|
|
6948
7369
|
function queryFn() {
|
|
6949
|
-
return
|
|
7370
|
+
return _queryFn5.apply(this, arguments);
|
|
6950
7371
|
}
|
|
6951
7372
|
return queryFn;
|
|
6952
7373
|
}(),
|
|
@@ -6972,17 +7393,56 @@ var useStacTemporalStepItems = function useStacTemporalStepItems(stacBaseUrlWith
|
|
|
6972
7393
|
* Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
|
|
6973
7394
|
* */
|
|
6974
7395
|
var DEFAULT_STAC_TEMPORAL_STEP = 'PT1H';
|
|
7396
|
+
var STAC_BBOX_COMPARISON_TOLERANCE = 1e-6;
|
|
7397
|
+
var hasSameBboxAndDifferentTimes = function hasSameBboxAndDifferentTimes(items) {
|
|
7398
|
+
if (items.length < 2) {
|
|
7399
|
+
return false;
|
|
7400
|
+
}
|
|
7401
|
+
var firstBbox = items[0].bbox;
|
|
7402
|
+
if ((firstBbox === null || firstBbox === void 0 ? void 0 : firstBbox.length) !== 4 || !firstBbox.every(function (coordinate) {
|
|
7403
|
+
return Number.isFinite(coordinate);
|
|
7404
|
+
})) {
|
|
7405
|
+
return false;
|
|
7406
|
+
}
|
|
7407
|
+
var times = new Set();
|
|
7408
|
+
var _iterator = _createForOfIteratorHelper(items),
|
|
7409
|
+
_step;
|
|
7410
|
+
try {
|
|
7411
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
7412
|
+
var _item$properties$date, _item$bbox;
|
|
7413
|
+
var item = _step.value;
|
|
7414
|
+
var itemTime = new Date((_item$properties$date = item.properties.datetime) !== null && _item$properties$date !== void 0 ? _item$properties$date : '').getTime();
|
|
7415
|
+
if (!Number.isFinite(itemTime) || ((_item$bbox = item.bbox) === null || _item$bbox === void 0 ? void 0 : _item$bbox.length) !== firstBbox.length || !item.bbox.every(function (coordinate, index) {
|
|
7416
|
+
return Number.isFinite(coordinate) && Math.abs(coordinate - firstBbox[index]) <= STAC_BBOX_COMPARISON_TOLERANCE;
|
|
7417
|
+
})) {
|
|
7418
|
+
return false;
|
|
7419
|
+
}
|
|
7420
|
+
times.add(itemTime);
|
|
7421
|
+
}
|
|
7422
|
+
} catch (err) {
|
|
7423
|
+
_iterator.e(err);
|
|
7424
|
+
} finally {
|
|
7425
|
+
_iterator.f();
|
|
7426
|
+
}
|
|
7427
|
+
return times.size > 1;
|
|
7428
|
+
};
|
|
7429
|
+
var isSpatiallyTiledStacCollection = function isSpatiallyTiledStacCollection(dataLayout, hasItemAssets) {
|
|
7430
|
+
var sampleItems = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
7431
|
+
return dataLayout === 'spatial-tiles' || dataLayout !== 'temporal' && hasItemAssets && !hasSameBboxAndDifferentTimes(sampleItems);
|
|
7432
|
+
};
|
|
6975
7433
|
/**
|
|
6976
7434
|
* Infers the temporal step (time resolution) from STAC collection metadata and items.
|
|
6977
7435
|
* Attempts multiple strategies:
|
|
6978
7436
|
* 1. Look for 'temporal-resolution' in collection properties
|
|
6979
|
-
* 2.
|
|
6980
|
-
* 3.
|
|
7437
|
+
* 2. Use a daily step for spatially tiled collections
|
|
7438
|
+
* 3. Calculate from actual item timestamps
|
|
7439
|
+
* 4. Fall back to PT1H if unable to determine
|
|
6981
7440
|
*
|
|
6982
7441
|
* @param collection - STAC collection with metadata and items
|
|
6983
7442
|
* @returns ISO 8601 duration string (e.g., 'PT5M', 'PT1H', 'P1D')
|
|
6984
7443
|
*/
|
|
6985
7444
|
var inferTemporalStep = function inferTemporalStep(collection, items) {
|
|
7445
|
+
var dataLayout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'auto';
|
|
6986
7446
|
if (!collection) {
|
|
6987
7447
|
return DEFAULT_STAC_TEMPORAL_STEP;
|
|
6988
7448
|
}
|
|
@@ -6993,6 +7453,11 @@ var inferTemporalStep = function inferTemporalStep(collection, items) {
|
|
|
6993
7453
|
return resolution;
|
|
6994
7454
|
}
|
|
6995
7455
|
}
|
|
7456
|
+
// Item datetimes in a spatially tiled collection describe individual tiles,
|
|
7457
|
+
// so differences between them are not animation timesteps.
|
|
7458
|
+
if (isSpatiallyTiledStacCollection(dataLayout, Boolean(collection.item_assets), items)) {
|
|
7459
|
+
return 'P1D';
|
|
7460
|
+
}
|
|
6996
7461
|
// Strategy 2: Calculate from actual item timestamps
|
|
6997
7462
|
var itemsToInferFrom = items && items.length >= 2 ? items : collection.features;
|
|
6998
7463
|
if (itemsToInferFrom && itemsToInferFrom.length >= 2) {
|
|
@@ -7126,8 +7591,9 @@ var useGetStacGeoTIFFWMLayerInstance = function useGetStacGeoTIFFWMLayerInstance
|
|
|
7126
7591
|
}, [name, onLayerError, serviceUrl]);
|
|
7127
7592
|
return layer;
|
|
7128
7593
|
};
|
|
7129
|
-
var useGetStacGeoTIFFLayerInstance = function useGetStacGeoTIFFLayerInstance(stacCollectionURL, parameter, layerId, onInitializeLayer) {
|
|
7130
|
-
var _collectionInfo$data, _collectionInfo$data2;
|
|
7594
|
+
var useGetStacGeoTIFFLayerInstance = function useGetStacGeoTIFFLayerInstance(stacCollectionURL, parameter, layerId, onInitializeLayer, configuredTemporalStep) {
|
|
7595
|
+
var _collectionInfo$data, _collectionInfo$data2, _collectionInfo$data3;
|
|
7596
|
+
var dataLayout = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'auto';
|
|
7131
7597
|
var wmLayer = useGetStacGeoTIFFWMLayerInstance(stacCollectionURL, parameter, layerId);
|
|
7132
7598
|
var collectionInfo = useStacCollection(stacCollectionURL);
|
|
7133
7599
|
var _React$useState3 = React.useState(undefined),
|
|
@@ -7140,13 +7606,14 @@ var useGetStacGeoTIFFLayerInstance = function useGetStacGeoTIFFLayerInstance(sta
|
|
|
7140
7606
|
return collectionInfo.data ? new Date().toISOString() : undefined;
|
|
7141
7607
|
}, [collectionInfo.data]);
|
|
7142
7608
|
var extentEnd = (temporalInterval === null || temporalInterval === void 0 ? void 0 : temporalInterval[1]) || fallbackExtentEnd;
|
|
7143
|
-
var
|
|
7609
|
+
var isSpatiallyTiledCollection = isSpatiallyTiledStacCollection(dataLayout, Boolean((_collectionInfo$data2 = collectionInfo.data) === null || _collectionInfo$data2 === void 0 ? void 0 : _collectionInfo$data2.item_assets));
|
|
7610
|
+
var shouldFetchTemporalStepItems = collectionInfo.isFetched && !!extentStart && !!extentEnd && !hasTemporalResolution((_collectionInfo$data3 = collectionInfo.data) === null || _collectionInfo$data3 === void 0 ? void 0 : _collectionInfo$data3.properties) && !isSpatiallyTiledCollection && !configuredTemporalStep;
|
|
7144
7611
|
var temporalStepItems = useStacTemporalStepItems(stacCollectionURL, extentStart || undefined, extentEnd, shouldFetchTemporalStepItems);
|
|
7145
7612
|
var temporalStepItemsReady = !shouldFetchTemporalStepItems || temporalStepItems.isFetched || temporalStepItems.isError;
|
|
7146
7613
|
React.useEffect(function () {
|
|
7147
7614
|
if (wmLayer && collectionInfo.data && collectionInfo.isFetched && extentStart && extentEnd && temporalStepItemsReady) {
|
|
7148
7615
|
// Infer temporal step from collection metadata and items instead of hardcoding a fixed step.
|
|
7149
|
-
var temporalStep = inferTemporalStep(collectionInfo.data, temporalStepItems.data);
|
|
7616
|
+
var temporalStep = configuredTemporalStep || inferTemporalStep(collectionInfo.data, temporalStepItems.data, dataLayout);
|
|
7150
7617
|
var timeRangeDurationFromStacCollection = "".concat(extentStart, "/").concat(extentEnd, "/").concat(temporalStep);
|
|
7151
7618
|
if (!wmLayer.getDimension('time')) {
|
|
7152
7619
|
var dim = new WMJSDimension({
|
|
@@ -7164,7 +7631,7 @@ var useGetStacGeoTIFFLayerInstance = function useGetStacGeoTIFFLayerInstance(sta
|
|
|
7164
7631
|
setTimeRangeDuration(timeRangeDurationFromStacCollection);
|
|
7165
7632
|
wmLayer.isConfigured = true;
|
|
7166
7633
|
}
|
|
7167
|
-
}, [collectionInfo.data, collectionInfo.isFetched, extentEnd, extentStart, temporalStepItems.data, temporalStepItemsReady, wmLayer]);
|
|
7634
|
+
}, [collectionInfo.data, collectionInfo.isFetched, configuredTemporalStep, dataLayout, extentEnd, extentStart, temporalStepItems.data, temporalStepItemsReady, wmLayer]);
|
|
7168
7635
|
React.useEffect(function () {
|
|
7169
7636
|
var initializeLayer = /*#__PURE__*/function () {
|
|
7170
7637
|
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
@@ -7215,52 +7682,240 @@ var useGetStacGeoTIFFLayerInstance = function useGetStacGeoTIFFLayerInstance(sta
|
|
|
7215
7682
|
return wmLayer;
|
|
7216
7683
|
};
|
|
7217
7684
|
|
|
7218
|
-
var
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7685
|
+
var STAC_LOOKUP_HALF_WINDOW_MS = 30 * 60 * 1000;
|
|
7686
|
+
var STAC_TILED_LOOKUP_WINDOW_MS = STAC_LOOKUP_HALF_WINDOW_MS * 2;
|
|
7687
|
+
var STAC_OVERVIEW_TIME_TOLERANCE_MS = STAC_LOOKUP_HALF_WINDOW_MS;
|
|
7688
|
+
var STAC_TILED_TIMELINE_TOLERANCE_MS = STAC_LOOKUP_HALF_WINDOW_MS;
|
|
7689
|
+
var stacFootprintStyle = new Style({
|
|
7690
|
+
fill: new Fill({
|
|
7691
|
+
color: 'rgba(0, 145, 234, 0.08)'
|
|
7692
|
+
}),
|
|
7693
|
+
stroke: new Stroke({
|
|
7694
|
+
color: 'rgba(0, 145, 234, 0.9)',
|
|
7695
|
+
width: 2
|
|
7696
|
+
})
|
|
7697
|
+
});
|
|
7698
|
+
var hoveredStacFootprintStyle = new Style({
|
|
7699
|
+
fill: new Fill({
|
|
7700
|
+
color: 'rgba(0, 145, 234, 0.2)'
|
|
7701
|
+
}),
|
|
7702
|
+
stroke: new Stroke({
|
|
7703
|
+
color: 'rgba(0, 145, 234, 1)',
|
|
7704
|
+
width: 3
|
|
7705
|
+
})
|
|
7706
|
+
});
|
|
7707
|
+
var hoveredRasterStacFootprintStyle = new Style({
|
|
7708
|
+
fill: new Fill({
|
|
7709
|
+
color: 'rgba(0, 0, 0, 0)'
|
|
7710
|
+
}),
|
|
7711
|
+
stroke: new Stroke({
|
|
7712
|
+
color: 'rgba(0, 145, 234, 1)',
|
|
7713
|
+
width: 3
|
|
7714
|
+
})
|
|
7715
|
+
});
|
|
7716
|
+
var selectedStacFootprintStyle = new Style({
|
|
7717
|
+
fill: new Fill({
|
|
7718
|
+
color: 'rgba(255, 193, 7, 0)'
|
|
7719
|
+
}),
|
|
7720
|
+
stroke: new Stroke({
|
|
7721
|
+
color: 'rgba(255, 193, 7, 1)',
|
|
7722
|
+
width: 3
|
|
7723
|
+
})
|
|
7724
|
+
});
|
|
7725
|
+
var hoveredSelectedStacFootprintStyle = new Style({
|
|
7726
|
+
fill: new Fill({
|
|
7727
|
+
color: 'rgba(255, 193, 7, 0.2)'
|
|
7728
|
+
}),
|
|
7729
|
+
stroke: new Stroke({
|
|
7730
|
+
color: 'rgba(255, 193, 7, 1)',
|
|
7731
|
+
width: 3
|
|
7732
|
+
})
|
|
7733
|
+
});
|
|
7734
|
+
var hoveredSelectedRasterStacFootprintStyle = new Style({
|
|
7735
|
+
fill: new Fill({
|
|
7736
|
+
color: 'rgba(0, 0, 0, 0)'
|
|
7737
|
+
}),
|
|
7738
|
+
stroke: new Stroke({
|
|
7739
|
+
color: 'rgba(255, 193, 7, 1)',
|
|
7740
|
+
width: 3
|
|
7741
|
+
})
|
|
7742
|
+
});
|
|
7743
|
+
var transparentStacFootprintStyle = new Style({
|
|
7744
|
+
fill: new Fill({
|
|
7745
|
+
color: 'rgba(0, 0, 0, 0)'
|
|
7746
|
+
}),
|
|
7747
|
+
stroke: new Stroke({
|
|
7748
|
+
color: 'rgba(0, 0, 0, 0)',
|
|
7749
|
+
width: 1
|
|
7750
|
+
})
|
|
7751
|
+
});
|
|
7752
|
+
var bboxesIntersect = function bboxesIntersect(first, second) {
|
|
7753
|
+
return first.length === 4 && second.length === 4 && first[0] <= second[2] && first[2] >= second[0] && first[1] <= second[3] && first[3] >= second[1];
|
|
7754
|
+
};
|
|
7755
|
+
var useStacItemsQueryStrategy = function useStacItemsQueryStrategy(_ref) {
|
|
7756
|
+
var _collectionData$links, _catalogRootQuery$dat, _catalogRootQuery$dat2, _collectionData$id;
|
|
7757
|
+
var collectionData = _ref.collectionData,
|
|
7758
|
+
isItemQueryEnabled = _ref.isItemQueryEnabled,
|
|
7759
|
+
isTiledCollection = _ref.isTiledCollection,
|
|
7760
|
+
isTiledOverview = _ref.isTiledOverview,
|
|
7761
|
+
itemEndDate = _ref.itemEndDate,
|
|
7762
|
+
itemQueryBbox = _ref.itemQueryBbox,
|
|
7763
|
+
itemStartDate = _ref.itemStartDate,
|
|
7764
|
+
stacCollectionUrl = _ref.stacCollectionUrl;
|
|
7765
|
+
var stacRootUrl = collectionData === null || collectionData === void 0 || (_collectionData$links = collectionData.links.find(function (_ref2) {
|
|
7766
|
+
var rel = _ref2.rel;
|
|
7767
|
+
return rel === 'root';
|
|
7768
|
+
})) === null || _collectionData$links === void 0 ? void 0 : _collectionData$links.href;
|
|
7769
|
+
var catalogRootQuery = useStacCatalogRoot(stacRootUrl !== null && stacRootUrl !== void 0 ? stacRootUrl : '', isTiledOverview);
|
|
7770
|
+
var itemSearchUrl = (_catalogRootQuery$dat = catalogRootQuery.data) === null || _catalogRootQuery$dat === void 0 || (_catalogRootQuery$dat = _catalogRootQuery$dat.links.find(function (_ref3) {
|
|
7771
|
+
var rel = _ref3.rel,
|
|
7772
|
+
method = _ref3.method;
|
|
7773
|
+
return rel === 'search' && (!method || method.toUpperCase() === 'GET');
|
|
7774
|
+
})) === null || _catalogRootQuery$dat === void 0 ? void 0 : _catalogRootQuery$dat.href;
|
|
7775
|
+
var conformsToItemSearchFields = (_catalogRootQuery$dat2 = catalogRootQuery.data) === null || _catalogRootQuery$dat2 === void 0 || (_catalogRootQuery$dat2 = _catalogRootQuery$dat2.conformsTo) === null || _catalogRootQuery$dat2 === void 0 ? void 0 : _catalogRootQuery$dat2.some(function (conformance) {
|
|
7776
|
+
return conformance.replace(/\/$/, '') === STAC_ITEM_SEARCH_FIELDS_CONFORMANCE;
|
|
7777
|
+
});
|
|
7778
|
+
var supportsItemSearchFields = Boolean(itemSearchUrl && conformsToItemSearchFields);
|
|
7779
|
+
var isOverviewCapabilityResolved = !stacRootUrl || catalogRootQuery.isSuccess || catalogRootQuery.isError;
|
|
7780
|
+
var canUseLightweightOverview = isTiledOverview && supportsItemSearchFields;
|
|
7781
|
+
var overviewItemsQuery = useStacOverviewItems(itemSearchUrl !== null && itemSearchUrl !== void 0 ? itemSearchUrl : '', (_collectionData$id = collectionData === null || collectionData === void 0 ? void 0 : collectionData.id) !== null && _collectionData$id !== void 0 ? _collectionData$id : '', itemStartDate, itemEndDate, itemQueryBbox, isItemQueryEnabled && canUseLightweightOverview, STAC_TILED_OVERVIEW_ITEM_PAGE_LIMIT);
|
|
7782
|
+
var shouldUseLightweightOverview = canUseLightweightOverview && !overviewItemsQuery.isError;
|
|
7783
|
+
var shouldUseFullItemQuery = !isTiledOverview || isTiledOverview && isOverviewCapabilityResolved && !shouldUseLightweightOverview;
|
|
7784
|
+
var fullItemsQuery = useStacItems(stacCollectionUrl, itemStartDate, itemEndDate, itemQueryBbox, isItemQueryEnabled && shouldUseFullItemQuery, isTiledCollection ? STAC_TILED_ITEM_PAGE_LIMIT : undefined);
|
|
7785
|
+
var _ref4 = shouldUseLightweightOverview ? overviewItemsQuery : fullItemsQuery,
|
|
7786
|
+
items = _ref4.data,
|
|
7787
|
+
isFetching = _ref4.isFetching;
|
|
7788
|
+
return {
|
|
7789
|
+
items: items,
|
|
7790
|
+
isFetching: isFetching
|
|
7791
|
+
};
|
|
7792
|
+
};
|
|
7793
|
+
var useRetainedTiledItems = function useRetainedTiledItems(_ref5) {
|
|
7794
|
+
var isFetching = _ref5.isFetching,
|
|
7795
|
+
isTiledCollection = _ref5.isTiledCollection,
|
|
7796
|
+
isTiledOverview = _ref5.isTiledOverview,
|
|
7797
|
+
items = _ref5.items,
|
|
7798
|
+
timeValue = _ref5.timeValue;
|
|
7799
|
+
var lastTiledItemsRef = React.useRef(undefined);
|
|
7800
|
+
React.useEffect(function () {
|
|
7801
|
+
if (isTiledCollection && !isTiledOverview && items && items.length > 0) {
|
|
7802
|
+
lastTiledItemsRef.current = {
|
|
7803
|
+
items: items,
|
|
7804
|
+
timeValue: timeValue
|
|
7805
|
+
};
|
|
7806
|
+
}
|
|
7807
|
+
}, [isTiledCollection, isTiledOverview, items, timeValue]);
|
|
7808
|
+
var lastTiledItems = lastTiledItemsRef.current;
|
|
7809
|
+
var retainedTiledItems = !isTiledOverview && lastTiledItems && lastTiledItems.timeValue === timeValue && isFetching ? lastTiledItems.items : undefined;
|
|
7810
|
+
var displayedItems = items && items.length > 0 ? items : retainedTiledItems;
|
|
7811
|
+
var canRetainRasterWhileFetching = Boolean(retainedTiledItems);
|
|
7812
|
+
return {
|
|
7813
|
+
displayedItems: displayedItems,
|
|
7814
|
+
canRetainRasterWhileFetching: canRetainRasterWhileFetching
|
|
7815
|
+
};
|
|
7816
|
+
};
|
|
7817
|
+
var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref6) {
|
|
7818
|
+
var _collectionData$exten, _temporalInterval$, _temporalInterval$2, _collectionData$rende, _dimensions$find, _wmLayer$getDimension;
|
|
7819
|
+
var stacCollectionUrl = _ref6.stacCollectionUrl,
|
|
7820
|
+
layerName = _ref6.layerName;
|
|
7821
|
+
_ref6.style;
|
|
7822
|
+
var styleName = _ref6.styleName,
|
|
7823
|
+
zIndex = _ref6.zIndex,
|
|
7824
|
+
opacity = _ref6.opacity,
|
|
7825
|
+
_ref6$dimensions = _ref6.dimensions,
|
|
7826
|
+
dimensions = _ref6$dimensions === void 0 ? [] : _ref6$dimensions,
|
|
7827
|
+
layerId = _ref6.layerId,
|
|
7828
|
+
_ref6$visible = _ref6.visible,
|
|
7829
|
+
visible = _ref6$visible === void 0 ? true : _ref6$visible,
|
|
7830
|
+
assetKey = _ref6.assetKey,
|
|
7831
|
+
_ref6$dataLayout = _ref6.dataLayout,
|
|
7832
|
+
dataLayout = _ref6$dataLayout === void 0 ? 'auto' : _ref6$dataLayout,
|
|
7833
|
+
spatialFilter = _ref6.spatialFilter,
|
|
7834
|
+
temporalStep = _ref6.temporalStep,
|
|
7835
|
+
onInitializeLayer = _ref6.onInitializeLayer;
|
|
7232
7836
|
var _React$useContext = React.useContext(TimeContext),
|
|
7233
7837
|
_React$useContext$pre = _React$useContext.prefetchList,
|
|
7234
7838
|
prefetchList = _React$useContext$pre === void 0 ? [] : _React$useContext$pre;
|
|
7235
|
-
var
|
|
7839
|
+
var _React$useContext2 = React.useContext(MapContext),
|
|
7840
|
+
map = _React$useContext2.map;
|
|
7841
|
+
var _React$useState = React.useState(),
|
|
7842
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
7843
|
+
manuallySelectedTile = _React$useState2[0],
|
|
7844
|
+
setManuallySelectedTile = _React$useState2[1];
|
|
7236
7845
|
var _useStacCollection = useStacCollection(stacCollectionUrl),
|
|
7237
7846
|
collectionData = _useStacCollection.data;
|
|
7847
|
+
var temporalInterval = collectionData === null || collectionData === void 0 || (_collectionData$exten = collectionData.extent) === null || _collectionData$exten === void 0 || (_collectionData$exten = _collectionData$exten.temporal) === null || _collectionData$exten === void 0 || (_collectionData$exten = _collectionData$exten.interval) === null || _collectionData$exten === void 0 ? void 0 : _collectionData$exten[0];
|
|
7848
|
+
var sampleStart = (_temporalInterval$ = temporalInterval === null || temporalInterval === void 0 ? void 0 : temporalInterval[0]) !== null && _temporalInterval$ !== void 0 ? _temporalInterval$ : undefined;
|
|
7849
|
+
var fallbackSampleEnd = React.useMemo(function () {
|
|
7850
|
+
return collectionData ? new Date().toISOString() : undefined;
|
|
7851
|
+
}, [collectionData]);
|
|
7852
|
+
var sampleEnd = (_temporalInterval$2 = temporalInterval === null || temporalInterval === void 0 ? void 0 : temporalInterval[1]) !== null && _temporalInterval$2 !== void 0 ? _temporalInterval$2 : fallbackSampleEnd;
|
|
7853
|
+
var layoutSample = useStacTemporalStepItems(stacCollectionUrl, sampleStart, sampleEnd, dataLayout === 'auto');
|
|
7854
|
+
var isTiledCollection = isSpatiallyTiledStacCollection(dataLayout, Boolean(collectionData === null || collectionData === void 0 ? void 0 : collectionData.item_assets), layoutSample.data);
|
|
7855
|
+
var effectiveDataLayout = isTiledCollection ? 'spatial-tiles' : 'temporal';
|
|
7856
|
+
var wmLayer = useGetStacGeoTIFFLayerInstance(stacCollectionUrl, layerName, layerId, onInitializeLayer, temporalStep, effectiveDataLayout);
|
|
7238
7857
|
var effectiveStyleName = React.useMemo(function () {
|
|
7239
|
-
var
|
|
7240
|
-
|
|
7858
|
+
var stacStyles = getStacCollectionStyles(collectionData === null || collectionData === void 0 ? void 0 : collectionData.renders, collectionData === null || collectionData === void 0 ? void 0 : collectionData.item_assets);
|
|
7859
|
+
var styleNames = stacStyles.map(function (stacStyle) {
|
|
7860
|
+
return stacStyle.name;
|
|
7861
|
+
});
|
|
7862
|
+
return resolvePreferredStyleName(styleNames, styleName);
|
|
7241
7863
|
}, [collectionData, styleName]);
|
|
7864
|
+
var renderEntry = collectionData === null || collectionData === void 0 || (_collectionData$rende = collectionData.renders) === null || _collectionData$rende === void 0 ? void 0 : _collectionData$rende[effectiveStyleName];
|
|
7242
7865
|
var geotiffStyle = React.useMemo(function () {
|
|
7243
|
-
var _collectionData$rende;
|
|
7244
|
-
var renderEntry = collectionData === null || collectionData === void 0 || (_collectionData$rende = collectionData.renders) === null || _collectionData$rende === void 0 ? void 0 : _collectionData$rende[effectiveStyleName];
|
|
7245
7866
|
if (renderEntry !== null && renderEntry !== void 0 && renderEntry.colormap) {
|
|
7246
7867
|
return stacColormapToOlStyle(renderEntry.colormap);
|
|
7247
7868
|
}
|
|
7248
7869
|
return undefined;
|
|
7249
|
-
}, [
|
|
7250
|
-
var shouldNormalizeGeoTiff =
|
|
7870
|
+
}, [renderEntry === null || renderEntry === void 0 ? void 0 : renderEntry.colormap]);
|
|
7871
|
+
var shouldNormalizeGeoTiff = !(renderEntry !== null && renderEntry !== void 0 && renderEntry.colormap);
|
|
7872
|
+
var shouldUseSpatialFilter = spatialFilter !== null && spatialFilter !== void 0 ? spatialFilter : isTiledCollection;
|
|
7873
|
+
var viewportBbox = useStacViewportBbox(map, shouldUseSpatialFilter);
|
|
7874
|
+
var selectionViewportBbox = useStacViewportBbox(map, shouldUseSpatialFilter, undefined, 0);
|
|
7875
|
+
React.useEffect(function () {
|
|
7876
|
+
if (manuallySelectedTile && selectionViewportBbox && !bboxesIntersect(manuallySelectedTile.bbox, selectionViewportBbox)) {
|
|
7877
|
+
setManuallySelectedTile(undefined);
|
|
7878
|
+
}
|
|
7879
|
+
}, [manuallySelectedTile, selectionViewportBbox]);
|
|
7880
|
+
var rasterViewportBbox = useStacViewportBbox(map, shouldUseSpatialFilter, isTiledCollection ? STAC_TILED_MINIMUM_ZOOM : undefined);
|
|
7881
|
+
var _resolveStacItemQuery = resolveStacItemQueryState({
|
|
7882
|
+
hasCollectionData: Boolean(collectionData),
|
|
7883
|
+
isTiledCollection: isTiledCollection,
|
|
7884
|
+
rasterViewportBbox: rasterViewportBbox,
|
|
7885
|
+
shouldUseSpatialFilter: shouldUseSpatialFilter,
|
|
7886
|
+
viewportBbox: viewportBbox
|
|
7887
|
+
}),
|
|
7888
|
+
isTiledOverview = _resolveStacItemQuery.isTiledOverview,
|
|
7889
|
+
itemQueryBbox = _resolveStacItemQuery.itemQueryBbox,
|
|
7890
|
+
isItemQueryEnabled = _resolveStacItemQuery.isItemQueryEnabled;
|
|
7251
7891
|
var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
|
|
7252
|
-
var
|
|
7892
|
+
var requestedTimeValue = (_dimensions$find = dimensions.find(function (_ref7) {
|
|
7893
|
+
var name = _ref7.name;
|
|
7894
|
+
return (name === null || name === void 0 ? void 0 : name.toLowerCase()) === 'time';
|
|
7895
|
+
})) === null || _dimensions$find === void 0 ? void 0 : _dimensions$find.currentValue;
|
|
7896
|
+
// Third-party tiled STAC collections expose a temporal extent, not a list of
|
|
7897
|
+
// discrete valid times. WMS closest-value logic can therefore snap the
|
|
7898
|
+
// timeline to an unrelated acquisition; query STAC with the exact selection.
|
|
7899
|
+
var timeValue = isTiledCollection ? requestedTimeValue : dimensionsValues === null || dimensionsValues === void 0 ? void 0 : dimensionsValues['TIME'];
|
|
7900
|
+
React.useEffect(function () {
|
|
7901
|
+
setManuallySelectedTile(undefined);
|
|
7902
|
+
}, [isTiledCollection, timeValue]);
|
|
7253
7903
|
var timeIntervalMs = getTimeIntervalInMilliseconds(wmLayer === null || wmLayer === void 0 || (_wmLayer$getDimension = wmLayer.getDimension('time')) === null || _wmLayer$getDimension === void 0 ? void 0 : _wmLayer$getDimension.getDimInterval());
|
|
7254
7904
|
var prefetchListEffectCheck = prefetchList.join(',');
|
|
7255
7905
|
var frameStepMs = React.useMemo(function () {
|
|
7256
|
-
return getFrameStepInMilliseconds(timeValue, prefetchList, timeIntervalMs);
|
|
7906
|
+
return isTiledCollection ? undefined : getFrameStepInMilliseconds(timeValue, prefetchList, timeIntervalMs);
|
|
7257
7907
|
},
|
|
7258
7908
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7259
|
-
[prefetchListEffectCheck, timeIntervalMs, timeValue]);
|
|
7260
|
-
var lookupStepMs = getLookupStepInMilliseconds(frameStepMs, timeIntervalMs);
|
|
7909
|
+
[isTiledCollection, prefetchListEffectCheck, timeIntervalMs, timeValue]);
|
|
7910
|
+
var lookupStepMs = isTiledCollection ? undefined : getLookupStepInMilliseconds(frameStepMs, timeIntervalMs);
|
|
7261
7911
|
var shouldPreloadFrames = shouldPreloadStacFrames(frameStepMs, timeIntervalMs);
|
|
7262
|
-
var preloadRadius = shouldPreloadFrames ? STAC_GEOTIFF_FRAME_PRELOAD_RADIUS : 0;
|
|
7263
|
-
var lookupWindowMs =
|
|
7912
|
+
var preloadRadius = shouldPreloadFrames && !isTiledCollection ? STAC_GEOTIFF_FRAME_PRELOAD_RADIUS : 0;
|
|
7913
|
+
var lookupWindowMs = STAC_ITEM_LOOKUP_WINDOW_MS;
|
|
7914
|
+
if (isTiledCollection) {
|
|
7915
|
+
lookupWindowMs = STAC_TILED_LOOKUP_WINDOW_MS;
|
|
7916
|
+
} else if (lookupStepMs) {
|
|
7917
|
+
lookupWindowMs = lookupStepMs * STAC_ITEM_LOOKUP_WINDOW_INTERVAL_MULTIPLIER;
|
|
7918
|
+
}
|
|
7264
7919
|
var frameTargetTimes = React.useMemo(function () {
|
|
7265
7920
|
return getStacFrameTargetTimes(timeValue, prefetchList, frameStepMs, preloadRadius);
|
|
7266
7921
|
},
|
|
@@ -7273,17 +7928,21 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
7273
7928
|
_React$useMemo2 = _slicedToArray(_React$useMemo, 2),
|
|
7274
7929
|
requestedStartDate = _React$useMemo2[0],
|
|
7275
7930
|
requestedEndDate = _React$useMemo2[1];
|
|
7276
|
-
var
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7931
|
+
var isTiledLookupWindow = isTiledCollection;
|
|
7932
|
+
var _React$useState3 = React.useState([undefined, undefined]),
|
|
7933
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
7934
|
+
activeItemLookupWindow = _React$useState4[0],
|
|
7935
|
+
setActiveItemLookupWindow = _React$useState4[1];
|
|
7280
7936
|
var isActiveItemLookupWindowValid = isStacItemLookupWindowValidForTime(activeItemLookupWindow, timeValue, requiredLookupMarginMs);
|
|
7281
7937
|
var _activeItemLookupWind = _slicedToArray(activeItemLookupWindow, 2),
|
|
7282
7938
|
activeStartDate = _activeItemLookupWind[0],
|
|
7283
7939
|
activeEndDate = _activeItemLookupWind[1];
|
|
7284
|
-
var startDate = isActiveItemLookupWindowValid ? activeStartDate : requestedStartDate;
|
|
7285
|
-
var endDate = isActiveItemLookupWindowValid ? activeEndDate : requestedEndDate;
|
|
7940
|
+
var startDate = !isTiledLookupWindow && isActiveItemLookupWindowValid ? activeStartDate : requestedStartDate;
|
|
7941
|
+
var endDate = !isTiledLookupWindow && isActiveItemLookupWindowValid ? activeEndDate : requestedEndDate;
|
|
7286
7942
|
React.useEffect(function () {
|
|
7943
|
+
if (isTiledLookupWindow) {
|
|
7944
|
+
return;
|
|
7945
|
+
}
|
|
7287
7946
|
setActiveItemLookupWindow(function (currentWindow) {
|
|
7288
7947
|
if (isStacItemLookupWindowValidForTime(currentWindow, timeValue, requiredLookupMarginMs)) {
|
|
7289
7948
|
return currentWindow;
|
|
@@ -7293,23 +7952,240 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
7293
7952
|
}
|
|
7294
7953
|
return [requestedStartDate, requestedEndDate];
|
|
7295
7954
|
});
|
|
7296
|
-
}, [requestedEndDate, requestedStartDate, requiredLookupMarginMs, timeValue]);
|
|
7297
|
-
var
|
|
7298
|
-
|
|
7299
|
-
|
|
7955
|
+
}, [isTiledLookupWindow, requestedEndDate, requestedStartDate, requiredLookupMarginMs, timeValue]);
|
|
7956
|
+
var _React$useMemo3 = React.useMemo(function () {
|
|
7957
|
+
if (isTiledCollection && timeValue) {
|
|
7958
|
+
return getStacItemLookupWindowForTimes([timeValue], STAC_TILED_LOOKUP_WINDOW_MS);
|
|
7959
|
+
}
|
|
7960
|
+
return [startDate, endDate];
|
|
7961
|
+
}, [endDate, isTiledCollection, startDate, timeValue]),
|
|
7962
|
+
_React$useMemo4 = _slicedToArray(_React$useMemo3, 2),
|
|
7963
|
+
itemStartDate = _React$useMemo4[0],
|
|
7964
|
+
itemEndDate = _React$useMemo4[1];
|
|
7965
|
+
// When a tile is manually selected, fetch its full item data
|
|
7966
|
+
// This works in both overview mode and zoomed-in mode
|
|
7967
|
+
var isManualSelectionActive = manuallySelectedTile;
|
|
7968
|
+
var manualSelectionItemsQuery = useStacItems(stacCollectionUrl, itemStartDate, itemEndDate, manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.bbox, isManualSelectionActive && Boolean(itemStartDate && itemEndDate), STAC_TILED_ITEM_PAGE_LIMIT);
|
|
7969
|
+
var _useStacItemsQueryStr = useStacItemsQueryStrategy({
|
|
7970
|
+
collectionData: collectionData,
|
|
7971
|
+
isItemQueryEnabled: isItemQueryEnabled,
|
|
7972
|
+
isTiledCollection: isTiledCollection,
|
|
7973
|
+
isTiledOverview: isTiledOverview,
|
|
7974
|
+
itemEndDate: itemEndDate,
|
|
7975
|
+
itemQueryBbox: itemQueryBbox,
|
|
7976
|
+
itemStartDate: itemStartDate,
|
|
7977
|
+
stacCollectionUrl: stacCollectionUrl
|
|
7978
|
+
}),
|
|
7979
|
+
items = _useStacItemsQueryStr.items,
|
|
7980
|
+
isFetching = _useStacItemsQueryStr.isFetching;
|
|
7981
|
+
var _useRetainedTiledItem = useRetainedTiledItems({
|
|
7982
|
+
isFetching: isFetching,
|
|
7983
|
+
isTiledCollection: isTiledCollection,
|
|
7984
|
+
isTiledOverview: isTiledOverview,
|
|
7985
|
+
items: items,
|
|
7986
|
+
timeValue: timeValue
|
|
7987
|
+
}),
|
|
7988
|
+
displayedItems = _useRetainedTiledItem.displayedItems,
|
|
7989
|
+
canRetainRasterWhileFetching = _useRetainedTiledItem.canRetainRasterWhileFetching;
|
|
7990
|
+
var timelineSelectionItems = React.useMemo(function () {
|
|
7991
|
+
if (!isTiledCollection || isTiledOverview || !displayedItems || !timeValue) {
|
|
7992
|
+
return displayedItems;
|
|
7993
|
+
}
|
|
7994
|
+
var timelineTime = new Date(timeValue).getTime();
|
|
7995
|
+
if (!Number.isFinite(timelineTime)) {
|
|
7996
|
+
return displayedItems;
|
|
7997
|
+
}
|
|
7998
|
+
return displayedItems.filter(function (item) {
|
|
7999
|
+
var _item$properties$date;
|
|
8000
|
+
var itemTime = new Date((_item$properties$date = item.properties.datetime) !== null && _item$properties$date !== void 0 ? _item$properties$date : '').getTime();
|
|
8001
|
+
return Number.isFinite(itemTime) && Math.abs(itemTime - timelineTime) <= STAC_TILED_TIMELINE_TOLERANCE_MS;
|
|
8002
|
+
});
|
|
8003
|
+
}, [displayedItems, isTiledCollection, isTiledOverview, timeValue]);
|
|
8004
|
+
var _React$useState5 = React.useState(undefined),
|
|
8005
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
8006
|
+
tiledRasterAnchorTime = _React$useState6[0],
|
|
8007
|
+
setTiledRasterAnchorTime = _React$useState6[1];
|
|
8008
|
+
React.useEffect(function () {
|
|
8009
|
+
if (!isTiledCollection) {
|
|
8010
|
+
return;
|
|
8011
|
+
}
|
|
8012
|
+
setTiledRasterAnchorTime(undefined);
|
|
8013
|
+
}, [isTiledCollection, timeValue]);
|
|
8014
|
+
React.useEffect(function () {
|
|
8015
|
+
if (isTiledCollection && isTiledOverview) {
|
|
8016
|
+
setTiledRasterAnchorTime(undefined);
|
|
8017
|
+
}
|
|
8018
|
+
}, [isTiledCollection, isTiledOverview]);
|
|
8019
|
+
var frameSelectionTimeValue = isTiledCollection && !isTiledOverview ? tiledRasterAnchorTime !== null && tiledRasterAnchorTime !== void 0 ? tiledRasterAnchorTime : timeValue : timeValue;
|
|
8020
|
+
var isWaitingForRasterQuery = isTiledCollection && !isTiledOverview && !canRetainRasterWhileFetching && (!items || isFetching);
|
|
8021
|
+
var isWaitingForManualSelectionQuery = isManualSelectionActive && manualSelectionItemsQuery.isFetching;
|
|
8022
|
+
var isWaitingForRasterSelection = isTiledCollection && !isTiledOverview && !selectionViewportBbox;
|
|
8023
|
+
var shouldRenderFootprints = isTiledOverview && !isManualSelectionActive || isWaitingForRasterQuery || isWaitingForManualSelectionQuery || isWaitingForRasterSelection;
|
|
7300
8024
|
var frameItems = React.useMemo(function () {
|
|
7301
|
-
return getStacFrameItemsToRender(
|
|
7302
|
-
}, [frameTargetTimes,
|
|
8025
|
+
return getStacFrameItemsToRender(timelineSelectionItems, frameSelectionTimeValue, frameTargetTimes, selectionViewportBbox, isTiledOverview ? STAC_OVERVIEW_TIME_TOLERANCE_MS : undefined, isTiledCollection ? STAC_TILED_LOOKUP_WINDOW_MS : undefined);
|
|
8026
|
+
}, [frameSelectionTimeValue, frameTargetTimes, isTiledCollection, isTiledOverview, selectionViewportBbox, timelineSelectionItems]);
|
|
8027
|
+
var rasterFrameItems = React.useMemo(function () {
|
|
8028
|
+
var _manualSelectionItems;
|
|
8029
|
+
// When a tile is manually selected, use the separately fetched full item data
|
|
8030
|
+
if (isManualSelectionActive && (_manualSelectionItems = manualSelectionItemsQuery.data) !== null && _manualSelectionItems !== void 0 && _manualSelectionItems.length) {
|
|
8031
|
+
// Filter to only the selected item (query might return overlapping tiles)
|
|
8032
|
+
// Match by ID first, then verify bbox if needed
|
|
8033
|
+
var selectedItem = manualSelectionItemsQuery.data.find(function (item) {
|
|
8034
|
+
return item.id === (manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id);
|
|
8035
|
+
});
|
|
8036
|
+
if (selectedItem) {
|
|
8037
|
+
return [{
|
|
8038
|
+
item: selectedItem,
|
|
8039
|
+
isSelected: true
|
|
8040
|
+
}];
|
|
8041
|
+
}
|
|
8042
|
+
// Fallback: if no exact ID match, try to find by bbox (shouldn't happen in normal cases)
|
|
8043
|
+
var bboxMatch = manualSelectionItemsQuery.data.find(function (item) {
|
|
8044
|
+
if (!(manuallySelectedTile !== null && manuallySelectedTile !== void 0 && manuallySelectedTile.bbox) || !item.bbox) {
|
|
8045
|
+
return false;
|
|
8046
|
+
}
|
|
8047
|
+
return item.bbox[0] === manuallySelectedTile.bbox[0] && item.bbox[1] === manuallySelectedTile.bbox[1] && item.bbox[2] === manuallySelectedTile.bbox[2] && item.bbox[3] === manuallySelectedTile.bbox[3];
|
|
8048
|
+
});
|
|
8049
|
+
return bboxMatch ? [{
|
|
8050
|
+
item: bboxMatch,
|
|
8051
|
+
isSelected: true
|
|
8052
|
+
}] : [];
|
|
8053
|
+
}
|
|
8054
|
+
if (isTiledCollection && !isTiledOverview) {
|
|
8055
|
+
return getSingleStacRasterItem(frameItems, selectionViewportBbox, undefined);
|
|
8056
|
+
}
|
|
8057
|
+
return frameItems;
|
|
8058
|
+
}, [frameItems, isTiledCollection, isTiledOverview, isManualSelectionActive, manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id, manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.bbox, manualSelectionItemsQuery.data, selectionViewportBbox]);
|
|
8059
|
+
React.useEffect(function () {
|
|
8060
|
+
var _manualSelectionItems2;
|
|
8061
|
+
if (manuallySelectedTile && displayedItems && !isFetching && !manualSelectionItemsQuery.isFetching && !((_manualSelectionItems2 = manualSelectionItemsQuery.data) !== null && _manualSelectionItems2 !== void 0 && _manualSelectionItems2.some(function (_ref8) {
|
|
8062
|
+
var id = _ref8.id;
|
|
8063
|
+
return id === manuallySelectedTile.id;
|
|
8064
|
+
}))) {
|
|
8065
|
+
setManuallySelectedTile(undefined);
|
|
8066
|
+
}
|
|
8067
|
+
}, [displayedItems, isFetching, manualSelectionItemsQuery.data, manualSelectionItemsQuery.isFetching, manuallySelectedTile]);
|
|
8068
|
+
React.useEffect(function () {
|
|
8069
|
+
var _rasterFrameItems$fin;
|
|
8070
|
+
if (!isTiledCollection || isTiledOverview) {
|
|
8071
|
+
return;
|
|
8072
|
+
}
|
|
8073
|
+
var selectedRasterTime = (_rasterFrameItems$fin = rasterFrameItems.find(function (_ref9) {
|
|
8074
|
+
var isSelected = _ref9.isSelected;
|
|
8075
|
+
return isSelected;
|
|
8076
|
+
})) === null || _rasterFrameItems$fin === void 0 ? void 0 : _rasterFrameItems$fin.item.properties.datetime;
|
|
8077
|
+
if (typeof selectedRasterTime !== 'string') {
|
|
8078
|
+
return;
|
|
8079
|
+
}
|
|
8080
|
+
var selectedRasterEpoch = new Date(selectedRasterTime !== null && selectedRasterTime !== void 0 ? selectedRasterTime : '').getTime();
|
|
8081
|
+
if (!Number.isFinite(selectedRasterEpoch)) {
|
|
8082
|
+
return;
|
|
8083
|
+
}
|
|
8084
|
+
setTiledRasterAnchorTime(function (currentTime) {
|
|
8085
|
+
return currentTime === selectedRasterTime ? currentTime : selectedRasterTime;
|
|
8086
|
+
});
|
|
8087
|
+
}, [isTiledCollection, isTiledOverview, rasterFrameItems]);
|
|
8088
|
+
var rasterAssetKeys = React.useMemo(function () {
|
|
8089
|
+
var _manualSelectionItems3;
|
|
8090
|
+
// When manually selected, fetch assets for the selected item
|
|
8091
|
+
if (isManualSelectionActive && (_manualSelectionItems3 = manualSelectionItemsQuery.data) !== null && _manualSelectionItems3 !== void 0 && _manualSelectionItems3.length) {
|
|
8092
|
+
var _selectedItem$assets;
|
|
8093
|
+
// Find the item matching the selected tile id (query might return overlapping tiles)
|
|
8094
|
+
var selectedItem = manualSelectionItemsQuery.data.find(function (item) {
|
|
8095
|
+
return item.id === (manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id);
|
|
8096
|
+
});
|
|
8097
|
+
if (!selectedItem) {
|
|
8098
|
+
return new Map();
|
|
8099
|
+
}
|
|
8100
|
+
var resolvedAssetKey = resolveStacAssetKey((_selectedItem$assets = selectedItem.assets) !== null && _selectedItem$assets !== void 0 ? _selectedItem$assets : {}, effectiveStyleName, renderEntry === null || renderEntry === void 0 ? void 0 : renderEntry.assets, assetKey);
|
|
8101
|
+
return resolvedAssetKey ? new Map([[selectedItem.id, resolvedAssetKey]]) : new Map();
|
|
8102
|
+
}
|
|
8103
|
+
if (isTiledOverview) {
|
|
8104
|
+
return new Map();
|
|
8105
|
+
}
|
|
8106
|
+
return new Map(rasterFrameItems.flatMap(function (_ref0) {
|
|
8107
|
+
var _item$assets;
|
|
8108
|
+
var item = _ref0.item;
|
|
8109
|
+
var resolvedAssetKey = resolveStacAssetKey((_item$assets = item.assets) !== null && _item$assets !== void 0 ? _item$assets : {}, effectiveStyleName, renderEntry === null || renderEntry === void 0 ? void 0 : renderEntry.assets, assetKey);
|
|
8110
|
+
return resolvedAssetKey ? [[item.id, resolvedAssetKey]] : [];
|
|
8111
|
+
}));
|
|
8112
|
+
}, [isManualSelectionActive, manualSelectionItemsQuery.data, isTiledOverview, rasterFrameItems, effectiveStyleName, renderEntry === null || renderEntry === void 0 ? void 0 : renderEntry.assets, assetKey, manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id]);
|
|
8113
|
+
var rasterItemIds = React.useMemo(function () {
|
|
8114
|
+
return new Set(rasterFrameItems.map(function (_ref1) {
|
|
8115
|
+
var item = _ref1.item;
|
|
8116
|
+
return item.id;
|
|
8117
|
+
}).filter(function (itemId) {
|
|
8118
|
+
return rasterAssetKeys.has(itemId);
|
|
8119
|
+
}));
|
|
8120
|
+
}, [rasterAssetKeys, rasterFrameItems]);
|
|
8121
|
+
var footprintStyle = React.useMemo(function () {
|
|
8122
|
+
return function (feature) {
|
|
8123
|
+
var itemId = feature.get('stacItemId');
|
|
8124
|
+
var isHovered = feature.get('hover') === true;
|
|
8125
|
+
var hasRasterData = itemId && rasterItemIds.has(itemId);
|
|
8126
|
+
if (itemId === (manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id)) {
|
|
8127
|
+
if (!isHovered) {
|
|
8128
|
+
return selectedStacFootprintStyle;
|
|
8129
|
+
}
|
|
8130
|
+
return hasRasterData ? hoveredSelectedRasterStacFootprintStyle : hoveredSelectedStacFootprintStyle;
|
|
8131
|
+
}
|
|
8132
|
+
if (isHovered) {
|
|
8133
|
+
return hasRasterData ? hoveredRasterStacFootprintStyle : hoveredStacFootprintStyle;
|
|
8134
|
+
}
|
|
8135
|
+
return hasRasterData ? transparentStacFootprintStyle : stacFootprintStyle;
|
|
8136
|
+
};
|
|
8137
|
+
}, [manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id, rasterItemIds]);
|
|
8138
|
+
var clickOnFootprint = React.useMemo(function () {
|
|
8139
|
+
return {
|
|
8140
|
+
eventType: 'singleclick',
|
|
8141
|
+
onClick: function onClick(features) {
|
|
8142
|
+
var clickedFeature = features.find(function (feature) {
|
|
8143
|
+
return Boolean(feature.get('stacItemId'));
|
|
8144
|
+
});
|
|
8145
|
+
var itemId = clickedFeature === null || clickedFeature === void 0 ? void 0 : clickedFeature.get('stacItemId');
|
|
8146
|
+
var bbox = clickedFeature === null || clickedFeature === void 0 ? void 0 : clickedFeature.get('stacItemBbox');
|
|
8147
|
+
if (!itemId || (bbox === null || bbox === void 0 ? void 0 : bbox.length) !== 4 || !bbox.every(function (coordinate) {
|
|
8148
|
+
return Number.isFinite(coordinate);
|
|
8149
|
+
})) {
|
|
8150
|
+
return;
|
|
8151
|
+
}
|
|
8152
|
+
setManuallySelectedTile(function (currentTile) {
|
|
8153
|
+
return (currentTile === null || currentTile === void 0 ? void 0 : currentTile.id) === itemId ? undefined : {
|
|
8154
|
+
bbox: _toConsumableArray(bbox),
|
|
8155
|
+
id: itemId
|
|
8156
|
+
};
|
|
8157
|
+
});
|
|
8158
|
+
}
|
|
8159
|
+
};
|
|
8160
|
+
}, []);
|
|
8161
|
+
var hoverOnFootprint = React.useMemo(function () {
|
|
8162
|
+
return {
|
|
8163
|
+
active: true
|
|
8164
|
+
};
|
|
8165
|
+
}, []);
|
|
7303
8166
|
React.useLayoutEffect(function () {
|
|
7304
|
-
|
|
7305
|
-
|
|
8167
|
+
var _manualSelectionItems4;
|
|
8168
|
+
frameItems.forEach(function (_ref10) {
|
|
8169
|
+
var item = _ref10.item;
|
|
7306
8170
|
var wkt2 = item.properties['proj:wkt2'];
|
|
7307
8171
|
if (wkt2) {
|
|
7308
8172
|
registerProjection(wkt2);
|
|
7309
8173
|
}
|
|
7310
8174
|
});
|
|
7311
|
-
|
|
7312
|
-
|
|
8175
|
+
// Also register projection for manually selected item
|
|
8176
|
+
if (isManualSelectionActive && (_manualSelectionItems4 = manualSelectionItemsQuery.data) !== null && _manualSelectionItems4 !== void 0 && _manualSelectionItems4.length) {
|
|
8177
|
+
var selectedItem = manualSelectionItemsQuery.data.find(function (item) {
|
|
8178
|
+
return item.id === (manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id);
|
|
8179
|
+
});
|
|
8180
|
+
if (selectedItem) {
|
|
8181
|
+
var wkt2 = selectedItem.properties['proj:wkt2'];
|
|
8182
|
+
if (wkt2) {
|
|
8183
|
+
registerProjection(wkt2);
|
|
8184
|
+
}
|
|
8185
|
+
}
|
|
8186
|
+
}
|
|
8187
|
+
}, [frameItems, isManualSelectionActive, manualSelectionItemsQuery.data, manuallySelectedTile === null || manuallySelectedTile === void 0 ? void 0 : manuallySelectedTile.id]);
|
|
8188
|
+
if (!displayedItems || !startDate || !endDate) {
|
|
7313
8189
|
return null;
|
|
7314
8190
|
}
|
|
7315
8191
|
if (!isStacItemLookupWindowValidForTime([startDate, endDate], timeValue, requiredLookupMarginMs)) {
|
|
@@ -7318,13 +8194,55 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
7318
8194
|
if (frameItems.length === 0) {
|
|
7319
8195
|
return null;
|
|
7320
8196
|
}
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
8197
|
+
var footprintFeatureCollection = {
|
|
8198
|
+
type: 'FeatureCollection',
|
|
8199
|
+
features: frameItems.filter(function (_ref11) {
|
|
8200
|
+
var item = _ref11.item;
|
|
8201
|
+
return Boolean(item.geometry);
|
|
8202
|
+
}).map(function (_ref12) {
|
|
8203
|
+
var item = _ref12.item;
|
|
8204
|
+
return {
|
|
8205
|
+
type: 'Feature',
|
|
8206
|
+
id: item.id,
|
|
8207
|
+
geometry: item.geometry,
|
|
8208
|
+
properties: {
|
|
8209
|
+
datetime: item.properties.datetime,
|
|
8210
|
+
stacItemBbox: item.bbox,
|
|
8211
|
+
stacItemId: item.id
|
|
8212
|
+
}
|
|
8213
|
+
};
|
|
8214
|
+
})
|
|
8215
|
+
};
|
|
8216
|
+
var footprintLayer = isTiledCollection ? jsx(OpenLayersFeatureLayer, {
|
|
8217
|
+
clickOnFeature: clickOnFootprint,
|
|
8218
|
+
featureCollection: footprintFeatureCollection,
|
|
8219
|
+
hoverSelect: hoverOnFootprint,
|
|
8220
|
+
opacity: opacity,
|
|
8221
|
+
style: footprintStyle,
|
|
8222
|
+
testId: "stac-item-footprints",
|
|
8223
|
+
visible: visible,
|
|
8224
|
+
zIndex: (zIndex !== null && zIndex !== void 0 ? zIndex : 0) + 1
|
|
8225
|
+
}) : null;
|
|
8226
|
+
if (shouldRenderFootprints) {
|
|
8227
|
+
return footprintLayer;
|
|
8228
|
+
}
|
|
8229
|
+
return jsxs(Fragment, {
|
|
8230
|
+
children: [footprintLayer, rasterFrameItems.map(function (_ref13) {
|
|
8231
|
+
var _item$assets2, _ref14, _item$properties$proj;
|
|
8232
|
+
var item = _ref13.item,
|
|
8233
|
+
isSelected = _ref13.isSelected;
|
|
8234
|
+
var resolvedAssetKey = rasterAssetKeys.get(item.id);
|
|
8235
|
+
if (!resolvedAssetKey) {
|
|
8236
|
+
return null;
|
|
8237
|
+
}
|
|
8238
|
+
var resolvedAsset = (_item$assets2 = item.assets) === null || _item$assets2 === void 0 ? void 0 : _item$assets2[resolvedAssetKey];
|
|
8239
|
+
if (!resolvedAsset) {
|
|
8240
|
+
return null;
|
|
8241
|
+
}
|
|
8242
|
+
var projection = (_ref14 = (_item$properties$proj = item.properties['proj:wkt2']) !== null && _item$properties$proj !== void 0 ? _item$properties$proj : item.properties['proj:code']) !== null && _ref14 !== void 0 ? _ref14 : item.properties['proj:epsg'] ? "EPSG:".concat(item.properties['proj:epsg']) : undefined;
|
|
7325
8243
|
return jsx(GeoTIFFLayer, {
|
|
7326
8244
|
geotiffStyle: geotiffStyle,
|
|
7327
|
-
layerName: item.id,
|
|
8245
|
+
layerName: "".concat(item.id, "-").concat(resolvedAssetKey),
|
|
7328
8246
|
layerOptions: {
|
|
7329
8247
|
opacity: isSelected ? opacity !== null && opacity !== void 0 ? opacity : 1 : 0,
|
|
7330
8248
|
zIndex: isSelected ? zIndex : (zIndex !== null && zIndex !== void 0 ? zIndex : 0) - 1
|
|
@@ -7333,10 +8251,10 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
7333
8251
|
enabled: visible
|
|
7334
8252
|
},
|
|
7335
8253
|
normalize: shouldNormalizeGeoTiff,
|
|
7336
|
-
projection:
|
|
7337
|
-
url:
|
|
7338
|
-
}, "".concat(item.id, "-").concat(effectiveStyleName));
|
|
7339
|
-
})
|
|
8254
|
+
projection: projection,
|
|
8255
|
+
url: resolvedAsset.href
|
|
8256
|
+
}, "".concat(item.id, "-").concat(resolvedAssetKey, "-").concat(effectiveStyleName));
|
|
8257
|
+
})]
|
|
7340
8258
|
});
|
|
7341
8259
|
};
|
|
7342
8260
|
var registerProjection = function registerProjection(wkt2) {
|
|
@@ -8139,8 +9057,9 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
8139
9057
|
});
|
|
8140
9058
|
case LayerType.edrFeatureLayer:
|
|
8141
9059
|
{
|
|
8142
|
-
var
|
|
8143
|
-
var
|
|
9060
|
+
var edrOptions = options && 'parameterNames' in options ? options : undefined;
|
|
9061
|
+
var parameterNames = (edrOptions === null || edrOptions === void 0 ? void 0 : edrOptions.parameterNames.join(',')) || '';
|
|
9062
|
+
var multiParam = Array.isArray(edrOptions === null || edrOptions === void 0 ? void 0 : edrOptions.parameterNames) && edrOptions.parameterNames.length > 1;
|
|
8144
9063
|
var styleLike = style !== undefined ? styleNameToStyleLike(style, multiParam) : undefined;
|
|
8145
9064
|
return jsx(TimeAwareEDRLocationLayer, {
|
|
8146
9065
|
dimensions: dimensions,
|
|
@@ -8156,14 +9075,19 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
8156
9075
|
}
|
|
8157
9076
|
case LayerType.stacGeoTIFFLayer:
|
|
8158
9077
|
{
|
|
9078
|
+
var stacOptions = options && !('parameterNames' in options) ? options : undefined;
|
|
8159
9079
|
return jsx(TimeAwareGeoTIFFLayer, {
|
|
9080
|
+
assetKey: stacOptions === null || stacOptions === void 0 ? void 0 : stacOptions.assetKey,
|
|
9081
|
+
dataLayout: stacOptions === null || stacOptions === void 0 ? void 0 : stacOptions.dataLayout,
|
|
8160
9082
|
dimensions: dimensions,
|
|
8161
9083
|
layerId: id,
|
|
8162
9084
|
layerName: id,
|
|
8163
9085
|
onInitializeLayer: onInitializeLayer,
|
|
8164
9086
|
opacity: layerOptions.opacity,
|
|
9087
|
+
spatialFilter: stacOptions === null || stacOptions === void 0 ? void 0 : stacOptions.spatialFilter,
|
|
8165
9088
|
stacCollectionUrl: service,
|
|
8166
9089
|
styleName: style,
|
|
9090
|
+
temporalStep: stacOptions === null || stacOptions === void 0 ? void 0 : stacOptions.temporalStep,
|
|
8167
9091
|
visible: !!(enabled !== false),
|
|
8168
9092
|
zIndex: layerOptions.zIndex
|
|
8169
9093
|
});
|
|
@@ -8473,6 +9397,20 @@ new Style$1({
|
|
|
8473
9397
|
})
|
|
8474
9398
|
})
|
|
8475
9399
|
})];
|
|
9400
|
+
var observationStationStyleWithOpacity = function observationStationStyleWithOpacity(styles, layerOpacity) {
|
|
9401
|
+
if (layerOpacity === 1) {
|
|
9402
|
+
return styles;
|
|
9403
|
+
}
|
|
9404
|
+
return styles.map(function (style) {
|
|
9405
|
+
var nextStyle = style.clone();
|
|
9406
|
+
var image = nextStyle.getImage();
|
|
9407
|
+
if (!(image instanceof Circle)) {
|
|
9408
|
+
return nextStyle;
|
|
9409
|
+
}
|
|
9410
|
+
image.setOpacity(layerOpacity);
|
|
9411
|
+
return nextStyle;
|
|
9412
|
+
});
|
|
9413
|
+
};
|
|
8476
9414
|
var FEATURE_OBSERVATIONSTATION_HIDDEN = [
|
|
8477
9415
|
// Outer circle
|
|
8478
9416
|
new Style$1({
|
|
@@ -8571,10 +9509,6 @@ new Style$1({
|
|
|
8571
9509
|
})
|
|
8572
9510
|
})
|
|
8573
9511
|
})];
|
|
8574
|
-
/**
|
|
8575
|
-
* Creates a nearby observation station style with the specified color.
|
|
8576
|
-
* Used for highlighting nearest location markers with per-source colors.
|
|
8577
|
-
*/
|
|
8578
9512
|
var createObservationStationNearbyStyle = function createObservationStationNearbyStyle(color) {
|
|
8579
9513
|
return [
|
|
8580
9514
|
// Outer circle with custom color
|
|
@@ -8829,31 +9763,33 @@ var stylesByMapFeatureClass = _defineProperty(_defineProperty(_defineProperty(_d
|
|
|
8829
9763
|
}), MapFeatureClass.MyLocation, function (feature) {
|
|
8830
9764
|
return !feature.get('hover') ? FEATURE_MY_LOCATION : [FEATURE_MY_LOCATION, textLabelStyle(feature.getProperties().name)];
|
|
8831
9765
|
}), MapFeatureClass.ObservationStation, function (feature) {
|
|
9766
|
+
var layerOpacity = typeof feature.get('layerOpacity') === 'number' ? feature.get('layerOpacity') : 1;
|
|
8832
9767
|
if (feature.get('hidden') && feature.get('hover') && feature.get('highlightSelectedFeature')) {
|
|
8833
|
-
return [].concat(FEATURE_OBSERVATIONSTATION_SELECTED, [textLabelStyle(feature.getProperties().name)]);
|
|
9768
|
+
return [].concat(_toConsumableArray(observationStationStyleWithOpacity(FEATURE_OBSERVATIONSTATION_SELECTED, layerOpacity)), [textLabelStyle(feature.getProperties().name)]);
|
|
8834
9769
|
}
|
|
8835
9770
|
if (feature.get('highlightNearbyFeature')) {
|
|
8836
9771
|
// Use per-source highlightColor if available, otherwise fall back to default green
|
|
8837
9772
|
var highlightColor = feature.get('highlightColor');
|
|
8838
9773
|
var nearbyStyle = highlightColor ? createObservationStationNearbyStyle(highlightColor) : FEATURE_OBSERVATIONSTATION_NEARBY;
|
|
8839
|
-
|
|
9774
|
+
var visibleNearbyStyle = observationStationStyleWithOpacity(nearbyStyle, layerOpacity);
|
|
9775
|
+
return [].concat(_toConsumableArray(visibleNearbyStyle), [textLabelStyle(feature.getProperties().name)]);
|
|
8840
9776
|
}
|
|
8841
9777
|
if (feature.get('hidden') && feature.get('hover')) {
|
|
8842
|
-
return [].concat(FEATURE_OBSERVATIONSTATION_HIDDEN_AND_HOVERED, [textLabelStyle(feature.getProperties().name)]);
|
|
9778
|
+
return [].concat(_toConsumableArray(observationStationStyleWithOpacity(FEATURE_OBSERVATIONSTATION_HIDDEN_AND_HOVERED, layerOpacity)), [textLabelStyle(feature.getProperties().name)]);
|
|
8843
9779
|
}
|
|
8844
9780
|
if (feature.get('highlightSelectedFeature') && feature.get('hover')) {
|
|
8845
|
-
return [].concat(FEATURE_OBSERVATIONSTATION_SELECTED, [textLabelStyle(feature.getProperties().name)]);
|
|
9781
|
+
return [].concat(_toConsumableArray(observationStationStyleWithOpacity(FEATURE_OBSERVATIONSTATION_SELECTED, layerOpacity)), [textLabelStyle(feature.getProperties().name)]);
|
|
8846
9782
|
}
|
|
8847
9783
|
if (feature.get('highlightSelectedFeature')) {
|
|
8848
|
-
return FEATURE_OBSERVATIONSTATION_SELECTED;
|
|
9784
|
+
return observationStationStyleWithOpacity(FEATURE_OBSERVATIONSTATION_SELECTED, layerOpacity);
|
|
8849
9785
|
}
|
|
8850
9786
|
if (feature.get('hidden')) {
|
|
8851
|
-
return FEATURE_OBSERVATIONSTATION_HIDDEN;
|
|
9787
|
+
return observationStationStyleWithOpacity(FEATURE_OBSERVATIONSTATION_HIDDEN, layerOpacity);
|
|
8852
9788
|
}
|
|
8853
9789
|
if (feature.get('hover')) {
|
|
8854
|
-
return [].concat(FEATURE_OBSERVATIONSTATION_HOVER, [textLabelStyle(feature.getProperties().name)]);
|
|
9790
|
+
return [].concat(_toConsumableArray(observationStationStyleWithOpacity(FEATURE_OBSERVATIONSTATION_HOVER, layerOpacity)), [textLabelStyle(feature.getProperties().name)]);
|
|
8855
9791
|
}
|
|
8856
|
-
return FEATURE_OBSERVATIONSTATION;
|
|
9792
|
+
return observationStationStyleWithOpacity(FEATURE_OBSERVATIONSTATION, layerOpacity);
|
|
8857
9793
|
}), MapFeatureClass.EDRFeature, function (feature) {
|
|
8858
9794
|
return !feature.get('hover') ? FEATURE_EDR : [].concat(FEATURE_EDR_HOVER, [textLabelStyle(feature.getProperties().name)]);
|
|
8859
9795
|
}), MapFeatureClass.EDRMultiPolygon, function (feature) {
|
|
@@ -8920,11 +9856,7 @@ var geowebColorToOpenLayersColor = function geowebColorToOpenLayersColor(color,
|
|
|
8920
9856
|
return color;
|
|
8921
9857
|
}
|
|
8922
9858
|
var decimalToHex = function decimalToHex(decimal, padding) {
|
|
8923
|
-
|
|
8924
|
-
if (hex.length < padding.length) {
|
|
8925
|
-
hex.push(padding.substring(hex.length));
|
|
8926
|
-
}
|
|
8927
|
-
return hex.join('');
|
|
9859
|
+
return decimal.toString(16).padStart(padding.length, '0');
|
|
8928
9860
|
};
|
|
8929
9861
|
var opacityNumber = Math.min(Math.max(0, Number.parseFloat("".concat(opacity))), 255 / 256);
|
|
8930
9862
|
var bitsPerColor = color.length - 1 >= 6 ? 8 : 4;
|
|
@@ -8943,12 +9875,14 @@ var geowebColorToOpenLayersColor = function geowebColorToOpenLayersColor(color,
|
|
|
8943
9875
|
return resultingColor.join('');
|
|
8944
9876
|
};
|
|
8945
9877
|
var inlineFeatureStyle = function inlineFeatureStyle(feature) {
|
|
8946
|
-
var
|
|
8947
|
-
var
|
|
9878
|
+
var featureProperties = feature.getProperties();
|
|
9879
|
+
var fillProperty = featureProperties['fill'];
|
|
9880
|
+
var strokeProperty = featureProperties['stroke'];
|
|
9881
|
+
var layerOpacity = typeof featureProperties.layerOpacity === 'number' ? featureProperties.layerOpacity : 1;
|
|
8948
9882
|
var fillStrokeStyle = new Style$1();
|
|
8949
9883
|
var styles = [fillStrokeStyle];
|
|
8950
9884
|
if (fillProperty) {
|
|
8951
|
-
var fillColor = geowebColorToOpenLayersColor(fillProperty,
|
|
9885
|
+
var fillColor = geowebColorToOpenLayersColor(fillProperty, (typeof featureProperties['fill-opacity'] === 'number' ? featureProperties['fill-opacity'] : 1) * layerOpacity);
|
|
8952
9886
|
fillStrokeStyle.setFill(new Fill({
|
|
8953
9887
|
color: fillColor
|
|
8954
9888
|
}));
|
|
@@ -8964,8 +9898,8 @@ var inlineFeatureStyle = function inlineFeatureStyle(feature) {
|
|
|
8964
9898
|
}
|
|
8965
9899
|
if (strokeProperty) {
|
|
8966
9900
|
fillStrokeStyle.setStroke(new Stroke({
|
|
8967
|
-
color: geowebColorToOpenLayersColor(strokeProperty,
|
|
8968
|
-
width:
|
|
9901
|
+
color: geowebColorToOpenLayersColor(strokeProperty, (typeof featureProperties['stroke-opacity'] === 'number' ? featureProperties['stroke-opacity'] : 1) * layerOpacity),
|
|
9902
|
+
width: featureProperties['stroke-width']
|
|
8969
9903
|
}));
|
|
8970
9904
|
}
|
|
8971
9905
|
return styles;
|
|
@@ -9049,7 +9983,13 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
9049
9983
|
showNameOnHover = props.showNameOnHover,
|
|
9050
9984
|
name = props.name,
|
|
9051
9985
|
geometry = props.geometry,
|
|
9052
|
-
selectionType = props.selectionType
|
|
9986
|
+
selectionType = props.selectionType,
|
|
9987
|
+
_props$layerOpacity = props.layerOpacity,
|
|
9988
|
+
layerOpacity = _props$layerOpacity === void 0 ? 1 : _props$layerOpacity;
|
|
9989
|
+
var effectiveLayerOpacity = typeof layerOpacity === 'number' ? layerOpacity : 1;
|
|
9990
|
+
var effectiveFillOpacity = (typeof fillOpacity === 'number' ? fillOpacity : 1) * effectiveLayerOpacity;
|
|
9991
|
+
var effectiveStrokeOpacity = (typeof strokeOpacity === 'number' ? strokeOpacity : 1) * effectiveLayerOpacity;
|
|
9992
|
+
var effectiveHighlightFillOpacity = typeof fillOpacity === 'number' ? fillOpacity : 0;
|
|
9053
9993
|
var hoverLabelStyle = hover && showNameOnHover && name ? function () {
|
|
9054
9994
|
var type = geometry === null || geometry === void 0 ? void 0 : geometry.getType();
|
|
9055
9995
|
switch (type) {
|
|
@@ -9072,7 +10012,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
9072
10012
|
geometry: new LineString(smoothed),
|
|
9073
10013
|
stroke: new Stroke({
|
|
9074
10014
|
width: strokeWidth || 3,
|
|
9075
|
-
color: geowebColorToOpenLayersColor(stroke,
|
|
10015
|
+
color: geowebColorToOpenLayersColor(stroke, effectiveStrokeOpacity)
|
|
9076
10016
|
})
|
|
9077
10017
|
});
|
|
9078
10018
|
}
|
|
@@ -9108,7 +10048,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
9108
10048
|
width: 3
|
|
9109
10049
|
}),
|
|
9110
10050
|
fill: new Fill({
|
|
9111
|
-
color: geowebColorToOpenLayersColor(fill, (
|
|
10051
|
+
color: geowebColorToOpenLayersColor(fill, Math.min((effectiveHighlightFillOpacity + (hover ? 0.6 : 0.4)) * effectiveLayerOpacity, 1) || 0.9)
|
|
9112
10052
|
}),
|
|
9113
10053
|
zIndex: 9998
|
|
9114
10054
|
});
|
|
@@ -9122,7 +10062,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
9122
10062
|
width: 3
|
|
9123
10063
|
}),
|
|
9124
10064
|
fill: new Fill({
|
|
9125
|
-
color: fill ? geowebColorToOpenLayersColor(fill, (
|
|
10065
|
+
color: fill ? geowebColorToOpenLayersColor(fill, Math.min((effectiveHighlightFillOpacity + 0.2) * effectiveLayerOpacity, 1) || 0.9) : 'rgba(226, 125, 0, 0.6)'
|
|
9126
10066
|
}),
|
|
9127
10067
|
zIndex: 9999
|
|
9128
10068
|
});
|
|
@@ -9132,7 +10072,7 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
9132
10072
|
return [].concat(_toConsumableArray(inlineFeatureStyle(feature)), [hoverLabelStyle]);
|
|
9133
10073
|
}
|
|
9134
10074
|
if ((!mapFeatureClass || mapFeatureClass === MapFeatureClass["default"]) && geometry && selectionType === 'point') {
|
|
9135
|
-
return getFeaturePointStyle(fill,
|
|
10075
|
+
return getFeaturePointStyle(fill, effectiveFillOpacity);
|
|
9136
10076
|
}
|
|
9137
10077
|
if (fill || stroke) {
|
|
9138
10078
|
return inlineFeatureStyle(feature);
|
|
@@ -12723,4 +13663,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
|
|
|
12723
13663
|
return updateObject;
|
|
12724
13664
|
};
|
|
12725
13665
|
|
|
12726
|
-
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, 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, STAC_ITEM_PAGE_LIMIT, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, 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, getBoxRotateHandlePoints, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getRendersAsStyles, getStacFrameItemsToRender, getStacItemLookupWindowForTimes, getStacItemsUrl, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isClickFromDrag, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isPointFeatureCollection, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, removeOverlappingLines, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, 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, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCollection, useStacItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|
|
13666
|
+
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, 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, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, 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, getBoxRotateHandlePoints, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFrameItemsToRender, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, removeOverlappingLines, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, 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, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|