@opengeoweb/core 5.0.0 → 5.0.1
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.js +7 -7
- package/package.json +6 -6
- package/src/lib/components/MapDraw/MapDrawTool.stories.d.ts +1 -0
- package/src/lib/components/MapDraw/mapDrawUtils.d.ts +34 -0
- package/src/lib/components/MapDraw/storyComponents/EditModeButton.d.ts +8 -0
- package/src/lib/components/MapDraw/storyComponents/FeatureLayers.d.ts +8 -0
- package/src/lib/components/MapDraw/storyComponents/GeoJSONTextField.d.ts +8 -0
- package/src/lib/components/MapDraw/storyComponents/StoryLayout.d.ts +10 -0
- package/src/lib/components/MapDraw/useMapDrawTool.d.ts +12 -1
- package/src/lib/components/MapView/MapViewLayer.d.ts +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import produce, { enableES5, isDraftable, isDraft, current, produce as produce$1 } from 'immer';
|
|
2
2
|
import { createSelector } from 'reselect';
|
|
3
3
|
import _, { isEqual as isEqual$1, compact, debounce, groupBy, throttle as throttle$2, range } from 'lodash';
|
|
4
4
|
import moment from 'moment';
|
|
@@ -231,7 +231,7 @@ function isPlainObject$2(value) {
|
|
|
231
231
|
return EnhancerArray;
|
|
232
232
|
})(Array));
|
|
233
233
|
function freezeDraftable(val) {
|
|
234
|
-
return isDraftable(val) ?
|
|
234
|
+
return isDraftable(val) ? produce(val, function () {
|
|
235
235
|
}) : val;
|
|
236
236
|
}
|
|
237
237
|
// src/immutableStateInvariantMiddleware.ts
|
|
@@ -374,7 +374,7 @@ function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defau
|
|
|
374
374
|
return result;
|
|
375
375
|
}
|
|
376
376
|
else {
|
|
377
|
-
return
|
|
377
|
+
return produce(previousState, function (draft) {
|
|
378
378
|
return caseReducer(draft, action);
|
|
379
379
|
});
|
|
380
380
|
}
|
|
@@ -530,7 +530,7 @@ function createStateOperator(mutator) {
|
|
|
530
530
|
return state;
|
|
531
531
|
}
|
|
532
532
|
else {
|
|
533
|
-
return
|
|
533
|
+
return produce(state, runMutator);
|
|
534
534
|
}
|
|
535
535
|
};
|
|
536
536
|
}
|
|
@@ -3296,7 +3296,7 @@ var createLayersWithIds = function createLayersWithIds(state, layers) {
|
|
|
3296
3296
|
if (!layers) {
|
|
3297
3297
|
return layers;
|
|
3298
3298
|
}
|
|
3299
|
-
return produce(layers, function (draft) {
|
|
3299
|
+
return produce$1(layers, function (draft) {
|
|
3300
3300
|
for (var j = 0; j < draft.length; j += 1) {
|
|
3301
3301
|
var layer = draft[j];
|
|
3302
3302
|
if (!layer.id) {
|
|
@@ -4619,7 +4619,7 @@ var slice$5 = createSlice({
|
|
|
4619
4619
|
}
|
|
4620
4620
|
});
|
|
4621
4621
|
var setBboxOrTimeSync = function setBboxOrTimeSync(state, action) {
|
|
4622
|
-
return produce(state, function (draft) {
|
|
4622
|
+
return produce$1(state, function (draft) {
|
|
4623
4623
|
var _action$payload6 = action.payload,
|
|
4624
4624
|
targets = _action$payload6.targets,
|
|
4625
4625
|
source = _action$payload6.source,
|
|
@@ -6826,7 +6826,7 @@ var groupTypes = [{
|
|
|
6826
6826
|
- Fill arrays inside initialState with objects containing new values from Redux
|
|
6827
6827
|
*/
|
|
6828
6828
|
var createSyncGroupViewState = function createSyncGroupViewState(groups, sources) {
|
|
6829
|
-
var initialState = produce(emptyState, function (draft) {
|
|
6829
|
+
var initialState = produce$1(emptyState, function (draft) {
|
|
6830
6830
|
/*
|
|
6831
6831
|
_____ 1. Fill groups _____
|
|
6832
6832
|
1. Goes through all groups by ID
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/core",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "GeoWeb Core library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@mui/material": "5.12.0",
|
|
17
17
|
"@mui/system": "5.12.0",
|
|
18
|
-
"@opengeoweb/api": "5.0.
|
|
19
|
-
"@opengeoweb/form-fields": "5.0.
|
|
20
|
-
"@opengeoweb/shared": "5.0.
|
|
21
|
-
"@opengeoweb/theme": "5.0.
|
|
22
|
-
"@opengeoweb/webmap": "5.0.
|
|
18
|
+
"@opengeoweb/api": "5.0.1",
|
|
19
|
+
"@opengeoweb/form-fields": "5.0.1",
|
|
20
|
+
"@opengeoweb/shared": "5.0.1",
|
|
21
|
+
"@opengeoweb/theme": "5.0.1",
|
|
22
|
+
"@opengeoweb/webmap": "5.0.1",
|
|
23
23
|
"@redux-eggs/core": "2.2.0",
|
|
24
24
|
"@redux-eggs/redux-toolkit": "2.2.0",
|
|
25
25
|
"@redux-eggs/saga-extension": "2.2.0",
|
|
@@ -24,4 +24,38 @@ declare type DrawFunction = {
|
|
|
24
24
|
};
|
|
25
25
|
export declare const getDrawFunctionFromStore: (id: string) => DrawFunction['drawMethod'] | undefined;
|
|
26
26
|
export declare const registerDrawFunction: (drawFunction?: DrawFunction['drawMethod']) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Adds properties to the first geojson feature based on the given property object.
|
|
29
|
+
* It only extends or changes the properties which are defined in styleConfig,
|
|
30
|
+
* all other properties in the geojson are left unchanged.
|
|
31
|
+
* @param geojson
|
|
32
|
+
* @param featureProperties
|
|
33
|
+
*/
|
|
34
|
+
export declare const addFeatureProperties: (geojson: GeoJSON.FeatureCollection | undefined, featureProperties: GeoJSON.GeoJsonProperties) => GeoJSON.FeatureCollection;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the intersection of two features. In case of a polygon, only the first feature is used.
|
|
37
|
+
* @param a Feature A
|
|
38
|
+
* @param b Feature B
|
|
39
|
+
* @returns The intersection of the two features.
|
|
40
|
+
*/
|
|
41
|
+
export declare const intersectGeoJSONS: (a: GeoJSON.FeatureCollection, b: GeoJSON.FeatureCollection, geoJSONProperties?: {
|
|
42
|
+
stroke: string;
|
|
43
|
+
'stroke-width': number;
|
|
44
|
+
'stroke-opacity': number;
|
|
45
|
+
fill: string;
|
|
46
|
+
'fill-opacity': number;
|
|
47
|
+
}) => GeoJSON.FeatureCollection;
|
|
48
|
+
/**
|
|
49
|
+
* Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
|
|
50
|
+
* @param geoJSONs
|
|
51
|
+
* @returns GeoJSONS extend with intersections
|
|
52
|
+
*/
|
|
53
|
+
export declare const createInterSections: (geojson: GeoJSON.FeatureCollection, otherGeoJSON: GeoJSON.FeatureCollection, geoJSONproperties?: {
|
|
54
|
+
stroke: string;
|
|
55
|
+
'stroke-width': number;
|
|
56
|
+
'stroke-opacity': number;
|
|
57
|
+
fill: string;
|
|
58
|
+
'fill-opacity': number;
|
|
59
|
+
}) => GeoJSON.FeatureCollection;
|
|
60
|
+
export declare const getGeoJson: (geojson: GeoJSON.FeatureCollection, shouldAllowMultipleshapes: boolean) => GeoJSON.FeatureCollection;
|
|
27
61
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface EditModeButtonProps {
|
|
3
|
+
isInEditMode: boolean;
|
|
4
|
+
onToggleEditMode: (isEditMode: boolean) => void;
|
|
5
|
+
drawMode: string;
|
|
6
|
+
}
|
|
7
|
+
declare const EditModeButtonField: React.FC<EditModeButtonProps>;
|
|
8
|
+
export default EditModeButtonField;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface FeatureLayersProps {
|
|
3
|
+
geojson: GeoJSON.FeatureCollection;
|
|
4
|
+
onChangeLayerIndex: (newIndex: number) => void;
|
|
5
|
+
activeFeatureLayerIndex: number;
|
|
6
|
+
}
|
|
7
|
+
declare const FeatureLayers: React.FC<FeatureLayersProps>;
|
|
8
|
+
export default FeatureLayers;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface GeoJSONTextFieldProps {
|
|
3
|
+
geoJSON: GeoJSON.FeatureCollection;
|
|
4
|
+
onChangeGeoJSON?: (geoJSON: GeoJSON.FeatureCollection) => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const GeoJSONTextField: React.FC<GeoJSONTextFieldProps>;
|
|
8
|
+
export default GeoJSONTextField;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DrawModeExitCallback } from '../MapDraw';
|
|
3
|
+
import { MapViewLayerProps } from '../../MapView/MapViewLayer';
|
|
4
|
+
interface StoryLayoutProps {
|
|
5
|
+
layers: MapViewLayerProps[];
|
|
6
|
+
children: React.ReactElement;
|
|
7
|
+
onExitDrawMode: (reason: DrawModeExitCallback) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const StoryLayout: React.FC<StoryLayoutProps>;
|
|
10
|
+
export default StoryLayout;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DRAWMODE } from './MapDraw';
|
|
3
|
+
import { MapViewLayerProps } from '../MapView/MapViewLayer';
|
|
3
4
|
export declare const defaultStyleProperties: {
|
|
4
5
|
stroke: string;
|
|
5
6
|
'stroke-width': number;
|
|
@@ -7,6 +8,13 @@ export declare const defaultStyleProperties: {
|
|
|
7
8
|
fill: string;
|
|
8
9
|
'fill-opacity': number;
|
|
9
10
|
};
|
|
11
|
+
export declare const defaultIntersectionStyleProperties: {
|
|
12
|
+
stroke: string;
|
|
13
|
+
'stroke-width': number;
|
|
14
|
+
'stroke-opacity': number;
|
|
15
|
+
fill: string;
|
|
16
|
+
'fill-opacity': number;
|
|
17
|
+
};
|
|
10
18
|
export declare const emptyLineString: GeoJSON.Feature;
|
|
11
19
|
export declare const emptyPoint: GeoJSON.Feature;
|
|
12
20
|
export declare const emptyPolygon: GeoJSON.Feature;
|
|
@@ -31,9 +39,12 @@ interface MapDrawToolProps {
|
|
|
31
39
|
activeTool: string;
|
|
32
40
|
changeActiveTool: (newMode: EditMode) => void;
|
|
33
41
|
setActiveTool: (newToolId: string) => void;
|
|
42
|
+
layers: MapViewLayerProps[];
|
|
34
43
|
}
|
|
35
44
|
export interface MapDrawToolOptions {
|
|
36
45
|
editModes?: EditMode[];
|
|
46
|
+
shouldAllowMultipleshapes?: boolean;
|
|
47
|
+
intersectionShape?: GeoJSON.Feature;
|
|
37
48
|
}
|
|
38
49
|
export declare const defaultModes: ({
|
|
39
50
|
id: string;
|
|
@@ -48,5 +59,5 @@ export declare const defaultModes: ({
|
|
|
48
59
|
icon: React.JSX.Element;
|
|
49
60
|
shape: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
50
61
|
})[];
|
|
51
|
-
export declare const useMapDrawTool: ({ editModes, }: MapDrawToolOptions) => MapDrawToolProps;
|
|
62
|
+
export declare const useMapDrawTool: ({ editModes, shouldAllowMultipleshapes, intersectionShape, }: MapDrawToolOptions) => MapDrawToolProps;
|
|
52
63
|
export {};
|