@opengeoweb/store 19.5.0 → 19.5.1-nightly-20260831
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -7,6 +7,7 @@ import { secondsPerPxFromCanvasWidth, defaultTimeSpan, defaultSecondsPerPx, defa
|
|
|
7
7
|
import { produce } from 'immer';
|
|
8
8
|
import { getLastEmptyFeatureIndex, getGeoJson, moveFeature, createInterSections, defaultLayers, fetchStacCatalogRoot, stacCatalogCollectionToLayerProps, fetchStacCatalogCollections, emptyGeoJSON, defaultIntersectionStyleProperties, addSelectionTypeToGeoJSON, getFeatureCollection } from '@opengeoweb/webmap-react';
|
|
9
9
|
export { defaultLayers } from '@opengeoweb/webmap-react';
|
|
10
|
+
import { v4 } from 'uuid';
|
|
10
11
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
11
12
|
import { useDispatch, useSelector, shallowEqual, useStore } from 'react-redux';
|
|
12
13
|
import { center } from '@turf/turf';
|
|
@@ -1282,6 +1283,39 @@ var getSTACServiceRootUrl = function getSTACServiceRootUrl(serviceUrl) {
|
|
|
1282
1283
|
var getTrailingSlashVariant = function getTrailingSlashVariant(url) {
|
|
1283
1284
|
return url.endsWith('/') ? url.slice(0, -1) : "".concat(url, "/");
|
|
1284
1285
|
};
|
|
1286
|
+
/**
|
|
1287
|
+
* Generates a unique id for a geoJSON feature. Feature ids need to be stable
|
|
1288
|
+
* over the lifetime of a feature (also when other features are added or
|
|
1289
|
+
* removed), because they are used to select features and to link feature
|
|
1290
|
+
* properties (eg objectName) to form fields.
|
|
1291
|
+
* @returns unique feature id
|
|
1292
|
+
*/
|
|
1293
|
+
var generateFeatureId = function generateFeatureId() {
|
|
1294
|
+
return "drawFeature-".concat(v4());
|
|
1295
|
+
};
|
|
1296
|
+
/**
|
|
1297
|
+
* Makes sure every feature in the featurecollection has a unique id. Existing
|
|
1298
|
+
* unique ids are preserved, missing or duplicate ids are (re)generated.
|
|
1299
|
+
* @param geojson The featurecollection to add ids to
|
|
1300
|
+
* @returns featurecollection where every feature has a unique id
|
|
1301
|
+
*/
|
|
1302
|
+
var ensureFeatureIds = function ensureFeatureIds(geojson) {
|
|
1303
|
+
var usedIds = new Set();
|
|
1304
|
+
return _objectSpread2(_objectSpread2({}, geojson), {}, {
|
|
1305
|
+
features: geojson.features.map(function (feature) {
|
|
1306
|
+
var currentId = feature.id !== undefined && feature.id !== null ? String(feature.id) : undefined;
|
|
1307
|
+
if (currentId !== undefined && !usedIds.has(currentId)) {
|
|
1308
|
+
usedIds.add(currentId);
|
|
1309
|
+
return feature;
|
|
1310
|
+
}
|
|
1311
|
+
var newId = generateFeatureId();
|
|
1312
|
+
usedIds.add(newId);
|
|
1313
|
+
return _objectSpread2(_objectSpread2({}, feature), {}, {
|
|
1314
|
+
id: newId
|
|
1315
|
+
});
|
|
1316
|
+
})
|
|
1317
|
+
});
|
|
1318
|
+
};
|
|
1285
1319
|
var getFeatureSelectionKey = function getFeatureSelectionKey(feature) {
|
|
1286
1320
|
var _feature$properties;
|
|
1287
1321
|
if (!feature) {
|
|
@@ -1505,8 +1539,10 @@ var updateMinMaxValueWhenReferenceTimeChanges = function updateMinMaxValueWhenRe
|
|
|
1505
1539
|
|
|
1506
1540
|
var utils$1 = /*#__PURE__*/Object.freeze({
|
|
1507
1541
|
__proto__: null,
|
|
1542
|
+
ensureFeatureIds: ensureFeatureIds,
|
|
1508
1543
|
filterCurrentValueFromDimensions: filterCurrentValueFromDimensions,
|
|
1509
1544
|
filterNonTimeDimensions: filterNonTimeDimensions,
|
|
1545
|
+
generateFeatureId: generateFeatureId,
|
|
1510
1546
|
getFeatureSelectionKey: getFeatureSelectionKey,
|
|
1511
1547
|
getSTACServiceRootUrl: getSTACServiceRootUrl,
|
|
1512
1548
|
getSelectedFeatureIndexByIds: getSelectedFeatureIndexByIds,
|
|
@@ -2041,14 +2077,7 @@ var slice$7 = createSlice({
|
|
|
2041
2077
|
nextSelectedFeatureIndex = newFeatureIndex;
|
|
2042
2078
|
}
|
|
2043
2079
|
}
|
|
2044
|
-
var updatedGeoJSONWithIds = shouldAllowMultipleShapes ?
|
|
2045
|
-
features: updatedGeoJSON.features.map(function (feature, index) {
|
|
2046
|
-
return _objectSpread2(_objectSpread2({}, feature), {}, {
|
|
2047
|
-
// Save the index as id so we can use it to select features
|
|
2048
|
-
id: index
|
|
2049
|
-
});
|
|
2050
|
-
})
|
|
2051
|
-
}) : updatedGeoJSON;
|
|
2080
|
+
var updatedGeoJSONWithIds = shouldAllowMultipleShapes ? ensureFeatureIds(updatedGeoJSON) : updatedGeoJSON;
|
|
2052
2081
|
currentLayer.geojson = updatedGeoJSONWithIds;
|
|
2053
2082
|
if (nextSelectedFeatureIndex !== undefined) {
|
|
2054
2083
|
var selectedFeature = updatedGeoJSONWithIds.features[nextSelectedFeatureIndex];
|
|
@@ -2087,11 +2116,47 @@ var slice$7 = createSlice({
|
|
|
2087
2116
|
});
|
|
2088
2117
|
}
|
|
2089
2118
|
},
|
|
2090
|
-
|
|
2119
|
+
deleteFeature: function deleteFeature(draft, action) {
|
|
2120
|
+
var _currentLayer$geojson3, _currentLayer$selecte, _currentLayer$hovered;
|
|
2091
2121
|
var _action$payload21 = action.payload,
|
|
2092
2122
|
layerId = _action$payload21.layerId,
|
|
2093
|
-
|
|
2094
|
-
|
|
2123
|
+
featureId = _action$payload21.featureId;
|
|
2124
|
+
var currentLayer = draft.byId[layerId];
|
|
2125
|
+
if (!(currentLayer !== null && currentLayer !== void 0 && (_currentLayer$geojson3 = currentLayer.geojson) !== null && _currentLayer$geojson3 !== void 0 && _currentLayer$geojson3.features.length)) {
|
|
2126
|
+
return;
|
|
2127
|
+
}
|
|
2128
|
+
var features = currentLayer.geojson.features;
|
|
2129
|
+
var featureIndex = features.findIndex(function (feature) {
|
|
2130
|
+
return getFeatureSelectionKey(feature) === featureId;
|
|
2131
|
+
});
|
|
2132
|
+
if (featureIndex < 0) {
|
|
2133
|
+
return;
|
|
2134
|
+
}
|
|
2135
|
+
currentLayer.geojson = _objectSpread2(_objectSpread2({}, currentLayer.geojson), {}, {
|
|
2136
|
+
features: features.filter(function (_feature, index) {
|
|
2137
|
+
return index !== featureIndex;
|
|
2138
|
+
})
|
|
2139
|
+
});
|
|
2140
|
+
var wasSelected = !!((_currentLayer$selecte = currentLayer.selectedFeatureIds) !== null && _currentLayer$selecte !== void 0 && _currentLayer$selecte.includes(featureId));
|
|
2141
|
+
if (wasSelected) {
|
|
2142
|
+
currentLayer.selectedFeatureIds = currentLayer.selectedFeatureIds.filter(function (selectedFeatureId) {
|
|
2143
|
+
return selectedFeatureId !== featureId;
|
|
2144
|
+
});
|
|
2145
|
+
// deleting the feature being edited should also end the edit mode
|
|
2146
|
+
if (!currentLayer.selectedFeatureIds.length) {
|
|
2147
|
+
currentLayer.isInEditMode = false;
|
|
2148
|
+
currentLayer.drawMode = '';
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
currentLayer.hoveredFeatureIds = (_currentLayer$hovered = currentLayer.hoveredFeatureIds) === null || _currentLayer$hovered === void 0 ? void 0 : _currentLayer$hovered.filter(function (hoveredFeatureId) {
|
|
2152
|
+
return hoveredFeatureId !== featureId;
|
|
2153
|
+
});
|
|
2154
|
+
},
|
|
2155
|
+
toggleFeatureMode: function toggleFeatureMode(draft, action) {
|
|
2156
|
+
var _action$payload22 = action.payload,
|
|
2157
|
+
layerId = _action$payload22.layerId,
|
|
2158
|
+
isInEditMode = _action$payload22.isInEditMode,
|
|
2159
|
+
drawMode = _action$payload22.drawMode;
|
|
2095
2160
|
if (!draft.byId[layerId]) {
|
|
2096
2161
|
return;
|
|
2097
2162
|
}
|
|
@@ -2103,10 +2168,10 @@ var slice$7 = createSlice({
|
|
|
2103
2168
|
}
|
|
2104
2169
|
},
|
|
2105
2170
|
exitFeatureDrawMode: function exitFeatureDrawMode(draft, action) {
|
|
2106
|
-
var _action$
|
|
2107
|
-
layerId = _action$
|
|
2108
|
-
shouldAllowMultipleShapes = _action$
|
|
2109
|
-
reason = _action$
|
|
2171
|
+
var _action$payload23 = action.payload,
|
|
2172
|
+
layerId = _action$payload23.layerId,
|
|
2173
|
+
shouldAllowMultipleShapes = _action$payload23.shouldAllowMultipleShapes,
|
|
2174
|
+
reason = _action$payload23.reason;
|
|
2110
2175
|
if (!draft.byId[layerId]) {
|
|
2111
2176
|
return;
|
|
2112
2177
|
}
|
|
@@ -2142,10 +2207,10 @@ var slice$7 = createSlice({
|
|
|
2142
2207
|
},
|
|
2143
2208
|
// layer info actions
|
|
2144
2209
|
showLayerInfo: function showLayerInfo(draft, action) {
|
|
2145
|
-
var _action$
|
|
2146
|
-
serviceUrl = _action$
|
|
2147
|
-
layerName = _action$
|
|
2148
|
-
style = _action$
|
|
2210
|
+
var _action$payload24 = action.payload,
|
|
2211
|
+
serviceUrl = _action$payload24.serviceUrl,
|
|
2212
|
+
layerName = _action$payload24.layerName,
|
|
2213
|
+
style = _action$payload24.style;
|
|
2149
2214
|
draft.activeLayerInfo = {
|
|
2150
2215
|
serviceUrl: serviceUrl,
|
|
2151
2216
|
layerName: layerName,
|
|
@@ -2156,9 +2221,9 @@ var slice$7 = createSlice({
|
|
|
2156
2221
|
delete draft.activeLayerInfo;
|
|
2157
2222
|
},
|
|
2158
2223
|
SetLayerLegendVisibilityPayload: function SetLayerLegendVisibilityPayload(draft, action) {
|
|
2159
|
-
var _action$
|
|
2160
|
-
layerId = _action$
|
|
2161
|
-
showLayerLegend = _action$
|
|
2224
|
+
var _action$payload25 = action.payload,
|
|
2225
|
+
layerId = _action$payload25.layerId,
|
|
2226
|
+
showLayerLegend = _action$payload25.showLayerLegend;
|
|
2162
2227
|
var layer = draft.byId[layerId];
|
|
2163
2228
|
if (!layer) {
|
|
2164
2229
|
return;
|
|
@@ -2171,9 +2236,9 @@ var slice$7 = createSlice({
|
|
|
2171
2236
|
},
|
|
2172
2237
|
extraReducers: function extraReducers(builder) {
|
|
2173
2238
|
builder.addCase(setTimeSync, function (draft, action) {
|
|
2174
|
-
var _action$
|
|
2175
|
-
targetsFromAction = _action$
|
|
2176
|
-
source = _action$
|
|
2239
|
+
var _action$payload26 = action.payload,
|
|
2240
|
+
targetsFromAction = _action$payload26.targets,
|
|
2241
|
+
source = _action$payload26.source;
|
|
2177
2242
|
/* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
|
|
2178
2243
|
var targets = [];
|
|
2179
2244
|
if (source) {
|
|
@@ -2203,9 +2268,9 @@ var slice$7 = createSlice({
|
|
|
2203
2268
|
* These targets can be used as payloads in new Layer actions.
|
|
2204
2269
|
* These actions are here handled via the layer reducer, as it is the same logic
|
|
2205
2270
|
*/
|
|
2206
|
-
var _action$
|
|
2207
|
-
targets = _action$
|
|
2208
|
-
source = _action$
|
|
2271
|
+
var _action$payload27 = action.payload,
|
|
2272
|
+
targets = _action$payload27.targets,
|
|
2273
|
+
source = _action$payload27.source;
|
|
2209
2274
|
return targets.reduce(function (prevState, target) {
|
|
2210
2275
|
var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
|
|
2211
2276
|
var action = {
|
|
@@ -2784,6 +2849,9 @@ var slice$6 = createSlice({
|
|
|
2784
2849
|
map.mapLayers = map.mapLayers.filter(function (id) {
|
|
2785
2850
|
return id !== layerId;
|
|
2786
2851
|
});
|
|
2852
|
+
map.featureLayers = map.featureLayers.filter(function (id) {
|
|
2853
|
+
return id !== layerId;
|
|
2854
|
+
});
|
|
2787
2855
|
// if auto layer is deleted, change auto layer ids
|
|
2788
2856
|
if (!map.mapLayers.length) {
|
|
2789
2857
|
map.autoUpdateLayerId = undefined;
|
|
@@ -2798,9 +2866,6 @@ var slice$6 = createSlice({
|
|
|
2798
2866
|
if (map.autoTimeStepLayerId === layerId) {
|
|
2799
2867
|
map.autoTimeStepLayerId = activeLayerId;
|
|
2800
2868
|
}
|
|
2801
|
-
map.featureLayers = map.featureLayers.filter(function (id) {
|
|
2802
|
-
return id !== layerId;
|
|
2803
|
-
});
|
|
2804
2869
|
}).addCase(layerActions.baseLayerDelete, function (draft, action) {
|
|
2805
2870
|
var _action$payload36 = action.payload,
|
|
2806
2871
|
mapId = _action$payload36.mapId,
|
|
@@ -9796,7 +9861,7 @@ drawingToolListener.startListening({
|
|
|
9796
9861
|
actionCreator: drawingToolActions.changeDrawToolMode,
|
|
9797
9862
|
effect: function () {
|
|
9798
9863
|
var _effect2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(_ref2, listenerApi) {
|
|
9799
|
-
var payload, _layerSelectors$getAc, _currentGeoJSON$featu, _currentGeoJSON$featu2, drawModeId, drawToolId, _payload$shouldUpdate, shouldUpdateShape, drawingTool, _drawingTool$shouldAl, shouldAllowMultipleShapes, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId, newDrawMode, geoJSONLayer, geoJSON, lastFeatureIndex, newGeoJSON, selectedFeature, _selectedFeatureIndex, isLayerInEditMode,
|
|
9864
|
+
var payload, _layerSelectors$getAc, _currentGeoJSON$featu, _currentGeoJSON$featu2, drawModeId, drawToolId, _payload$shouldUpdate, shouldUpdateShape, drawingTool, _drawingTool$shouldAl, shouldAllowMultipleShapes, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId, newDrawMode, geoJSONLayer, geoJSON, lastFeatureIndex, newGeoJSON, selectedFeature, _selectedFeatureIndex, isLayerInEditMode, _selectedFeature, selectedFeatureId, currentGeoJSONLayer, _ref3, currentGeoJSON, selectedFeatureIndex, currentSelectionType, newSelectionType, isNewToolSelected, shouldUpdateNewShape, shapeWithSelectionType, geoJSONFeatureCollection, _newGeoJSON, _selectedFeature2, _t;
|
|
9800
9865
|
return _regenerator().w(function (_context2) {
|
|
9801
9866
|
while (1) switch (_context2.p = _context2.n) {
|
|
9802
9867
|
case 0:
|
|
@@ -9849,20 +9914,12 @@ drawingToolListener.startListening({
|
|
|
9849
9914
|
}
|
|
9850
9915
|
_selectedFeatureIndex = getActiveFeatureIndex(listenerApi.getState(), drawingTool.geoJSONLayerId);
|
|
9851
9916
|
isLayerInEditMode = getIsLayerInEditMode(listenerApi.getState(), drawingTool.geoJSONLayerId);
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
return index !== _selectedFeatureIndex;
|
|
9857
|
-
})
|
|
9858
|
-
});
|
|
9859
|
-
listenerApi.dispatch(layerActions.updateFeature({
|
|
9917
|
+
_selectedFeature = _selectedFeatureIndex !== undefined && geoJSON ? geoJSON.features[_selectedFeatureIndex] : undefined;
|
|
9918
|
+
selectedFeatureId = getFeatureSelectionKey(_selectedFeature);
|
|
9919
|
+
if (isLayerInEditMode && selectedFeatureId) {
|
|
9920
|
+
listenerApi.dispatch(layerActions.deleteFeature({
|
|
9860
9921
|
layerId: drawingTool.geoJSONLayerId,
|
|
9861
|
-
|
|
9862
|
-
}));
|
|
9863
|
-
listenerApi.dispatch(layerActions.setSelectedFeatures({
|
|
9864
|
-
layerId: drawingTool.geoJSONLayerId,
|
|
9865
|
-
selectedFeatureIds: []
|
|
9922
|
+
featureId: selectedFeatureId
|
|
9866
9923
|
}));
|
|
9867
9924
|
} else {
|
|
9868
9925
|
// if nothing selected, delete all
|
|
@@ -9912,18 +9969,18 @@ drawingToolListener.startListening({
|
|
|
9912
9969
|
if (shouldUpdateNewShape && shouldUpdateShape) {
|
|
9913
9970
|
shapeWithSelectionType = addSelectionTypeToGeoJSON(newDrawMode.shape, newDrawMode.selectionType);
|
|
9914
9971
|
geoJSONFeatureCollection = getFeatureCollection(shapeWithSelectionType, shouldAllowMultipleShapes, currentGeoJSON);
|
|
9915
|
-
|
|
9972
|
+
_newGeoJSON = getGeoJson(geoJSONFeatureCollection, shouldAllowMultipleShapes);
|
|
9916
9973
|
if (shouldAllowMultipleShapes) {
|
|
9917
|
-
moveFeature(currentGeoJSON,
|
|
9974
|
+
moveFeature(currentGeoJSON, _newGeoJSON, selectedFeatureIndex, '');
|
|
9918
9975
|
}
|
|
9919
|
-
|
|
9976
|
+
_selectedFeature2 = shouldAllowMultipleShapes ? _objectSpread2(_objectSpread2({}, _newGeoJSON.features[_newGeoJSON.features.length - 1]), {}, {
|
|
9920
9977
|
// Keep this in sync with layerReducer.updateFeature, which
|
|
9921
9978
|
// materializes multi-shape feature ids from their array index.
|
|
9922
|
-
id:
|
|
9923
|
-
}) :
|
|
9979
|
+
id: _newGeoJSON.features.length - 1
|
|
9980
|
+
}) : _newGeoJSON.features[_newGeoJSON.features.length - 1];
|
|
9924
9981
|
listenerApi.dispatch(layerActions.updateFeature(_objectSpread2(_objectSpread2({
|
|
9925
9982
|
layerId: drawingTool.geoJSONLayerId,
|
|
9926
|
-
geojson:
|
|
9983
|
+
geojson: _newGeoJSON
|
|
9927
9984
|
}, geoJSONIntersectionLayerId && {
|
|
9928
9985
|
geoJSONIntersectionLayerId: geoJSONIntersectionLayerId
|
|
9929
9986
|
}), geoJSONIntersectionBoundsLayerId && {
|
|
@@ -9931,7 +9988,7 @@ drawingToolListener.startListening({
|
|
|
9931
9988
|
})));
|
|
9932
9989
|
listenerApi.dispatch(layerActions.setSelectedFeatures({
|
|
9933
9990
|
layerId: drawingTool.geoJSONLayerId,
|
|
9934
|
-
selectedFeatureIds: getSelectedFeatureIds(
|
|
9991
|
+
selectedFeatureIds: getSelectedFeatureIds(_selectedFeature2)
|
|
9935
9992
|
}));
|
|
9936
9993
|
}
|
|
9937
9994
|
listenerApi.dispatch(layerActions.toggleFeatureMode({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
import type { SetLayerAcceptanceTimePayload, SetLayerDimensionsPayload, SetLayerStylePayload, UpdateLayerInfoPayload } from '@opengeoweb/webmap-react';
|
|
3
|
-
import type { LayerState, Layer, AddLayerPayload, SetLayerDimensionPayload, SetLayerEnabledPayload, SetLayerOpacityPayload, SetLayerNamePayload, SetLayerServicePayload, SetLayerGeojsonPayload, DeleteLayerPayload, ErrorLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, SetAvailableBaseLayersPayload, SetSelectedFeaturesPayload, SetHoveredFeaturesPayload, UpdateFeaturePayload, ExitFeatureDrawModePayload, ToggleFeatureModePayload, UpdateFeaturePropertiesPayload, DuplicateMapLayerPayload, ShowLayerInfoPayload, SetLayerGeojsonFromLayerPayload, SetLayerOptionsPayload, SetLayerLegendVisibilityPayload } from './types';
|
|
3
|
+
import type { LayerState, Layer, AddLayerPayload, SetLayerDimensionPayload, SetLayerEnabledPayload, SetLayerOpacityPayload, SetLayerNamePayload, SetLayerServicePayload, SetLayerGeojsonPayload, DeleteLayerPayload, ErrorLayerPayload, SetLayersPayload, SetBaseLayersPayload, AddBaseLayerPayload, AddAvailableBaseLayerPayload, AddAvailableBaseLayersPayload, SetAvailableBaseLayersPayload, SetSelectedFeaturesPayload, SetHoveredFeaturesPayload, UpdateFeaturePayload, ExitFeatureDrawModePayload, ToggleFeatureModePayload, UpdateFeaturePropertiesPayload, DeleteFeaturePayload, DuplicateMapLayerPayload, ShowLayerInfoPayload, SetLayerGeojsonFromLayerPayload, SetLayerOptionsPayload, SetLayerLegendVisibilityPayload } from './types';
|
|
4
4
|
export declare const createLayer: ({ id, opacity, acceptanceTimeInMinutes, enabled, layerType, status, useLatestReferenceTime, ...props }: Layer) => Layer;
|
|
5
5
|
export declare const initialState: LayerState;
|
|
6
6
|
export declare const slice: import("@reduxjs/toolkit").Slice<LayerState, {
|
|
@@ -38,6 +38,7 @@ export declare const slice: import("@reduxjs/toolkit").Slice<LayerState, {
|
|
|
38
38
|
setHoveredFeatures: (draft: Draft<LayerState>, action: PayloadAction<SetHoveredFeaturesPayload>) => void;
|
|
39
39
|
updateFeature: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePayload>) => void;
|
|
40
40
|
updateFeatureProperties: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePropertiesPayload>) => void;
|
|
41
|
+
deleteFeature: (draft: Draft<LayerState>, action: PayloadAction<DeleteFeaturePayload>) => void;
|
|
41
42
|
toggleFeatureMode: (draft: Draft<LayerState>, action: PayloadAction<ToggleFeatureModePayload>) => void;
|
|
42
43
|
exitFeatureDrawMode: (draft: Draft<LayerState>, action: PayloadAction<ExitFeatureDrawModePayload>) => void;
|
|
43
44
|
toggleSelectableFeatures: (draft: Draft<LayerState>, action: PayloadAction<{
|
|
@@ -82,6 +83,7 @@ export declare const layerReducer: import("redux").Reducer<LayerState>, layerAct
|
|
|
82
83
|
setHoveredFeatures: (draft: Draft<LayerState>, action: PayloadAction<SetHoveredFeaturesPayload>) => void;
|
|
83
84
|
updateFeature: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePayload>) => void;
|
|
84
85
|
updateFeatureProperties: (draft: Draft<LayerState>, action: PayloadAction<UpdateFeaturePropertiesPayload>) => void;
|
|
86
|
+
deleteFeature: (draft: Draft<LayerState>, action: PayloadAction<DeleteFeaturePayload>) => void;
|
|
85
87
|
toggleFeatureMode: (draft: Draft<LayerState>, action: PayloadAction<ToggleFeatureModePayload>) => void;
|
|
86
88
|
exitFeatureDrawMode: (draft: Draft<LayerState>, action: PayloadAction<ExitFeatureDrawModePayload>) => void;
|
|
87
89
|
toggleSelectableFeatures: (draft: Draft<LayerState>, action: PayloadAction<{
|
|
@@ -175,6 +175,9 @@ export interface UpdateFeaturePropertiesPayload extends LayerPayload {
|
|
|
175
175
|
properties: GeoJSON.GeoJsonProperties;
|
|
176
176
|
targetFeatureIndex?: number;
|
|
177
177
|
}
|
|
178
|
+
export interface DeleteFeaturePayload extends LayerPayload {
|
|
179
|
+
featureId: string;
|
|
180
|
+
}
|
|
178
181
|
export interface ToggleFeatureModePayload extends LayerPayload {
|
|
179
182
|
isInEditMode?: boolean;
|
|
180
183
|
drawMode?: string;
|
|
@@ -5,6 +5,21 @@ import type { LayerState } from './types';
|
|
|
5
5
|
export declare const trimTrailingSlashes: (url: string) => string;
|
|
6
6
|
export declare const getSTACServiceRootUrl: (serviceUrl: string) => string;
|
|
7
7
|
export declare const getTrailingSlashVariant: (url: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Generates a unique id for a geoJSON feature. Feature ids need to be stable
|
|
10
|
+
* over the lifetime of a feature (also when other features are added or
|
|
11
|
+
* removed), because they are used to select features and to link feature
|
|
12
|
+
* properties (eg objectName) to form fields.
|
|
13
|
+
* @returns unique feature id
|
|
14
|
+
*/
|
|
15
|
+
export declare const generateFeatureId: () => string;
|
|
16
|
+
/**
|
|
17
|
+
* Makes sure every feature in the featurecollection has a unique id. Existing
|
|
18
|
+
* unique ids are preserved, missing or duplicate ids are (re)generated.
|
|
19
|
+
* @param geojson The featurecollection to add ids to
|
|
20
|
+
* @returns featurecollection where every feature has a unique id
|
|
21
|
+
*/
|
|
22
|
+
export declare const ensureFeatureIds: (geojson: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection;
|
|
8
23
|
export declare const getFeatureSelectionKey: (feature?: GeoJSON.Feature) => string | undefined;
|
|
9
24
|
export declare const getSelectedFeatureIndexByIds: (geojson: GeoJSON.FeatureCollection | undefined, selectedFeatureIds: string[] | undefined) => number | undefined;
|
|
10
25
|
export declare const isActionLayerSynced: (state: LayerState, layerIdFromAction: string, dimension: Dimension) => boolean;
|
package/package.json
CHANGED
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
2
|
+
"name": "@opengeoweb/store",
|
|
3
|
+
"version": "19.5.1-nightly-20260831",
|
|
4
|
+
"description": "GeoWeb Store library for the opengeoweb project",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.esm.js",
|
|
11
|
+
"module": "./dist/index.esm.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"@opengeoweb/source": "./src/index.ts",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.esm.js",
|
|
19
|
+
"default": "./dist/index.esm.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@opengeoweb/shared": "19.5.1-nightly-20260831",
|
|
24
|
+
"react-redux": "^9.2.0",
|
|
25
|
+
"@reduxjs/toolkit": "^2.6.1",
|
|
26
|
+
"@opengeoweb/webmap-react": "19.5.1-nightly-20260831",
|
|
27
|
+
"@opengeoweb/webmap": "19.5.1-nightly-20260831",
|
|
28
|
+
"immer": "^10.0.3",
|
|
29
|
+
"lodash": "^4.18.1",
|
|
30
|
+
"@opengeoweb/metronome": "19.5.1-nightly-20260831",
|
|
31
|
+
"@opengeoweb/time-slider": "19.5.1-nightly-20260831",
|
|
32
|
+
"ol": "^10.4.0",
|
|
33
|
+
"@turf/turf": "^7.2.0",
|
|
34
|
+
"@types/geojson": "^7946.0.14",
|
|
35
|
+
"react-router": "^7.15.1",
|
|
36
|
+
"uuid": "^11.0.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "19"
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"!dist/package.json",
|
|
44
|
+
"README.md",
|
|
45
|
+
"package.json"
|
|
46
|
+
]
|
|
47
|
+
}
|