@opengeoweb/webmap-react 13.1.1 → 14.0.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/index.esm.js +244 -54
- package/package.json +4 -4
- package/src/lib/components/MapDrawTool/storyExamplesMapDrawTool.d.ts +1 -0
- package/src/lib/components/OpenLayers/OlStyles.d.ts +7 -1
- package/src/lib/components/OpenLayers/draw/OpenLayersMapDraw.stories.d.ts +1 -0
- package/src/lib/components/OpenLayers/draw/types.d.ts +2 -1
- package/src/lib/components/OpenLayers/types/WorkerQueue.d.ts +1 -1
- package/src/lib/components/OpenLayers/utils/TimeAwareImageWrapper.d.ts +2 -2
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.d.ts +3 -1
- package/src/lib/components/OpenLayers/utils/makeDimValuesToPrefetch.d.ts +1 -0
- package/src/lib/edr-layer-api/colormaps/edrOlLegendUtils.d.ts +6 -0
- package/src/lib/edr-layer-api/hooks.d.ts +3 -1
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WMImageStore, WMInvalidDateValues, getCorrectWMSDimName, WMJSDimension, webmapUtils, WMLayer, LayerType, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, WEBMAP_NAMESPACE, WMProj4Defs, privateWebMapUtils, tilesettings } from '@opengeoweb/webmap';
|
|
1
|
+
import { WMImageStore, WMImageStoreLoadType, WMInvalidDateValues, getCorrectWMSDimName, WMJSDimension, webmapUtils, WMLayer, LayerType, legendImageStore, WMImageEventType, getLegendGraphicURLForLayer, WEBMAP_NAMESPACE, WMProj4Defs, privateWebMapUtils, tilesettings } from '@opengeoweb/webmap';
|
|
2
2
|
export { WEBMAP_NAMESPACE, webmapTranslations } from '@opengeoweb/webmap';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { createContext, useMemo, useRef, useState, useEffect, useCallback, useContext, useLayoutEffect } from 'react';
|
|
@@ -17,8 +17,8 @@ import { useTranslation } from 'react-i18next';
|
|
|
17
17
|
import { Paper, Box, Typography, useTheme, Grid, TextField, FormControl, InputLabel, Select, MenuItem, Icon as Icon$2, FormLabel, Switch, styled, Slider } from '@mui/material';
|
|
18
18
|
import { useQuery } from '@tanstack/react-query';
|
|
19
19
|
import { Style, Icon as Icon$1, Circle, Stroke, Fill, Text } from 'ol/style';
|
|
20
|
-
import { Point, MultiPoint, Polygon } from 'ol/geom';
|
|
21
|
-
import { arrowUpPath, Home, Add, Minus, List, Delete, Edit, DrawRegion, DrawPolygon, Location, DrawFIRLand, ArrowUp, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath } from '@opengeoweb/theme';
|
|
20
|
+
import { Point, MultiPoint, LineString, Polygon } from 'ol/geom';
|
|
21
|
+
import { arrowUpPath, Home, Add, Minus, List, Delete, Edit, DrawRegion, DrawPolygon, Location, DrawFIRLand, ArrowUp, SandStorm, Equalizer, DimensionsElevation, Link, LinkOff, Info, DimensionsOther, DimensionsRefTime, DimensionsTime, locationPath } from '@opengeoweb/theme';
|
|
22
22
|
import { http, HttpResponse } from 'msw';
|
|
23
23
|
import proj4 from 'proj4';
|
|
24
24
|
import * as turf from '@turf/turf';
|
|
@@ -794,7 +794,8 @@ var WorkerQueue = /*#__PURE__*/function () {
|
|
|
794
794
|
// eslint-disable-next-line no-param-reassign
|
|
795
795
|
job.cancelled = true;
|
|
796
796
|
});
|
|
797
|
-
this.taskQueue =
|
|
797
|
+
this.taskQueue.length = 0;
|
|
798
|
+
this.tasksInProcess.length = 0;
|
|
798
799
|
}
|
|
799
800
|
}, {
|
|
800
801
|
key: "addJobs",
|
|
@@ -818,8 +819,8 @@ var WorkerQueue = /*#__PURE__*/function () {
|
|
|
818
819
|
}
|
|
819
820
|
this.tasksInProcess.push(job);
|
|
820
821
|
job.task().then(function (finalise) {
|
|
821
|
-
if (
|
|
822
|
-
finalise();
|
|
822
|
+
if (finalise) {
|
|
823
|
+
finalise(job.cancelled);
|
|
823
824
|
}
|
|
824
825
|
})["catch"](function (e) {
|
|
825
826
|
window.console.error(e);
|
|
@@ -897,7 +898,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
897
898
|
key: "getWMSGetMapRequestURL",
|
|
898
899
|
value: function getWMSGetMapRequestURL(extentToLoad, resolutionToLoad, __pixelRatio, projection, getMapUrl, params, layerName, styleName, dimProps) {
|
|
899
900
|
var pixelRatio = 1; // TODO?
|
|
900
|
-
if (!getMapUrl || !layerName) {
|
|
901
|
+
if (!getMapUrl || !layerName || !extentToLoad || (extentToLoad === null || extentToLoad === void 0 ? void 0 : extentToLoad.length) === 0) {
|
|
901
902
|
return {
|
|
902
903
|
src: '',
|
|
903
904
|
extent: this.extent,
|
|
@@ -1007,7 +1008,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1007
1008
|
if (imageEl.hasError()) {
|
|
1008
1009
|
this._rejectAll(imageEl.getSrc());
|
|
1009
1010
|
} else {
|
|
1010
|
-
this._resolveAll();
|
|
1011
|
+
this._resolveAll(imageEl);
|
|
1011
1012
|
}
|
|
1012
1013
|
return;
|
|
1013
1014
|
}
|
|
@@ -1035,10 +1036,10 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1035
1036
|
}
|
|
1036
1037
|
}, {
|
|
1037
1038
|
key: "_resolveAll",
|
|
1038
|
-
value: function _resolveAll() {
|
|
1039
|
+
value: function _resolveAll(image) {
|
|
1039
1040
|
while (this._resolvers.length !== 0) {
|
|
1040
1041
|
var resolve = this._resolvers.pop();
|
|
1041
|
-
resolve && resolve.resolve();
|
|
1042
|
+
resolve && resolve.resolve(image);
|
|
1042
1043
|
}
|
|
1043
1044
|
}
|
|
1044
1045
|
}, {
|
|
@@ -1078,6 +1079,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1078
1079
|
var wmsUrl = _ref.wmsUrl,
|
|
1079
1080
|
timeStampsToPrefetch = _ref.timeStampsToPrefetch,
|
|
1080
1081
|
layerName = _ref.layerName,
|
|
1082
|
+
layerId = _ref.layerId,
|
|
1081
1083
|
styleName = _ref.styleName,
|
|
1082
1084
|
dimProps = _ref.dimProps,
|
|
1083
1085
|
params = _ref.params,
|
|
@@ -1097,14 +1099,21 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1097
1099
|
_this.hasImageLoadedForTimeValue = _this.hasImageLoadedForTimeValue.bind(_this);
|
|
1098
1100
|
_this.setImageForTimeValue = _this.setImageForTimeValue.bind(_this);
|
|
1099
1101
|
_this._conditionalPrefetch = _this._conditionalPrefetch.bind(_this);
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
+
// These throttle settings ensure that prefetching starts after 200ms of inactivity, but at the same time
|
|
1103
|
+
// if there is a continuous stream of changes (like when moving the map), it will still trigger at least every 2 seconds.
|
|
1104
|
+
// This ensures that prefetching also happens when the user is continuously interacting with the map, but at a throttled rate.
|
|
1105
|
+
_this.throttledPrefetch = throttle(throttle(_this._conditionalPrefetch, 2000, {
|
|
1106
|
+
leading: true,
|
|
1102
1107
|
trailing: true
|
|
1108
|
+
}), 200, {
|
|
1109
|
+
leading: true,
|
|
1110
|
+
trailing: false
|
|
1103
1111
|
});
|
|
1104
1112
|
_this.throttledImageLoad = debounce(_this._loadImagery, 100, {
|
|
1105
1113
|
leading: false,
|
|
1106
1114
|
trailing: true
|
|
1107
1115
|
});
|
|
1116
|
+
_this._layerId = layerId;
|
|
1108
1117
|
_this.triggerPrefetch = _this.triggerPrefetch.bind(_this);
|
|
1109
1118
|
_this._imWrapperEmptyButLoading = initImageWrapper();
|
|
1110
1119
|
_this._imWrapperForOlSource = initImageWrapper();
|
|
@@ -1131,8 +1140,6 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1131
1140
|
timeStampsToPrefetch: this._timeStampsToPrefetch,
|
|
1132
1141
|
dimProperties: this._dimProperties
|
|
1133
1142
|
};
|
|
1134
|
-
// Clear old jobs
|
|
1135
|
-
this._prefetchWorkers.clearJobs();
|
|
1136
1143
|
this.prefetch(extent, resolution, pixelRatio, projection);
|
|
1137
1144
|
}
|
|
1138
1145
|
}
|
|
@@ -1140,11 +1147,18 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1140
1147
|
key: "_loadImagery",
|
|
1141
1148
|
value: function _loadImagery(dimProperties) {
|
|
1142
1149
|
var _this2 = this;
|
|
1150
|
+
// Tell the imagestore that we are about to do a GetMap request
|
|
1151
|
+
openLayersGetMapImageStore.loadDuration.setLoadingStatusForId(WMImageStoreLoadType.GETMAP, this._layerId, 0, 1, true);
|
|
1143
1152
|
// Load the newly requested image
|
|
1144
|
-
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))
|
|
1153
|
+
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) {
|
|
1154
|
+
// Tell the imagestore that GetMap request was finished.
|
|
1155
|
+
openLayersGetMapImageStore.loadDuration.setLoadDurationForId(_this2._layerId, el.getLoadDuration());
|
|
1156
|
+
})["catch"](function () {
|
|
1145
1157
|
// TODO, enable error handling
|
|
1146
1158
|
// console.error(e);
|
|
1147
1159
|
})["finally"](function () {
|
|
1160
|
+
// Tell the imagestore that GetMap request was finished.
|
|
1161
|
+
openLayersGetMapImageStore.loadDuration.setLoadingStatusForId(WMImageStoreLoadType.GETMAP, _this2._layerId, 1, 1);
|
|
1148
1162
|
_this2._loadedExtent = _this2._lastRequestedExtent;
|
|
1149
1163
|
_this2._loadedResolution = _this2._lastRequestedResolution;
|
|
1150
1164
|
_this2._loadedPixelRatio = _this2._lastRequestedPixelRatio;
|
|
@@ -1158,20 +1172,51 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1158
1172
|
key: "prefetch",
|
|
1159
1173
|
value: function prefetch(extent, resolution, pixelRatio, projection) {
|
|
1160
1174
|
var _this3 = this;
|
|
1175
|
+
var dimensionsToPrefetchUnFiltered = this._timeStampsToPrefetch;
|
|
1176
|
+
// Only work on imagery that still needs to be loaded.
|
|
1177
|
+
var dimensionsToPrefetch = dimensionsToPrefetchUnFiltered.filter(function (dimValue) {
|
|
1178
|
+
var hasExactImage = _this3._imWrapperForOlSource.hasImage(extent, resolution, pixelRatio, projection, _this3._wmsUrl, _this3._extraWMSParams, _this3._layerName, _this3._styleName, _objectSpread2(_objectSpread2({}, _this3._dimProperties), {}, {
|
|
1179
|
+
TIME: dimValue
|
|
1180
|
+
}));
|
|
1181
|
+
return hasExactImage === false || !hasExactImage.isLoadedWithoutErrors;
|
|
1182
|
+
});
|
|
1183
|
+
if (dimensionsToPrefetch.length === 0) {
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1161
1186
|
this._prefetchWorkers.clearJobs();
|
|
1162
|
-
var dimensionsToPrefetch = this._timeStampsToPrefetch;
|
|
1163
1187
|
var jobs = dimensionsToPrefetch.slice(0, MAX_NUMBER_TO_PREFETCH).map(function (dimValue) {
|
|
1164
1188
|
return {
|
|
1165
1189
|
dimValue: dimValue,
|
|
1166
1190
|
cancelled: false,
|
|
1167
|
-
task: function
|
|
1168
|
-
|
|
1169
|
-
|
|
1191
|
+
task: function () {
|
|
1192
|
+
var _task = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
1193
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1194
|
+
while (1) switch (_context.prev = _context.next) {
|
|
1195
|
+
case 0:
|
|
1196
|
+
_context.next = 2;
|
|
1197
|
+
return _this3._imWrapperForPrefetch.loadAndResolve(extent, resolution, pixelRatio, projection, _this3._wmsUrl, _this3._extraWMSParams, _this3._layerName, _this3._styleName, _objectSpread2(_objectSpread2({}, _this3._dimProperties), {}, {
|
|
1198
|
+
TIME: dimValue
|
|
1199
|
+
}))["catch"](function (e) {
|
|
1200
|
+
console.error(e);
|
|
1201
|
+
});
|
|
1202
|
+
case 2:
|
|
1203
|
+
return _context.abrupt("return", function (cancelled) {
|
|
1204
|
+
openLayersGetMapImageStore.loadDuration.setLoadingStatusForId(WMImageStoreLoadType.PREFETCH, _this3._layerId, dimensionsToPrefetch.length - _this3._prefetchWorkers.taskQueue.length, dimensionsToPrefetch.length);
|
|
1205
|
+
});
|
|
1206
|
+
case 3:
|
|
1207
|
+
case "end":
|
|
1208
|
+
return _context.stop();
|
|
1209
|
+
}
|
|
1210
|
+
}, _callee);
|
|
1170
1211
|
}));
|
|
1171
|
-
|
|
1212
|
+
function task() {
|
|
1213
|
+
return _task.apply(this, arguments);
|
|
1214
|
+
}
|
|
1215
|
+
return task;
|
|
1216
|
+
}()
|
|
1172
1217
|
};
|
|
1173
1218
|
});
|
|
1174
|
-
|
|
1219
|
+
this._prefetchWorkers.addJobs(jobs);
|
|
1175
1220
|
}
|
|
1176
1221
|
}, {
|
|
1177
1222
|
key: "triggerPrefetch",
|
|
@@ -1326,17 +1371,6 @@ var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsT
|
|
|
1326
1371
|
var dimValuesToPrefetch = dimensionValuesToPrefetchCombined.map(function (timeStamp) {
|
|
1327
1372
|
return wmTimeDim.getClosestValueForTime(timeStamp);
|
|
1328
1373
|
});
|
|
1329
|
-
// TODO: When animating with two maps, the not leading map does get the wrong prefetch values. Use the following to debug this
|
|
1330
|
-
// if (dimensionValuesToPrefetch.length === 0) {
|
|
1331
|
-
// console.warn(
|
|
1332
|
-
// 'NOTHING TO PREFETCH',
|
|
1333
|
-
// stepsToCheck.map((s) => {
|
|
1334
|
-
// return new Date(s).toISOString();
|
|
1335
|
-
// }),
|
|
1336
|
-
// wmTimeDim.getFirstValue(),
|
|
1337
|
-
// wmTimeDim.getLastValue(),
|
|
1338
|
-
// );
|
|
1339
|
-
// }
|
|
1340
1374
|
return dimValuesToPrefetch;
|
|
1341
1375
|
}
|
|
1342
1376
|
}
|
|
@@ -1591,6 +1625,7 @@ var fetchEDRLayerCollectionCube = /*#__PURE__*/function () {
|
|
|
1591
1625
|
var DEFAULT_STALE_TIME = 60000; // One minute
|
|
1592
1626
|
var useEDRLayerCollection = function useEDRLayerCollection(edrBaseUrlWithCollection) {
|
|
1593
1627
|
var instanceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1628
|
+
var enabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
1594
1629
|
return useQuery({
|
|
1595
1630
|
staleTime: DEFAULT_STALE_TIME,
|
|
1596
1631
|
queryKey: [edrBaseUrlWithCollection, instanceId, 'useEDRLayerCollection'],
|
|
@@ -1611,7 +1646,7 @@ var useEDRLayerCollection = function useEDRLayerCollection(edrBaseUrlWithCollect
|
|
|
1611
1646
|
}
|
|
1612
1647
|
return queryFn;
|
|
1613
1648
|
}(),
|
|
1614
|
-
enabled: edrBaseUrlWithCollection.length > 0
|
|
1649
|
+
enabled: edrBaseUrlWithCollection.length > 0 && enabled
|
|
1615
1650
|
});
|
|
1616
1651
|
};
|
|
1617
1652
|
var useEDRLayerCollectionCube = function useEDRLayerCollectionCube(edrBaseUrlWithCollection, parameterName) {
|
|
@@ -2044,6 +2079,42 @@ var styleNameToStyleLikeNotMemoed = function styleNameToStyleLikeNotMemoed(style
|
|
|
2044
2079
|
};
|
|
2045
2080
|
};
|
|
2046
2081
|
var styleNameToStyleLike = memoize(styleNameToStyleLikeNotMemoed);
|
|
2082
|
+
var defaultEdrStyles = [{
|
|
2083
|
+
name: 'temperatureLegendColorsWoW:-18,38',
|
|
2084
|
+
title: 'WOW Legend -18 till 18 degrees',
|
|
2085
|
+
"abstract": 'temperatureLegendColorsWoW',
|
|
2086
|
+
legendURL: ''
|
|
2087
|
+
}, {
|
|
2088
|
+
name: 'temperatureLegendColorsWoW:0,20',
|
|
2089
|
+
title: 'WOW Legend 0 till 20 degrees',
|
|
2090
|
+
"abstract": 'temperatureLegendColorsWoW',
|
|
2091
|
+
legendURL: ''
|
|
2092
|
+
}, {
|
|
2093
|
+
name: 'temperatureLegendColorsWoW:10,20',
|
|
2094
|
+
title: 'WOW Legend 10 till 20 degrees',
|
|
2095
|
+
"abstract": 'temperatureLegendColorsWoW',
|
|
2096
|
+
legendURL: ''
|
|
2097
|
+
}, {
|
|
2098
|
+
name: 'temperatureLegendColorsCWK',
|
|
2099
|
+
title: 'temperatureLegendColorsCWK',
|
|
2100
|
+
"abstract": 'temperatureLegendColorsCWK',
|
|
2101
|
+
legendURL: ''
|
|
2102
|
+
}, {
|
|
2103
|
+
name: 'precipitationMMLegendColorsWoW:0,30',
|
|
2104
|
+
title: '0 till 30 mm/h',
|
|
2105
|
+
"abstract": 'precipitationMMLegendColorsWoW',
|
|
2106
|
+
legendURL: ''
|
|
2107
|
+
}, {
|
|
2108
|
+
name: 'precipitationMMLegendColorsWoW:0,3',
|
|
2109
|
+
title: '0 till 3 mm/h',
|
|
2110
|
+
"abstract": 'precipitationMMLegendColorsWoW',
|
|
2111
|
+
legendURL: ''
|
|
2112
|
+
}, {
|
|
2113
|
+
name: 'wind/direction-speed',
|
|
2114
|
+
title: 'Wind direction and speed',
|
|
2115
|
+
"abstract": '',
|
|
2116
|
+
legendURL: ''
|
|
2117
|
+
}];
|
|
2047
2118
|
|
|
2048
2119
|
/**
|
|
2049
2120
|
* Returns WMLayer instance in EDR mode. The layer will contains parsed dimensions and styles and keeps a state for these properties.
|
|
@@ -10593,7 +10664,7 @@ var GeoJSONTextField = function GeoJSONTextField(_ref) {
|
|
|
10593
10664
|
try {
|
|
10594
10665
|
onChangeGeoJSON(JSON.parse(event.target.value));
|
|
10595
10666
|
setValidity(true);
|
|
10596
|
-
} catch (
|
|
10667
|
+
} catch (_e) {
|
|
10597
10668
|
onChangeGeoJSON(null);
|
|
10598
10669
|
setValidity(false);
|
|
10599
10670
|
}
|
|
@@ -11439,9 +11510,7 @@ var moveFeature = function moveFeature(currentGeoJSON, newGeoJSON, featureLayerI
|
|
|
11439
11510
|
* @param intersectB Feature B
|
|
11440
11511
|
* @returns The intersection of the two features.
|
|
11441
11512
|
*/
|
|
11442
|
-
var intersectPointGeoJSONS = function intersectPointGeoJSONS(
|
|
11443
|
-
// eslint-disable-next-line id-length
|
|
11444
|
-
intersectA, intersectB) {
|
|
11513
|
+
var intersectPointGeoJSONS = function intersectPointGeoJSONS(intersectA, intersectB) {
|
|
11445
11514
|
var geoJSONProperties = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
11446
11515
|
stroke: '#FF0000',
|
|
11447
11516
|
'stroke-width': 10.0,
|
|
@@ -11530,7 +11599,7 @@ var createInterSections = function createInterSections(geojson, otherGeoJSON) {
|
|
|
11530
11599
|
return addFeatureProperties(intersectPointGeoJSONS(geojson, otherGeoJSON), geoJSONproperties);
|
|
11531
11600
|
}
|
|
11532
11601
|
return addFeatureProperties(intersectPolygonGeoJSONS(geojson, otherGeoJSON), geoJSONproperties);
|
|
11533
|
-
} catch (
|
|
11602
|
+
} catch (_error) {
|
|
11534
11603
|
return addFeatureProperties(geojson, geoJSONproperties);
|
|
11535
11604
|
}
|
|
11536
11605
|
});
|
|
@@ -11668,6 +11737,7 @@ var DRAWMODE;
|
|
|
11668
11737
|
DRAWMODE["MULTIPOINT"] = "MULTIPOINT";
|
|
11669
11738
|
DRAWMODE["POINT"] = "POINT";
|
|
11670
11739
|
DRAWMODE["LINESTRING"] = "LINESTRING";
|
|
11740
|
+
DRAWMODE["SMOOTHLINE"] = "SMOOTHLINE";
|
|
11671
11741
|
})(DRAWMODE || (DRAWMODE = {}));
|
|
11672
11742
|
|
|
11673
11743
|
var defaultIntersectionStyleProperties = _objectSpread2(_objectSpread2({}, defaultGeoJSONStyleProperties), {}, {
|
|
@@ -11961,6 +12031,9 @@ var getToolIcon = function getToolIcon(selectionType) {
|
|
|
11961
12031
|
if (selectionType === customLineButton.selectionType) {
|
|
11962
12032
|
return jsx(ArrowUp, {});
|
|
11963
12033
|
}
|
|
12034
|
+
if (selectionType === smoothLineButton.selectionType) {
|
|
12035
|
+
return jsx(SandStorm, {});
|
|
12036
|
+
}
|
|
11964
12037
|
return jsx("div", {});
|
|
11965
12038
|
};
|
|
11966
12039
|
// custom buttons
|
|
@@ -12164,6 +12237,18 @@ var basicExampleMultipleShapeWithValuesDrawOptions = _objectSpread2(_objectSprea
|
|
|
12164
12237
|
}]
|
|
12165
12238
|
}
|
|
12166
12239
|
});
|
|
12240
|
+
var smoothLineButton = {
|
|
12241
|
+
drawModeId: 'tool-smooth-line',
|
|
12242
|
+
value: DRAWMODE.SMOOTHLINE,
|
|
12243
|
+
title: 'Smooth LineString',
|
|
12244
|
+
shape: emptyLineString,
|
|
12245
|
+
isSelectable: true,
|
|
12246
|
+
selectionType: 'smooth-line'
|
|
12247
|
+
};
|
|
12248
|
+
var basicExampleSmoothLineOptions = {
|
|
12249
|
+
shouldAllowMultipleShapes: true,
|
|
12250
|
+
defaultDrawModes: [].concat(_toConsumableArray(defaultModes), [smoothLineButton])
|
|
12251
|
+
};
|
|
12167
12252
|
|
|
12168
12253
|
var getIntersectionToolIcon = function getIntersectionToolIcon(selectionType) {
|
|
12169
12254
|
var defaultIcon = getIcon(selectionType);
|
|
@@ -13944,6 +14029,7 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13944
14029
|
var dimensionsValuesEffectCheck = dimensionsValues && Object.entries(dimensionsValues).map(function (dimensionNameAndCurrentValue) {
|
|
13945
14030
|
return "".concat(dimensionNameAndCurrentValue[0], ":").concat(dimensionNameAndCurrentValue[1]);
|
|
13946
14031
|
}).join(',');
|
|
14032
|
+
var prefetchListEffectCheck = (prefetchList !== null && prefetchList !== void 0 ? prefetchList : []).join(',');
|
|
13947
14033
|
// Make a TimeawareImageSource and add it to the map, add and remove should only be done when the map changes, layer id changes, visibility changes or dimensionsValues get defined.
|
|
13948
14034
|
useEffect(function () {
|
|
13949
14035
|
if (!map || !wmLayer || visible === false || !dimensionsValues) {
|
|
@@ -13954,6 +14040,7 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
13954
14040
|
source: new TimeawareImageSource({
|
|
13955
14041
|
wmsUrl: wmLayer.getmapURL,
|
|
13956
14042
|
layerName: wmLayer.name,
|
|
14043
|
+
layerId: layerId || '',
|
|
13957
14044
|
styleName: styleName,
|
|
13958
14045
|
dimProps: dimensionsValues,
|
|
13959
14046
|
timeStampsToPrefetch: [],
|
|
@@ -14112,7 +14199,7 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
14112
14199
|
// - styleName,
|
|
14113
14200
|
// - dimensionsValuesEffectCheck,
|
|
14114
14201
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14115
|
-
}, [layer, wmLayer,
|
|
14202
|
+
}, [layer, wmLayer, prefetchListEffectCheck, layerName, styleName, dimensionsValuesEffectCheck]);
|
|
14116
14203
|
// Only show debug info for data layers with time dimension
|
|
14117
14204
|
var hasTimeDim = (_wmLayer$dimensions$f = wmLayer === null || wmLayer === void 0 || (_wmLayer$dimensions4 = wmLayer.dimensions) === null || _wmLayer$dimensions4 === void 0 ? void 0 : _wmLayer$dimensions4.findIndex(function (dimension) {
|
|
14118
14205
|
return dimension.name === 'time';
|
|
@@ -14407,7 +14494,7 @@ var useViewFromLayer = function useViewFromLayer(layerProps) {
|
|
|
14407
14494
|
if (viewRef.current === null) {
|
|
14408
14495
|
try {
|
|
14409
14496
|
viewRef.current = new View(baseView);
|
|
14410
|
-
} catch (
|
|
14497
|
+
} catch (_e) {
|
|
14411
14498
|
viewRef.current = new View({
|
|
14412
14499
|
projection: 'EPSG:3857',
|
|
14413
14500
|
zoom: 1,
|
|
@@ -14433,7 +14520,6 @@ var useViewFromLayer = function useViewFromLayer(layerProps) {
|
|
|
14433
14520
|
var USEANIMATIONFORLAYER_DEFAULT_NUMSTEPS = 48;
|
|
14434
14521
|
var USEANIMATIONFORLAYER_DEFAULT_UPDATEINTERVALMS = 60000;
|
|
14435
14522
|
var USEANIMATIONFORLAYER_DEFAULT_MSINHOUR = 3600000;
|
|
14436
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
14437
14523
|
var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInMs) {
|
|
14438
14524
|
var numStepsTillLatest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : USEANIMATIONFORLAYER_DEFAULT_NUMSTEPS;
|
|
14439
14525
|
var checkForUpdatesMs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : USEANIMATIONFORLAYER_DEFAULT_UPDATEINTERVALMS;
|
|
@@ -14517,7 +14603,6 @@ var useAnimationForLayer = function useAnimationForLayer(layerProps, intervalInM
|
|
|
14517
14603
|
}
|
|
14518
14604
|
}, _callee);
|
|
14519
14605
|
})), [calculateTimeSpan, wmLayer]);
|
|
14520
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
14521
14606
|
useSetIntervalWhenVisible(refetchLayer, checkForUpdatesMs);
|
|
14522
14607
|
return {
|
|
14523
14608
|
dimensions: [{
|
|
@@ -15252,7 +15337,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
15252
15337
|
}, [style]);
|
|
15253
15338
|
useEffect(function () {
|
|
15254
15339
|
// Handle opacity:
|
|
15255
|
-
if (layerRef.current && opacity) {
|
|
15340
|
+
if (layerRef.current && opacity !== undefined) {
|
|
15256
15341
|
var _layerRef$current2;
|
|
15257
15342
|
(_layerRef$current2 = layerRef.current) === null || _layerRef$current2 === void 0 || _layerRef$current2.setOpacity(opacity);
|
|
15258
15343
|
}
|
|
@@ -15358,7 +15443,6 @@ var OpenLayersFeatureLayer = function OpenLayersFeatureLayer(_ref) {
|
|
|
15358
15443
|
var featureCollectionHasChanges = featureCollectionRef.current !== featureCollection;
|
|
15359
15444
|
if (featureCollectionHasChanges) {
|
|
15360
15445
|
if (projection && featureCollection) {
|
|
15361
|
-
// eslint-disable-next-line no-console
|
|
15362
15446
|
featureCollectionRef.current = featureCollection;
|
|
15363
15447
|
var formatter = new GeoJSON({
|
|
15364
15448
|
featureProjection: projection
|
|
@@ -15716,6 +15800,13 @@ var FEATURE_STROKE_EDIT = new Stroke({
|
|
|
15716
15800
|
color: '#e14',
|
|
15717
15801
|
width: 1.5 + 1
|
|
15718
15802
|
});
|
|
15803
|
+
var FEATURE_FILL_SELECTED = new Fill({
|
|
15804
|
+
color: '#186DFF'
|
|
15805
|
+
});
|
|
15806
|
+
var FEATURE_STROKE_SELECTED = new Stroke({
|
|
15807
|
+
color: '#186DFF',
|
|
15808
|
+
width: 1.5 + 1
|
|
15809
|
+
});
|
|
15719
15810
|
var FEATURE_VERTICE_IMAGE = new Circle({
|
|
15720
15811
|
radius: 5,
|
|
15721
15812
|
stroke: new Stroke({
|
|
@@ -15744,6 +15835,16 @@ var ICON_LOCATIONMARKER = createIconStyle(locationPath, {
|
|
|
15744
15835
|
anchor: [0.5, 1]
|
|
15745
15836
|
}
|
|
15746
15837
|
});
|
|
15838
|
+
var ICON_LOCATIONMARKER_SELECTED = createIconStyle(locationPath, {
|
|
15839
|
+
render: {
|
|
15840
|
+
fillStyle: '#186DFF',
|
|
15841
|
+
strokeStyle: '#186DFF',
|
|
15842
|
+
lineWidth: 2
|
|
15843
|
+
},
|
|
15844
|
+
icon: {
|
|
15845
|
+
anchor: [0.5, 1]
|
|
15846
|
+
}
|
|
15847
|
+
});
|
|
15747
15848
|
var ICON_LOCATIONMARKER_MODIFY = createIconStyle(locationPath, {
|
|
15748
15849
|
render: {
|
|
15749
15850
|
fillStyle: '#eee',
|
|
@@ -15988,14 +16089,26 @@ var stylesByMapFeatureClass = _defineProperty(_defineProperty(_defineProperty(_d
|
|
|
15988
16089
|
return !feature.get('hover') ? FEATURE_EDR : [].concat(FEATURE_EDR_HOVER, [textLabelStyle(feature.getProperties().name)]);
|
|
15989
16090
|
}), MapFeatureClass.EDRMultiPolygon, function (feature) {
|
|
15990
16091
|
return !feature.get('hover') ? FEATURE_EDR : [].concat(FEATURE_EDR_HOVER, [multiPolygonLabelStyle(feature.getProperties().name)]);
|
|
15991
|
-
}), MapFeatureClass["default"],
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
16092
|
+
}), MapFeatureClass["default"], function (feature) {
|
|
16093
|
+
if (feature.get('highlightSelectedFeature')) {
|
|
16094
|
+
return [
|
|
16095
|
+
// Polygon / LineString
|
|
16096
|
+
new Style$1({
|
|
16097
|
+
fill: FEATURE_FILL_SELECTED,
|
|
16098
|
+
stroke: FEATURE_STROKE_SELECTED
|
|
16099
|
+
}),
|
|
16100
|
+
// Point
|
|
16101
|
+
ICON_LOCATIONMARKER_SELECTED];
|
|
16102
|
+
}
|
|
16103
|
+
return [
|
|
16104
|
+
// Polygon / LineString
|
|
16105
|
+
new Style$1({
|
|
16106
|
+
fill: FEATURE_FILL,
|
|
16107
|
+
stroke: FEATURE_STROKE
|
|
16108
|
+
}),
|
|
16109
|
+
// Point
|
|
16110
|
+
ICON_LOCATIONMARKER];
|
|
16111
|
+
});
|
|
15999
16112
|
var geowebColorToOpenLayersColor = function geowebColorToOpenLayersColor(color, opacity) {
|
|
16000
16113
|
// Return as-is if no opacity, or non-hex color (we do not know how to add opacity to non-hex colors)
|
|
16001
16114
|
if (color[0] !== '#' || opacity === undefined) {
|
|
@@ -16056,13 +16169,31 @@ var genericOpenLayersFeatureStyle = function genericOpenLayersFeatureStyle(featu
|
|
|
16056
16169
|
var props = feature.getProperties();
|
|
16057
16170
|
var fill = props.fill,
|
|
16058
16171
|
stroke = props.stroke,
|
|
16172
|
+
strokeOpacity = props['stroke-opacity'],
|
|
16173
|
+
strokeWidth = props['stroke-width'],
|
|
16059
16174
|
hover = props.hover,
|
|
16060
16175
|
mapFeatureClass = props.mapFeatureClass,
|
|
16061
16176
|
showNameOnHover = props.showNameOnHover,
|
|
16062
16177
|
name = props.name,
|
|
16063
16178
|
geometry = props.geometry,
|
|
16064
16179
|
selectionType = props.selectionType;
|
|
16065
|
-
|
|
16180
|
+
if (selectionType === 'smooth-line') {
|
|
16181
|
+
var geom = feature.getGeometry();
|
|
16182
|
+
if (geom instanceof LineString) {
|
|
16183
|
+
var coords = geom.getCoordinates();
|
|
16184
|
+
var smoothed = catmullRomSpline(coords, 16);
|
|
16185
|
+
// Smoothed line
|
|
16186
|
+
return new Style$1({
|
|
16187
|
+
geometry: new LineString(smoothed),
|
|
16188
|
+
stroke: new Stroke({
|
|
16189
|
+
width: strokeWidth || 3,
|
|
16190
|
+
color: geowebColorToOpenLayersColor(stroke, strokeOpacity || 1)
|
|
16191
|
+
})
|
|
16192
|
+
});
|
|
16193
|
+
}
|
|
16194
|
+
return undefined;
|
|
16195
|
+
}
|
|
16196
|
+
var shouldHighlight = geometry && geometry.getType() !== 'Point' && mapFeatureClass !== MapFeatureClass.ObservationStation && !showNameOnHover && selectionType !== 'fir';
|
|
16066
16197
|
// Highlight map polygons on hover
|
|
16067
16198
|
if (hover && shouldHighlight) {
|
|
16068
16199
|
return new Style$1({
|
|
@@ -16120,6 +16251,57 @@ var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature)
|
|
|
16120
16251
|
}
|
|
16121
16252
|
})];
|
|
16122
16253
|
};
|
|
16254
|
+
// Simple Catmull-Rom spline smoothing
|
|
16255
|
+
var catmullRomSpline = function catmullRomSpline(points) {
|
|
16256
|
+
var numPoints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;
|
|
16257
|
+
var result = [];
|
|
16258
|
+
if (points.length < 2) {
|
|
16259
|
+
return points;
|
|
16260
|
+
}
|
|
16261
|
+
for (var i = 0; i < points.length - 1; i += 1) {
|
|
16262
|
+
var _points, _points2;
|
|
16263
|
+
var p0 = (_points = points[i - 1]) !== null && _points !== void 0 ? _points : points[i];
|
|
16264
|
+
var p1 = points[i];
|
|
16265
|
+
var p2 = points[i + 1];
|
|
16266
|
+
var p3 = (_points2 = points[i + 2]) !== null && _points2 !== void 0 ? _points2 : p2;
|
|
16267
|
+
// always include the control point
|
|
16268
|
+
result.push(p1);
|
|
16269
|
+
for (var pointIndex = 1; pointIndex < numPoints; pointIndex += 1) {
|
|
16270
|
+
var t = pointIndex / numPoints;
|
|
16271
|
+
var t2 = t * t;
|
|
16272
|
+
var t3 = t2 * t;
|
|
16273
|
+
var x = 0.5 * (2 * p1[0] + (-p0[0] + p2[0]) * t + (2 * p0[0] - 5 * p1[0] + 4 * p2[0] - p3[0]) * t2 + (-p0[0] + 3 * p1[0] - 3 * p2[0] + p3[0]) * t3);
|
|
16274
|
+
var y = 0.5 * (2 * p1[1] + (-p0[1] + p2[1]) * t + (2 * p0[1] - 5 * p1[1] + 4 * p2[1] - p3[1]) * t2 + (-p0[1] + 3 * p1[1] - 3 * p2[1] + p3[1]) * t3);
|
|
16275
|
+
result.push([x, y]);
|
|
16276
|
+
}
|
|
16277
|
+
}
|
|
16278
|
+
// include the very last control point
|
|
16279
|
+
result.push(points[points.length - 1]);
|
|
16280
|
+
return result;
|
|
16281
|
+
};
|
|
16282
|
+
var smoothLineLikeFeatureStyle = function smoothLineLikeFeatureStyle(feature) {
|
|
16283
|
+
var props = feature.getProperties();
|
|
16284
|
+
var stroke = props.stroke,
|
|
16285
|
+
strokeOpacity = props['stroke-opacity'],
|
|
16286
|
+
strokeWidth = props['stroke-width'];
|
|
16287
|
+
var geom = feature.getGeometry();
|
|
16288
|
+
if (geom instanceof LineString) {
|
|
16289
|
+
var coords = geom.getCoordinates();
|
|
16290
|
+
var smoothed = catmullRomSpline(coords, 16);
|
|
16291
|
+
return [
|
|
16292
|
+
// Smoothed line
|
|
16293
|
+
new Style$1({
|
|
16294
|
+
geometry: new LineString(smoothed),
|
|
16295
|
+
stroke: new Stroke({
|
|
16296
|
+
width: strokeWidth || 3,
|
|
16297
|
+
color: geowebColorToOpenLayersColor(stroke || '#ff7800', strokeOpacity || 1)
|
|
16298
|
+
})
|
|
16299
|
+
}),
|
|
16300
|
+
// Vertices
|
|
16301
|
+
FEATURE_VERTICES_EDIT_HANDLES];
|
|
16302
|
+
}
|
|
16303
|
+
return undefined;
|
|
16304
|
+
};
|
|
16123
16305
|
var drawPointLikeFeatureStyle = ICON_LOCATIONMARKER_MODIFY;
|
|
16124
16306
|
var modifyPolygonLikeFeatureStyle = [
|
|
16125
16307
|
// Area
|
|
@@ -16134,6 +16316,7 @@ var drawStyles = {
|
|
|
16134
16316
|
POLYGON: drawPolygonLikeFeatureStyle,
|
|
16135
16317
|
BOX: drawPolygonLikeFeatureStyle,
|
|
16136
16318
|
LINESTRING: drawPolygonLikeFeatureStyle,
|
|
16319
|
+
SMOOTHLINE: smoothLineLikeFeatureStyle,
|
|
16137
16320
|
POINT: drawPointLikeFeatureStyle,
|
|
16138
16321
|
MULTIPOINT: drawPointLikeFeatureStyle,
|
|
16139
16322
|
DELETE: [],
|
|
@@ -16143,6 +16326,7 @@ var modifyStyles = {
|
|
|
16143
16326
|
POLYGON: modifyPolygonLikeFeatureStyle,
|
|
16144
16327
|
BOX: modifyPolygonLikeFeatureStyle,
|
|
16145
16328
|
LINESTRING: modifyPolygonLikeFeatureStyle,
|
|
16329
|
+
SMOOTHLINE: smoothLineLikeFeatureStyle,
|
|
16146
16330
|
POINT: [modifyPointLikeFeatureStyle],
|
|
16147
16331
|
MULTIPOINT: [modifyPointLikeFeatureStyle],
|
|
16148
16332
|
DELETE: [],
|
|
@@ -16164,6 +16348,10 @@ var createDrawOperation = function createDrawOperation(type) {
|
|
|
16164
16348
|
return {
|
|
16165
16349
|
type: 'LineString'
|
|
16166
16350
|
};
|
|
16351
|
+
case 'SMOOTHLINE':
|
|
16352
|
+
return {
|
|
16353
|
+
type: 'LineString'
|
|
16354
|
+
};
|
|
16167
16355
|
case 'POLYGON':
|
|
16168
16356
|
default:
|
|
16169
16357
|
return {
|
|
@@ -16230,6 +16418,8 @@ var selectionTypeToDrawModeValue = function selectionTypeToDrawModeValue(selecti
|
|
|
16230
16418
|
case 'linestring':
|
|
16231
16419
|
case 'custom-line':
|
|
16232
16420
|
return DRAWMODE.LINESTRING;
|
|
16421
|
+
case 'smooth-line':
|
|
16422
|
+
return DRAWMODE.SMOOTHLINE;
|
|
16233
16423
|
case 'delete':
|
|
16234
16424
|
return 'DELETE';
|
|
16235
16425
|
case 'fir':
|
|
@@ -16562,4 +16752,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
|
|
|
16562
16752
|
return updateObject;
|
|
16563
16753
|
};
|
|
16564
16754
|
|
|
16565
|
-
export { BaseLayerType, ClickOnMapTool, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_FILL, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, ICON_LOCATIONMARKER, ICON_LOCATIONMARKER_MODIFY, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, Proj4js, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, clearImageCacheForAllMaps, colorMaps, createIconStyle, createInterSections, currentlySupportedDrawModes, defaultBox, defaultDelete, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultModes, defaultPoint, defaultPolygon, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, fakeEdrLayerApiHandlers, featureBox, featureMultiPoint, featurePoint, featurePolygon, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getFeatureCollection, getFeatureExtent, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isPointFeatureCollection, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, rewindGeometry, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRLayerCollection, useEDRLayerCollectionCube, useGeoJSON, useGetEDRLayerInstance, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useViewFromLayer, viewUtils, webmapReactTranslations };
|
|
16755
|
+
export { BaseLayerType, ClickOnMapTool, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, 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, ICON_LOCATIONMARKER, ICON_LOCATIONMARKER_MODIFY, ICON_LOCATIONMARKER_SELECTED, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, Proj4js, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, basicExampleSmoothLineOptions, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, createIconStyle, createInterSections, currentlySupportedDrawModes, defaultBox, defaultDelete, defaultEdrStyles, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultModes, defaultPoint, defaultPolygon, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, fakeEdrLayerApiHandlers, featureBox, featureMultiPoint, featurePoint, featurePolygon, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getFeatureCollection, getFeatureExtent, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isPointFeatureCollection, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, rewindGeometry, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRLayerCollection, useEDRLayerCollectionCube, useGeoJSON, useGetEDRLayerInstance, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useViewFromLayer, viewUtils, webmapReactTranslations };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/webmap": "
|
|
12
|
-
"@opengeoweb/theme": "
|
|
13
|
-
"@opengeoweb/shared": "
|
|
11
|
+
"@opengeoweb/webmap": "14.0.0",
|
|
12
|
+
"@opengeoweb/theme": "14.0.0",
|
|
13
|
+
"@opengeoweb/shared": "14.0.0",
|
|
14
14
|
"lodash": "^4.17.21",
|
|
15
15
|
"ol": "^10.4.0",
|
|
16
16
|
"proj4": "^2.9.2",
|
|
@@ -8,3 +8,4 @@ export declare const getToolIcon: (selectionType: SelectionType) => React.ReactE
|
|
|
8
8
|
export declare const basicExampleDrawOptions: MapDrawToolOptions;
|
|
9
9
|
export declare const basicExampleMultipleShapeDrawOptions: MapDrawToolOptions;
|
|
10
10
|
export declare const basicExampleMultipleShapeWithValuesDrawOptions: MapDrawToolOptions;
|
|
11
|
+
export declare const basicExampleSmoothLineOptions: MapDrawToolOptions;
|
|
@@ -2,6 +2,8 @@ import { ColorLike } from 'ol/colorlike';
|
|
|
2
2
|
import { FeatureLike } from 'ol/Feature';
|
|
3
3
|
import { Circle, Fill, Stroke } from 'ol/style';
|
|
4
4
|
import Style, { StyleFunction, StyleLike } from 'ol/style/Style';
|
|
5
|
+
import { Coordinate } from 'ol/coordinate';
|
|
6
|
+
import { LineCoordType } from 'ol/interaction/Draw';
|
|
5
7
|
import { DrawModeValue } from '../MapDrawTool';
|
|
6
8
|
export declare enum MapFeatureClass {
|
|
7
9
|
MyLocation = "MyLocation",
|
|
@@ -14,9 +16,12 @@ export declare enum MapFeatureClass {
|
|
|
14
16
|
export declare const FEATURE_FILL: Fill;
|
|
15
17
|
export declare const FEATURE_STROKE: Stroke;
|
|
16
18
|
export declare const FEATURE_STROKE_EDIT: Stroke;
|
|
19
|
+
export declare const FEATURE_FILL_SELECTED: Fill;
|
|
20
|
+
export declare const FEATURE_STROKE_SELECTED: Stroke;
|
|
17
21
|
export declare const FEATURE_VERTICE_IMAGE: Circle;
|
|
18
22
|
export declare const FEATURE_VERTICE_HANDLE_IMAGE: Circle;
|
|
19
23
|
export declare const ICON_LOCATIONMARKER: Style;
|
|
24
|
+
export declare const ICON_LOCATIONMARKER_SELECTED: Style;
|
|
20
25
|
export declare const ICON_LOCATIONMARKER_MODIFY: Style;
|
|
21
26
|
export declare const FEATURE_VERTICES_EDIT_HANDLES: Style;
|
|
22
27
|
export declare const textLabelStyle: (text: string) => Style;
|
|
@@ -25,5 +30,6 @@ export declare const multiLineStringLabelStyle: (text: string) => Style;
|
|
|
25
30
|
export declare const geowebColorToOpenLayersColor: (color: string, opacity?: string | number) => ColorLike;
|
|
26
31
|
export declare const inlineFeatureStyle: (feature: FeatureLike) => Style[];
|
|
27
32
|
export declare const genericOpenLayersFeatureStyle: StyleFunction;
|
|
33
|
+
export declare const catmullRomSpline: (points: LineCoordType, numPoints?: number) => Coordinate[];
|
|
28
34
|
export declare const drawStyles: Record<DrawModeValue, StyleLike>;
|
|
29
|
-
export declare const modifyStyles: Record<DrawModeValue, Style[]>;
|
|
35
|
+
export declare const modifyStyles: Record<DrawModeValue, Style[] | StyleLike>;
|
|
@@ -7,3 +7,4 @@ export declare const OlBasicMapDrawTool: Story;
|
|
|
7
7
|
export declare const OlBasicMapDrawToolShape: Story;
|
|
8
8
|
export declare const OlBasicMapDrawToolWithMultipleShapes: Story;
|
|
9
9
|
export declare const OlBasicMapDrawToolWithMultipleShapesValues: Story;
|
|
10
|
+
export declare const OlBasicMapDrawToolWithSmoothLines: Story;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Extent } from 'ol/extent';
|
|
2
2
|
import ImageWrapper from 'ol/Image';
|
|
3
3
|
import { Projection } from 'ol/proj';
|
|
4
|
-
import { WMImageStore } from '@opengeoweb/webmap';
|
|
4
|
+
import { WMImage, WMImageStore } from '@opengeoweb/webmap';
|
|
5
5
|
export declare const openLayersGetMapImageStore: WMImageStore;
|
|
6
6
|
export declare const clearImageCacheForAllMaps: () => void;
|
|
7
7
|
interface TimeAwareGeoreferencedImageSrc {
|
|
@@ -38,6 +38,6 @@ declare class TimeAwareImageWrapper extends ImageWrapper {
|
|
|
38
38
|
setState(state: number): void;
|
|
39
39
|
private _rejectAll;
|
|
40
40
|
private _resolveAll;
|
|
41
|
-
loadAndResolve(extentToLoad: Extent, resolutionToLoad: number, pixelRatio: number, projection: Projection, getMapUrl: string, params: Record<string, string>, layerName: string, styleName: string, dimProps: Record<string, string>): Promise<
|
|
41
|
+
loadAndResolve(extentToLoad: Extent, resolutionToLoad: number, pixelRatio: number, projection: Projection, getMapUrl: string, params: Record<string, string>, layerName: string, styleName: string, dimProps: Record<string, string>): Promise<WMImage>;
|
|
42
42
|
}
|
|
43
43
|
export default TimeAwareImageWrapper;
|
|
@@ -8,6 +8,7 @@ interface TimeawareImageSourceOptions {
|
|
|
8
8
|
wmsUrl: string;
|
|
9
9
|
params?: Record<string, string>;
|
|
10
10
|
layerName: string;
|
|
11
|
+
layerId: string;
|
|
11
12
|
dimProps?: Record<string, string>;
|
|
12
13
|
styleName?: string | undefined;
|
|
13
14
|
timeStampsToPrefetch?: string[];
|
|
@@ -36,7 +37,8 @@ export declare class TimeawareImageSource extends ImageSource {
|
|
|
36
37
|
private _imWrapperForPrefetch;
|
|
37
38
|
private throttledPrefetch;
|
|
38
39
|
private throttledImageLoad;
|
|
39
|
-
|
|
40
|
+
private _layerId;
|
|
41
|
+
constructor({ wmsUrl, timeStampsToPrefetch, layerName, layerId, styleName, dimProps, params, visible, }: TimeawareImageSourceOptions);
|
|
40
42
|
private _conditionalPrefetch;
|
|
41
43
|
private _loadImagery;
|
|
42
44
|
private prefetch;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WMJSDimension, Dimension, WMLayer } from '@opengeoweb/webmap';
|
|
2
2
|
import { Timespan } from '../types/Timespan';
|
|
3
3
|
export declare const makeDimValuesToPrefetch: (wmTimeDim: WMJSDimension, stepsToCheck: number[], isAnimating: boolean) => string[];
|
|
4
|
+
export declare const extendPrefetchListWithModelRunTimeSteps: (wmLayer: WMLayer, stepsToCheck: number[]) => number[];
|
|
4
5
|
/**
|
|
5
6
|
* We use the WMLayer dimension logic to obtain the dimension value to use in the WMS GetMap request. The input is the dimensions array which is typically the properties set for the layer component.
|
|
6
7
|
* The input time is descretized to the closest value which is available in the WMS layer.
|
|
@@ -24,3 +24,9 @@ export declare const makeFeatureStyleMultiParamLoading: () => Style;
|
|
|
24
24
|
export declare const makeFeatureStyleDisc: (feature: FeatureLike, legend: EdrOlColorLegend) => Style;
|
|
25
25
|
export declare const makeFeatureStyleLoading: (feature: FeatureLike) => Style;
|
|
26
26
|
export declare const styleNameToStyleLike: ((styleName: string, multiParam?: boolean) => ((feature: FeatureLike) => Style | Style[])) & import("lodash").MemoizedFunction;
|
|
27
|
+
export declare const defaultEdrStyles: {
|
|
28
|
+
name: string;
|
|
29
|
+
title: string;
|
|
30
|
+
abstract: string;
|
|
31
|
+
legendURL: string;
|
|
32
|
+
}[];
|
|
@@ -2,6 +2,8 @@ import { EDRInstance, CoverageCollection, EdrParameters } from '@opengeoweb/shar
|
|
|
2
2
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
3
3
|
export interface EdrLayerInstance extends EDRInstance {
|
|
4
4
|
parameter_names?: EdrParameters;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
5
7
|
}
|
|
6
|
-
export declare const useEDRLayerCollection: (edrBaseUrlWithCollection: string, instanceId?: string) => UseQueryResult<EdrLayerInstance, Error>;
|
|
8
|
+
export declare const useEDRLayerCollection: (edrBaseUrlWithCollection: string, instanceId?: string, enabled?: boolean) => UseQueryResult<EdrLayerInstance, Error>;
|
|
7
9
|
export declare const useEDRLayerCollectionCube: (edrBaseUrlWithCollection: string, parameterName: string, datetime?: string, instanceId?: string, bbox?: string) => UseQueryResult<CoverageCollection, Error>;
|