@opengeoweb/webmap-react 21.3.0-nightly-20261201 → 21.3.0-nightly-20261203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -10,7 +10,7 @@ import ImageSource, { getRequestExtent } from 'ol/source/Image';
10
10
  import ImageWrapper 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, calculateStartSize, ToolContainerDraggable, CustomIconButton, dateUtils, isDialogFocused, useMakeSureContainerStaysInsideWindow, Draggable, Resizable } from '@opengeoweb/shared';
13
+ import { CustomTooltip, CanvasComponent, useWheelStopPropagation, calculateStartSize, ToolContainerDraggable, CustomIconButton, dateUtils, isDialogFocused, canvasToBlob, 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';
@@ -744,6 +744,7 @@ var NUM_IMAGES_TO_CACHE = 10000;
744
744
  var WMS_EXTENT_RATIO_TO_VIEWPORT = 1.2;
745
745
  var FAILED_IMAGE_RETRY_CHECK_INTERVAL_MS = 10000;
746
746
  var TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = 'Image did not load succesfully';
747
+ var TIMEAWAREIMAGEWRAPPER_NOIMAGEFORREQUEST = 'No image available for request';
747
748
  // // To debug what dimensions are actually being used in the map, use:
748
749
  // export const ADD_SHOW_DIMS_OPTION = true;
749
750
  // export const WMS_EXTENT_RATIO_TO_VIEWPORT = 1.0;
@@ -1213,9 +1214,11 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
1213
1214
  resolution: request.resolution
1214
1215
  });
1215
1216
  });
1216
- if (images.some(function (image) {
1217
+ var missingImageIndex = images.findIndex(function (image) {
1217
1218
  return !image;
1218
- })) {
1219
+ });
1220
+ if (missingImageIndex !== -1) {
1221
+ this._rejectAll(requests[missingImageIndex].src, TIMEAWAREIMAGEWRAPPER_NOIMAGEFORREQUEST);
1219
1222
  return;
1220
1223
  }
1221
1224
  if (images.length === 1) {
@@ -1295,10 +1298,11 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
1295
1298
  }, {
1296
1299
  key: "_rejectAll",
1297
1300
  value: function _rejectAll(url) {
1301
+ var reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY;
1298
1302
  while (this._resolvers.length !== 0) {
1299
1303
  var resolve = this._resolvers.pop();
1300
1304
  resolve === null || resolve === void 0 || resolve.reject({
1301
- reason: TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY,
1305
+ reason: reason,
1302
1306
  url: url
1303
1307
  });
1304
1308
  }
@@ -1467,6 +1471,8 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1467
1471
  _classCallCheck(this, TimeawareImageSource);
1468
1472
  _this = _callSuper(this, TimeawareImageSource, [{}]);
1469
1473
  _this._failedImageRetryTimer = null;
1474
+ _this._loadRequestId = 0;
1475
+ _this._unloadableRequestKey = null;
1470
1476
  _this._wmsUrl = wmsUrl;
1471
1477
  _this._extraWMSParams = _objectSpread2({}, params);
1472
1478
  _this._layerName = layerName;
@@ -1527,17 +1533,28 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1527
1533
  this.prefetch(extent, resolution, pixelRatio, projection);
1528
1534
  }
1529
1535
  }
1536
+ }, {
1537
+ key: "_getRequestKey",
1538
+ value: function _getRequestKey(extent, resolution, dimProperties) {
1539
+ return JSON.stringify([extent, resolution, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimProperties]);
1540
+ }
1530
1541
  }, {
1531
1542
  key: "_loadImagery",
1532
1543
  value: function _loadImagery(dimProperties) {
1533
1544
  var _this2 = this;
1545
+ var requestId = this._loadRequestId;
1546
+ var dimPropertiesToLoad = dimProperties ? _objectSpread2({}, dimProperties) : _objectSpread2({}, this._dimProperties);
1547
+ var requestKey = this._getRequestKey(this._lastRequestedExtent, this._lastRequestedResolution, dimPropertiesToLoad);
1534
1548
  // Tell the imagestore that we are about to do a GetMap request
1535
1549
  openLayersGetMapImageStore.loadDuration.setLoadingStatusForId(WMImageStoreLoadType.GETMAP, this._layerId, 0, 1, true);
1536
1550
  // Load the newly requested image
1537
- this._imWrapperForOlSource.loadAndResolve(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimProperties ? _objectSpread2({}, dimProperties) : _objectSpread2({}, this._dimProperties)).then(function (el) {
1551
+ this._imWrapperForOlSource.loadAndResolve(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimPropertiesToLoad).then(function (el) {
1538
1552
  // Tell the imagestore that GetMap request was finished.
1539
1553
  openLayersGetMapImageStore.loadDuration.setLoadDurationForId(_this2._layerId, el.getLoadDuration());
1540
- })["catch"](function () {
1554
+ })["catch"](function (error) {
1555
+ if ((error === null || error === void 0 ? void 0 : error.reason) === TIMEAWAREIMAGEWRAPPER_NOIMAGEFORREQUEST) {
1556
+ _this2._unloadableRequestKey = requestKey;
1557
+ }
1541
1558
  // TODO, enable error handling
1542
1559
  // console.error(e);
1543
1560
  })["finally"](function () {
@@ -1547,6 +1564,9 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1547
1564
  _this2._loadedResolution = _this2._lastRequestedResolution;
1548
1565
  _this2._loadedPixelRatio = _this2._lastRequestedPixelRatio;
1549
1566
  _this2._loadedProjection = _this2._lastRequestedProjection;
1567
+ if (requestId === _this2._loadRequestId) {
1568
+ _this2.loading = false;
1569
+ }
1550
1570
  // Loading finished, tell openlayers that we need to change. It will then call getImage again, which will display this loaded image.
1551
1571
  _this2.changed();
1552
1572
  _this2.triggerPrefetch();
@@ -1638,10 +1658,15 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1638
1658
  this._scheduleFailedImageRetry();
1639
1659
  return this._getAltImageOrEmpty(requestExtent, requestResolution, pixelRatio, projection, requestDimProperties);
1640
1660
  }
1661
+ if (this._getRequestKey(requestExtent, requestResolution, requestDimProperties) === this._unloadableRequestKey) {
1662
+ return this._getAltImageOrEmpty(requestExtent, requestResolution, pixelRatio, projection, requestDimProperties);
1663
+ }
1641
1664
  this._lastRequestedExtent = requestExtent;
1642
1665
  this._lastRequestedResolution = requestResolution;
1643
1666
  this._lastRequestedPixelRatio = pixelRatio;
1644
1667
  this._lastRequestedProjection = projection;
1668
+ this._loadRequestId += 1;
1669
+ this.loading = true;
1645
1670
  this.throttledImageLoad();
1646
1671
  if (hasExactImage && !hasExactImage.isLoaded && !hasExactImage.hasError && hasExactImage.hasCompletedImage && requestedImageHasWantedExtent) {
1647
1672
  // Keep the decoded frame visible while its expired response is revalidated.
@@ -4739,7 +4764,7 @@ var LegendDialog = function LegendDialog(_ref) {
4739
4764
  });
4740
4765
  };
4741
4766
 
4742
- var _excluded$3 = ["onClick", "children", "title", "placement", "isActive"];
4767
+ var _excluded$4 = ["onClick", "children", "title", "placement", "isActive"];
4743
4768
  var MapControlButton = function MapControlButton(_ref) {
4744
4769
  var onClick = _ref.onClick,
4745
4770
  children = _ref.children,
@@ -4748,7 +4773,7 @@ var MapControlButton = function MapControlButton(_ref) {
4748
4773
  placement = _ref$placement === void 0 ? 'right' : _ref$placement,
4749
4774
  _ref$isActive = _ref.isActive,
4750
4775
  isActive = _ref$isActive === void 0 ? false : _ref$isActive,
4751
- props = _objectWithoutProperties(_ref, _excluded$3);
4776
+ props = _objectWithoutProperties(_ref, _excluded$4);
4752
4777
  return jsx(CustomIconButton, _objectSpread2(_objectSpread2({
4753
4778
  isSelected: isActive,
4754
4779
  onClick: onClick,
@@ -4788,10 +4813,10 @@ var ZoomControls = function ZoomControls(_ref) {
4788
4813
  });
4789
4814
  };
4790
4815
 
4791
- var _excluded$2 = ["children"];
4816
+ var _excluded$3 = ["children"];
4792
4817
  var MapControls = function MapControls(_ref) {
4793
4818
  var children = _ref.children,
4794
- props = _objectWithoutProperties(_ref, _excluded$2);
4819
+ props = _objectWithoutProperties(_ref, _excluded$3);
4795
4820
  return jsx(Box, _objectSpread2(_objectSpread2({
4796
4821
  sx: {
4797
4822
  position: 'absolute',
@@ -5247,11 +5272,11 @@ var MapDimensionSelect = function MapDimensionSelect(_ref2) {
5247
5272
  }, layerId);
5248
5273
  };
5249
5274
 
5250
- var _excluded$1 = ["isActive", "onClick"];
5275
+ var _excluded$2 = ["isActive", "onClick"];
5251
5276
  var LayerInfoButton = function LayerInfoButton(_ref) {
5252
5277
  var isActive = _ref.isActive,
5253
5278
  onClick = _ref.onClick,
5254
- props = _objectWithoutProperties(_ref, _excluded$1);
5279
+ props = _objectWithoutProperties(_ref, _excluded$2);
5255
5280
  return jsx(CustomIconButton, _objectSpread2(_objectSpread2({
5256
5281
  "aria-label": "layer info",
5257
5282
  className: "layerInfoButton",
@@ -8123,7 +8148,7 @@ var lineStringCollection = {
8123
8148
  features: [lineString]
8124
8149
  };
8125
8150
 
8126
- var _excluded = ["id"];
8151
+ var _excluded$1 = ["id"];
8127
8152
  /**
8128
8153
  * Adds properties to the first geojson feature based on the given property object.
8129
8154
  * It only extends or changes the properties which are defined in styleConfig,
@@ -8471,7 +8496,7 @@ var IDENTITY_PROPERTIES = ['objectName', 'isSelected', 'highlightSelectedFeature
8471
8496
  */
8472
8497
  var asNewFeature = function asNewFeature(feature) {
8473
8498
  feature.id;
8474
- var featureWithoutId = _objectWithoutProperties(feature, _excluded);
8499
+ var featureWithoutId = _objectWithoutProperties(feature, _excluded$1);
8475
8500
  var properties = _objectSpread2({}, featureWithoutId.properties);
8476
8501
  IDENTITY_PROPERTIES.forEach(function (property) {
8477
8502
  delete properties[property];
@@ -8674,6 +8699,136 @@ var viewUtils = {
8674
8699
  makeView: makeView
8675
8700
  };
8676
8701
 
8702
+ var _excluded = ["timeout"];
8703
+ var LAYER_CANVAS_SELECTOR = '.ol-layer canvas, canvas.ol-layer';
8704
+ var getCanvasTransform = function getCanvasTransform(canvas) {
8705
+ var matrix = /^matrix\(([^(]*)\)$/.exec(canvas.style.transform);
8706
+ if (matrix) {
8707
+ return matrix[1].split(',').map(Number);
8708
+ }
8709
+ return [parseFloat(canvas.style.width) / canvas.width || 1, 0, 0, parseFloat(canvas.style.height) / canvas.height || 1, 0, 0];
8710
+ };
8711
+ var getLayerOpacity = function getLayerOpacity(canvas) {
8712
+ var _canvas$parentElement;
8713
+ var opacity = ((_canvas$parentElement = canvas.parentElement) === null || _canvas$parentElement === void 0 ? void 0 : _canvas$parentElement.style.opacity) || canvas.style.opacity;
8714
+ return opacity === '' ? 1 : Number(opacity);
8715
+ };
8716
+ /**
8717
+ * Draws the layer canvases currently rendered by OpenLayers into a single
8718
+ * canvas. UI elements rendered on top of the map are not included.
8719
+ * Should be called right after the map has rendered, see exportMapToCanvas.
8720
+ */
8721
+ var composeMapCanvas = function composeMapCanvas(map) {
8722
+ var _map$getSize;
8723
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
8724
+ _ref$pixelRatio = _ref.pixelRatio,
8725
+ pixelRatio = _ref$pixelRatio === void 0 ? map.getPixelRatio() : _ref$pixelRatio,
8726
+ backgroundColor = _ref.backgroundColor;
8727
+ var _ref2 = (_map$getSize = map.getSize()) !== null && _map$getSize !== void 0 ? _map$getSize : [0, 0],
8728
+ _ref3 = _slicedToArray(_ref2, 2),
8729
+ width = _ref3[0],
8730
+ height = _ref3[1];
8731
+ var mapCanvas = document.createElement('canvas');
8732
+ mapCanvas.width = Math.round(width * pixelRatio);
8733
+ mapCanvas.height = Math.round(height * pixelRatio);
8734
+ var mapContext = mapCanvas.getContext('2d');
8735
+ if (!mapContext) {
8736
+ return mapCanvas;
8737
+ }
8738
+ if (backgroundColor) {
8739
+ mapContext.fillStyle = backgroundColor;
8740
+ mapContext.fillRect(0, 0, mapCanvas.width, mapCanvas.height);
8741
+ }
8742
+ map.getViewport().querySelectorAll(LAYER_CANVAS_SELECTOR).forEach(function (canvas) {
8743
+ var _canvas$parentElement2;
8744
+ if (canvas.width === 0 || canvas.height === 0) {
8745
+ return;
8746
+ }
8747
+ // Transform maps layer canvas pixels to CSS pixels, scale it to output pixels
8748
+ var transform = getCanvasTransform(canvas).map(function (value) {
8749
+ return value * pixelRatio;
8750
+ });
8751
+ mapContext.setTransform.apply(mapContext, _toConsumableArray(transform));
8752
+ mapContext.globalAlpha = getLayerOpacity(canvas);
8753
+ var layerBackgroundColor = (_canvas$parentElement2 = canvas.parentElement) === null || _canvas$parentElement2 === void 0 ? void 0 : _canvas$parentElement2.style.backgroundColor;
8754
+ if (layerBackgroundColor) {
8755
+ mapContext.fillStyle = layerBackgroundColor;
8756
+ mapContext.fillRect(0, 0, canvas.width, canvas.height);
8757
+ }
8758
+ mapContext.drawImage(canvas, 0, 0);
8759
+ });
8760
+ mapContext.globalAlpha = 1;
8761
+ mapContext.setTransform(1, 0, 0, 1, 0, 0);
8762
+ return mapCanvas;
8763
+ };
8764
+ var EXPORT_MAP_TIMEOUT_MS = 30000;
8765
+ /**
8766
+ * Waits until all visible layers of the map have loaded and rendered, and
8767
+ * returns the map as a single canvas.
8768
+ */
8769
+ var exportMapToCanvas = /*#__PURE__*/function () {
8770
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(map) {
8771
+ var _ref5,
8772
+ _ref5$timeout,
8773
+ timeout,
8774
+ canvasOptions,
8775
+ _args = arguments;
8776
+ return _regenerator().w(function (_context) {
8777
+ while (1) switch (_context.n) {
8778
+ case 0:
8779
+ _ref5 = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}, _ref5$timeout = _ref5.timeout, timeout = _ref5$timeout === void 0 ? EXPORT_MAP_TIMEOUT_MS : _ref5$timeout, canvasOptions = _objectWithoutProperties(_ref5, _excluded);
8780
+ return _context.a(2, new Promise(function (resolve, reject) {
8781
+ var _map$getSize2;
8782
+ var _ref6 = (_map$getSize2 = map.getSize()) !== null && _map$getSize2 !== void 0 ? _map$getSize2 : [0, 0],
8783
+ _ref7 = _slicedToArray(_ref6, 2),
8784
+ width = _ref7[0],
8785
+ height = _ref7[1];
8786
+ if (!width || !height) {
8787
+ reject(new Error('The map has no size'));
8788
+ return;
8789
+ }
8790
+ var onRenderComplete = function onRenderComplete() {
8791
+ clearTimeout(timer);
8792
+ // Compose inside the listener, WebGL layers clear their canvas afterwards
8793
+ try {
8794
+ resolve(composeMapCanvas(map, canvasOptions));
8795
+ } catch (error) {
8796
+ reject(error);
8797
+ }
8798
+ };
8799
+ var timer = setTimeout(function () {
8800
+ map.un('rendercomplete', onRenderComplete);
8801
+ reject(new Error('Timed out waiting for the map to render'));
8802
+ }, timeout);
8803
+ map.once('rendercomplete', onRenderComplete);
8804
+ map.render();
8805
+ }));
8806
+ }
8807
+ }, _callee);
8808
+ }));
8809
+ return function exportMapToCanvas(_x) {
8810
+ return _ref4.apply(this, arguments);
8811
+ };
8812
+ }();
8813
+ var exportMapToBlob = /*#__PURE__*/function () {
8814
+ var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(map, options) {
8815
+ var _t;
8816
+ return _regenerator().w(function (_context2) {
8817
+ while (1) switch (_context2.n) {
8818
+ case 0:
8819
+ _t = canvasToBlob;
8820
+ _context2.n = 1;
8821
+ return exportMapToCanvas(map, options);
8822
+ case 1:
8823
+ return _context2.a(2, _t(_context2.v));
8824
+ }
8825
+ }, _callee2);
8826
+ }));
8827
+ return function exportMapToBlob(_x2, _x3) {
8828
+ return _ref8.apply(this, arguments);
8829
+ };
8830
+ }();
8831
+
8677
8832
  var privateWmsGetCapabilities = privateWebMapUtils.privateWmsGetCapabilities,
8678
8833
  privateGetWMSServiceInfo = privateWebMapUtils.privateGetWMSServiceInfo,
8679
8834
  privateWmsGetLayerTree = privateWebMapUtils.privateWmsGetLayerTree,
@@ -16280,4 +16435,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
16280
16435
  return updateObject;
16281
16436
  };
16282
16437
 
16283
- export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDR_PLAIN_NUMBERS_STYLE, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, POINTER_CLICK_TOLERANCE_PX, SELECTED_FEATURE_COLOR, SELECTED_POINT_HALO_STYLE, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StacLegendCanvas, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, applyStacNodataMask, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, clearStacFeatureInfoCache, colorMaps, connectSharedVertices, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createModifyFeatures, createMoveFeatures, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSplit, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, edrCollectionsToServiceLayers, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureMultiPoint, featurePoint, featurePolygon, fetchEDRArea, fetchEDRCollectionDetails, fetchEDRCube, fetchEDRJson, fetchEDRParameter, fetchEDRServiceLayers, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatEDRValue, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getEDRUnitLabel, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFeatureInfoSources, getStacFrameItemsToRender, getStacGrayscaleRange, getStacGrayscaleSampleRange, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getStacLegendMetadata, getStacLegendWidth, getStacRasterBands, getTimeDimension, getToolIcon, getVertexLetter, getWMSStyleName, handleResponse, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, isStacFeatureInfoReady, joinUrlParams, keepIdentityOnFirstSplitFeature, labelOptions, letteredLineResultStyle, letteredLineStyle, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStylePlainNumber, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeStacLegendModel, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, normalizeEDRLabel, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, readStacPointValue, registerStacFeatureInfoSource, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, renderStacLegend, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, selectPreferredWMTSTileMatrixSet, setMapCenter, setStacFeatureInfoReady, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, subscribeStacFeatureInfoSources, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, toMovedFeatures, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useModifyFeatures, useMoveFeatures, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
16438
+ export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDR_PLAIN_NUMBERS_STYLE, EXPORT_MAP_TIMEOUT_MS, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, POINTER_CLICK_TOLERANCE_PX, SELECTED_FEATURE_COLOR, SELECTED_POINT_HALO_STYLE, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StacLegendCanvas, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, applyStacNodataMask, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, clearStacFeatureInfoCache, colorMaps, composeMapCanvas, connectSharedVertices, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createModifyFeatures, createMoveFeatures, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSplit, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, edrCollectionsToServiceLayers, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, exportMapToBlob, exportMapToCanvas, featureMultiPoint, featurePoint, featurePolygon, fetchEDRArea, fetchEDRCollectionDetails, fetchEDRCube, fetchEDRJson, fetchEDRParameter, fetchEDRServiceLayers, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatEDRValue, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getEDRUnitLabel, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFeatureInfoSources, getStacFrameItemsToRender, getStacGrayscaleRange, getStacGrayscaleSampleRange, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getStacLegendMetadata, getStacLegendWidth, getStacRasterBands, getTimeDimension, getToolIcon, getVertexLetter, getWMSStyleName, handleResponse, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, isStacFeatureInfoReady, joinUrlParams, keepIdentityOnFirstSplitFeature, labelOptions, letteredLineResultStyle, letteredLineStyle, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStylePlainNumber, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeStacLegendModel, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, normalizeEDRLabel, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, readStacPointValue, registerStacFeatureInfoSource, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, renderStacLegend, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, selectPreferredWMTSTileMatrixSet, setMapCenter, setStacFeatureInfoReady, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, subscribeStacFeatureInfoSources, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, toMovedFeatures, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useModifyFeatures, useMoveFeatures, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
@@ -7,6 +7,7 @@ export * from './utils/moveFeatures';
7
7
  export * from './utils/projections';
8
8
  export * from './utils/setMapCenter';
9
9
  export * from './utils/viewUtils';
10
+ export * from './utils/exportMap';
10
11
  export * from './controls';
11
12
  export * from './draw';
12
13
  export * from './styles/useIconStyle';
@@ -21,6 +21,10 @@ interface TimeAwareGeoreferencedImage {
21
21
  hasCompletedImage?: boolean;
22
22
  }
23
23
  type TimeAwareGeoreferencedImageRequest = TimeAwareGeoreferencedImageSrc;
24
+ export interface RejectImageLoad {
25
+ reason: string;
26
+ url: string;
27
+ }
24
28
  declare class TimeAwareImageWrapper extends ImageWrapper {
25
29
  private _extentToLoad;
26
30
  private _resolutionToLoad;
@@ -41,8 +41,11 @@ export declare class TimeawareImageSource extends ImageSource {
41
41
  private _layerId;
42
42
  private _failedImageRetryTimer;
43
43
  private _extentRatio;
44
+ private _loadRequestId;
45
+ private _unloadableRequestKey;
44
46
  constructor({ wmsUrl, timeStampsToPrefetch, layerName, layerId, styleName, dimProps, params, visible, extentRatio, }: TimeawareImageSourceOptions);
45
47
  private _conditionalPrefetch;
48
+ private _getRequestKey;
46
49
  private _loadImagery;
47
50
  private prefetch;
48
51
  triggerPrefetch(): void;
@@ -7,3 +7,4 @@ export declare const NUM_IMAGES_TO_CACHE = 10000;
7
7
  export declare const WMS_EXTENT_RATIO_TO_VIEWPORT = 1.2;
8
8
  export declare const FAILED_IMAGE_RETRY_CHECK_INTERVAL_MS = 10000;
9
9
  export declare const TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = "Image did not load succesfully";
10
+ export declare const TIMEAWAREIMAGEWRAPPER_NOIMAGEFORREQUEST = "No image available for request";
@@ -0,0 +1,21 @@
1
+ import type { Map } from 'ol';
2
+ export interface MapCanvasOptions {
3
+ pixelRatio?: number;
4
+ backgroundColor?: string;
5
+ }
6
+ /**
7
+ * Draws the layer canvases currently rendered by OpenLayers into a single
8
+ * canvas. UI elements rendered on top of the map are not included.
9
+ * Should be called right after the map has rendered, see exportMapToCanvas.
10
+ */
11
+ export declare const composeMapCanvas: (map: Map, { pixelRatio, backgroundColor }?: MapCanvasOptions) => HTMLCanvasElement;
12
+ export declare const EXPORT_MAP_TIMEOUT_MS = 30000;
13
+ export interface ExportMapOptions extends MapCanvasOptions {
14
+ timeout?: number;
15
+ }
16
+ /**
17
+ * Waits until all visible layers of the map have loaded and rendered, and
18
+ * returns the map as a single canvas.
19
+ */
20
+ export declare const exportMapToCanvas: (map: Map, { timeout, ...canvasOptions }?: ExportMapOptions) => Promise<HTMLCanvasElement>;
21
+ export declare const exportMapToBlob: (map: Map, options?: ExportMapOptions) => Promise<Blob>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap-react",
3
- "version": "21.3.0-nightly-20261201",
3
+ "version": "21.3.0-nightly-20261203",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,9 +20,9 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/webmap": "21.3.0-nightly-20261201",
24
- "@opengeoweb/theme": "21.3.0-nightly-20261201",
25
- "@opengeoweb/shared": "21.3.0-nightly-20261201",
23
+ "@opengeoweb/webmap": "21.3.0-nightly-20261203",
24
+ "@opengeoweb/theme": "21.3.0-nightly-20261203",
25
+ "@opengeoweb/shared": "21.3.0-nightly-20261203",
26
26
  "lodash": "^4.18.1",
27
27
  "ol": "^10.4.0",
28
28
  "geotiff": "^3.0.5",