@opengeoweb/webmap-react 21.2.0 → 21.3.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 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, useEffectEvent } from 'react';
4
4
  import { memoize, range, without, isEqual, throttle, debounce, cloneDeep } from 'lodash';
5
- import { equals, containsExtent as containsExtent$1, buffer, boundingExtent, containsCoordinate, getCenter } from 'ol/extent';
5
+ import { equals, containsExtent as containsExtent$1, buffer, boundingExtent, containsCoordinate, getIntersection, isEmpty, wrapAndSliceX, createEmpty, extend, 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';
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
18
18
  import { useQuery, queryOptions } from '@tanstack/react-query';
19
19
  import { toLonLat, fromLonLat, get, equivalent, transformExtent, transform } from 'ol/proj';
20
20
  import { getDistance, getLength } from 'ol/sphere.js';
21
- import { Point, MultiPoint, Polygon, LineString } from 'ol/geom';
21
+ import { Point, LineString, MultiPoint, Polygon } from 'ol/geom';
22
22
  import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
23
23
  import Box$1 from '@mui/material/Box';
24
24
  import Typography$1 from '@mui/material/Typography';
@@ -32,7 +32,7 @@ import { equals as equals$1, closestOnSegment } from 'ol/coordinate';
32
32
  import { noModifierKeys, never, platformModifierKeyOnly, always } from 'ol/events/condition';
33
33
  import Modify from 'ol/interaction/Modify';
34
34
  import Style$1, { createDefaultStyle } from 'ol/style/Style';
35
- import GeoJSON from 'ol/format/GeoJSON';
35
+ import OlGeoJSON from 'ol/format/GeoJSON';
36
36
  import Translate from 'ol/interaction/Translate';
37
37
  import { lineSplit, cleanCoords, featureCollection, round, difference, bbox, feature, simplify, booleanPointInPolygon, intersect, polygonToLine, booleanClockwise, rewind, toWgs84, toMercator, coordEach } from '@turf/turf';
38
38
  import proj4 from 'proj4';
@@ -114,7 +114,8 @@ var en = {
114
114
  "clock-animation-options": "Animation options",
115
115
  "webmap-react-show-layer-legend": "Show layer legend",
116
116
  "webmap-react-show-layer": "Show layer in legend",
117
- "webmap-react-hide-layer": "Hide layer in legend"
117
+ "webmap-react-hide-layer": "Hide layer in legend",
118
+ "webmap-react-map-draw-help-tooltip": "Click to draw"
118
119
  };
119
120
  var fi = {
120
121
  "webmap-react-event": "tapahtuma:",
@@ -178,7 +179,8 @@ var fi = {
178
179
  "clock-animation-options": "Animoinnin asetukset",
179
180
  "webmap-react-show-layer-legend": "Näytä karttatason selite",
180
181
  "webmap-react-show-layer": "Näytä karttataso selitteessä",
181
- "webmap-react-hide-layer": "Piilota karttataso selitteestä"
182
+ "webmap-react-hide-layer": "Piilota karttataso selitteestä",
183
+ "webmap-react-map-draw-help-tooltip": "Piirrä napsauttamalla"
182
184
  };
183
185
  var no = {
184
186
  "webmap-react-event": "hendelse:",
@@ -234,7 +236,8 @@ var no = {
234
236
  "clock-animation-options": "Animasjonsinnstillinger",
235
237
  "webmap-react-show-layer-legend": "Vis",
236
238
  "webmap-react-show-layer": "Vis laget i tegnforklaringen",
237
- "webmap-react-hide-layer": "Skjul laget i tegnforklaringen"
239
+ "webmap-react-hide-layer": "Skjul laget i tegnforklaringen",
240
+ "webmap-react-map-draw-help-tooltip": "Klikk for å tegne"
238
241
  };
239
242
  var nl = {
240
243
  "webmap-react-event": "event:",
@@ -299,7 +302,8 @@ var nl = {
299
302
  "clock-animation-options": "Animatie opties",
300
303
  "webmap-react-show-layer-legend": "Toon laag in legenda",
301
304
  "webmap-react-show-layer": "Toon laag in legenda",
302
- "webmap-react-hide-layer": "Verberg laag in legenda"
305
+ "webmap-react-hide-layer": "Verberg laag in legenda",
306
+ "webmap-react-map-draw-help-tooltip": "Klik om te tekenen"
303
307
  };
304
308
  var webmapReactTranslations = {
305
309
  en: en,
@@ -878,7 +882,9 @@ var timeSpanToTimeList = function timeSpanToTimeList(timespan) {
878
882
  var makeTimeList = memoize(timeSpanToTimeList);
879
883
 
880
884
  var openLayersGetMapImageStore = new WMImageStore(NUM_IMAGES_TO_CACHE, {
881
- id: 'ol'
885
+ id: 'ol',
886
+ // Let playback consume a completed frame before it becomes stale again.
887
+ zeroMaxAgeGraceSeconds: 2
882
888
  });
883
889
  var clearImageCacheForAllMaps = function clearImageCacheForAllMaps() {
884
890
  openLayersGetMapImageStore.clear();
@@ -931,7 +937,8 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
931
937
  function TimeAwareImageWrapper(extent, resolution, pixelRatio) {
932
938
  var _this;
933
939
  _classCallCheck(this, TimeAwareImageWrapper);
934
- _this = _callSuper(this, TimeAwareImageWrapper, [extent, resolution, pixelRatio, ImageState.IDLE]);
940
+ // GetMap requests use pixel ratio 1, including on HiDPI displays.
941
+ _this = _callSuper(this, TimeAwareImageWrapper, [extent, resolution, 1, ImageState.IDLE]);
935
942
  _this._paramsToLoad = {};
936
943
  _this._dimPropsToLoad = {};
937
944
  _this._getMapUrl = null;
@@ -1112,13 +1119,17 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
1112
1119
  isLoaded: imageEl.isLoaded(),
1113
1120
  isLoadedWithoutErrors: imageEl.isLoadedWithoutErrors(),
1114
1121
  hasError: imageEl.hasError(),
1115
- isLoading: imageEl.isLoading()
1122
+ isLoading: imageEl.isLoading(),
1123
+ hasCompletedImage: imageEl._loadedAtTime !== undefined
1116
1124
  };
1117
1125
  }
1118
1126
  var completeImages = images;
1127
+ var hasCompletedImage = completeImages.every(function (image) {
1128
+ return image._loadedAtTime !== undefined && !image.hasError();
1129
+ });
1119
1130
  if (!completeImages.every(function (image) {
1120
1131
  return image.isLoaded();
1121
- })) {
1132
+ }) && !hasCompletedImage) {
1122
1133
  return false;
1123
1134
  }
1124
1135
  var image = this.createCompositeImage(completeImages, requests);
@@ -1131,7 +1142,9 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
1131
1142
  return request.extent;
1132
1143
  })),
1133
1144
  resolution: requests[0].resolution,
1134
- isLoaded: true,
1145
+ isLoaded: completeImages.every(function (loadedImage) {
1146
+ return loadedImage.isLoaded();
1147
+ }),
1135
1148
  isLoadedWithoutErrors: completeImages.every(function (loadedImage) {
1136
1149
  return loadedImage.isLoadedWithoutErrors();
1137
1150
  }),
@@ -1140,7 +1153,8 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
1140
1153
  }),
1141
1154
  isLoading: completeImages.some(function (loadedImage) {
1142
1155
  return loadedImage.isLoading();
1143
- })
1156
+ }),
1157
+ hasCompletedImage: hasCompletedImage
1144
1158
  };
1145
1159
  }
1146
1160
  }, {
@@ -1629,6 +1643,11 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
1629
1643
  this._lastRequestedPixelRatio = pixelRatio;
1630
1644
  this._lastRequestedProjection = projection;
1631
1645
  this.throttledImageLoad();
1646
+ if (hasExactImage && !hasExactImage.isLoaded && !hasExactImage.hasError && hasExactImage.hasCompletedImage && requestedImageHasWantedExtent) {
1647
+ // Keep the decoded frame visible while its expired response is revalidated.
1648
+ this._imWrapperForAltImage.setGeoReferencedImage(hasExactImage);
1649
+ return this._imWrapperForAltImage;
1650
+ }
1632
1651
  // While we are loading, check if there is an alternative image available
1633
1652
  return this._getAltImageOrEmpty(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, requestDimProperties);
1634
1653
  }
@@ -6144,7 +6163,7 @@ var isDefaultMovable = function isDefaultMovable(feature) {
6144
6163
  return feature.get('isSelected') === true && feature.get('isReadonly') !== true;
6145
6164
  };
6146
6165
  var toMovedFeatures = function toMovedFeatures(olFeatures, projection) {
6147
- var formatter = new GeoJSON({
6166
+ var formatter = new OlGeoJSON({
6148
6167
  featureProjection: projection
6149
6168
  });
6150
6169
  return olFeatures.reduce(function (acc, olFeature) {
@@ -6271,6 +6290,68 @@ var FEATURE_DRAW_STROKE_COLOR = '#186DFF';
6271
6290
  var FEATURE_DRAW_SECONDARY_FILL_COLOR = '#6e1e91';
6272
6291
  var FEATURE_DRAW_SECONDARY_STROKE_COLOR = '#6e1e91';
6273
6292
 
6293
+ var color = '#ff005c';
6294
+ var vertexImage = new Circle({
6295
+ radius: 4,
6296
+ fill: new Fill({
6297
+ color: '#fff'
6298
+ }),
6299
+ stroke: new Stroke({
6300
+ color: color,
6301
+ width: 1.5
6302
+ })
6303
+ });
6304
+ var pointerStyle = new Style({
6305
+ image: vertexImage
6306
+ });
6307
+ var getVertexLetter = function getVertexLetter(index) {
6308
+ var letter = '';
6309
+ for (var value = index + 1; value > 0; value = Math.floor((value - 1) / 26)) {
6310
+ letter = String.fromCharCode(65 + (value - 1) % 26) + letter;
6311
+ }
6312
+ return letter;
6313
+ };
6314
+ /** The sketch ends with a moving pointer coordinate, which is not a placed vertex. */
6315
+ var letteredLineStyle = function letteredLineStyle(feature) {
6316
+ var sketch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6317
+ var geometry = feature.getGeometry();
6318
+ if (sketch && geometry instanceof Point) {
6319
+ return [pointerStyle];
6320
+ }
6321
+ if (!(geometry instanceof LineString) && !(geometry instanceof Point)) {
6322
+ return [];
6323
+ }
6324
+ var coordinates = geometry instanceof Point ? [geometry.getCoordinates()] : geometry.getCoordinates();
6325
+ var vertices = sketch ? coordinates.slice(0, -1) : coordinates;
6326
+ return [].concat(_toConsumableArray(geometry instanceof LineString ? [new Style({
6327
+ stroke: new Stroke({
6328
+ color: color,
6329
+ width: 2,
6330
+ lineDash: sketch ? [10, 10] : undefined
6331
+ })
6332
+ })] : []), _toConsumableArray(vertices.map(function (coordinate, index) {
6333
+ return new Style({
6334
+ geometry: new Point(coordinate),
6335
+ image: vertexImage,
6336
+ text: new Text({
6337
+ text: getVertexLetter(index),
6338
+ font: '14px Roboto, sans-serif',
6339
+ offsetY: -13,
6340
+ fill: new Fill({
6341
+ color: color
6342
+ }),
6343
+ stroke: new Stroke({
6344
+ color: '#fff',
6345
+ width: 2
6346
+ })
6347
+ })
6348
+ });
6349
+ })));
6350
+ };
6351
+ var letteredLineResultStyle = function letteredLineResultStyle(feature) {
6352
+ return letteredLineStyle(feature);
6353
+ };
6354
+
6274
6355
  var MapFeatureClass;
6275
6356
  (function (MapFeatureClass) {
6276
6357
  MapFeatureClass["MyLocation"] = "MyLocation";
@@ -7046,6 +7127,9 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
7046
7127
  return textLabelStyle(name);
7047
7128
  }
7048
7129
  }() : null;
7130
+ if (selectionType === 'lettered-line') {
7131
+ return letteredLineResultStyle(feature);
7132
+ }
7049
7133
  if (selectionType === 'smooth-line') {
7050
7134
  var _feature$getGeometry2;
7051
7135
  var geom = (_feature$getGeometry2 = feature.getGeometry) === null || _feature$getGeometry2 === void 0 ? void 0 : _feature$getGeometry2.call(feature);
@@ -8553,7 +8637,7 @@ var getDrawModeIdFromSelectionType = function getDrawModeIdFromSelectionType(sel
8553
8637
  * */
8554
8638
  initializeOpenLayersProjections();
8555
8639
  var setViewFromExtent = function setViewFromExtent(view, bbox) {
8556
- if (!bbox || !Number(bbox.left) || !isFinite(bbox.left) || isNaN(bbox.left)) {
8640
+ if (!bbox || ![bbox.left, bbox.bottom, bbox.right, bbox.top].every(Number.isFinite)) {
8557
8641
  view.setCenter([0, 0]);
8558
8642
  view.setZoom(1);
8559
8643
  return;
@@ -9295,6 +9379,7 @@ var WMSLayer = function WMSLayer(_ref) {
9295
9379
  }
9296
9380
  var layer = new ImageLayer({
9297
9381
  source: new ImageSource({
9382
+ projection: projection,
9298
9383
  loader: createLoader({
9299
9384
  url: url,
9300
9385
  params: {
@@ -9556,32 +9641,50 @@ var useSetIntervalWhenVisible = function useSetIntervalWhenVisible(autoUpdate, r
9556
9641
  }, [refetch, refetchIfTimeHasPassed, refetchInterval, shouldAutoFetch]);
9557
9642
  };
9558
9643
 
9559
- /* *
9560
- * Licensed under the Apache License, Version 2.0 (the "License");
9561
- * you may not use this file except in compliance with the License.
9562
- * You may obtain a copy of the License at
9563
- *
9564
- * http://www.apache.org/licenses/LICENSE-2.0
9565
- *
9566
- * Unless required by applicable law or agreed to in writing, software
9567
- * distributed under the License is distributed on an "AS IS" BASIS,
9568
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9569
- * See the License for the specific language governing permissions and
9570
- * limitations under the License.
9571
- *
9572
- * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
9573
- * Copyright 2025 - Finnish Meteorological Institute (FMI)
9574
- * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
9575
- * */
9576
9644
  initializeOpenLayersProjections();
9577
9645
  var getLayerExtentForProjection = function getLayerExtentForProjection(wmLayer, projectionCode) {
9646
+ var _crs$bbox, _extent;
9578
9647
  var crs = wmLayer.getCRSByName(projectionCode);
9579
- if (crs !== null && crs !== void 0 && crs.bbox) {
9580
- return crs.bbox.getExtent();
9648
+ var projection = get(projectionCode);
9649
+ var projectionExtent = projection === null || projection === void 0 ? void 0 : projection.getExtent();
9650
+ var extent = crs === null || crs === void 0 || (_crs$bbox = crs.bbox) === null || _crs$bbox === void 0 ? void 0 : _crs$bbox.getExtent();
9651
+ if (extent && projectionExtent) {
9652
+ extent = getIntersection(extent, projectionExtent);
9653
+ }
9654
+ if ((_extent = extent) !== null && _extent !== void 0 && _extent.every(Number.isFinite) && !isEmpty(extent)) {
9655
+ return extent;
9581
9656
  }
9582
9657
  var geo = wmLayer.geographicBoundingBox;
9583
9658
  if (geo) {
9584
- return transformExtent([parseFloat(geo.west), parseFloat(geo.south), parseFloat(geo.east), parseFloat(geo.north)], WMJSMAP_LONLAT_EPSGCODE, projectionCode);
9659
+ var west = parseFloat(geo.west);
9660
+ var east = parseFloat(geo.east);
9661
+ var geographicExtent = [west, parseFloat(geo.south), east < west ? east + 360 : east, parseFloat(geo.north)];
9662
+ if (geographicExtent.every(Number.isFinite) && !isEmpty(geographicExtent)) {
9663
+ // Split wrapped longitudes so clipping does not discard either side.
9664
+ var sourceExtents = wrapAndSliceX(geographicExtent, get(WMJSMAP_LONLAT_EPSGCODE));
9665
+ var worldExtent = projection === null || projection === void 0 ? void 0 : projection.getWorldExtent();
9666
+ extent = createEmpty();
9667
+ var _iterator = _createForOfIteratorHelper(sourceExtents),
9668
+ _step;
9669
+ try {
9670
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
9671
+ var sourceExtent = _step.value;
9672
+ // Clip before transforming: poles are outside Mercator's supported area.
9673
+ var clippedSource = worldExtent ? getIntersection(sourceExtent, worldExtent) : sourceExtent;
9674
+ if (!isEmpty(clippedSource)) {
9675
+ var projectedExtent = transformExtent(clippedSource, WMJSMAP_LONLAT_EPSGCODE, projectionCode);
9676
+ extend(extent, projectionExtent ? getIntersection(projectedExtent, projectionExtent) : projectedExtent);
9677
+ }
9678
+ }
9679
+ } catch (err) {
9680
+ _iterator.e(err);
9681
+ } finally {
9682
+ _iterator.f();
9683
+ }
9684
+ if (extent.every(Number.isFinite) && !isEmpty(extent)) {
9685
+ return extent;
9686
+ }
9687
+ }
9585
9688
  }
9586
9689
  return undefined;
9587
9690
  };
@@ -10237,7 +10340,7 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
10237
10340
  if (projection && featureCollection) {
10238
10341
  featureCollectionRef.current = featureCollection;
10239
10342
  projectionRef.current = projection;
10240
- var formatter = new GeoJSON({
10343
+ var formatter = new OlGeoJSON({
10241
10344
  featureProjection: projection
10242
10345
  });
10243
10346
  features.current = formatter.readFeatures(featureCollection);
@@ -12822,6 +12925,105 @@ var OpenLayersZoomControl = function OpenLayersZoomControl(_ref) {
12822
12925
  });
12823
12926
  };
12824
12927
 
12928
+ /** Draw replacement points or paths, staying active without entering vertex-edit mode. */
12929
+ var addReplaceModeDraw = function addReplaceModeDraw(map, formatter, onComplete, tooltipMsg) {
12930
+ var pointerInside = true;
12931
+ var draw = new Draw({
12932
+ type: 'LineString',
12933
+ minPoints: 1,
12934
+ style: function style(feature) {
12935
+ var _feature$getGeometry;
12936
+ return !pointerInside && ((_feature$getGeometry = feature.getGeometry()) === null || _feature$getGeometry === void 0 ? void 0 : _feature$getGeometry.getType()) === 'Point' ? [] : letteredLineStyle(feature, true);
12937
+ }
12938
+ });
12939
+ var tooltipElement = document.createElement('div');
12940
+ tooltipElement.textContent = tooltipMsg;
12941
+ tooltipElement.setAttribute('data-testid', 'map-draw-help-overlay');
12942
+ Object.assign(tooltipElement.style, {
12943
+ padding: '8px 12px',
12944
+ backgroundColor: '#111',
12945
+ color: '#eee',
12946
+ borderRadius: '3px',
12947
+ pointerEvents: 'none',
12948
+ whiteSpace: 'nowrap'
12949
+ });
12950
+ var tooltip = new Overlay({
12951
+ element: tooltipElement,
12952
+ offset: [40, 60],
12953
+ positioning: 'bottom-center',
12954
+ stopEvent: false,
12955
+ insertFirst: false
12956
+ });
12957
+ map.addOverlay(tooltip);
12958
+ var sketchInProgress = false;
12959
+ var hideTooltip = function hideTooltip() {
12960
+ return tooltip.setPosition(undefined);
12961
+ };
12962
+ var pointerListener = map.on('pointermove', function (event) {
12963
+ if (!pointerInside) {
12964
+ pointerInside = true;
12965
+ draw.getOverlay().changed();
12966
+ }
12967
+ tooltip.setPosition(!event.dragging && !sketchInProgress ? event.coordinate : undefined);
12968
+ });
12969
+ var viewport = map.getViewport();
12970
+ var onPointerLeave = function onPointerLeave() {
12971
+ hideTooltip();
12972
+ pointerInside = false;
12973
+ draw.getOverlay().changed();
12974
+ };
12975
+ viewport.addEventListener('pointerleave', onPointerLeave);
12976
+ draw.on('drawstart', function () {
12977
+ hideTooltip();
12978
+ sketchInProgress = true;
12979
+ });
12980
+ draw.on('drawabort', function () {
12981
+ sketchInProgress = false;
12982
+ });
12983
+ draw.on('drawend', function (_ref) {
12984
+ var feature = _ref.feature;
12985
+ sketchInProgress = false;
12986
+ var result = formatter.writeFeatureObject(feature);
12987
+ var coordinates = roundCoordinates(result.geometry.coordinates).filter(function (point, index, points) {
12988
+ return index === 0 || point[0] !== points[index - 1][0] || point[1] !== points[index - 1][1];
12989
+ });
12990
+ if (coordinates.length === 0) {
12991
+ return;
12992
+ }
12993
+ var geometry = coordinates.length === 1 ? {
12994
+ type: 'Point',
12995
+ coordinates: coordinates[0]
12996
+ } : {
12997
+ type: 'LineString',
12998
+ coordinates: coordinates
12999
+ };
13000
+ onComplete(_objectSpread2(_objectSpread2({}, result), {}, {
13001
+ geometry: geometry
13002
+ }));
13003
+ });
13004
+ var finishOnEscape = function finishOnEscape(event) {
13005
+ if (event.key !== 'Escape' || !sketchInProgress) {
13006
+ return;
13007
+ }
13008
+ event.preventDefault();
13009
+ // OL drops the trailing pointer coordinate in finishDrawing().
13010
+ draw.finishDrawing();
13011
+ };
13012
+ map.addInteraction(draw);
13013
+ window.addEventListener('keydown', finishOnEscape);
13014
+ return function () {
13015
+ window.removeEventListener('keydown', finishOnEscape);
13016
+ viewport.removeEventListener('pointerleave', onPointerLeave);
13017
+ unByKey(pointerListener);
13018
+ map.removeOverlay(tooltip);
13019
+ tooltipElement.remove();
13020
+ tooltip.dispose();
13021
+ map.removeInteraction(draw);
13022
+ draw.getOverlay().clearRenderer();
13023
+ draw.dispose();
13024
+ };
13025
+ };
13026
+
12825
13027
  /* *
12826
13028
  * Licensed under the Apache License, Version 2.0 (the "License");
12827
13029
  * you may not use this file except in compliance with the License.
@@ -12961,6 +13163,7 @@ var selectionTypeToDrawModeValue = function selectionTypeToDrawModeValue(selecti
12961
13163
  * is not really a requirement for any production workflows, this functionality was left as is.
12962
13164
  */
12963
13165
  var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
13166
+ var _geojson$features$sel;
12964
13167
  var isInEditMode = _ref.isInEditMode,
12965
13168
  drawMode = _ref.drawMode,
12966
13169
  viewOnlyStyle = _ref.viewOnlyStyle,
@@ -12972,29 +13175,52 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
12972
13175
  onViewOnlyFeatureClick = _ref.onViewOnlyFeatureClick,
12973
13176
  onNoFeatureClick = _ref.onNoFeatureClick,
12974
13177
  onEscape = _ref.onEscape,
12975
- boxSelect = _ref.boxSelect;
13178
+ boxSelect = _ref.boxSelect,
13179
+ _ref$replaceMode = _ref.replaceMode,
13180
+ replaceMode = _ref$replaceMode === void 0 ? false : _ref$replaceMode;
12976
13181
  var _React$useContext = React.useContext(MapContext),
12977
13182
  map = _React$useContext.map;
12978
13183
  var projection = useProjection();
13184
+ var _useWebmapReactTransl = useWebmapReactTranslation(),
13185
+ t = _useWebmapReactTransl.t;
13186
+ var tooltipMsg = t('webmap-react-map-draw-help-tooltip');
12979
13187
  var exitDrawModeCallbackRef = React.useRef(exitDrawModeCallback);
12980
13188
  var updateGeojsonRef = React.useRef(updateGeojson);
13189
+ var geojsonRef = React.useRef(geojson);
12981
13190
  var onViewOnlyFeatureClickRef = React.useRef(onViewOnlyFeatureClick);
12982
13191
  var onNoFeatureClickRef = React.useRef(onNoFeatureClick);
12983
13192
  var onEscapeRef = React.useRef(onEscape);
12984
13193
  var boxSelectRef = React.useRef(boxSelect);
12985
13194
  exitDrawModeCallbackRef.current = exitDrawModeCallback;
12986
13195
  updateGeojsonRef.current = updateGeojson;
13196
+ geojsonRef.current = geojson;
12987
13197
  onViewOnlyFeatureClickRef.current = onViewOnlyFeatureClick;
12988
13198
  onNoFeatureClickRef.current = onNoFeatureClick;
12989
13199
  onEscapeRef.current = onEscape;
12990
13200
  boxSelectRef.current = boxSelect;
13201
+ var selectionType = geojson === null || geojson === void 0 || (_geojson$features$sel = geojson.features[selectedFeatureIndex]) === null || _geojson$features$sel === void 0 || (_geojson$features$sel = _geojson$features$sel.properties) === null || _geojson$features$sel === void 0 ? void 0 : _geojson$features$sel.selectionType;
13202
+ var actualDrawMode = drawMode || selectionTypeToDrawModeValue(selectionType);
13203
+ var isReplaceDrawing = replaceMode && actualDrawMode === DRAWMODE.LINESTRING;
13204
+ React.useEffect(function () {
13205
+ if (!map || !isInEditMode || !isReplaceDrawing) {
13206
+ return undefined;
13207
+ }
13208
+ return addReplaceModeDraw(map, new OlGeoJSON({
13209
+ featureProjection: projection
13210
+ }), function (feature) {
13211
+ var _updateGeojsonRef$cur, _geojsonRef$current$f;
13212
+ (_updateGeojsonRef$cur = updateGeojsonRef.current) === null || _updateGeojsonRef$cur === void 0 || _updateGeojsonRef$cur.call(updateGeojsonRef, {
13213
+ type: 'FeatureCollection',
13214
+ features: [_objectSpread2(_objectSpread2({}, feature), {}, {
13215
+ properties: _objectSpread2({}, (_geojsonRef$current$f = geojsonRef.current.features[0]) === null || _geojsonRef$current$f === void 0 ? void 0 : _geojsonRef$current$f.properties)
13216
+ })]
13217
+ }, NEW_FEATURE_CREATED);
13218
+ }, tooltipMsg);
13219
+ }, [map, isInEditMode, isReplaceDrawing, projection, tooltipMsg]);
12991
13220
  React.useEffect(function () {
12992
- var _geojson$features$sel;
12993
- if (!map || !isInEditMode) {
13221
+ if (!map || !isInEditMode || isReplaceDrawing) {
12994
13222
  return function () {};
12995
13223
  }
12996
- var selectionType = geojson === null || geojson === void 0 || (_geojson$features$sel = geojson.features[selectedFeatureIndex]) === null || _geojson$features$sel === void 0 || (_geojson$features$sel = _geojson$features$sel.properties) === null || _geojson$features$sel === void 0 ? void 0 : _geojson$features$sel.selectionType;
12997
- var actualDrawMode = drawMode || selectionTypeToDrawModeValue(selectionType);
12998
13224
  if (actualDrawMode === DRAWMODE.SPLIT) {
12999
13225
  var viewport = map.getViewport();
13000
13226
  if (viewport !== null && viewport !== void 0 && viewport.style) {
@@ -13005,7 +13231,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
13005
13231
  var drawOperation = createDrawOperation(actualDrawMode, selectedFeature === null || selectedFeature === void 0 ? void 0 : selectedFeature.geometry.type);
13006
13232
  var drawStyle = drawStyles[actualDrawMode];
13007
13233
  var modifyStyle = modifyStyles[actualDrawMode];
13008
- var geojsonFormatter = new GeoJSON({
13234
+ var geojsonFormatter = new OlGeoJSON({
13009
13235
  featureProjection: projection
13010
13236
  });
13011
13237
  var allFeatures = geojson ? geojsonFormatter.readFeatures(geojson) : [];
@@ -13072,7 +13298,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
13072
13298
  map.on('singleclick', handleSingleClick);
13073
13299
  }
13074
13300
  var updateFeature = function updateFeature(feature) {
13075
- var _feature$getGeometry, _updateGeojsonRef$cur;
13301
+ var _feature$getGeometry, _updateGeojsonRef$cur2;
13076
13302
  // Convert Circle to Polygon for GeoJSON serialization
13077
13303
  if (((_feature$getGeometry = feature.getGeometry()) === null || _feature$getGeometry === void 0 ? void 0 : _feature$getGeometry.getType()) === 'Circle') {
13078
13304
  var geometry = fromCircle(feature.getGeometry(), 64);
@@ -13087,7 +13313,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
13087
13313
  var newGeoJson = _objectSpread2(_objectSpread2({}, geojson), {}, {
13088
13314
  features: [].concat(_toConsumableArray(geojson.features.slice(0, selectedFeatureIndex)), [obj], _toConsumableArray(geojson.features.slice(selectedFeatureIndex + 1)))
13089
13315
  });
13090
- (_updateGeojsonRef$cur = updateGeojsonRef.current) === null || _updateGeojsonRef$cur === void 0 || _updateGeojsonRef$cur.call(updateGeojsonRef, newGeoJson, NEW_FEATURE_CREATED);
13316
+ (_updateGeojsonRef$cur2 = updateGeojsonRef.current) === null || _updateGeojsonRef$cur2 === void 0 || _updateGeojsonRef$cur2.call(updateGeojsonRef, newGeoJson, NEW_FEATURE_CREATED);
13091
13317
  };
13092
13318
  var splitSelectedPolygon = function splitSelectedPolygon(splitFeature) {
13093
13319
  var isValidSplit = selectedFeatureHasGeometry && selectedFeature.geometry.type !== 'Point';
@@ -13095,7 +13321,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
13095
13321
  return;
13096
13322
  }
13097
13323
  // GeoJsons are always treated as latlon, therefore using EPSG:4326 as transformer does not do anything except translating the object.
13098
- var geojsonFormatterNoTransform = new GeoJSON({
13324
+ var geojsonFormatterNoTransform = new OlGeoJSON({
13099
13325
  featureProjection: 'EPSG:4326'
13100
13326
  });
13101
13327
  var isLineSplit = selectedFeature.geometry.type === 'LineString';
@@ -13676,7 +13902,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
13676
13902
  // re-run when parents pass inline arrows. Re-running mid-sketch would
13677
13903
  // tear down the Draw interaction and lose the in-progress polygon.
13678
13904
  // eslint-disable-next-line react-hooks/exhaustive-deps
13679
- }, [map, isInEditMode, geojson, projection, viewOnlyStyle, selectedFeatureIndex, selectedFeatureIndices, boxSelect === null || boxSelect === void 0 ? void 0 : boxSelect.active, drawMode]);
13905
+ }, [map, isInEditMode, geojson, projection, viewOnlyStyle, selectedFeatureIndex, selectedFeatureIndices, boxSelect === null || boxSelect === void 0 ? void 0 : boxSelect.active, actualDrawMode, isReplaceDrawing]);
13680
13906
  return null;
13681
13907
  };
13682
13908
 
@@ -16054,4 +16280,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
16054
16280
  return updateObject;
16055
16281
  };
16056
16282
 
16057
- export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, CONSTRAINED_SELECTION_TYPES, COORDINATE_DECIMALS, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EDR_PLAIN_NUMBERS_STYLE, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, POINTER_CLICK_TOLERANCE_PX, SELECTED_FEATURE_COLOR, SELECTED_POINT_HALO_STYLE, STAC_ASSET_STYLE_PREFIX, STAC_ITEM_PAGE_LIMIT, STAC_ITEM_SEARCH_FIELDS_CONFORMANCE, STAC_TEMPORAL_STEP_SAMPLE_LIMIT, SelectField, StacLegendCanvas, StoryLayoutGrid, TRANSIENT_FEATURE_PROPERTIES, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, applyStacNodataMask, asNewFeature, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSharedVertexDrawOptions, calculateBoxSelection, calculateNewSelection, catmullRomSpline, clearImageCacheForAllMaps, clearStacFeatureInfoCache, colorMaps, connectSharedVertices, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createModifyFeatures, createMoveFeatures, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSplit, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, edrCollectionsToServiceLayers, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, featureMultiPoint, featurePoint, featurePolygon, fetchEDRArea, fetchEDRCollectionDetails, fetchEDRCube, fetchEDRJson, fetchEDRParameter, fetchEDRServiceLayers, fetchStacCatalogCollections, fetchStacCatalogRoot, fetchStacCollection, fetchStacItem, fetchStacItems, fetchStacItemsPage, fetchStacItemsWithPagination, fillOptions, firSelectionType, formatEDRValue, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getAffectedIndices, getBoxRotateHandlePoints, getBoxSelectPreviewStyle, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getEDRUnitLabel, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerExtentForProjection, getLayerStyles, getLayerUpdateInfo, getLegendClass, getOlFeatureKey, getProj4, getRendersAsStyles, getStacAssetKeyFromStyle, getStacAssetStyles, getStacCollectionStyles, getStacFeatureInfoSources, getStacFrameItemsToRender, getStacGrayscaleRange, getStacGrayscaleSampleRange, getStacItemLookupWindowForTimes, getStacItemSearchUrl, getStacItemsUrl, getStacLegendMetadata, getStacLegendWidth, getStacRasterBands, getTimeDimension, getToolIcon, getWMSStyleName, handleResponse, hasEditableVertices, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isBrowserReadableGeoTIFFAsset, isClickFromDrag, isDefaultModifiable, isDefaultMovable, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isGeoTIFFAsset, isPointFeatureCollection, isStacFeatureInfoReady, joinUrlParams, keepIdentityOnFirstSplitFeature, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStylePlainNumber, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeStacLegendModel, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyHandleStyle$1 as modifyHandleStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, normalizeEDRLabel, opacityOptions, openLayersGetMapImageStore, polygonCleanDangling, polygonCleanDanglingCoords, polygonFeatureCollectionCleanDangling, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, readStacPointValue, registerStacFeatureInfoSource, removeFeatureProperties, removeOverlappingLines, removeTransientFeatureProperties, renderStacLegend, resolvePreferredStyleName$1 as resolvePreferredStyleName, resolveStacAssetKey, rewindGeometry, roundCoordinates, roundFeatureCoordinates, selectPreferredWMSProjection, selectPreferredWMTSTileMatrixSet, setMapCenter, setStacFeatureInfoReady, setViewFromExtent, setViewFromFeature, shouldEnterEditMode, shouldExitEditModeForMultiSelect, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, splitLine, splitPolygon, splitStyle, stacCatalogCollectionToLayerProps, stacColormapToOlStyle, stacGrayscaleOlStyle, stacNormalizedGrayscaleOlStyle, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, subscribeStacFeatureInfoSources, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, toMovedFeatures, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useModifyFeatures, useMoveFeatures, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCatalogRoot, useStacCollection, useStacItems, useStacOverviewItems, useStacTemporalStepItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
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 };
@@ -19,6 +19,7 @@ export interface OpenLayersMapDrawProps {
19
19
  /** Called after the map handled Escape in edit or draw mode */
20
20
  onEscape?: () => void;
21
21
  boxSelect?: BoxSelect;
22
+ replaceMode?: boolean;
22
23
  }
23
24
  /**
24
25
  * Integrates with OpenLayers Draw and Modify (+Snap) interactions, to implement feature drawing
@@ -0,0 +1,4 @@
1
+ import type { Map } from 'ol';
2
+ import type GeoJSONFormatter from 'ol/format/GeoJSON';
3
+ /** Draw replacement points or paths, staying active without entering vertex-edit mode. */
4
+ export declare const addReplaceModeDraw: (map: Map, formatter: GeoJSONFormatter, onComplete: (feature: GeoJSON.Feature<GeoJSON.LineString | GeoJSON.Point>) => void, tooltipMsg: string) => (() => void);
@@ -37,6 +37,8 @@ export interface DrawMode {
37
37
  title: string;
38
38
  isSelectable: boolean;
39
39
  selectionType: SelectionType;
40
+ /** Draw a replacement point or path and stay ready to draw, without vertex editing. */
41
+ replaceMode?: boolean;
40
42
  }
41
43
  export type ProjectFn = (feat: Feature<Polygon | MultiPolygon>) => Feature<Polygon | MultiPolygon>;
42
44
  export type UnprojectFn = (feat: Feature<Polygon | MultiPolygon>) => Feature<Polygon | MultiPolygon>;
@@ -14,3 +14,4 @@ export * from './OlStyles';
14
14
  export * from './OlColors';
15
15
  export * from './tools';
16
16
  export * from './layers';
17
+ export * from './styles/letteredLineStyle';
@@ -0,0 +1,6 @@
1
+ import type { FeatureLike } from 'ol/Feature';
2
+ import { Style } from 'ol/style';
3
+ export declare const getVertexLetter: (index: number) => string;
4
+ /** The sketch ends with a moving pointer coordinate, which is not a placed vertex. */
5
+ export declare const letteredLineStyle: (feature: FeatureLike, sketch?: boolean) => Style[];
6
+ export declare const letteredLineResultStyle: (feature: FeatureLike) => Style[];
@@ -18,6 +18,7 @@ interface TimeAwareGeoreferencedImage {
18
18
  hasError: boolean;
19
19
  isLoadedWithoutErrors: boolean;
20
20
  isLoading: boolean;
21
+ hasCompletedImage?: boolean;
21
22
  }
22
23
  type TimeAwareGeoreferencedImageRequest = TimeAwareGeoreferencedImageSrc;
23
24
  declare class TimeAwareImageWrapper extends ImageWrapper {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap-react",
3
- "version": "21.2.0",
3
+ "version": "21.3.0",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -20,16 +20,16 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@opengeoweb/webmap": "21.2.0",
24
- "@opengeoweb/theme": "21.2.0",
25
- "@opengeoweb/shared": "21.2.0",
23
+ "@opengeoweb/webmap": "21.3.0",
24
+ "@opengeoweb/theme": "21.3.0",
25
+ "@opengeoweb/shared": "21.3.0",
26
26
  "lodash": "^4.18.1",
27
27
  "ol": "^10.4.0",
28
28
  "geotiff": "^3.0.5",
29
29
  "proj4": "^2.9.2",
30
30
  "@turf/turf": "^7.1.0",
31
31
  "immer": "^10.0.3",
32
- "i18next": "^25.0.1",
32
+ "i18next": "^26.3.4",
33
33
  "@mui/material": "^9.0.1",
34
34
  "react-i18next": "^15.1.1",
35
35
  "@tanstack/react-query": "^5.85.5",