@opengeoweb/webmap-react 20.1.0 → 20.2.0-nightly-20261021

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
@@ -1,6 +1,6 @@
1
1
  import { WMInvalidDateValues, getCorrectWMSDimName, WMImageStore, WMImageStoreLoadType, WMJSDimension, webmapUtils, WMLayer, LayerType, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, WEBMAP_NAMESPACE, WMProj4Defs, privateWebMapUtils, wmDetermineDimensionMode, WMJSMAP_LONLAT_EPSGCODE, WMDefaultStyleName, tilesettings } from '@opengeoweb/webmap';
2
2
  export { WEBMAP_NAMESPACE, webmapTranslations } from '@opengeoweb/webmap';
3
- import React, { createContext, useMemo, useRef, useState, useEffect, useCallback, useContext, useLayoutEffect } from 'react';
3
+ import React, { createContext, useMemo, useRef, useState, useEffect, useCallback, useContext, useLayoutEffect, useEffectEvent } from 'react';
4
4
  import { memoize, range, without, isEqual, throttle, debounce, cloneDeep } from 'lodash';
5
5
  import { equals, containsExtent as containsExtent$1, buffer, boundingExtent, containsCoordinate, getCenter } from 'ol/extent';
6
6
  import ImageState from 'ol/ImageState';
@@ -26,14 +26,14 @@ 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, transformExtent, transform } from 'ol/proj';
29
+ import { toLonLat, get, equivalent, fromLonLat, transformExtent, transform } from 'ol/proj';
30
30
  import { equals as equals$1, closestOnSegment } from 'ol/coordinate';
31
31
  import { noModifierKeys, never, platformModifierKeyOnly, always } from 'ol/events/condition';
32
32
  import Modify from 'ol/interaction/Modify';
33
33
  import Style$1, { createDefaultStyle } from 'ol/style/Style';
34
34
  import GeoJSON from 'ol/format/GeoJSON';
35
35
  import Translate from 'ol/interaction/Translate';
36
- import { lineSplit, cleanCoords, featureCollection, difference, bbox, feature, simplify, booleanPointInPolygon, intersect, polygonToLine, booleanClockwise, rewind, toWgs84, toMercator, coordEach } from '@turf/turf';
36
+ import { lineSplit, cleanCoords, featureCollection, round, difference, bbox, feature, simplify, booleanPointInPolygon, intersect, polygonToLine, booleanClockwise, rewind, toWgs84, toMercator, coordEach } from '@turf/turf';
37
37
  import proj4 from 'proj4';
38
38
  import { register } from 'ol/proj/proj4';
39
39
  import { produce } from 'immer';
@@ -919,6 +919,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
919
919
  _this._resolvers = [];
920
920
  _this._styleName = 'default';
921
921
  _this._layerName = null;
922
+ _this._extentRatio = WMS_EXTENT_RATIO_TO_VIEWPORT;
922
923
  _this._compositeImageKey = '';
923
924
  _this._compositeImage = null;
924
925
  _this.extent = extent;
@@ -938,6 +939,11 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
938
939
  }
939
940
  _inherits(TimeAwareImageWrapper, _ImageWrapper);
940
941
  return _createClass(TimeAwareImageWrapper, [{
942
+ key: "setExtentRatio",
943
+ value: function setExtentRatio(extentRatio) {
944
+ this._extentRatio = extentRatio;
945
+ }
946
+ }, {
941
947
  key: "getWMSGetMapRequestURL",
942
948
  value: function getWMSGetMapRequestURL(extentToLoad, resolutionToLoad, __pixelRatio, projection, getMapUrl, params, layerName, styleName, dimProps) {
943
949
  var pixelRatio = 1; // TODO?
@@ -954,8 +960,8 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
954
960
  var resolution = resolutionToLoad;
955
961
  var requestResolution = Array.isArray(resolution) ? resolution[0] : resolution || 1;
956
962
  var newPixelRatio = pixelRatio;
957
- // Load 1.2^2 % larger WMS extents than the current view
958
- var ratio = WMS_EXTENT_RATIO_TO_VIEWPORT;
963
+ // Load extentRatio^2 % larger WMS extents than the current view (default 1.2, see WMS_EXTENT_RATIO_TO_VIEWPORT)
964
+ var ratio = this._extentRatio;
959
965
  var extent = extentToLoad;
960
966
  var newExtent = getRequestExtent(extent, requestResolution, newPixelRatio, ratio);
961
967
  // Feature in adaguc-server to display actually used dimensions in the map.
@@ -1422,7 +1428,8 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1422
1428
  styleName = _ref.styleName,
1423
1429
  dimProps = _ref.dimProps,
1424
1430
  params = _ref.params,
1425
- visible = _ref.visible;
1431
+ visible = _ref.visible,
1432
+ extentRatio = _ref.extentRatio;
1426
1433
  _classCallCheck(this, TimeawareImageSource);
1427
1434
  _this = _callSuper(this, TimeawareImageSource, [{}]);
1428
1435
  _this._failedImageRetryTimer = null;
@@ -1434,6 +1441,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1434
1441
  _this._timeStampsToPrefetch = _toConsumableArray(timeStampsToPrefetch || []);
1435
1442
  _this._previousPrefetchExtent = null;
1436
1443
  _this._prefetchWorkers = new WorkerQueue(NUMBER_PREFETCH_WORKERS);
1444
+ _this._extentRatio = extentRatio !== null && extentRatio !== void 0 ? extentRatio : WMS_EXTENT_RATIO_TO_VIEWPORT;
1437
1445
  _this.prefetch = _this.prefetch.bind(_this);
1438
1446
  _this.isImageLoadingForTimestep = _this.isImageLoadingForTimestep.bind(_this);
1439
1447
  _this.hasImageLoadedForTimeValue = _this.hasImageLoadedForTimeValue.bind(_this);
@@ -1459,6 +1467,8 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1459
1467
  _this._imWrapperEmptyButLoading = initImageWrapper();
1460
1468
  _this._imWrapperForOlSource = initImageWrapper();
1461
1469
  _this._imWrapperForAltImage = initImageWrapper();
1470
+ _this._imWrapperForOlSource.setExtentRatio(_this._extentRatio);
1471
+ _this._imWrapperForAltImage.setExtentRatio(_this._extentRatio);
1462
1472
  _this.set(LayerProperty.VISIBLE, !!visible);
1463
1473
  return _this;
1464
1474
  }
@@ -1535,6 +1545,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1535
1545
  while (1) switch (_context.n) {
1536
1546
  case 0:
1537
1547
  jobWrapper = new TimeAwareImageWrapper([0, 0, 0, 0], 1, 1);
1548
+ jobWrapper.setExtentRatio(_this3._extentRatio);
1538
1549
  dimPropsWithTime = _objectSpread2(_objectSpread2({}, _this3._dimProperties), {}, {
1539
1550
  TIME: dimValue
1540
1551
  });
@@ -4372,10 +4383,6 @@ var NEW_LINESTRING_CREATED = 'new point in LineString created';
4372
4383
  var NEW_FEATURE_CREATED = 'new feature created';
4373
4384
  var NEW_POINT_CREATED = 'new point created';
4374
4385
  var COORDINATE_DECIMALS = 5;
4375
- var roundToDecimals = function roundToDecimals(value, decimals) {
4376
- var factor = Math.pow(10, decimals);
4377
- return Math.round(value * factor) / factor;
4378
- };
4379
4386
  var roundCoordinates = function roundCoordinates(coords) {
4380
4387
  if (!Array.isArray(coords)) {
4381
4388
  return coords;
@@ -4385,7 +4392,7 @@ var roundCoordinates = function roundCoordinates(coords) {
4385
4392
  return value.map(_mapCoords);
4386
4393
  }
4387
4394
  if (typeof value === 'number') {
4388
- return roundToDecimals(value, COORDINATE_DECIMALS);
4395
+ return round(value, COORDINATE_DECIMALS);
4389
4396
  }
4390
4397
  return value;
4391
4398
  };
@@ -6210,6 +6217,59 @@ var selectPreferredWMSProjection = function selectPreferredWMSProjection(viewSrs
6210
6217
  }
6211
6218
  return 'EPSG:3857';
6212
6219
  };
6220
+ /**
6221
+ * Returns the identifier of a linked tile matrix set whose CRS matches the view SRS.
6222
+ * The view SRS is preferred; if it has no match, configured WMProj4Defs are checked
6223
+ * in order. Matrix sets without a known CRS or tiles are ignored.
6224
+ *
6225
+ * @param capabilities WMTS capabilities to search.
6226
+ * @param layerName Identifier of the layer to search.
6227
+ * @param viewSrs Projection code of the current map view.
6228
+ * @returns The matching tile matrix set identifier, or null if no match is available.
6229
+ */
6230
+ var selectPreferredWMTSTileMatrixSet = function selectPreferredWMTSTileMatrixSet(capabilities, layerName, viewSrs) {
6231
+ var _contents$Layer, _layer$TileMatrixSetL;
6232
+ if (!viewSrs) {
6233
+ return null;
6234
+ }
6235
+ var contents = capabilities === null || capabilities === void 0 ? void 0 : capabilities.Contents;
6236
+ var layer = contents === null || contents === void 0 || (_contents$Layer = contents.Layer) === null || _contents$Layer === void 0 ? void 0 : _contents$Layer.find(function (candidate) {
6237
+ return candidate.Identifier === layerName;
6238
+ });
6239
+ var candidates = ((_layer$TileMatrixSetL = layer === null || layer === void 0 ? void 0 : layer.TileMatrixSetLink) !== null && _layer$TileMatrixSetL !== void 0 ? _layer$TileMatrixSetL : []).flatMap(function (link) {
6240
+ var _contents$TileMatrixS, _matrixSet$TileMatrix;
6241
+ var matrixSet = contents === null || contents === void 0 || (_contents$TileMatrixS = contents.TileMatrixSet) === null || _contents$TileMatrixS === void 0 ? void 0 : _contents$TileMatrixS.find(function (candidate) {
6242
+ return candidate.Identifier === link.TileMatrixSet;
6243
+ });
6244
+ var projection = matrixSet !== null && matrixSet !== void 0 && matrixSet.SupportedCRS ? get(matrixSet.SupportedCRS) : null;
6245
+ return matrixSet !== null && matrixSet !== void 0 && matrixSet.Identifier && (_matrixSet$TileMatrix = matrixSet.TileMatrix) !== null && _matrixSet$TileMatrix !== void 0 && _matrixSet$TileMatrix.length && projection ? [{
6246
+ identifier: matrixSet.Identifier,
6247
+ projection: projection
6248
+ }] : [];
6249
+ });
6250
+ var _loop = function _loop() {
6251
+ var code = _arr[_i];
6252
+ var projection = get(code);
6253
+ var match = projection && candidates.find(function (candidate) {
6254
+ return equivalent(candidate.projection, projection);
6255
+ });
6256
+ if (match) {
6257
+ return {
6258
+ v: match.identifier
6259
+ };
6260
+ }
6261
+ },
6262
+ _ret;
6263
+ for (var _i = 0, _arr = [viewSrs].concat(_toConsumableArray(WMProj4Defs.map(function (_ref5) {
6264
+ var _ref6 = _slicedToArray(_ref5, 1),
6265
+ srs = _ref6[0];
6266
+ return srs;
6267
+ }))); _i < _arr.length; _i++) {
6268
+ _ret = _loop();
6269
+ if (_ret) return _ret.v;
6270
+ }
6271
+ return null;
6272
+ };
6213
6273
  var useProjection = function useProjection() {
6214
6274
  var _useContext = useContext(MapContext),
6215
6275
  map = _useContext.map;
@@ -7296,7 +7356,8 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
7296
7356
  visible = _ref$visible === void 0 ? true : _ref$visible,
7297
7357
  onInitializeLayer = _ref.onInitializeLayer,
7298
7358
  onLayerReady = _ref.onLayerReady,
7299
- onLayerError = _ref.onLayerError;
7359
+ onLayerError = _ref.onLayerError,
7360
+ extentRatio = _ref.extentRatio;
7300
7361
  var _useContext = useContext(MapContext),
7301
7362
  map = _useContext.map;
7302
7363
  var _useContext2 = useContext(TimeContext),
@@ -7339,7 +7400,8 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
7339
7400
  styleName: styleName && styleName !== 'default' ? styleName : '',
7340
7401
  dimProps: dimensionsValues,
7341
7402
  timeStampsToPrefetch: [],
7342
- visible: visible
7403
+ visible: visible,
7404
+ extentRatio: extentRatio
7343
7405
  })
7344
7406
  });
7345
7407
  map.addLayer(olLayer);
@@ -7621,7 +7683,6 @@ var WMTSDimensionsFromDimensions = function WMTSDimensionsFromDimensions(dimensi
7621
7683
  var WMTSLayer = function WMTSLayer(_ref) {
7622
7684
  var getCapsURL = _ref.getCapsURL,
7623
7685
  layerName = _ref.layerName,
7624
- tileMatrixSet = _ref.tileMatrixSet,
7625
7686
  layerOptions = _ref.layerOptions,
7626
7687
  layerProps = _ref.layerProps;
7627
7688
  var _useContext = useContext(MapContext),
@@ -7638,17 +7699,26 @@ var WMTSLayer = function WMTSLayer(_ref) {
7638
7699
  wmtsCaps = _useQueryWMTSGetCapab.data,
7639
7700
  isLoading = _useQueryWMTSGetCapab.isLoading,
7640
7701
  isError = _useQueryWMTSGetCapab.isError;
7702
+ var projectionName = useProjection();
7641
7703
  var wmtsLayer = useMemo(function () {
7642
- if (isLoading || isError || !wmtsCaps) {
7704
+ if (isLoading || isError || !wmtsCaps || !projectionName) {
7643
7705
  return null;
7644
7706
  }
7645
- var parser = new WMTSCapabilities();
7646
- var capabilities = parser.read(wmtsCaps);
7647
- return optionsFromCapabilities(capabilities, {
7648
- layer: layerName,
7649
- matrixSet: tileMatrixSet
7650
- });
7651
- }, [wmtsCaps, isLoading, isError, layerName, tileMatrixSet]);
7707
+ try {
7708
+ var capabilities = new WMTSCapabilities().read(wmtsCaps);
7709
+ var matrixSet = selectPreferredWMTSTileMatrixSet(capabilities, layerName, projectionName);
7710
+ if (!matrixSet) {
7711
+ return null;
7712
+ }
7713
+ return optionsFromCapabilities(capabilities, {
7714
+ layer: layerName,
7715
+ matrixSet: matrixSet
7716
+ });
7717
+ } catch (e) {
7718
+ console.error('Error parsing WMTS capabilities:', e);
7719
+ return null;
7720
+ }
7721
+ }, [isLoading, isError, wmtsCaps, layerName, projectionName]);
7652
7722
  useEffect(function () {
7653
7723
  if (!map || !wmtsLayer) {
7654
7724
  return function () {};
@@ -7665,6 +7735,7 @@ var WMTSLayer = function WMTSLayer(_ref) {
7665
7735
  return function () {
7666
7736
  map.removeLayer(layer);
7667
7737
  setLayer(undefined);
7738
+ setSource(undefined);
7668
7739
  };
7669
7740
  // eslint-disable-next-line react-hooks/exhaustive-deps
7670
7741
  }, [map, wmtsLayer]);
@@ -8048,8 +8119,7 @@ var DefaultBaseLayers = function DefaultBaseLayers(_ref) {
8048
8119
  getCapsURL: "https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer/WMTS?SERVICE=WMTS&REQUEST=GetCapabilities",
8049
8120
  layerName: "World_Topo_Map",
8050
8121
  layerOptions: layerOptions,
8051
- layerProps: layerProps,
8052
- tileMatrixSet: "GoogleMapsCompatible"
8122
+ layerProps: layerProps
8053
8123
  });
8054
8124
  case BaseLayerType.LIGHT_GREY_CANVAS:
8055
8125
  default:
@@ -10622,7 +10692,6 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
10622
10692
  onLayerError = _ref.onLayerError,
10623
10693
  _ref$visible = _ref.visible,
10624
10694
  visible = _ref$visible === void 0 ? true : _ref$visible;
10625
- var tileMatrixSet = 'EPSG:3857';
10626
10695
  var _useContext = useContext(MapContext),
10627
10696
  map = _useContext.map;
10628
10697
  var _useState = useState(),
@@ -10633,6 +10702,7 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
10633
10702
  _useState4 = _slicedToArray(_useState3, 2),
10634
10703
  source = _useState4[0],
10635
10704
  setSource = _useState4[1];
10705
+ var projectionName = useProjection();
10636
10706
  // get a wmLayer instance
10637
10707
  var _useGetWMLayerInstanc = useGetWMLayerInstance({
10638
10708
  service: getCapsURL,
@@ -10642,18 +10712,12 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
10642
10712
  }),
10643
10713
  wmLayer = _useGetWMLayerInstanc.wmLayer,
10644
10714
  errorMessage = _useGetWMLayerInstanc.errorMessage;
10645
- if (errorMessage && onLayerError) {
10646
- onLayerError(layerId || '', errorMessage);
10647
- }
10648
10715
  // dimensionsValues is a key/value dictionary with dimension names specifically for WMS GetMap requests
10649
10716
  var dimensionsValues = getDimensionParamsForWMS(dimensions, wmLayer);
10650
10717
  // This string can be used safely in a useEffect or other React hook to check if the contents changed
10651
10718
  var dimensionsValuesEffectCheck = dimensionsValues && Object.entries(dimensionsValues).map(function (dimensionNameAndCurrentValue) {
10652
10719
  return "".concat(dimensionNameAndCurrentValue[0], ":").concat(dimensionNameAndCurrentValue[1]);
10653
10720
  }).join(',');
10654
- useEffect(function () {
10655
- onLayerReady && wmLayer && layerId && onLayerReady(layerId);
10656
- }, [layerId, wmLayer, onLayerReady]);
10657
10721
  // Initialize layer for GeoWeb, call onInitializeLayer
10658
10722
  useEffect(function () {
10659
10723
  var initializeLayer = /*#__PURE__*/function () {
@@ -10725,23 +10789,54 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
10725
10789
  var _useQueryWMTSGetCapab = useQueryWMTSGetCapabilities(getCapsURL),
10726
10790
  wmtsCaps = _useQueryWMTSGetCapab.data,
10727
10791
  isLoading = _useQueryWMTSGetCapab.isLoading,
10728
- isError = _useQueryWMTSGetCapab.isError;
10729
- var TimeAwareWMTSLayer = useMemo(function () {
10730
- if (isLoading || isError || !wmtsCaps) {
10731
- return null;
10792
+ isError = _useQueryWMTSGetCapab.isError,
10793
+ error = _useQueryWMTSGetCapab.error;
10794
+ var _useMemo = useMemo(function () {
10795
+ if (isLoading || isError || !wmtsCaps || !projectionName) {
10796
+ return {
10797
+ options: null
10798
+ };
10799
+ }
10800
+ try {
10801
+ var capabilities = new WMTSCapabilities().read(wmtsCaps);
10802
+ var matrixSet = selectPreferredWMTSTileMatrixSet(capabilities, layerName, projectionName);
10803
+ if (!matrixSet) {
10804
+ return {
10805
+ options: null
10806
+ };
10807
+ }
10808
+ return {
10809
+ options: optionsFromCapabilities(capabilities, {
10810
+ layer: layerName,
10811
+ matrixSet: matrixSet
10812
+ })
10813
+ };
10814
+ } catch (e) {
10815
+ return {
10816
+ options: null,
10817
+ error: "Error parsing WMTS capabilities: ".concat(e instanceof Error ? e.message : String(e))
10818
+ };
10819
+ }
10820
+ }, [wmtsCaps, isLoading, isError, layerName, projectionName]),
10821
+ wmtsOptions = _useMemo.options,
10822
+ parsingError = _useMemo.error;
10823
+ var layerError = errorMessage || isError && "Error fetching WMTS capabilities: ".concat((error === null || error === void 0 ? void 0 : error.message) || 'Unknown error') || parsingError;
10824
+ var isLayerReady = !!wmLayer && !!wmtsOptions;
10825
+ var reportLayerStatus = useEffectEvent(function () {
10826
+ if (layerError) {
10827
+ onLayerError === null || onLayerError === void 0 || onLayerError(layerId || '', layerError);
10828
+ } else if (isLayerReady && layerId) {
10829
+ onLayerReady === null || onLayerReady === void 0 || onLayerReady(layerId);
10732
10830
  }
10733
- var parser = new WMTSCapabilities();
10734
- var capabilities = parser.read(wmtsCaps);
10735
- return optionsFromCapabilities(capabilities, {
10736
- layer: layerName,
10737
- matrixSet: tileMatrixSet
10738
- });
10739
- }, [wmtsCaps, isLoading, isError, layerName, tileMatrixSet]);
10831
+ });
10740
10832
  useEffect(function () {
10741
- if (!map || !TimeAwareWMTSLayer) {
10833
+ reportLayerStatus();
10834
+ }, [layerError, isLayerReady, layerId]);
10835
+ useEffect(function () {
10836
+ if (!map || !wmtsOptions) {
10742
10837
  return function () {};
10743
10838
  }
10744
- var source = new WMTS(_objectSpread2(_objectSpread2({}, TimeAwareWMTSLayer), dimensions ? {
10839
+ var source = new WMTS(_objectSpread2(_objectSpread2({}, wmtsOptions), dimensions ? {
10745
10840
  dimensions: WMTSDimensionsFromDimensions(dimensions)
10746
10841
  } : {}));
10747
10842
  var layer = new TileLayer({
@@ -10756,12 +10851,13 @@ var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
10756
10851
  return function () {
10757
10852
  map.removeLayer(layer);
10758
10853
  setLayer(undefined);
10854
+ setSource(undefined);
10759
10855
  if (wmLayer) {
10760
10856
  wmLayer.olSource = null;
10761
10857
  }
10762
10858
  };
10763
10859
  // eslint-disable-next-line react-hooks/exhaustive-deps
10764
- }, [map, TimeAwareWMTSLayer, wmLayer]);
10860
+ }, [map, wmtsOptions, wmLayer]);
10765
10861
  useEffect(function () {
10766
10862
  if (dimensions) {
10767
10863
  source === null || source === void 0 || source.updateDimensions(WMTSDimensionsFromDimensions(dimensions));
@@ -11359,7 +11455,8 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
11359
11455
  layerType = _layerProps$layerType === void 0 ? LayerType.mapLayer : _layerProps$layerType,
11360
11456
  _layerProps$tileServe = layerProps.tileServerSettings,
11361
11457
  tileServerSettings = _layerProps$tileServe === void 0 ? tilesettings : _layerProps$tileServe,
11362
- options = layerProps.options;
11458
+ options = layerProps.options,
11459
+ extentRatio = layerProps.extentRatio;
11363
11460
  var isBaseLayer = layerType === LayerType.baseLayer;
11364
11461
  var isOverlay = layerType === LayerType.overLayer;
11365
11462
  var layerOptions = useMemo(function () {
@@ -11377,6 +11474,7 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
11377
11474
  return jsx(TimeawareImageSourceWMSLayer, {
11378
11475
  debugMode: debugMode,
11379
11476
  dimensions: dimensions,
11477
+ extentRatio: extentRatio,
11380
11478
  getCapsURL: service,
11381
11479
  layerId: id,
11382
11480
  layerName: name,
@@ -11490,6 +11588,13 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
11490
11588
  urlTemplate: urlTemplate
11491
11589
  });
11492
11590
  }
11591
+ } else if (type === 'wmts' && _name && _service) {
11592
+ return jsx(WMTSLayer, {
11593
+ getCapsURL: "".concat(_service, "?SERVICE=WMTS&REQUEST=GetCapabilities"),
11594
+ layerName: _name,
11595
+ layerOptions: layerOptions,
11596
+ layerProps: layerProps
11597
+ });
11493
11598
  } else if (_name && _service) {
11494
11599
  return jsx(WMSLayer, {
11495
11600
  layerName: _name,
@@ -11759,6 +11864,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
11759
11864
  updateGeojson = _ref.updateGeojson,
11760
11865
  onViewOnlyFeatureClick = _ref.onViewOnlyFeatureClick,
11761
11866
  onNoFeatureClick = _ref.onNoFeatureClick,
11867
+ onEscape = _ref.onEscape,
11762
11868
  boxSelect = _ref.boxSelect;
11763
11869
  var _React$useContext = React.useContext(MapContext),
11764
11870
  map = _React$useContext.map;
@@ -11767,11 +11873,13 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
11767
11873
  var updateGeojsonRef = React.useRef(updateGeojson);
11768
11874
  var onViewOnlyFeatureClickRef = React.useRef(onViewOnlyFeatureClick);
11769
11875
  var onNoFeatureClickRef = React.useRef(onNoFeatureClick);
11876
+ var onEscapeRef = React.useRef(onEscape);
11770
11877
  var boxSelectRef = React.useRef(boxSelect);
11771
11878
  exitDrawModeCallbackRef.current = exitDrawModeCallback;
11772
11879
  updateGeojsonRef.current = updateGeojson;
11773
11880
  onViewOnlyFeatureClickRef.current = onViewOnlyFeatureClick;
11774
11881
  onNoFeatureClickRef.current = onNoFeatureClick;
11882
+ onEscapeRef.current = onEscape;
11775
11883
  boxSelectRef.current = boxSelect;
11776
11884
  React.useEffect(function () {
11777
11885
  var _geojson$features$sel;
@@ -12360,6 +12468,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
12360
12468
  };
12361
12469
  var abortOnEsc = function abortOnEsc(evt) {
12362
12470
  if (evt.key === 'Escape') {
12471
+ var _onEscapeRef$current;
12363
12472
  evt.preventDefault();
12364
12473
  draw.finishDrawing();
12365
12474
  if (selectedFeatureHasGeometry) {
@@ -12368,6 +12477,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
12368
12477
  } else {
12369
12478
  draw.abortDrawing();
12370
12479
  }
12480
+ (_onEscapeRef$current = onEscapeRef.current) === null || _onEscapeRef$current === void 0 || _onEscapeRef$current.call(onEscapeRef);
12371
12481
  }
12372
12482
  };
12373
12483
  var onlyAllowMoving = actualDrawMode === DRAWMODE.CIRCLE || actualDrawMode === DRAWMODE.OVAL || actualDrawMode === DRAWMODE.FREEHANDLINE;
@@ -14837,4 +14947,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
14837
14947
  return updateObject;
14838
14948
  };
14839
14949
 
14840
- export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, POINTER_CLICK_TOLERANCE_PX, SELECTED_FEATURE_COLOR, SELECTED_POINT_HALO_STYLE, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, connectSharedVertices, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createModifyFeatures, createMoveFeatures, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSplit, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureMultiPoint, featurePoint, featurePolygon, fetchEDRArea, fetchEDRCollectionDetails, fetchEDRCube, fetchEDRJson, fetchEDRParameter, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFrameItemsToRender, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getTimeDimension, getToolIcon, handleResponse, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, joinUrlParams, keepIdentityOnFirstSplitFeature, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, normalizeEDRLabel, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, toMovedFeatures, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useModifyFeatures, useMoveFeatures, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
14950
+ export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, POINTER_CLICK_TOLERANCE_PX, SELECTED_FEATURE_COLOR, SELECTED_POINT_HALO_STYLE, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, connectSharedVertices, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createModifyFeatures, createMoveFeatures, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSplit, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureMultiPoint, featurePoint, featurePolygon, fetchEDRArea, fetchEDRCollectionDetails, fetchEDRCube, fetchEDRJson, fetchEDRParameter, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFrameItemsToRender, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getTimeDimension, getToolIcon, handleResponse, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, joinUrlParams, keepIdentityOnFirstSplitFeature, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, normalizeEDRLabel, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, selectPreferredWMTSTileMatrixSet, setMapCenter, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, toMovedFeatures, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useModifyFeatures, useMoveFeatures, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
@@ -16,6 +16,8 @@ export interface OpenLayersMapDrawProps {
16
16
  updateGeojson?: (geoJson: GeoJSON.FeatureCollection, text: string) => void;
17
17
  onViewOnlyFeatureClick?: (feature: Feature<Geometry>[], isShiftClick?: boolean) => void;
18
18
  onNoFeatureClick?: () => void;
19
+ /** Called after the map handled Escape in edit or draw mode */
20
+ onEscape?: () => void;
19
21
  boxSelect?: BoxSelect;
20
22
  }
21
23
  /**
@@ -16,5 +16,6 @@ export interface OpenLayersLayerProps extends LayerFoundation {
16
16
  onClickFeature?: (event?: FeatureEvent) => void;
17
17
  onHoverFeature?: (event: FeatureEvent) => void;
18
18
  tileServerSettings?: TileServerSettings;
19
+ extentRatio?: number;
19
20
  }
20
21
  export declare const OpenLayersLayer: (layerProps: OpenLayersLayerProps) => React.ReactElement | null;
@@ -13,6 +13,7 @@ interface TimeawareImageSourceWMSLayerProps {
13
13
  onLayerReady?: (layerId: string) => void;
14
14
  onLayerError?: (layerId: string, message: string) => void;
15
15
  debugMode?: boolean;
16
+ extentRatio?: number;
16
17
  }
17
18
  export declare const TimeawareImageSourceWMSLayer: React.FC<TimeawareImageSourceWMSLayerProps>;
18
19
  export {};
@@ -3,7 +3,6 @@ import type { LayerFoundation } from '@opengeoweb/webmap';
3
3
  export interface WMTSLayerProps {
4
4
  getCapsURL: string;
5
5
  layerName: string;
6
- tileMatrixSet: string;
7
6
  layerOptions: ConstructorParameters<typeof TileLayer>[0];
8
7
  layerProps?: LayerFoundation;
9
8
  }
@@ -1 +1,2 @@
1
+ export declare const createWMTSCapabilities: (codes: string[]) => string;
1
2
  export declare const fakeWMTSLayerApiHandlers: import("msw").HttpHandler[];
@@ -31,9 +31,11 @@ declare class TimeAwareImageWrapper extends ImageWrapper {
31
31
  private _resolvers;
32
32
  private _styleName;
33
33
  private _layerName;
34
+ private _extentRatio;
34
35
  private _compositeImageKey;
35
36
  private _compositeImage;
36
37
  constructor(extent: Extent, resolution: number, pixelRatio: number);
38
+ setExtentRatio(extentRatio: number): void;
37
39
  getWMSGetMapRequestURL(extentToLoad: Extent, resolutionToLoad: number, __pixelRatio: number, projection: Projection | null, getMapUrl: string | null, params: Record<string, string>, layerName: string | null, styleName: string, dimProps: Record<string, string>): TimeAwareGeoreferencedImageSrc;
38
40
  getAlternativeImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection, getMapUrl: string, params: Record<string, string>, layerName: string, styleName: string, dimsProps: Record<string, string>): TimeAwareGeoreferencedImage | false;
39
41
  hasImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection, getMapUrl: string, params: Record<string, string>, layerName: string, styleName: string, dimsProps: Record<string, string>): TimeAwareGeoreferencedImage | false;
@@ -14,6 +14,7 @@ interface TimeawareImageSourceOptions {
14
14
  styleName?: string | undefined;
15
15
  timeStampsToPrefetch?: string[];
16
16
  visible?: boolean;
17
+ extentRatio?: number;
17
18
  }
18
19
  export declare class TimeawareImageSource extends ImageSource {
19
20
  private _wmsUrl;
@@ -39,7 +40,8 @@ export declare class TimeawareImageSource extends ImageSource {
39
40
  private throttledImageLoad;
40
41
  private _layerId;
41
42
  private _failedImageRetryTimer;
42
- constructor({ wmsUrl, timeStampsToPrefetch, layerName, layerId, styleName, dimProps, params, visible, }: TimeawareImageSourceOptions);
43
+ private _extentRatio;
44
+ constructor({ wmsUrl, timeStampsToPrefetch, layerName, layerId, styleName, dimProps, params, visible, extentRatio, }: TimeawareImageSourceOptions);
43
45
  private _conditionalPrefetch;
44
46
  private _loadImagery;
45
47
  private prefetch;
@@ -13,4 +13,31 @@ export declare const initializeOpenLayersProjections: () => void;
13
13
  * @returns
14
14
  */
15
15
  export declare const selectPreferredWMSProjection: (viewSrs: string, layerProps: LayerProps | null) => string;
16
+ interface WMTSCapabilitiesContents {
17
+ Contents?: {
18
+ Layer?: {
19
+ Identifier: string;
20
+ TileMatrixSetLink?: {
21
+ TileMatrixSet: string;
22
+ }[];
23
+ }[];
24
+ TileMatrixSet?: {
25
+ Identifier: string;
26
+ SupportedCRS?: string;
27
+ TileMatrix?: unknown[];
28
+ }[];
29
+ };
30
+ }
31
+ /**
32
+ * Returns the identifier of a linked tile matrix set whose CRS matches the view SRS.
33
+ * The view SRS is preferred; if it has no match, configured WMProj4Defs are checked
34
+ * in order. Matrix sets without a known CRS or tiles are ignored.
35
+ *
36
+ * @param capabilities WMTS capabilities to search.
37
+ * @param layerName Identifier of the layer to search.
38
+ * @param viewSrs Projection code of the current map view.
39
+ * @returns The matching tile matrix set identifier, or null if no match is available.
40
+ */
41
+ export declare const selectPreferredWMTSTileMatrixSet: (capabilities: WMTSCapabilitiesContents | null, layerName: string, viewSrs: string | undefined) => string | null;
16
42
  export declare const useProjection: () => string | undefined;
43
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap-react",
3
- "version": "20.1.0",
3
+ "version": "20.2.0-nightly-20261021",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,9 +20,9 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/webmap": "20.1.0",
24
- "@opengeoweb/theme": "20.1.0",
25
- "@opengeoweb/shared": "20.1.0",
23
+ "@opengeoweb/webmap": "20.2.0-nightly-20261021",
24
+ "@opengeoweb/theme": "20.2.0-nightly-20261021",
25
+ "@opengeoweb/shared": "20.2.0-nightly-20261021",
26
26
  "lodash": "^4.18.1",
27
27
  "ol": "^10.4.0",
28
28
  "proj4": "^2.9.2",