@opengeoweb/webmap-react 9.8.0 → 9.10.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 +754 -552
- package/package.json +4 -5
- package/src/lib/components/MapDimensionSelect/DimensionSelectButton.d.ts +8 -0
- package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.d.ts +14 -0
- package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.stories.d.ts +29 -0
- package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.d.ts +14 -0
- package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.spec.d.ts +1 -0
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.d.ts +11 -0
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.spec.d.ts +1 -0
- package/src/lib/components/MapDimensionSelect/MapDimensionSelect.stories.d.ts +7 -0
- package/src/lib/components/MapDimensionSelect/index.d.ts +6 -0
- package/src/lib/components/MapDimensionSelect/utils.d.ts +17 -0
- package/src/lib/components/MapDimensionSelect/utils.spec.d.ts +1 -0
- package/src/lib/components/MapDraw/MapDraw.d.ts +4 -4
- package/src/lib/components/MapDraw/MapDrawContainer.d.ts +2 -2
- package/src/lib/components/MapDraw/geojsonShapes.d.ts +4 -4
- package/src/lib/components/MapDraw/mapDrawUtils.d.ts +2 -2
- package/src/lib/components/MapDraw/storyComponents/FeatureLayers.d.ts +2 -1
- package/src/lib/components/MapDraw/storyComponents/IntersectionSelect.d.ts +2 -2
- package/src/lib/components/MapDraw/storyComponents/SelectField.d.ts +2 -2
- package/src/lib/components/MapDrawTool/MapDrawTool.stories.d.ts +1 -0
- package/src/lib/components/MapDrawTool/storyExamplesMapDrawTool.d.ts +5 -3
- package/src/lib/components/MapDrawTool/storyExamplesMapDrawToolIntersection.d.ts +2 -1
- package/src/lib/components/MapDrawTool/storyExamplesMapDrawToolMultipleDrawTools.d.ts +1 -1
- package/src/lib/components/MapDrawTool/types.d.ts +6 -2
- package/src/lib/components/MapDrawTool/useMapDrawTool.d.ts +9 -64
- package/src/lib/components/MapDrawTool/utils.d.ts +23 -6
- package/src/lib/components/ReactMapView/ReactMapView.d.ts +1 -0
- package/src/lib/components/ReactMapView/types.d.ts +1 -0
- package/src/lib/components/index.d.ts +1 -1
- package/src/lib/storyshots/Storyshots.spec.d.ts +1 -0
- package/src/lib/components/CanvasComponent/CanvasComponent.d.ts +0 -71
- package/src/lib/components/CanvasComponent/CanvasComponentDynamic.stories.d.ts +0 -6
- package/src/lib/components/CanvasComponent/CanvasComponentStatic.stories.d.ts +0 -6
- package/src/lib/components/CanvasComponent/index.d.ts +0 -1
- /package/src/lib/components/{CanvasComponent/CanvasComponent.spec.d.ts → MapDimensionSelect/DimensionSelectButton.spec.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.10.0",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -11,15 +11,14 @@
|
|
|
11
11
|
"@opengeoweb/webmap": "*",
|
|
12
12
|
"axios": "1.5.0",
|
|
13
13
|
"@opengeoweb/theme": "*",
|
|
14
|
-
"@mui/material": "5.
|
|
14
|
+
"@mui/material": "~5.15.11",
|
|
15
15
|
"@opengeoweb/shared": "*",
|
|
16
16
|
"lodash": "^4.17.21",
|
|
17
17
|
"proj4": "^2.9.2",
|
|
18
18
|
"@turf/turf": "^6.5.0",
|
|
19
|
-
"immer": "^
|
|
19
|
+
"immer": "^10.0.3",
|
|
20
20
|
"react-resize-detector": "^9.1.0",
|
|
21
|
-
"throttle-debounce": "^5.0.0"
|
|
22
|
-
"date-fns": "^3.3.0"
|
|
21
|
+
"throttle-debounce": "^5.0.0"
|
|
23
22
|
},
|
|
24
23
|
"peerDependencies": {
|
|
25
24
|
"react": "18"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface DimensionSelectButtonProps {
|
|
3
|
+
dimension: string;
|
|
4
|
+
onClickDimensionButton: () => void;
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const DimensionSelectButton: React.FC<DimensionSelectButtonProps>;
|
|
8
|
+
export default DimensionSelectButton;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Source } from '@opengeoweb/shared';
|
|
3
|
+
export interface DimensionSelectProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
order?: number;
|
|
6
|
+
onMouseDown?: () => void;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
source?: Source;
|
|
9
|
+
dimensionName: string;
|
|
10
|
+
index?: number;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
declare const DimensionSelectDialog: React.FC<DimensionSelectProps>;
|
|
14
|
+
export default DimensionSelectDialog;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const DimensionSelectElevationLight: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
storyName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const DimensionSelectElevationDark: {
|
|
11
|
+
(): React.ReactElement;
|
|
12
|
+
storyName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const DimensionSelectEnsembleMemberLight: {
|
|
15
|
+
(): React.ReactElement;
|
|
16
|
+
storyName: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const DimensionSelectEnsembleMemberDark: {
|
|
19
|
+
(): React.ReactElement;
|
|
20
|
+
storyName: string;
|
|
21
|
+
};
|
|
22
|
+
export declare const DimensionSelectInvalidSyncLight: {
|
|
23
|
+
(): React.ReactElement;
|
|
24
|
+
storyName: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const DimensionSelectInvalidSyncDark: {
|
|
27
|
+
(): React.ReactElement;
|
|
28
|
+
storyName: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Mark } from './utils';
|
|
3
|
+
interface DimensionSelectSliderProps {
|
|
4
|
+
marks: Mark[];
|
|
5
|
+
layerTitle: string;
|
|
6
|
+
reverse?: boolean;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
managedValue?: number | string;
|
|
9
|
+
validSelection?: boolean;
|
|
10
|
+
alertColor?: string;
|
|
11
|
+
onChangeDimensionValue: (dimensionValue: string) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const DimensionSelectSlider: React.FC<DimensionSelectSliderProps>;
|
|
14
|
+
export default DimensionSelectSlider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dimension } from '@opengeoweb/webmap';
|
|
3
|
+
export interface MapDimensionSelectProps {
|
|
4
|
+
layerId: string;
|
|
5
|
+
dimensionName: string;
|
|
6
|
+
handleDimensionValueChanged: (layerId: string, dimensionName: string, dimensionValue: string) => void;
|
|
7
|
+
handleSyncChanged: (layerId: string, dimensionName: string, dimensionValue: string, synced: boolean) => void;
|
|
8
|
+
layerDimension: Dimension;
|
|
9
|
+
}
|
|
10
|
+
declare const MapDimensionSelect: React.FC<MapDimensionSelectProps>;
|
|
11
|
+
export default MapDimensionSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as DimensionSelectButton } from './DimensionSelectButton';
|
|
2
|
+
export { default as DimensionSelectDialog } from './DimensionSelectDialog';
|
|
3
|
+
export { default as DimensionSelectSlider } from './DimensionSelectSlider';
|
|
4
|
+
export { default as MapDimensionSelect } from './MapDimensionSelect';
|
|
5
|
+
export { dimensionConfig, marksByDimension } from './utils';
|
|
6
|
+
export type { DimensionConfig } from './utils';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SvgIconProps } from '@mui/material';
|
|
3
|
+
import { WMJSDimension } from '@opengeoweb/webmap';
|
|
4
|
+
export interface DimensionConfig {
|
|
5
|
+
name: string;
|
|
6
|
+
label: string;
|
|
7
|
+
defaultUnit: string;
|
|
8
|
+
reversed: boolean;
|
|
9
|
+
iconType: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const dimensionConfig: DimensionConfig[];
|
|
12
|
+
export declare const getDimensionIcon: (iconType: string) => React.FC<SvgIconProps>;
|
|
13
|
+
export interface Mark {
|
|
14
|
+
value: number | string;
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const marksByDimension: (dim: WMJSDimension) => Mark[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GeoJsonProperties, GeometryObject, Position } from 'geojson';
|
|
3
3
|
import { GeoJsonFeatureType, GeoJsonFeature, GeoFeatureStyle, Coordinate } from './geojsonShapes';
|
|
4
|
-
|
|
4
|
+
interface DrawStyle {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
7
|
nr: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
}
|
|
9
|
+
interface InputEvent {
|
|
10
10
|
leftButton: boolean;
|
|
11
11
|
mouseDown: boolean;
|
|
12
12
|
mouseX: number;
|
|
13
13
|
mouseY: number;
|
|
14
14
|
rightButton: boolean;
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
export interface FeatureEvent {
|
|
17
17
|
coordinateIndexInFeature: number;
|
|
18
18
|
featureIndex: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GeometryObject } from 'geojson';
|
|
3
3
|
import { DrawModeExitCallback, FeatureEvent } from './MapDraw';
|
|
4
|
-
export
|
|
4
|
+
export interface FeatureLayer {
|
|
5
5
|
id: string;
|
|
6
6
|
type: string;
|
|
7
7
|
features: [];
|
|
@@ -14,7 +14,7 @@ export type FeatureLayer = {
|
|
|
14
14
|
updateGeojson?: (feature: GeometryObject, reason: string) => void;
|
|
15
15
|
exitDrawModeCallback?: (reason: DrawModeExitCallback) => void;
|
|
16
16
|
selectedFeatureIndex?: string;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
interface MapDrawContainerProps {
|
|
19
19
|
featureLayers: FeatureLayer[];
|
|
20
20
|
mapId: string;
|
|
@@ -7,14 +7,14 @@ export declare const featureBox: GeoJSON.Feature<GeoJSON.Polygon>;
|
|
|
7
7
|
export declare const lineString: GeoJSON.FeatureCollection;
|
|
8
8
|
export type GeoJsonFeatureType = GeoJSON.Polygon | GeoJSON.MultiPoint | GeoJSON.Point | GeoJSON.LineString | GeoJSON.MultiPolygon;
|
|
9
9
|
export type GeoJsonFeature = GeoJSON.Feature<GeoJsonFeatureType>;
|
|
10
|
-
export
|
|
10
|
+
export interface GeoFeatureStyle {
|
|
11
11
|
stroke?: string;
|
|
12
12
|
fill?: string;
|
|
13
13
|
'stroke-width'?: number;
|
|
14
14
|
'stroke-opacity'?: number;
|
|
15
15
|
'fill-opacity'?: number;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
16
|
+
}
|
|
17
|
+
export interface Coordinate {
|
|
18
18
|
x: number;
|
|
19
19
|
y: number;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
@@ -18,10 +18,10 @@ export interface MapDrawDrawFunctionArgs {
|
|
|
18
18
|
mouseY: number;
|
|
19
19
|
isHovered: boolean;
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
interface DrawFunction {
|
|
22
22
|
id: string;
|
|
23
23
|
drawMethod: (args: MapDrawDrawFunctionArgs) => void;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
export declare const getDrawFunctionFromStore: (id: string) => DrawFunction['drawMethod'] | undefined;
|
|
26
26
|
export declare const registerDrawFunction: (drawFunction?: DrawFunction['drawMethod']) => string;
|
|
27
27
|
export declare const NEW_LINESTRING_CREATED = "new point in LineString created";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface FeatureLayersProps {
|
|
3
3
|
geojson: GeoJSON.FeatureCollection;
|
|
4
|
-
onChangeLayerIndex: (newIndex: number) => void;
|
|
4
|
+
onChangeLayerIndex: (newIndex: number, feature: GeoJSON.Feature) => void;
|
|
5
5
|
activeFeatureLayerIndex: number;
|
|
6
|
+
getToolIcon: (selectionType: string) => React.ReactElement;
|
|
6
7
|
}
|
|
7
8
|
declare const FeatureLayers: React.FC<FeatureLayersProps>;
|
|
8
9
|
export default FeatureLayers;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
interface IntersectionElement {
|
|
3
3
|
geojson: GeoJSON.FeatureCollection;
|
|
4
4
|
title: string;
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
6
|
interface IntersectionSelectProps {
|
|
7
7
|
intersections: IntersectionElement[];
|
|
8
8
|
onChangeIntersection: (geojson: GeoJSON.FeatureCollection, title: string) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const SelectField: React.FC<{
|
|
3
3
|
label: string;
|
|
4
|
-
value: string
|
|
4
|
+
value: string;
|
|
5
5
|
onChangeValue: (value: string) => void;
|
|
6
|
-
options:
|
|
6
|
+
options: string[];
|
|
7
7
|
width?: string;
|
|
8
8
|
showValueAsColor?: boolean;
|
|
9
9
|
labelSuffix?: string;
|
|
@@ -10,3 +10,4 @@ interface BasicMapDrawToolProps {
|
|
|
10
10
|
export declare const BasicMapDrawTool: React.FC<BasicMapDrawToolProps>;
|
|
11
11
|
export declare const BasicMapDrawToolShape: () => React.ReactElement;
|
|
12
12
|
export declare const BasicMapDrawToolWithMultipleShapes: () => React.ReactElement;
|
|
13
|
+
export declare const BasicMapDrawToolWithMultipleShapesValues: () => React.ReactElement;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SelectionType } from './types';
|
|
2
3
|
import { MapDrawToolOptions } from './useMapDrawTool';
|
|
3
|
-
export declare const opacityOptions:
|
|
4
|
+
export declare const opacityOptions: string[];
|
|
4
5
|
export declare const fillOptions: any[];
|
|
5
|
-
export declare const strokeWidthOptions:
|
|
6
|
-
export declare const getToolIcon: (
|
|
6
|
+
export declare const strokeWidthOptions: string[];
|
|
7
|
+
export declare const getToolIcon: (selectionType: SelectionType) => React.ReactElement;
|
|
7
8
|
export declare const basicExampleDrawOptions: MapDrawToolOptions;
|
|
8
9
|
export declare const basicExampleMultipleShapeDrawOptions: MapDrawToolOptions;
|
|
10
|
+
export declare const basicExampleMultipleShapeWithValuesDrawOptions: MapDrawToolOptions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { SelectionType } from './types';
|
|
2
3
|
import { MapDrawToolOptions } from './useMapDrawTool';
|
|
3
|
-
export declare const getIntersectionToolIcon: (
|
|
4
|
+
export declare const getIntersectionToolIcon: (selectionType: SelectionType) => React.ReactElement;
|
|
4
5
|
export declare const exampleIntersections: {
|
|
5
6
|
title: string;
|
|
6
7
|
geojson: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DrawMode } from './types';
|
|
3
3
|
import { MapDrawToolOptions } from './useMapDrawTool';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const firSelectionType = "fir";
|
|
5
5
|
export declare const exampleIntersectionsMultiDrawTool: {
|
|
6
6
|
title: string;
|
|
7
7
|
geojson: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { DRAWMODE } from '../MapDraw/MapDraw';
|
|
2
2
|
export type DrawModeValue = DRAWMODE | 'DELETE' | '';
|
|
3
|
-
|
|
3
|
+
type DefaultSelectionTypes = 'poly' | 'point' | 'box' | 'linestring';
|
|
4
|
+
export type SelectionType = DefaultSelectionTypes | string;
|
|
5
|
+
export interface DrawMode {
|
|
4
6
|
drawModeId: string;
|
|
5
7
|
value: DrawModeValue;
|
|
6
8
|
shape: GeoJSON.Feature | GeoJSON.FeatureCollection;
|
|
7
9
|
title: string;
|
|
8
10
|
isSelectable: boolean;
|
|
9
|
-
|
|
11
|
+
selectionType: SelectionType;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DrawMode, DrawModeValue } from './types';
|
|
2
|
+
import { DrawMode, DrawModeValue, SelectionType } from './types';
|
|
3
3
|
import { MapViewLayerProps } from '../MapView';
|
|
4
|
-
import { DRAWMODE } from '../MapDraw/MapDraw';
|
|
5
4
|
export declare const defaultIntersectionStyleProperties: GeoJSON.GeoJsonProperties;
|
|
6
5
|
export declare const emptyLineString: GeoJSON.Feature;
|
|
7
6
|
export declare const emptyPoint: GeoJSON.Feature;
|
|
@@ -42,67 +41,13 @@ export interface MapDrawToolOptions {
|
|
|
42
41
|
geoJSONIntersectionLayerId?: string;
|
|
43
42
|
geoJSONIntersectionBoundsLayerId?: string;
|
|
44
43
|
}
|
|
45
|
-
export declare const getIcon: (
|
|
46
|
-
export declare const defaultPoint:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
export declare const defaultPolygon: {
|
|
54
|
-
drawModeId: string;
|
|
55
|
-
value: DRAWMODE;
|
|
56
|
-
title: string;
|
|
57
|
-
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
58
|
-
isSelectable: boolean;
|
|
59
|
-
};
|
|
60
|
-
export declare const defaultBox: {
|
|
61
|
-
drawModeId: string;
|
|
62
|
-
value: DRAWMODE;
|
|
63
|
-
title: string;
|
|
64
|
-
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
65
|
-
isSelectable: boolean;
|
|
66
|
-
};
|
|
67
|
-
export declare const defaultLineString: {
|
|
68
|
-
drawModeId: string;
|
|
69
|
-
value: DRAWMODE;
|
|
70
|
-
title: string;
|
|
71
|
-
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
72
|
-
isSelectable: boolean;
|
|
73
|
-
};
|
|
74
|
-
export declare const defaultDelete: {
|
|
75
|
-
drawModeId: string;
|
|
76
|
-
value: "DELETE";
|
|
77
|
-
title: string;
|
|
78
|
-
shape: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
79
|
-
isSelectable: boolean;
|
|
80
|
-
};
|
|
81
|
-
export declare const defaultModes: ({
|
|
82
|
-
drawModeId: string;
|
|
83
|
-
value: DRAWMODE;
|
|
84
|
-
title: string;
|
|
85
|
-
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
86
|
-
isSelectable: boolean;
|
|
87
|
-
} | {
|
|
88
|
-
drawModeId: string;
|
|
89
|
-
value: "DELETE";
|
|
90
|
-
title: string;
|
|
91
|
-
shape: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
92
|
-
isSelectable: boolean;
|
|
93
|
-
})[];
|
|
94
|
-
export declare const currentlySupportedDrawModes: ({
|
|
95
|
-
drawModeId: string;
|
|
96
|
-
value: DRAWMODE;
|
|
97
|
-
title: string;
|
|
98
|
-
shape: import("geojson").Feature<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
99
|
-
isSelectable: boolean;
|
|
100
|
-
} | {
|
|
101
|
-
drawModeId: string;
|
|
102
|
-
value: "DELETE";
|
|
103
|
-
title: string;
|
|
104
|
-
shape: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
|
|
105
|
-
isSelectable: boolean;
|
|
106
|
-
})[];
|
|
44
|
+
export declare const getIcon: (selectionType: SelectionType) => React.ReactElement | null;
|
|
45
|
+
export declare const defaultPoint: DrawMode;
|
|
46
|
+
export declare const defaultPolygon: DrawMode;
|
|
47
|
+
export declare const defaultBox: DrawMode;
|
|
48
|
+
export declare const defaultLineString: DrawMode;
|
|
49
|
+
export declare const defaultDelete: DrawMode;
|
|
50
|
+
export declare const defaultModes: DrawMode[];
|
|
51
|
+
export declare const currentlySupportedDrawModes: DrawMode[];
|
|
107
52
|
export declare const useMapDrawTool: ({ defaultDrawModes, shouldAllowMultipleShapes, defaultGeoJSON, defaultGeoJSONIntersection, defaultGeoJSONIntersectionBounds, defaultGeoJSONIntersectionProperties, geoJSONLayerId, geoJSONIntersectionLayerId, geoJSONIntersectionBoundsLayerId, }: MapDrawToolOptions) => MapDrawToolProps;
|
|
108
53
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Feature } from '@turf/turf';
|
|
2
|
-
import { FeatureCollection } from 'geojson';
|
|
3
|
-
import { DrawMode } from './types';
|
|
2
|
+
import { FeatureCollection, GeoJsonProperties, Point } from 'geojson';
|
|
3
|
+
import { DrawMode, SelectionType } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Adds properties to the first geojson feature based on the given property object.
|
|
6
6
|
* It only extends or changes the properties which are defined in styleConfig,
|
|
@@ -18,20 +18,34 @@ export declare const getGeoJSONPropertyValue: (property: string, properties: Geo
|
|
|
18
18
|
* @param {number} featureLayerIndex - feature layer index
|
|
19
19
|
* @param {string} text - reason of change
|
|
20
20
|
*/
|
|
21
|
-
export declare const moveFeature: (currentGeoJSON: GeoJSON.FeatureCollection, newGeoJSON: GeoJSON.FeatureCollection, featureLayerIndex: number, reason: string) => number | undefined;
|
|
21
|
+
export declare const moveFeature: (currentGeoJSON: GeoJSON.FeatureCollection, newGeoJSON: GeoJSON.FeatureCollection, featureLayerIndex: number, reason: string, selectionType?: string) => number | undefined;
|
|
22
22
|
/**
|
|
23
|
-
* Returns the intersection of two features. In case of a polygon, only the first feature is used.
|
|
23
|
+
* Returns the intersection of two point features. In case of a polygon, only the first feature is used.
|
|
24
24
|
* @param a Feature A
|
|
25
25
|
* @param b Feature B
|
|
26
26
|
* @returns The intersection of the two features.
|
|
27
27
|
*/
|
|
28
|
-
export declare const
|
|
28
|
+
export declare const intersectPointGeoJSONS: (a: GeoJSON.FeatureCollection<GeoJSON.Point>, b: GeoJSON.FeatureCollection, geoJSONProperties?: {
|
|
29
29
|
stroke: string;
|
|
30
30
|
'stroke-width': number;
|
|
31
31
|
'stroke-opacity': number;
|
|
32
32
|
fill: string;
|
|
33
33
|
'fill-opacity': number;
|
|
34
34
|
}) => GeoJSON.FeatureCollection;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the intersection of two (multi) polygon 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 intersectPolygonGeoJSONS: (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
|
+
export declare const isPointFeatureCollection: (geojson: GeoJSON.FeatureCollection) => geojson is FeatureCollection<Point, GeoJsonProperties>;
|
|
35
49
|
/**
|
|
36
50
|
* Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
|
|
37
51
|
* @param geoJSONs
|
|
@@ -39,6 +53,9 @@ export declare const intersectGeoJSONS: (a: GeoJSON.FeatureCollection, b: GeoJSO
|
|
|
39
53
|
*/
|
|
40
54
|
export declare const createInterSections: (geojson: GeoJSON.FeatureCollection, otherGeoJSON: GeoJSON.FeatureCollection, geoJSONproperties?: GeoJSON.GeoJsonProperties) => GeoJSON.FeatureCollection;
|
|
41
55
|
export declare const getGeoJson: (geojson: GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean) => GeoJSON.FeatureCollection;
|
|
56
|
+
export declare const getLastEmptyFeatureIndex: (geoJSONFeatureCollection: GeoJSON.FeatureCollection) => number | undefined;
|
|
42
57
|
export declare const getFeatureCollection: (geoJSONFeature: GeoJSON.Feature | GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean, geoJSONFeatureCollection?: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection;
|
|
43
|
-
export declare const isGeoJSONFeatureCreatedByTool: (existingJSON: GeoJSON.FeatureCollection,
|
|
58
|
+
export declare const isGeoJSONFeatureCreatedByTool: (existingJSON: GeoJSON.FeatureCollection, selectionType: SelectionType, featureLayerIndex?: number) => boolean;
|
|
44
59
|
export declare const rewindGeometry: (geoJSON: FeatureCollection) => FeatureCollection;
|
|
60
|
+
export declare const addGeoJSONProperties: (geoJSON: GeoJSON.Feature | GeoJSON.FeatureCollection, newProperties: GeoJsonProperties) => GeoJSON.Feature | GeoJSON.FeatureCollection;
|
|
61
|
+
export declare const addSelectionTypeToGeoJSON: (geoJSON: GeoJSON.Feature | GeoJSON.FeatureCollection, selectionType: SelectionType) => GeoJSON.Feature | GeoJSON.FeatureCollection;
|
|
@@ -33,6 +33,7 @@ export declare class ReactMapView extends React.Component<ReactMapViewProps, Rea
|
|
|
33
33
|
displayMapPin: boolean;
|
|
34
34
|
disableMapPin: boolean;
|
|
35
35
|
onWMJSMount: () => void;
|
|
36
|
+
onWMJSUnMount: () => void;
|
|
36
37
|
onMapChangeDimension: () => void;
|
|
37
38
|
onUpdateLayerInformation: () => void;
|
|
38
39
|
onMapZoomEnd: () => void;
|
|
@@ -26,6 +26,7 @@ export interface ReactMapViewProps {
|
|
|
26
26
|
showLayerInfo?: boolean;
|
|
27
27
|
disableMapPin?: boolean;
|
|
28
28
|
onWMJSMount?: (mapId: string) => void;
|
|
29
|
+
onWMJSUnMount?: (mapId: string) => void;
|
|
29
30
|
onMapChangeDimension?: (payload: SetMapDimensionPayload) => void;
|
|
30
31
|
onMapZoomEnd?: (payload: SetBboxPayload) => void;
|
|
31
32
|
onMapPinChangeLocation?: (payload: MapPinLocationPayload) => void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './CanvasComponent';
|
|
2
1
|
export * from './Legend';
|
|
3
2
|
export * from './MapDraw';
|
|
4
3
|
export * from './MapDrawTool';
|
|
@@ -7,3 +6,4 @@ export * from './MapView';
|
|
|
7
6
|
export * from './MapTime';
|
|
8
7
|
export * from './MapControls';
|
|
9
8
|
export * from './MapWarning';
|
|
9
|
+
export * from './MapDimensionSelect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
interface CanvasComponentProps {
|
|
3
|
-
onRenderCanvas: (ctx: CanvasRenderingContext2D, width: number, height: number, canvas: HTMLCanvasElement) => void;
|
|
4
|
-
onCanvasClick?: (x: number, y: number, width: number, height: number) => void;
|
|
5
|
-
onMouseMove?: (x: number, y: number, event: MouseEvent, width: number) => void;
|
|
6
|
-
onMouseUp?: (x: number) => void;
|
|
7
|
-
onMouseDown?: (x: number, y: number, width: number) => void;
|
|
8
|
-
onTouchStart?: (event: TouchEvent, width: number) => void;
|
|
9
|
-
onTouchEnd?: () => void;
|
|
10
|
-
onTouchMove?: (event: TouchEvent, width: number) => void;
|
|
11
|
-
onKeyUp?: (event: KeyboardEvent) => void;
|
|
12
|
-
onKeyDown?: (event: KeyboardEvent) => void;
|
|
13
|
-
isFocussed?: (isFocussed: boolean) => void;
|
|
14
|
-
onWheel?: ({ event, deltaY, deltaX, canvasWidth, mouseX, }: {
|
|
15
|
-
event: WheelEvent;
|
|
16
|
-
deltaY: number;
|
|
17
|
-
deltaX: number;
|
|
18
|
-
canvasWidth: number;
|
|
19
|
-
mouseX: number;
|
|
20
|
-
}) => void;
|
|
21
|
-
loop?: boolean;
|
|
22
|
-
redrawInterval?: number;
|
|
23
|
-
resizeCallback?: (newWidth: number) => void;
|
|
24
|
-
children?: React.ReactNode;
|
|
25
|
-
}
|
|
26
|
-
export declare class CanvasComponent extends Component<CanvasComponentProps> {
|
|
27
|
-
canvas: HTMLCanvasElement | null;
|
|
28
|
-
ctx: CanvasRenderingContext2D | null;
|
|
29
|
-
currentWidth: number;
|
|
30
|
-
currentHeight: number;
|
|
31
|
-
canvascontaineroutside: React.RefObject<HTMLDivElement> | null;
|
|
32
|
-
canvascontainer: React.RefObject<HTMLDivElement> | null;
|
|
33
|
-
timer: ReturnType<typeof setTimeout> | null;
|
|
34
|
-
redrawTimer: ReturnType<typeof setTimeout> | null;
|
|
35
|
-
loopHasStarted: boolean;
|
|
36
|
-
mounted: boolean;
|
|
37
|
-
static defaultProps: {
|
|
38
|
-
onRenderCanvas: () => void;
|
|
39
|
-
onCanvasClick: () => void;
|
|
40
|
-
onMouseMove: () => void;
|
|
41
|
-
onMouseUp: () => void;
|
|
42
|
-
onMouseDown: () => void;
|
|
43
|
-
onTouchStart: () => void;
|
|
44
|
-
onTouchEnd: () => void;
|
|
45
|
-
onTouchMove: () => void;
|
|
46
|
-
onWheel: () => void;
|
|
47
|
-
};
|
|
48
|
-
private _isFocussed;
|
|
49
|
-
constructor(props: CanvasComponentProps);
|
|
50
|
-
componentDidMount(): void;
|
|
51
|
-
shouldComponentUpdate(): boolean;
|
|
52
|
-
componentWillUnmount(): void;
|
|
53
|
-
handleMouseMoveEvent(event: MouseEvent): void;
|
|
54
|
-
handleMouseUpEvent(event: MouseEvent): void;
|
|
55
|
-
handleMouseDownEvent(event: MouseEvent): void;
|
|
56
|
-
handleTouchStartEvent(event: TouchEvent): void;
|
|
57
|
-
handleTouchEndEvent(): void;
|
|
58
|
-
handleTouchMoveEvent(event: TouchEvent): void;
|
|
59
|
-
handleClickEvent(event: MouseEvent): void;
|
|
60
|
-
handleWheelEvent(event: WheelEvent): void;
|
|
61
|
-
onFocus(): void;
|
|
62
|
-
onBlur(): void;
|
|
63
|
-
onKeyUp(event: KeyboardEvent): void;
|
|
64
|
-
_documentKeyDown(event: KeyboardEvent): void;
|
|
65
|
-
_handleWindowResize(): void;
|
|
66
|
-
startLoop(): void;
|
|
67
|
-
updateCanvas(): void;
|
|
68
|
-
resize(): void;
|
|
69
|
-
render(): React.ReactElement;
|
|
70
|
-
}
|
|
71
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CanvasComponent';
|