@opengeoweb/webmap-react 15.1.0 → 15.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/index.esm.js +223 -103
- package/package.json +4 -4
- package/src/lib/components/Clock/Clock.d.ts +14 -0
- package/src/lib/components/LayerInfo/LayerInfoDialog.d.ts +1 -0
- package/src/lib/components/LayerInfo/LayerInfoLegend.d.ts +1 -1
- package/src/lib/components/OpenLayers/OpenLayersMapView.NoTimeDim.stories.d.ts +6 -0
- package/src/lib/components/OpenLayers/draw/OpenLayersMapDraw.d.ts +4 -0
- package/src/lib/components/OpenLayers/draw/index.d.ts +1 -1
- package/src/lib/components/OpenLayers/draw/types.d.ts +2 -1
- package/src/lib/components/OpenLayers/draw/useMapDrawTool.d.ts +1 -0
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.d.ts +9 -1
- package/src/lib/components/OpenLayers/utils/TimeawareImageSource.spec.d.ts +1 -0
- package/src/lib/components/OpenLayers/utils/makeDimValuesToPrefetch.d.ts +8 -1
package/index.esm.js
CHANGED
|
@@ -91,6 +91,7 @@ var en = {
|
|
|
91
91
|
"webmap-react-point": "Point",
|
|
92
92
|
"webmap-react-polygon": "Polygon",
|
|
93
93
|
"webmap-react-box": "Rectangle",
|
|
94
|
+
"webmap-react-rotatable-box": "Rectangle",
|
|
94
95
|
"webmap-react-linestring": "Line String",
|
|
95
96
|
"webmap-react-circle": "Circle",
|
|
96
97
|
"webmap-react-square": "Square",
|
|
@@ -147,6 +148,7 @@ var fi = {
|
|
|
147
148
|
"webmap-react-point": "Piste",
|
|
148
149
|
"webmap-react-polygon": "Monikulmio",
|
|
149
150
|
"webmap-react-box": "Laatikko",
|
|
151
|
+
"webmap-react-rotatable-box": "Laatikko",
|
|
150
152
|
"webmap-react-linestring": "Viivajono",
|
|
151
153
|
"webmap-react-delete": "Poista",
|
|
152
154
|
"clock-show": "Näytä kello",
|
|
@@ -195,6 +197,7 @@ var no = {
|
|
|
195
197
|
"webmap-react-point": "Punkt",
|
|
196
198
|
"webmap-react-polygon": "Polygon",
|
|
197
199
|
"webmap-react-box": "Boks",
|
|
200
|
+
"webmap-react-rotatable-box": "Boks",
|
|
198
201
|
"webmap-react-linestring": "Linje",
|
|
199
202
|
"webmap-react-delete": "Fjerne",
|
|
200
203
|
"clock-show": "Vis klokke",
|
|
@@ -243,6 +246,7 @@ var nl = {
|
|
|
243
246
|
"webmap-react-point": "Punt",
|
|
244
247
|
"webmap-react-polygon": "Polygoon",
|
|
245
248
|
"webmap-react-box": "Rechthoek",
|
|
249
|
+
"webmap-react-rotatable-box": "Rechthoek",
|
|
246
250
|
"webmap-react-linestring": "Lijn",
|
|
247
251
|
"webmap-react-circle": "Cirkel",
|
|
248
252
|
"webmap-react-square": "Vierkant",
|
|
@@ -818,6 +822,13 @@ var TIMEAWAREIMAGEWRAPPER_IMAGEDIDNOTLOADSUCCESFULLY = 'Image did not load succe
|
|
|
818
822
|
// export const WMS_EXTENT_RATIO_TO_VIEWPORT = 1.0;
|
|
819
823
|
// export const ENABLE_PREFETCH = false;
|
|
820
824
|
|
|
825
|
+
/**
|
|
826
|
+
*
|
|
827
|
+
* @param wmTimeDim WMDimension time containing dimension values
|
|
828
|
+
* @param stepsToCheck Array with timestamps as posix timestamps to check
|
|
829
|
+
* @param isAnimating If the application is running an animation loop
|
|
830
|
+
* @returns A string list with ISO8601 values to fetch
|
|
831
|
+
*/
|
|
821
832
|
var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsToCheck, isAnimating) {
|
|
822
833
|
if (wmTimeDim) {
|
|
823
834
|
if ((stepsToCheck === null || stepsToCheck === void 0 ? void 0 : stepsToCheck.length) > 0) {
|
|
@@ -866,44 +877,48 @@ var makeDimValuesToPrefetch = function makeDimValuesToPrefetch(wmTimeDim, stepsT
|
|
|
866
877
|
*/
|
|
867
878
|
var getDimensionParamsForWMS = function getDimensionParamsForWMS(dimensions, wmLayer) {
|
|
868
879
|
// Check if pre-requisites are OK. Possibly still fetching WMS GetCapabilities.
|
|
869
|
-
if (!
|
|
880
|
+
if (!(wmLayer !== null && wmLayer !== void 0 && wmLayer.isConfigured)) {
|
|
870
881
|
return undefined;
|
|
871
882
|
}
|
|
872
883
|
var dimProps = {};
|
|
873
|
-
|
|
874
|
-
// It is possible that a layer has no dimensions. In that case return a map without any key values.
|
|
875
|
-
return dimProps;
|
|
876
|
-
}
|
|
884
|
+
var wmLayerDims = wmLayer.getDimensions();
|
|
877
885
|
// Loop without forEach so we can exit and return.
|
|
878
|
-
var _iterator = _createForOfIteratorHelper(
|
|
886
|
+
var _iterator = _createForOfIteratorHelper(wmLayerDims),
|
|
879
887
|
_step;
|
|
880
888
|
try {
|
|
889
|
+
var _loop = function _loop() {
|
|
890
|
+
var wmLayerDim = _step.value;
|
|
891
|
+
// Check if passed as part of the list of dimensions
|
|
892
|
+
var layerDim = dimensions.find(function (dim) {
|
|
893
|
+
return dim.name === wmLayerDim.name;
|
|
894
|
+
});
|
|
895
|
+
if (layerDim) {
|
|
896
|
+
var closestValue = wmLayerDim.getClosestValue(layerDim.currentValue);
|
|
897
|
+
if (!WMInvalidDateValues.has(closestValue)) {
|
|
898
|
+
wmLayerDim.setValue(closestValue);
|
|
899
|
+
dimProps[getCorrectWMSDimName(wmLayerDim.name)] = closestValue;
|
|
900
|
+
} else {
|
|
901
|
+
// The requested value is not in the range of the dimension, image should not show
|
|
902
|
+
return {
|
|
903
|
+
v: undefined
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
} else {
|
|
907
|
+
// Not specified so fall back to current/default value from WMLayer
|
|
908
|
+
dimProps[getCorrectWMSDimName(wmLayerDim.name)] = wmLayerDim.currentValue ? wmLayerDim.currentValue : wmLayerDim.defaultValue;
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
_ret;
|
|
881
912
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
if (!wmLayerDimension) {
|
|
885
|
-
return undefined;
|
|
886
|
-
}
|
|
887
|
-
// Take the closest WMLayer dimension value
|
|
888
|
-
var closestValue = wmLayerDimension.getClosestValue(dimension.currentValue);
|
|
889
|
-
if (!WMInvalidDateValues.has(closestValue)) {
|
|
890
|
-
wmLayerDimension.setValue(closestValue);
|
|
891
|
-
dimProps[getCorrectWMSDimName(dimension.name)] = closestValue;
|
|
892
|
-
} else {
|
|
893
|
-
// The dimension name does not occur in the layer, or the requested value is not in the range of the dimension
|
|
894
|
-
return undefined;
|
|
895
|
-
}
|
|
913
|
+
_ret = _loop();
|
|
914
|
+
if (_ret) return _ret.v;
|
|
896
915
|
}
|
|
897
|
-
// Check if all dims where used which occur in the WMLayer
|
|
898
916
|
} catch (err) {
|
|
899
917
|
_iterator.e(err);
|
|
900
918
|
} finally {
|
|
901
919
|
_iterator.f();
|
|
902
920
|
}
|
|
903
|
-
return
|
|
904
|
-
var wmsName = getCorrectWMSDimName(wmLayerDim.name);
|
|
905
|
-
return wmsName in dimProps;
|
|
906
|
-
}) ? dimProps : undefined;
|
|
921
|
+
return dimProps;
|
|
907
922
|
};
|
|
908
923
|
/**
|
|
909
924
|
* Calculates number of timesteps for given timespan
|
|
@@ -1016,10 +1031,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1016
1031
|
src = _this$getWMSGetMapReq.src,
|
|
1017
1032
|
newExtent = _this$getWMSGetMapReq.extent,
|
|
1018
1033
|
newResolution = _this$getWMSGetMapReq.resolution;
|
|
1019
|
-
var geoRef = openLayersGetMapImageStore.getAltGeoReferencedImage(src, newExtent, newResolution)
|
|
1020
|
-
extent: newExtent,
|
|
1021
|
-
resolution: newResolution
|
|
1022
|
-
});
|
|
1034
|
+
var geoRef = openLayersGetMapImageStore.getAltGeoReferencedImage(src, newExtent, newResolution);
|
|
1023
1035
|
if (geoRef) {
|
|
1024
1036
|
return {
|
|
1025
1037
|
el: geoRef.getElement(),
|
|
@@ -1040,10 +1052,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1040
1052
|
src = _this$getWMSGetMapReq2.src,
|
|
1041
1053
|
newExtent = _this$getWMSGetMapReq2.extent,
|
|
1042
1054
|
newResolution = _this$getWMSGetMapReq2.resolution;
|
|
1043
|
-
var imageEl = openLayersGetMapImageStore.
|
|
1044
|
-
extent: newExtent,
|
|
1045
|
-
resolution: newResolution
|
|
1046
|
-
});
|
|
1055
|
+
var imageEl = openLayersGetMapImageStore.getImage(src);
|
|
1047
1056
|
if (imageEl) {
|
|
1048
1057
|
return {
|
|
1049
1058
|
el: imageEl.getElement(),
|
|
@@ -1066,7 +1075,6 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1066
1075
|
this.setImage(el);
|
|
1067
1076
|
this.extent = extent;
|
|
1068
1077
|
this.resolution = resolution;
|
|
1069
|
-
// this.projection = projection;/?TODO
|
|
1070
1078
|
}
|
|
1071
1079
|
}, {
|
|
1072
1080
|
key: "load",
|
|
@@ -1076,7 +1084,7 @@ var TimeAwareImageWrapper = /*#__PURE__*/function (_ImageWrapper) {
|
|
|
1076
1084
|
src = _this$getWMSGetMapReq3.src,
|
|
1077
1085
|
newExtent = _this$getWMSGetMapReq3.extent,
|
|
1078
1086
|
newResolution = _this$getWMSGetMapReq3.resolution;
|
|
1079
|
-
var imageEl = openLayersGetMapImageStore.
|
|
1087
|
+
var imageEl = openLayersGetMapImageStore.getImageAndSetGeoReference(src, {
|
|
1080
1088
|
extent: newExtent,
|
|
1081
1089
|
resolution: newResolution
|
|
1082
1090
|
});
|
|
@@ -1437,7 +1445,7 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1437
1445
|
this.changed();
|
|
1438
1446
|
}
|
|
1439
1447
|
/**
|
|
1440
|
-
* Check if an image is available and loaded for requested date. Used for
|
|
1448
|
+
* Check if an image is available and loaded for requested date. Used for showlayerinfo to proceed.
|
|
1441
1449
|
* @param isoTime
|
|
1442
1450
|
* @returns
|
|
1443
1451
|
*/
|
|
@@ -1445,6 +1453,9 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1445
1453
|
key: "hasImageLoadedForTimeValue",
|
|
1446
1454
|
value: function hasImageLoadedForTimeValue(isoTime) {
|
|
1447
1455
|
var _this$_loadedExtent;
|
|
1456
|
+
if (!isoTime || WMInvalidDateValues.has(isoTime)) {
|
|
1457
|
+
return false;
|
|
1458
|
+
}
|
|
1448
1459
|
if (((_this$_loadedExtent = this._loadedExtent) === null || _this$_loadedExtent === void 0 ? void 0 : _this$_loadedExtent.length) !== 4) {
|
|
1449
1460
|
return false;
|
|
1450
1461
|
}
|
|
@@ -1456,24 +1467,44 @@ var TimeawareImageSource = /*#__PURE__*/function (_ImageSource) {
|
|
|
1456
1467
|
}
|
|
1457
1468
|
return true;
|
|
1458
1469
|
}
|
|
1459
|
-
// This function can be used to determine if the animation can proceed to the next step.
|
|
1460
1470
|
}, {
|
|
1461
|
-
key: "
|
|
1462
|
-
value: function
|
|
1471
|
+
key: "getAltGeoReferencedImages",
|
|
1472
|
+
value: function getAltGeoReferencedImages(isoTime) {
|
|
1463
1473
|
var _this$_loadedExtent2;
|
|
1474
|
+
if (!isoTime || WMInvalidDateValues.has(isoTime)) {
|
|
1475
|
+
return [];
|
|
1476
|
+
}
|
|
1464
1477
|
if (((_this$_loadedExtent2 = this._loadedExtent) === null || _this$_loadedExtent2 === void 0 ? void 0 : _this$_loadedExtent2.length) !== 4) {
|
|
1465
|
-
return
|
|
1478
|
+
return [];
|
|
1466
1479
|
}
|
|
1467
1480
|
var dimPropWithRequestedDate = _objectSpread2({}, this._dimProperties);
|
|
1468
1481
|
dimPropWithRequestedDate['TIME'] = isoTime;
|
|
1469
|
-
var
|
|
1470
|
-
|
|
1482
|
+
var _this$_imWrapperForOl = this._imWrapperForOlSource.getWMSGetMapRequestURL(this._lastRequestedExtent, this._lastRequestedResolution, this._lastRequestedPixelRatio, this._lastRequestedProjection, this._wmsUrl, this._extraWMSParams, this._layerName, this._styleName, dimPropWithRequestedDate),
|
|
1483
|
+
src = _this$_imWrapperForOl.src,
|
|
1484
|
+
newExtent = _this$_imWrapperForOl.extent,
|
|
1485
|
+
newResolution = _this$_imWrapperForOl.resolution;
|
|
1486
|
+
var geoRefs = openLayersGetMapImageStore.getAltGeoReferencedImages(src, newExtent, newResolution);
|
|
1487
|
+
return geoRefs;
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* This function can be used to determine if the animation can proceed to the next step.
|
|
1491
|
+
* @param isoTime ISO8601 string formatat like `YYYY-MM-DDTHH:MM:SSZ`
|
|
1492
|
+
* @returns Only specic case it returns false: when a image is available and is loading. That means we wait till it is loaded.
|
|
1493
|
+
* This function returns true if an image is not available in the store. Or true if it is available and already loaded.
|
|
1494
|
+
*/
|
|
1495
|
+
}, {
|
|
1496
|
+
key: "isImageLoadingForTimestep",
|
|
1497
|
+
value: function isImageLoadingForTimestep(isoTime) {
|
|
1498
|
+
var geoRefs = this.getAltGeoReferencedImages(isoTime);
|
|
1499
|
+
if (geoRefs.length === 0) {
|
|
1471
1500
|
// If there is no image at all for requested timestep, it means that the layer does not advertise data for that timestep.
|
|
1472
1501
|
// In that case the animation should proceed, so return true here to avoid blocking the animation.
|
|
1473
1502
|
return true;
|
|
1474
1503
|
}
|
|
1475
1504
|
// If it is still loading, we can block the animation going forward.
|
|
1476
|
-
return
|
|
1505
|
+
return geoRefs.filter(function (geoRef) {
|
|
1506
|
+
return !geoRef.isLoading();
|
|
1507
|
+
}).length !== 0;
|
|
1477
1508
|
}
|
|
1478
1509
|
}, {
|
|
1479
1510
|
key: "setImageForTimeValue",
|
|
@@ -11419,7 +11450,7 @@ var getDimensionsList = function getDimensionsList(dimensions) {
|
|
|
11419
11450
|
};
|
|
11420
11451
|
|
|
11421
11452
|
var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
11422
|
-
var _layer$
|
|
11453
|
+
var _layer$styles, _layer$styles2, _layer$path, _layer$keywords;
|
|
11423
11454
|
var onClose = _ref.onClose,
|
|
11424
11455
|
layer = _ref.layer,
|
|
11425
11456
|
serviceName = _ref.serviceName,
|
|
@@ -11436,12 +11467,18 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11436
11467
|
startPosition = _ref$startPosition === void 0 ? {
|
|
11437
11468
|
top: 150,
|
|
11438
11469
|
left: 900
|
|
11439
|
-
} : _ref$startPosition
|
|
11470
|
+
} : _ref$startPosition,
|
|
11471
|
+
selectedStyle = _ref.selectedStyle;
|
|
11440
11472
|
var styles = getLayerStyles(layer);
|
|
11441
11473
|
var dimensions = getDimensionsList(layer.dimensions);
|
|
11442
11474
|
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
11443
11475
|
t = _useWebmapReactTransl.t;
|
|
11444
11476
|
var bbox = getLayerBbox(t, layer);
|
|
11477
|
+
var legendURL = ((_layer$styles = layer.styles) === null || _layer$styles === void 0 || (_layer$styles = _layer$styles.find(function (styleItem) {
|
|
11478
|
+
return styleItem.name === selectedStyle;
|
|
11479
|
+
})) === null || _layer$styles === void 0 ? void 0 : _layer$styles.legendURL) || ((_layer$styles2 = layer.styles) === null || _layer$styles2 === void 0 ? void 0 : _layer$styles2[0].legendURL) ||
|
|
11480
|
+
// show first style if none selected
|
|
11481
|
+
undefined;
|
|
11445
11482
|
return jsx(ToolContainerDraggable, {
|
|
11446
11483
|
isOpen: isOpen,
|
|
11447
11484
|
onClose: onClose,
|
|
@@ -11490,7 +11527,7 @@ var LayerInfoDialog = function LayerInfoDialog(_ref) {
|
|
|
11490
11527
|
value: ((_layer$keywords = layer.keywords) === null || _layer$keywords === void 0 ? void 0 : _layer$keywords.join(', ')) || '-'
|
|
11491
11528
|
}), jsx(LayerInfoLegend, {
|
|
11492
11529
|
dimensions: layer.dimensions,
|
|
11493
|
-
legendURL:
|
|
11530
|
+
legendURL: legendURL,
|
|
11494
11531
|
name: layer.name,
|
|
11495
11532
|
title: layer.title
|
|
11496
11533
|
})]
|
|
@@ -12047,12 +12084,13 @@ var addFeatureProperties = function addFeatureProperties(geojson, featurePropert
|
|
|
12047
12084
|
* @returns Whether `feature` is empty or not
|
|
12048
12085
|
*/
|
|
12049
12086
|
var isGeoJSONGeometryEmpty = function isGeoJSONGeometryEmpty(feature) {
|
|
12050
|
-
|
|
12087
|
+
var _feature$geometry$coo, _feature$geometry$coo2, _feature$geometry$coo3;
|
|
12088
|
+
return feature.geometry && (feature.geometry.type === 'Polygon' && ((_feature$geometry$coo = feature.geometry.coordinates) === null || _feature$geometry$coo === void 0 ? void 0 : _feature$geometry$coo.length) === 1 && feature.geometry.coordinates[0].length === 0 || feature.geometry.type === 'LineString' && ((_feature$geometry$coo2 = feature.geometry.coordinates) === null || _feature$geometry$coo2 === void 0 ? void 0 : _feature$geometry$coo2.length) === 0 || feature.geometry.type === 'Point' && ((_feature$geometry$coo3 = feature.geometry.coordinates) === null || _feature$geometry$coo3 === void 0 ? void 0 : _feature$geometry$coo3.length) === 0);
|
|
12051
12089
|
};
|
|
12052
12090
|
var getGeoJSONPropertyValue = function getGeoJSONPropertyValue(property, properties, polygonDrawMode) {
|
|
12053
12091
|
var defaultProperties = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : defaultGeoJSONStyleProperties;
|
|
12054
12092
|
// if a shape is set, extract the style from there
|
|
12055
|
-
if (properties
|
|
12093
|
+
if ((properties === null || properties === void 0 ? void 0 : properties[property]) !== undefined) {
|
|
12056
12094
|
return properties[property];
|
|
12057
12095
|
}
|
|
12058
12096
|
// if active polygon tool is preset, retreive style from there
|
|
@@ -12107,7 +12145,7 @@ var moveFeature = function moveFeature(currentGeoJSON, newGeoJSON, featureLayerI
|
|
|
12107
12145
|
newGeoJSON.features.push(_copyFeature);
|
|
12108
12146
|
return newGeoJSON.features.length - 1;
|
|
12109
12147
|
}
|
|
12110
|
-
if (geometry.type === 'Point' && currentFeature
|
|
12148
|
+
if (geometry.type === 'Point' && (currentFeature === null || currentFeature === void 0 ? void 0 : currentFeature.geometry.type) === 'Point' && currentFeature.geometry.coordinates.length > 0 && reason === NEW_POINT_CREATED) {
|
|
12111
12149
|
var _copyFeature2 = _objectSpread2(_objectSpread2({}, currentFeature), selectionType && {
|
|
12112
12150
|
properties: _objectSpread2(_objectSpread2({}, feature.properties), {}, {
|
|
12113
12151
|
selectionType: selectionType
|
|
@@ -12764,12 +12802,13 @@ var ShowTimeAwareLayerInfo = function ShowTimeAwareLayerInfo(_ref) {
|
|
|
12764
12802
|
}
|
|
12765
12803
|
var itemWidth = Math.round(1000 / timeStepsToCheck.length);
|
|
12766
12804
|
return timeStepsToCheck.map(function (timeStep, index) {
|
|
12767
|
-
var _layer$getSource;
|
|
12805
|
+
var _layer$getSource, _layer$getSource2;
|
|
12768
12806
|
var closestValue = (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.getClosestValueForTime(timeStep)) || '';
|
|
12769
12807
|
var requestedStepIsOutsideRange = WMInvalidDateValues.has(closestValue);
|
|
12770
|
-
var
|
|
12808
|
+
var images = (layer === null || layer === void 0 || (_layer$getSource = layer.getSource()) === null || _layer$getSource === void 0 ? void 0 : _layer$getSource.getAltGeoReferencedImages(closestValue)) || [];
|
|
12771
12809
|
var isSelectedStep = visible && (wmTimeDim === null || wmTimeDim === void 0 ? void 0 : wmTimeDim.currentValue) === closestValue;
|
|
12772
|
-
var
|
|
12810
|
+
var colorImageIsLoading = layer !== null && layer !== void 0 && (_layer$getSource2 = layer.getSource()) !== null && _layer$getSource2 !== void 0 && _layer$getSource2.hasImageLoadedForTimeValue(closestValue) ? '#40AF50' : '#666666';
|
|
12811
|
+
var colorImageIsAvailable = (images === null || images === void 0 ? void 0 : images.length) > 0 ? colorImageIsLoading : '#FF0000';
|
|
12773
12812
|
var colorLayerIsOutsideRange = requestedStepIsOutsideRange ? '#5080FA' : colorImageIsAvailable;
|
|
12774
12813
|
var height = requestedStepIsOutsideRange ? '15px' : '20px';
|
|
12775
12814
|
var top = requestedStepIsOutsideRange ? '5px' : '2px';
|
|
@@ -12878,7 +12917,8 @@ var TimeawareImageSourceWMSLayer = function TimeawareImageSourceWMSLayer(_ref) {
|
|
|
12878
12917
|
layerOptions = _ref.layerOptions,
|
|
12879
12918
|
styleName = _ref.styleName,
|
|
12880
12919
|
layerName = _ref.layerName,
|
|
12881
|
-
dimensions = _ref.dimensions,
|
|
12920
|
+
_ref$dimensions = _ref.dimensions,
|
|
12921
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
12882
12922
|
debugMode = _ref.debugMode,
|
|
12883
12923
|
_ref$visible = _ref.visible,
|
|
12884
12924
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
@@ -13738,7 +13778,7 @@ var FeatureLayer = function FeatureLayer(_ref) {
|
|
|
13738
13778
|
var previousHover = [];
|
|
13739
13779
|
var pointerMoveFunction = debounce(function (evt) {
|
|
13740
13780
|
var hoveredFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
|
|
13741
|
-
if (!layer || layer.getSource() !== source) {
|
|
13781
|
+
if (!layer || (layer === null || layer === void 0 ? void 0 : layer.getSource()) !== source) {
|
|
13742
13782
|
return false;
|
|
13743
13783
|
}
|
|
13744
13784
|
return feature;
|
|
@@ -13854,7 +13894,8 @@ var TimeAwareEDRLocationLayer = function TimeAwareEDRLocationLayer(_ref) {
|
|
|
13854
13894
|
style = _ref.style,
|
|
13855
13895
|
zIndex = _ref.zIndex,
|
|
13856
13896
|
opacity = _ref.opacity,
|
|
13857
|
-
dimensions = _ref.dimensions,
|
|
13897
|
+
_ref$dimensions = _ref.dimensions,
|
|
13898
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
13858
13899
|
layerId = _ref.layerId,
|
|
13859
13900
|
_ref$visible = _ref.visible,
|
|
13860
13901
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
@@ -14248,7 +14289,8 @@ var TimeAwareGeoTIFFLayer = function TimeAwareGeoTIFFLayer(_ref) {
|
|
|
14248
14289
|
_ref.style;
|
|
14249
14290
|
var zIndex = _ref.zIndex,
|
|
14250
14291
|
opacity = _ref.opacity,
|
|
14251
|
-
dimensions = _ref.dimensions,
|
|
14292
|
+
_ref$dimensions = _ref.dimensions,
|
|
14293
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
14252
14294
|
layerId = _ref.layerId,
|
|
14253
14295
|
_ref$visible = _ref.visible,
|
|
14254
14296
|
visible = _ref$visible === void 0 ? true : _ref$visible,
|
|
@@ -14340,7 +14382,8 @@ var registerProjection = function registerProjection(wkt2) {
|
|
|
14340
14382
|
var TimeAwareWMTSLayer = function TimeAwareWMTSLayer(_ref) {
|
|
14341
14383
|
var getCapsURL = _ref.getCapsURL,
|
|
14342
14384
|
layerName = _ref.layerName,
|
|
14343
|
-
dimensions = _ref.dimensions,
|
|
14385
|
+
_ref$dimensions = _ref.dimensions,
|
|
14386
|
+
dimensions = _ref$dimensions === void 0 ? [] : _ref$dimensions,
|
|
14344
14387
|
layerOptions = _ref.layerOptions,
|
|
14345
14388
|
layerId = _ref.layerId,
|
|
14346
14389
|
onInitializeLayer = _ref.onInitializeLayer,
|
|
@@ -15422,11 +15465,11 @@ var FEATURE_VERTICES_EDIT_HANDLES = new Style$1({
|
|
|
15422
15465
|
image: FEATURE_VERTICE_IMAGE,
|
|
15423
15466
|
geometry: function geometry(feature) {
|
|
15424
15467
|
var geom = feature === null || feature === void 0 ? void 0 : feature.getGeometry();
|
|
15425
|
-
if (geom
|
|
15468
|
+
if ((geom === null || geom === void 0 ? void 0 : geom.getType()) === 'Polygon') {
|
|
15426
15469
|
var coordinates = geom.getCoordinates()[0];
|
|
15427
15470
|
return new MultiPoint(coordinates);
|
|
15428
15471
|
}
|
|
15429
|
-
if (geom
|
|
15472
|
+
if ((geom === null || geom === void 0 ? void 0 : geom.getType()) === 'LineString') {
|
|
15430
15473
|
var _coordinates = geom.getCoordinates();
|
|
15431
15474
|
return new MultiPoint(_coordinates);
|
|
15432
15475
|
}
|
|
@@ -15937,7 +15980,7 @@ var drawPolygonLikeFeatureStyle = function drawPolygonLikeFeatureStyle(feature)
|
|
|
15937
15980
|
image: FEATURE_VERTICE_IMAGE,
|
|
15938
15981
|
geometry: function geometry(feature) {
|
|
15939
15982
|
var geom = feature === null || feature === void 0 ? void 0 : feature.getGeometry();
|
|
15940
|
-
if (geom
|
|
15983
|
+
if ((geom === null || geom === void 0 ? void 0 : geom.getType()) === 'LineString') {
|
|
15941
15984
|
var coordinates = geom.getCoordinates();
|
|
15942
15985
|
return new MultiPoint(coordinates);
|
|
15943
15986
|
}
|
|
@@ -16190,7 +16233,7 @@ var createBoxBasedOnModifiedVertex = function createBoxBasedOnModifiedVertex(mod
|
|
|
16190
16233
|
var getBoxRotateHandlePoints = function getBoxRotateHandlePoints(feature, resolution) {
|
|
16191
16234
|
var originalGeometry = feature === null || feature === void 0 ? void 0 : feature.get('originalGeometry');
|
|
16192
16235
|
var geom = originalGeometry ? createBoxBasedOnModifiedVertex(feature.getGeometry(), originalGeometry, feature.get('selectionType') === 'square') : feature === null || feature === void 0 ? void 0 : feature.getGeometry();
|
|
16193
|
-
if (!geom || geom.getType() !== 'Polygon') {
|
|
16236
|
+
if (!geom || (geom === null || geom === void 0 ? void 0 : geom.getType()) !== 'Polygon') {
|
|
16194
16237
|
return undefined;
|
|
16195
16238
|
}
|
|
16196
16239
|
var ring = geom.getCoordinates()[0];
|
|
@@ -16350,6 +16393,7 @@ var drawStyles = {
|
|
|
16350
16393
|
POINT: pointFeatureStyle,
|
|
16351
16394
|
MULTIPOINT: pointFeatureStyle,
|
|
16352
16395
|
LOCATION: locationFeatureStyle,
|
|
16396
|
+
ROTATABLEBOX: drawPolygonLikeFeatureStyle,
|
|
16353
16397
|
DELETE: [],
|
|
16354
16398
|
'': []
|
|
16355
16399
|
};
|
|
@@ -16365,6 +16409,7 @@ var modifyStyles = {
|
|
|
16365
16409
|
POINT: modifyPointFeatureStyle,
|
|
16366
16410
|
MULTIPOINT: modifyPointFeatureStyle,
|
|
16367
16411
|
LOCATION: locationFeatureStyle,
|
|
16412
|
+
ROTATABLEBOX: boxModificationStyle,
|
|
16368
16413
|
DELETE: [],
|
|
16369
16414
|
'': []
|
|
16370
16415
|
};
|
|
@@ -16399,6 +16444,7 @@ var DRAWMODE;
|
|
|
16399
16444
|
DRAWMODE["OVAL"] = "OVAL";
|
|
16400
16445
|
DRAWMODE["LOCATION"] = "LOCATION";
|
|
16401
16446
|
DRAWMODE["FREEHANDLINE"] = "FREEHANDLINE";
|
|
16447
|
+
DRAWMODE["ROTATABLEBOX"] = "ROTATABLEBOX";
|
|
16402
16448
|
})(DRAWMODE || (DRAWMODE = {}));
|
|
16403
16449
|
|
|
16404
16450
|
var createDrawOperation = function createDrawOperation(type) {
|
|
@@ -16418,6 +16464,7 @@ var createDrawOperation = function createDrawOperation(type) {
|
|
|
16418
16464
|
geometryFunction: createRegularPolygon(4)
|
|
16419
16465
|
};
|
|
16420
16466
|
case 'BOX':
|
|
16467
|
+
case 'ROTATABLEBOX':
|
|
16421
16468
|
return {
|
|
16422
16469
|
type: 'Circle',
|
|
16423
16470
|
geometryFunction: createBox()
|
|
@@ -16462,6 +16509,8 @@ var selectionTypeToDrawModeValue = function selectionTypeToDrawModeValue(selecti
|
|
|
16462
16509
|
return DRAWMODE.SQUARE;
|
|
16463
16510
|
case 'box':
|
|
16464
16511
|
return DRAWMODE.BOX;
|
|
16512
|
+
case 'rotatable-box':
|
|
16513
|
+
return DRAWMODE.ROTATABLEBOX;
|
|
16465
16514
|
case 'oval':
|
|
16466
16515
|
return DRAWMODE.OVAL;
|
|
16467
16516
|
case 'point':
|
|
@@ -16503,7 +16552,9 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16503
16552
|
geojson = _ref.geojson,
|
|
16504
16553
|
selectedFeatureIndex = _ref.selectedFeatureIndex,
|
|
16505
16554
|
exitDrawModeCallback = _ref.exitDrawModeCallback,
|
|
16506
|
-
updateGeojson = _ref.updateGeojson
|
|
16555
|
+
updateGeojson = _ref.updateGeojson,
|
|
16556
|
+
onViewOnlyFeatureClick = _ref.onViewOnlyFeatureClick,
|
|
16557
|
+
onNoFeatureClick = _ref.onNoFeatureClick;
|
|
16507
16558
|
var _React$useContext = React.useContext(MapContext),
|
|
16508
16559
|
map = _React$useContext.map;
|
|
16509
16560
|
var projection = useProjection();
|
|
@@ -16532,7 +16583,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16532
16583
|
style: viewOnlyStyle,
|
|
16533
16584
|
zIndex: 1000000 - 1
|
|
16534
16585
|
});
|
|
16535
|
-
var editFeatureCollection = new Collection([allFeatures[selectedFeatureIndex]]);
|
|
16586
|
+
var editFeatureCollection = new Collection(allFeatures[selectedFeatureIndex] ? [allFeatures[selectedFeatureIndex]] : []);
|
|
16536
16587
|
var source = new VectorSource({
|
|
16537
16588
|
features: editFeatureCollection
|
|
16538
16589
|
});
|
|
@@ -16546,6 +16597,26 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16546
16597
|
map.addLayer(layer);
|
|
16547
16598
|
map.addLayer(viewOnlyLayer);
|
|
16548
16599
|
var interactions = [];
|
|
16600
|
+
var handleSingleClick = (onViewOnlyFeatureClick || onNoFeatureClick) && function (event) {
|
|
16601
|
+
var features = [];
|
|
16602
|
+
map.forEachFeatureAtPixel(event.pixel, function (featureAtPixel, layerAtPixel) {
|
|
16603
|
+
if (layerAtPixel === viewOnlyLayer || layerAtPixel === layer) {
|
|
16604
|
+
features.push(featureAtPixel);
|
|
16605
|
+
}
|
|
16606
|
+
}, {
|
|
16607
|
+
layerFilter: function layerFilter(layerAtPixel) {
|
|
16608
|
+
return layerAtPixel === viewOnlyLayer || layerAtPixel === layer;
|
|
16609
|
+
}
|
|
16610
|
+
});
|
|
16611
|
+
if (features.length) {
|
|
16612
|
+
onViewOnlyFeatureClick === null || onViewOnlyFeatureClick === void 0 || onViewOnlyFeatureClick(features);
|
|
16613
|
+
} else {
|
|
16614
|
+
onNoFeatureClick === null || onNoFeatureClick === void 0 || onNoFeatureClick();
|
|
16615
|
+
}
|
|
16616
|
+
};
|
|
16617
|
+
if (handleSingleClick) {
|
|
16618
|
+
map.on('singleclick', handleSingleClick);
|
|
16619
|
+
}
|
|
16549
16620
|
var updateFeature = function updateFeature(feature) {
|
|
16550
16621
|
var _feature$getGeometry;
|
|
16551
16622
|
// Convert Circle to Polygon for GeoJSON serialization
|
|
@@ -16624,6 +16695,20 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16624
16695
|
var lastPointerEvent = null;
|
|
16625
16696
|
var trackPointerMove = function trackPointerMove(event) {
|
|
16626
16697
|
lastPointerEvent = event;
|
|
16698
|
+
if (onViewOnlyFeatureClick) {
|
|
16699
|
+
var pixel = map.getEventPixel(event);
|
|
16700
|
+
var hasViewOnlyHit = false;
|
|
16701
|
+
map.forEachFeatureAtPixel(pixel, function (_featureAtPixel, layerAtPixel) {
|
|
16702
|
+
if (layerAtPixel === viewOnlyLayer) {
|
|
16703
|
+
hasViewOnlyHit = true;
|
|
16704
|
+
}
|
|
16705
|
+
}, {
|
|
16706
|
+
layerFilter: function layerFilter(layerAtPixel) {
|
|
16707
|
+
return layerAtPixel === viewOnlyLayer;
|
|
16708
|
+
}
|
|
16709
|
+
});
|
|
16710
|
+
map.getViewport().style.cursor = hasViewOnlyHit ? 'pointer' : '';
|
|
16711
|
+
}
|
|
16627
16712
|
// Update which rotate handle is "active" so only that
|
|
16628
16713
|
// icon is rendered near the mouse when editing boxes/squares.
|
|
16629
16714
|
// While rotating, keep the originally clicked handle active.
|
|
@@ -16636,7 +16721,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16636
16721
|
var handlePoints = getBoxRotateHandlePoints(featureToRotate, resolution);
|
|
16637
16722
|
var prevIndex = featureToRotate.get('activeRotateHandleIndex');
|
|
16638
16723
|
var newIndex;
|
|
16639
|
-
if (!handlePoints || !resolution) {
|
|
16724
|
+
if (!handlePoints || !resolution || !isBoxOrSquareRotatable) {
|
|
16640
16725
|
newIndex = undefined;
|
|
16641
16726
|
} else {
|
|
16642
16727
|
var coord = map.getEventCoordinate(event);
|
|
@@ -16679,7 +16764,8 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16679
16764
|
};
|
|
16680
16765
|
window.addEventListener('keydown', deleteVertexOnDeleteKey);
|
|
16681
16766
|
var isSquare = actualDrawMode === DRAWMODE.SQUARE;
|
|
16682
|
-
var
|
|
16767
|
+
var isBoxOrSquareRotatable = actualDrawMode === DRAWMODE.ROTATABLEBOX || isSquare;
|
|
16768
|
+
var isBoxOrSquare = actualDrawMode === DRAWMODE.BOX || isBoxOrSquareRotatable;
|
|
16683
16769
|
// Modifying is a combination of Modify and Translate interactions
|
|
16684
16770
|
var modify = new Modify({
|
|
16685
16771
|
features: editFeatureCollection,
|
|
@@ -16698,7 +16784,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16698
16784
|
feature.set('suppressRotateHandle', true, true);
|
|
16699
16785
|
feature.set('originalGeometry', (_feature$getGeometry2 = feature.getGeometry()) === null || _feature$getGeometry2 === void 0 ? void 0 : _feature$getGeometry2.clone(), true);
|
|
16700
16786
|
var viewport = map.getViewport();
|
|
16701
|
-
if (viewport && viewport.style) {
|
|
16787
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16702
16788
|
viewport.style.cursor = 'grabbing';
|
|
16703
16789
|
}
|
|
16704
16790
|
});
|
|
@@ -16709,7 +16795,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16709
16795
|
// Re-enable rotate handle visibility after modifying.
|
|
16710
16796
|
feature.unset('suppressRotateHandle', true);
|
|
16711
16797
|
var viewport = map.getViewport();
|
|
16712
|
-
if (viewport && viewport.style) {
|
|
16798
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16713
16799
|
viewport.style.cursor = '';
|
|
16714
16800
|
}
|
|
16715
16801
|
updateFeature(feature);
|
|
@@ -16717,13 +16803,13 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16717
16803
|
} else {
|
|
16718
16804
|
modify.on('modifystart', function () {
|
|
16719
16805
|
var viewport = map.getViewport();
|
|
16720
|
-
if (viewport && viewport.style) {
|
|
16806
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16721
16807
|
viewport.style.cursor = 'grabbing';
|
|
16722
16808
|
}
|
|
16723
16809
|
});
|
|
16724
16810
|
modify.on('modifyend', function (evt) {
|
|
16725
16811
|
var viewport = map.getViewport();
|
|
16726
|
-
if (viewport && viewport.style) {
|
|
16812
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16727
16813
|
viewport.style.cursor = '';
|
|
16728
16814
|
}
|
|
16729
16815
|
updateFeature(evt.features.getArray()[0]);
|
|
@@ -16750,7 +16836,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16750
16836
|
}
|
|
16751
16837
|
var feature = editFeatureCollection.item(0);
|
|
16752
16838
|
var geom = feature === null || feature === void 0 ? void 0 : feature.getGeometry();
|
|
16753
|
-
if (!geom || geom.getType() !== 'Polygon') {
|
|
16839
|
+
if (!geom || (geom === null || geom === void 0 ? void 0 : geom.getType()) !== 'Polygon') {
|
|
16754
16840
|
return;
|
|
16755
16841
|
}
|
|
16756
16842
|
var polygon = geom;
|
|
@@ -16778,7 +16864,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16778
16864
|
});
|
|
16779
16865
|
if (closestDist <= threshold) {
|
|
16780
16866
|
var viewport = map.getViewport();
|
|
16781
|
-
if (viewport && viewport.style) {
|
|
16867
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16782
16868
|
viewport.style.cursor = 'grabbing';
|
|
16783
16869
|
}
|
|
16784
16870
|
isPointerDownNearCorner = true;
|
|
@@ -16789,18 +16875,18 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16789
16875
|
return;
|
|
16790
16876
|
}
|
|
16791
16877
|
var viewport = map.getViewport();
|
|
16792
|
-
if (viewport && viewport.style) {
|
|
16878
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16793
16879
|
viewport.style.cursor = '';
|
|
16794
16880
|
}
|
|
16795
16881
|
isPointerDownNearCorner = false;
|
|
16796
16882
|
};
|
|
16797
16883
|
var startRotateIfOnHandle = function startRotateIfOnHandle(event) {
|
|
16798
|
-
if (!
|
|
16884
|
+
if (!isBoxOrSquareRotatable || !selectedFeatureHasGeometry) {
|
|
16799
16885
|
return;
|
|
16800
16886
|
}
|
|
16801
16887
|
var featureToRotate = editFeatureCollection.item(0);
|
|
16802
16888
|
var geom = featureToRotate === null || featureToRotate === void 0 ? void 0 : featureToRotate.getGeometry();
|
|
16803
|
-
if (!geom || geom.getType() !== 'Polygon') {
|
|
16889
|
+
if (!geom || (geom === null || geom === void 0 ? void 0 : geom.getType()) !== 'Polygon') {
|
|
16804
16890
|
return;
|
|
16805
16891
|
}
|
|
16806
16892
|
var polygon = geom;
|
|
@@ -16890,7 +16976,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16890
16976
|
});
|
|
16891
16977
|
// While rotating, show a grabbing cursor on the map viewport
|
|
16892
16978
|
var viewport = map.getViewport();
|
|
16893
|
-
if (viewport && viewport.style) {
|
|
16979
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16894
16980
|
viewport.style.cursor = 'grabbing';
|
|
16895
16981
|
}
|
|
16896
16982
|
// While rotating, disable modify/translate to avoid conflicts
|
|
@@ -16904,7 +16990,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16904
16990
|
}
|
|
16905
16991
|
var featureToRotate = editFeatureCollection.item(0);
|
|
16906
16992
|
var geom = featureToRotate === null || featureToRotate === void 0 ? void 0 : featureToRotate.getGeometry();
|
|
16907
|
-
if (!geom || geom.getType() !== 'Polygon') {
|
|
16993
|
+
if (!geom || (geom === null || geom === void 0 ? void 0 : geom.getType()) !== 'Polygon') {
|
|
16908
16994
|
return;
|
|
16909
16995
|
}
|
|
16910
16996
|
var polygon = geom;
|
|
@@ -16952,7 +17038,7 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
16952
17038
|
disabledDragPans = [];
|
|
16953
17039
|
// Restore the default cursor when rotation stops
|
|
16954
17040
|
var viewport = map.getViewport();
|
|
16955
|
-
if (viewport && viewport.style) {
|
|
17041
|
+
if (viewport !== null && viewport !== void 0 && viewport.style) {
|
|
16956
17042
|
viewport.style.cursor = '';
|
|
16957
17043
|
}
|
|
16958
17044
|
modify.setActive(true);
|
|
@@ -17022,8 +17108,14 @@ var OpenLayersMapDraw = function OpenLayersMapDraw(_ref) {
|
|
|
17022
17108
|
_viewport.removeEventListener('pointerup', handlePointerUpAfterCorner);
|
|
17023
17109
|
}
|
|
17024
17110
|
window.removeEventListener('keydown', deleteVertexOnDeleteKey);
|
|
17111
|
+
if (handleSingleClick) {
|
|
17112
|
+
map.un('singleclick', handleSingleClick);
|
|
17113
|
+
}
|
|
17114
|
+
if (onViewOnlyFeatureClick) {
|
|
17115
|
+
map.getViewport().style.cursor = '';
|
|
17116
|
+
}
|
|
17025
17117
|
};
|
|
17026
|
-
}, [map, isInEditMode, geojson, projection, viewOnlyStyle, selectedFeatureIndex, exitDrawModeCallback, updateGeojson, drawMode]);
|
|
17118
|
+
}, [map, isInEditMode, geojson, projection, viewOnlyStyle, selectedFeatureIndex, exitDrawModeCallback, updateGeojson, drawMode, onViewOnlyFeatureClick, onNoFeatureClick]);
|
|
17027
17119
|
return null;
|
|
17028
17120
|
};
|
|
17029
17121
|
|
|
@@ -17050,6 +17142,7 @@ var getIcon = function getIcon(selectionType) {
|
|
|
17050
17142
|
case 'poly':
|
|
17051
17143
|
return jsx(DrawToolPolygon, {});
|
|
17052
17144
|
case 'box':
|
|
17145
|
+
case 'rotatable-box':
|
|
17053
17146
|
return jsx(DrawToolRectangle, {});
|
|
17054
17147
|
case 'linestring':
|
|
17055
17148
|
return jsx(DrawToolLineString, {});
|
|
@@ -17159,8 +17252,16 @@ var defaultSmoothLine = {
|
|
|
17159
17252
|
isSelectable: true,
|
|
17160
17253
|
selectionType: 'smooth-line'
|
|
17161
17254
|
};
|
|
17162
|
-
var
|
|
17163
|
-
|
|
17255
|
+
var defaultRotatableBox = {
|
|
17256
|
+
drawModeId: 'drawtools-rotatable-box',
|
|
17257
|
+
value: DRAWMODE.ROTATABLEBOX,
|
|
17258
|
+
title: "".concat(WEBMAP_REACT_NAMESPACE, ":webmap-react-rotatable-box"),
|
|
17259
|
+
shape: emptyPolygon,
|
|
17260
|
+
isSelectable: true,
|
|
17261
|
+
selectionType: 'rotatable-box'
|
|
17262
|
+
};
|
|
17263
|
+
var defaultModes = [defaultPolygon, defaultLineString, defaultFreehandLine, defaultOval, defaultCircle, defaultBox, defaultSquare, defaultPoint, defaultLocation, defaultDelete, defaultRotatableBox];
|
|
17264
|
+
var currentlySupportedDrawModes = [defaultPolygon, defaultLineString, defaultFreehandLine, defaultCircle, defaultSquare, defaultPoint, defaultDelete, defaultSmoothLine, defaultOval, defaultBox, defaultLocation, defaultRotatableBox];
|
|
17164
17265
|
var useMapDrawTool = function useMapDrawTool(_ref) {
|
|
17165
17266
|
var _ref$defaultDrawModes = _ref.defaultDrawModes,
|
|
17166
17267
|
defaultDrawModes = _ref$defaultDrawModes === void 0 ? defaultModes : _ref$defaultDrawModes,
|
|
@@ -19078,32 +19179,42 @@ var Clock = function Clock(_ref2) {
|
|
|
19078
19179
|
var time = _ref2.time,
|
|
19079
19180
|
_ref2$isVisible = _ref2.isVisible,
|
|
19080
19181
|
isClockVisible = _ref2$isVisible === void 0 ? true : _ref2$isVisible,
|
|
19081
|
-
onToggleClock = _ref2.onToggleClock
|
|
19082
|
-
|
|
19083
|
-
|
|
19084
|
-
var clockElement = useRef(null);
|
|
19085
|
-
var _useState = useState({
|
|
19182
|
+
onToggleClock = _ref2.onToggleClock,
|
|
19183
|
+
_ref2$position = _ref2.position,
|
|
19184
|
+
position = _ref2$position === void 0 ? {
|
|
19086
19185
|
x: 0,
|
|
19087
19186
|
y: 0
|
|
19088
|
-
}
|
|
19089
|
-
|
|
19090
|
-
|
|
19091
|
-
|
|
19092
|
-
useMakeSureContainerStaysInsideWindow(clockElement, position, setPosition);
|
|
19093
|
-
var _useState3 = useState({
|
|
19187
|
+
} : _ref2$position,
|
|
19188
|
+
onSetPosition = _ref2.onSetPosition,
|
|
19189
|
+
_ref2$size = _ref2.size,
|
|
19190
|
+
size = _ref2$size === void 0 ? {
|
|
19094
19191
|
width: MIN_WIDTH,
|
|
19095
19192
|
height: MIN_HEIGHT
|
|
19096
|
-
}
|
|
19193
|
+
} : _ref2$size,
|
|
19194
|
+
onSetSize = _ref2.onSetSize;
|
|
19195
|
+
var _useWebmapReactTransl = useWebmapReactTranslation(),
|
|
19196
|
+
t = _useWebmapReactTransl.t;
|
|
19197
|
+
var clockElement = useRef(null);
|
|
19198
|
+
useMakeSureContainerStaysInsideWindow(clockElement, position, onSetPosition);
|
|
19199
|
+
var _useState = useState(FONT_SIZE_WIDTH_RATIO * size.width),
|
|
19200
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19201
|
+
resizeFontSize = _useState2[0],
|
|
19202
|
+
setResizeFontSize = _useState2[1];
|
|
19203
|
+
var _useState3 = useState(false),
|
|
19097
19204
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
fontSize = _useState6[0],
|
|
19103
|
-
setFontSize = _useState6[1];
|
|
19205
|
+
isResizing = _useState4[0],
|
|
19206
|
+
setIsResizing = _useState4[1];
|
|
19207
|
+
// While resizing, use the local font size. Once you finish and the width has been updated, revert back to the size as determined from width
|
|
19208
|
+
var fontSize = isResizing ? resizeFontSize : FONT_SIZE_WIDTH_RATIO * size.width;
|
|
19104
19209
|
var toggleClock = function toggleClock(isClockVisible) {
|
|
19105
19210
|
onToggleClock === null || onToggleClock === void 0 || onToggleClock(isClockVisible);
|
|
19106
19211
|
};
|
|
19212
|
+
var setPosition = function setPosition(position) {
|
|
19213
|
+
onSetPosition === null || onSetPosition === void 0 || onSetPosition(position);
|
|
19214
|
+
};
|
|
19215
|
+
var setSize = function setSize(size) {
|
|
19216
|
+
onSetSize === null || onSetSize === void 0 || onSetSize(size);
|
|
19217
|
+
};
|
|
19107
19218
|
return jsx(Fragment, {
|
|
19108
19219
|
children: !isClockVisible ? jsx(CustomIconButton, {
|
|
19109
19220
|
"aria-label": t('clock-show'),
|
|
@@ -19124,7 +19235,10 @@ var Clock = function Clock(_ref2) {
|
|
|
19124
19235
|
cancel: ".MuiButtonBase-root",
|
|
19125
19236
|
nodeRef: clockElement,
|
|
19126
19237
|
onStop: function onStop(_event, position) {
|
|
19127
|
-
setPosition(
|
|
19238
|
+
setPosition({
|
|
19239
|
+
x: position.x,
|
|
19240
|
+
y: position.y
|
|
19241
|
+
});
|
|
19128
19242
|
},
|
|
19129
19243
|
position: position,
|
|
19130
19244
|
children: jsx("div", {
|
|
@@ -19150,15 +19264,21 @@ var Clock = function Clock(_ref2) {
|
|
|
19150
19264
|
lockAspectRatio: true,
|
|
19151
19265
|
minHeight: MIN_HEIGHT,
|
|
19152
19266
|
minWidth: MIN_WIDTH + BUTTON_WIDTH,
|
|
19267
|
+
nodeRef: clockElement,
|
|
19153
19268
|
onResize: function onResize(_event, _direction, _ref, delta) {
|
|
19154
19269
|
var width = size.width + delta.width;
|
|
19155
|
-
var
|
|
19156
|
-
|
|
19157
|
-
|
|
19270
|
+
var fontSize = FONT_SIZE_WIDTH_RATIO * width;
|
|
19271
|
+
setResizeFontSize(fontSize);
|
|
19272
|
+
},
|
|
19273
|
+
onResizeStart: function onResizeStart() {
|
|
19274
|
+
setIsResizing(true);
|
|
19275
|
+
setResizeFontSize(FONT_SIZE_WIDTH_RATIO * size.width);
|
|
19158
19276
|
},
|
|
19159
19277
|
onResizeStop: function onResizeStop(_event, _direction, _ref, delta) {
|
|
19160
19278
|
var width = size.width + delta.width;
|
|
19161
19279
|
var height = size.height + delta.height;
|
|
19280
|
+
setIsResizing(false);
|
|
19281
|
+
setResizeFontSize(FONT_SIZE_WIDTH_RATIO * width);
|
|
19162
19282
|
setSize({
|
|
19163
19283
|
width: width,
|
|
19164
19284
|
height: height
|
|
@@ -19254,4 +19374,4 @@ var getLayerUpdateInfo = function getLayerUpdateInfo(wmLayer, mapId) {
|
|
|
19254
19374
|
return updateObject;
|
|
19255
19375
|
};
|
|
19256
19376
|
|
|
19257
|
-
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultSmoothLine, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, fakeEdrLayerApiHandlers, featureMultiPoint, featurePoint, featurePolygon, fetchStacCollection, fetchStacItem, fetchStacItems, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getBoxRotateHandlePoints, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isPointFeatureCollection, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, rewindGeometry, roundCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useFetchGeoTIFFBlob, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCollection, useStacItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|
|
19377
|
+
export { BaseLayerType, CLASSNAME_MAP_MEASURE_TOOLTIP, ClickOnMapTool, Clock, DEFAULT_GEOJSON_STYLE_FILL_OPACITY, DRAWMODE, DefaultBaseLayers, DimensionSelectButton, DimensionSelectDialog, DimensionSelectSlider, EditModeButton as EditModeButtonField, FEATURE_DRAW_FILL_COLOR, FEATURE_DRAW_FILL_COLOR_TRANSPARENT, FEATURE_DRAW_SECONDARY_FILL_COLOR, FEATURE_DRAW_SECONDARY_STROKE_COLOR, FEATURE_DRAW_STROKE_COLOR, FEATURE_FILL, FEATURE_FILL_SELECTED, FEATURE_STROKE, FEATURE_STROKE_EDIT, FEATURE_STROKE_SELECTED, FEATURE_VERTICES_EDIT_HANDLES, FEATURE_VERTICE_HANDLE_IMAGE, FEATURE_VERTICE_IMAGE, FeatureLayer, FeatureLayers, GeoJSONTextField, IntersectionSelect, LayerInfoButton, LayerInfoDialog, LayerInfoLegend, LayerInfoList, LayerInfoText, Legend, LegendButton, LegendDialog, LegendLayout, MIN_HEIGHT, MIN_WIDTH, MapContext, MapControlButton, MapControls, MapDimensionSelect, MapFeatureClass, MapMeasure, MapTime, MapWarningProperties, NEW_FEATURE_CREATED, NEW_LINESTRING_CREATED, NEW_POINT_CREATED, OpenLayersFeatureLayer, OpenLayersGetFeatureInfo, OpenLayersLayer, OpenLayersMapDraw, OpenLayersMapView, OpenLayersZoomControl, SelectField, StoryLayoutGrid, TimeAwareEDRLocationLayer, TimeAwareGeoTIFFLayer, TimeAwareWMTSLayer, TimeContext, TimeawareImageSource, TimeawareImageSourceWMSLayer, WEBMAP_REACT_NAMESPACE, WMSLayer, WMTSLayer, XYZLayer, ZoomControls, addFeatureProperties, addGeoJSONProperties, addSelectionTypeToGeoJSON, basicExampleDrawOptions, basicExampleMultipleShapeDrawOptions, basicExampleMultipleShapeWithValuesDrawOptions, catmullRomSpline, clearImageCacheForAllMaps, colorMaps, createBoxBasedOnModifiedVertex, createIconStyle, createInterSections, createOval, currentlySupportedDrawModes, defaultBox, defaultCircle, defaultDelete, defaultEdrStyles, defaultFreehandLine, defaultGeoJSONStyleProperties, defaultIntersectionStyleProperties, defaultLayers, defaultLineString, defaultLocation, defaultModes, defaultOval, defaultPoint, defaultPolygon, defaultRotatableBox, defaultSmoothLine, defaultSquare, defaultTimeFormat, dimensionConfig, drawPolyStoryStyles, drawStyles, emptyGeoJSON, endToolExampleConfig, exampleIntersectionOptions, exampleIntersectionWithShapeOptions, exampleIntersections, exampleIntersectionsMultiDrawTool, fakeEdrLayerApiHandlers, featureMultiPoint, featurePoint, featurePolygon, fetchStacCollection, fetchStacItem, fetchStacItems, fillOptions, firSelectionType, formatTime, generateImageFromLegend, genericOpenLayersFeatureStyle, geowebColorToOpenLayersColor, getBoxRotateHandlePoints, getDimensionIcon, getDimensionLabel, getDimensionValue, getDimensionsList, getDoubleControlToolIcon, getDrawModeIdFromSelectionType, getFeatureCollection, getFeatureExtent, getFeaturePointStyle, getFirTitle, getGeoJSONPropertyValue, getGeoJson, getIcon, getIntersectionToolIcon, getIsInsideAcceptanceTime, getLastEmptyFeatureIndex, getLayerBbox, getLayerStyles, getLayerUpdateInfo, getLegendClass, getProj4, getTimeDimension, getToolIcon, initializeOpenLayersProjections, inlineFeatureStyle, intersectPointGeoJSONS, intersectPolygonGeoJSONS, intersectionFeatureBE, intersectionFeatureNL, isGeoJSONFeatureCreatedByTool, isGeoJSONGeometryEmpty, isPointFeatureCollection, labelOptions, lineString, lineStringCollection, makeFeatureStyleDisc, makeFeatureStyleLoading, makeFeatureStyleMultiParam, makeFeatureStyleMultiParamLoading, makeFeatureStyleWind, makeLegendFromColorMap, makeLegendFromStyleName, makeTimeList, makeView, marksByDimension, measureResultStyle, measureToolStyle, modifyStyles, moveFeature, multiLineStringLabelStyle, multiPolygonLabelStyle, opacityOptions, openLayersGetMapImageStore, precipitationMMLegendColorsWoW, projectorCache, publicLayers, publicServices, rewindGeometry, roundCoordinates, selectPreferredWMSProjection, setMapCenter, setViewFromExtent, setViewFromFeature, simpleBoxGeoJSON, simpleBoxGeoJSONWrongOrder, simpleFlightRouteLineStringGeoJSON, simpleFlightRoutePointsGeoJSON, simpleGeometryCollectionGeoJSON, simpleLineStringGeoJSON, simpleMultiPolygon, simplePointsGeojson, simplePolygonGeoJSON, simpleSmallLineStringGeoJSON, startToolExampleConfig, strokeWidthOptions, styleNameToStyleLike, temperatureLegendColorsCWK, temperatureLegendColorsWoW, textLabelStyle, textStyle, textStyleWithMargin, updateEditModeButtonsWithFir, useAnimationForLayer, useEDRGetCollectionDetails, useEDRGetParameterData, useEDRWMLayer, useFetchGeoTIFFBlob, useGeoJSON, useGetWMLayerInstance, useGetWMSLayerStyleList, useIconStyle, useMapDrawTool, useProjection, useQueryGetWMSGetCapabilities, useQueryGetWMSLayer, useQueryGetWMSLayers, useQueryGetWMSLayersTree, useQueryGetWMSServiceInfo, useQueryWMTSGetCapabilities, useSetIntervalWhenVisible, useStacCollection, useStacItems, useViewFromLayer, viewUtils, webmapEDRQueryOptions, webmapReactTranslations };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.3.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": "15.
|
|
12
|
-
"@opengeoweb/theme": "15.
|
|
13
|
-
"@opengeoweb/shared": "15.
|
|
11
|
+
"@opengeoweb/webmap": "15.3.0",
|
|
12
|
+
"@opengeoweb/theme": "15.3.0",
|
|
13
|
+
"@opengeoweb/shared": "15.3.0",
|
|
14
14
|
"lodash": "^4.17.21",
|
|
15
15
|
"ol": "^10.4.0",
|
|
16
16
|
"proj4": "^2.9.2",
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
+
export declare const MIN_WIDTH = 170;
|
|
3
|
+
export declare const MIN_HEIGHT = 32;
|
|
4
|
+
export interface Position {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Size {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
2
12
|
export declare const Clock: FC<{
|
|
3
13
|
time: number;
|
|
4
14
|
isVisible?: boolean;
|
|
5
15
|
onToggleClock?: (isVisible: boolean) => void;
|
|
16
|
+
position?: Position | undefined;
|
|
17
|
+
onSetPosition: (position: Position) => void;
|
|
18
|
+
size?: Size | undefined;
|
|
19
|
+
onSetSize: (size: Size) => void;
|
|
6
20
|
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import { OpenLayersMapView } from '.';
|
|
3
|
+
declare const meta: Meta<typeof OpenLayersMapView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof OpenLayersMapView>;
|
|
6
|
+
export declare const MapViewNoTimeDim: Story;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Feature } from 'ol';
|
|
2
|
+
import type { Geometry } from 'ol/geom';
|
|
1
3
|
import type { StyleLike } from 'ol/style/Style';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import type { DrawModeExitCallback, DrawModeValue } from './types';
|
|
@@ -9,6 +11,8 @@ export interface OpenLayersMapDrawProps {
|
|
|
9
11
|
isInEditMode: boolean;
|
|
10
12
|
selectedFeatureIndex: number;
|
|
11
13
|
updateGeojson?: (geoJson: GeoJSON.FeatureCollection, text: string) => void;
|
|
14
|
+
onViewOnlyFeatureClick?: (feature: Feature<Geometry>[]) => void;
|
|
15
|
+
onNoFeatureClick?: () => void;
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Integrates with OpenLayers Draw and Modify (+Snap) interactions, to implement feature drawing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './OpenLayersMapDraw';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export { useMapDrawTool, defaultPoint, defaultDelete, defaultPolygon, defaultBox, defaultLocation, defaultIntersectionStyleProperties, defaultSmoothLine, defaultCircle, defaultFreehandLine, defaultLineString, defaultOval, defaultSquare, getIcon, currentlySupportedDrawModes, defaultModes, } from './useMapDrawTool';
|
|
3
|
+
export { useMapDrawTool, defaultPoint, defaultDelete, defaultPolygon, defaultBox, defaultLocation, defaultIntersectionStyleProperties, defaultSmoothLine, defaultCircle, defaultFreehandLine, defaultLineString, defaultOval, defaultSquare, defaultRotatableBox, getIcon, currentlySupportedDrawModes, defaultModes, } from './useMapDrawTool';
|
|
4
4
|
export type { MapDrawToolOptions } from './useMapDrawTool';
|
|
5
5
|
export * from './utils';
|
|
6
6
|
export * from './storyExamplesMapDrawTool';
|
|
@@ -10,7 +10,8 @@ export declare enum DRAWMODE {
|
|
|
10
10
|
SQUARE = "SQUARE",
|
|
11
11
|
OVAL = "OVAL",
|
|
12
12
|
LOCATION = "LOCATION",
|
|
13
|
-
FREEHANDLINE = "FREEHANDLINE"
|
|
13
|
+
FREEHANDLINE = "FREEHANDLINE",
|
|
14
|
+
ROTATABLEBOX = "ROTATABLEBOX"
|
|
14
15
|
}
|
|
15
16
|
export interface FeatureEvent {
|
|
16
17
|
coordinateIndexInFeature: number;
|
|
@@ -53,6 +53,7 @@ export declare const defaultFreehandLine: DrawMode;
|
|
|
53
53
|
export declare const defaultOval: DrawMode;
|
|
54
54
|
export declare const defaultLocation: DrawMode;
|
|
55
55
|
export declare const defaultSmoothLine: DrawMode;
|
|
56
|
+
export declare const defaultRotatableBox: DrawMode;
|
|
56
57
|
export declare const defaultModes: DrawMode[];
|
|
57
58
|
export declare const currentlySupportedDrawModes: DrawMode[];
|
|
58
59
|
export declare const useMapDrawTool: ({ defaultDrawModes, shouldAllowMultipleShapes, defaultGeoJSON, defaultGeoJSONIntersection, defaultGeoJSONIntersectionBounds, defaultGeoJSONIntersectionProperties, geoJSONLayerId, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId, projection, }: MapDrawToolOptions) => MapDrawToolProps;
|
|
@@ -2,6 +2,7 @@ import type { Extent } from 'ol/extent';
|
|
|
2
2
|
import type ImageWrapper from 'ol/Image';
|
|
3
3
|
import type { Projection } from 'ol/proj';
|
|
4
4
|
import ImageSource from 'ol/source/Image';
|
|
5
|
+
import type { WMImage } from '@opengeoweb/webmap';
|
|
5
6
|
import TimeAwareImageWrapper from './TimeAwareImageWrapper';
|
|
6
7
|
export declare const initImageWrapper: () => TimeAwareImageWrapper;
|
|
7
8
|
interface TimeawareImageSourceOptions {
|
|
@@ -47,11 +48,18 @@ export declare class TimeawareImageSource extends ImageSource {
|
|
|
47
48
|
getImage(extent: Extent, resolution: number, pixelRatio: number, projection: Projection): ImageWrapper;
|
|
48
49
|
setDimProps(params: Record<string, string>): void;
|
|
49
50
|
/**
|
|
50
|
-
* Check if an image is available and loaded for requested date. Used for
|
|
51
|
+
* Check if an image is available and loaded for requested date. Used for showlayerinfo to proceed.
|
|
51
52
|
* @param isoTime
|
|
52
53
|
* @returns
|
|
53
54
|
*/
|
|
54
55
|
hasImageLoadedForTimeValue(isoTime: string): boolean;
|
|
56
|
+
getAltGeoReferencedImages(isoTime: string): WMImage[];
|
|
57
|
+
/**
|
|
58
|
+
* This function can be used to determine if the animation can proceed to the next step.
|
|
59
|
+
* @param isoTime ISO8601 string formatat like `YYYY-MM-DDTHH:MM:SSZ`
|
|
60
|
+
* @returns Only specic case it returns false: when a image is available and is loading. That means we wait till it is loaded.
|
|
61
|
+
* This function returns true if an image is not available in the store. Or true if it is available and already loaded.
|
|
62
|
+
*/
|
|
55
63
|
isImageLoadingForTimestep(isoTime: string): boolean;
|
|
56
64
|
setImageForTimeValue(timeStampsToPrefetch: string): void;
|
|
57
65
|
setStyle(styleName: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { WMJSDimension, Dimension, WMLayer } from '@opengeoweb/webmap';
|
|
2
2
|
import type { Timespan } from '../types/Timespan';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param wmTimeDim WMDimension time containing dimension values
|
|
6
|
+
* @param stepsToCheck Array with timestamps as posix timestamps to check
|
|
7
|
+
* @param isAnimating If the application is running an animation loop
|
|
8
|
+
* @returns A string list with ISO8601 values to fetch
|
|
9
|
+
*/
|
|
3
10
|
export declare const makeDimValuesToPrefetch: (wmTimeDim: WMJSDimension, stepsToCheck: number[], isAnimating: boolean) => string[];
|
|
4
11
|
export declare const extendPrefetchListWithModelRunTimeSteps: (wmLayer: WMLayer, stepsToCheck: number[]) => number[];
|
|
5
12
|
/**
|
|
@@ -10,7 +17,7 @@ export declare const extendPrefetchListWithModelRunTimeSteps: (wmLayer: WMLayer,
|
|
|
10
17
|
* @param wmLayer The layer for which we would like to do the request
|
|
11
18
|
* @returns A map which returns a key/value to use
|
|
12
19
|
*/
|
|
13
|
-
export declare const getDimensionParamsForWMS: (dimensions: Dimension[]
|
|
20
|
+
export declare const getDimensionParamsForWMS: (dimensions: Dimension[], wmLayer: WMLayer | null) => Record<string, string> | undefined;
|
|
14
21
|
/**
|
|
15
22
|
* Calculates number of timesteps for given timespan
|
|
16
23
|
* @param timespan Object of Timespan, with start/stop/end in milliseconds
|