@opengeoweb/webmap-react 19.5.1 → 19.6.1-nightly-20260912
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 +606 -123
- package/dist/src/lib/components/Legend/LegendDialog.d.ts +5 -1
- package/dist/src/lib/components/OpenLayers/OlStyles.d.ts +4 -1
- package/dist/src/lib/components/OpenLayers/draw/OpenLayersMapDraw.d.ts +5 -1
- package/dist/src/lib/components/OpenLayers/draw/index.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/draw/selectionUtils.d.ts +5 -0
- package/dist/src/lib/components/OpenLayers/draw/utils.d.ts +15 -0
- package/dist/src/lib/components/OpenLayers/index.d.ts +1 -0
- package/dist/src/lib/components/OpenLayers/layers/FeatureLayer.d.ts +3 -1
- package/dist/src/lib/components/OpenLayers/layers/OpenLayersFeatureLayer.d.ts +2 -1
- package/dist/src/lib/components/OpenLayers/utils/dragBoxSelect.d.ts +25 -0
- package/dist/src/lib/components/OpenLayers/utils/moveFeatures.d.ts +24 -0
- package/dist/src/lib/components/OpenLayers/utils/types.d.ts +13 -0
- package/dist/src/lib/hooks/useViewFromLayer.d.ts +4 -1
- package/package.json +50 -50
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { Source } from '@opengeoweb/shared';
|
|
2
|
+
import type { Source, DraggablePosition, DraggableSize, Position, Size } from '@opengeoweb/shared';
|
|
3
3
|
import type { LayerFoundation } from '@opengeoweb/webmap';
|
|
4
4
|
interface LegendDialogProps {
|
|
5
5
|
layers: LayerFoundation[];
|
|
@@ -11,6 +11,10 @@ interface LegendDialogProps {
|
|
|
11
11
|
order?: number;
|
|
12
12
|
source?: Source;
|
|
13
13
|
onToggleLayerLegendVisibility: (layerId: string, showLegend: boolean) => void;
|
|
14
|
+
startDraggablePosition?: DraggablePosition;
|
|
15
|
+
startPosition?: Position;
|
|
16
|
+
startSize?: DraggableSize;
|
|
17
|
+
onDragEnd?: (position: DraggablePosition, size: Size) => void;
|
|
14
18
|
}
|
|
15
19
|
export declare const LegendDialog: React.FC<LegendDialogProps>;
|
|
16
20
|
export {};
|
|
@@ -24,7 +24,10 @@ export declare const FEATURE_STROKE_SELECTED: Stroke;
|
|
|
24
24
|
export declare const FEATURE_VERTICE_IMAGE: Circle;
|
|
25
25
|
export declare const FEATURE_VERTICE_HANDLE_IMAGE: Circle;
|
|
26
26
|
export declare const FEATURE_VERTICES_EDIT_HANDLES: Style;
|
|
27
|
-
export declare const
|
|
27
|
+
export declare const SELECTED_FEATURE_COLOR = "#006CFD";
|
|
28
|
+
export declare const getBoxSelectPreviewStyle: (fill?: string) => Style;
|
|
29
|
+
export declare const getFeaturePointStyle: (fillColor?: string, fillOpacity?: number, isSelected?: boolean) => Style;
|
|
30
|
+
export declare const SELECTED_POINT_HALO_STYLE: Style;
|
|
28
31
|
export declare const labelOptions: {
|
|
29
32
|
font: string;
|
|
30
33
|
padding: number[];
|
|
@@ -3,6 +3,7 @@ import type { Geometry } from 'ol/geom';
|
|
|
3
3
|
import type { StyleLike } from 'ol/style/Style';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import type { DrawModeExitCallback, DrawModeValue } from './types';
|
|
6
|
+
import type { BoxSelect } from '../utils/types';
|
|
6
7
|
export interface OpenLayersMapDrawProps {
|
|
7
8
|
geojson: GeoJSON.FeatureCollection;
|
|
8
9
|
drawMode?: DrawModeValue;
|
|
@@ -10,9 +11,12 @@ export interface OpenLayersMapDrawProps {
|
|
|
10
11
|
exitDrawModeCallback?: (reason: DrawModeExitCallback) => void;
|
|
11
12
|
isInEditMode: boolean;
|
|
12
13
|
selectedFeatureIndex: number;
|
|
14
|
+
/** Highlight-only. The edit target stays `selectedFeatureIndex`. */
|
|
15
|
+
selectedFeatureIndices?: number[];
|
|
13
16
|
updateGeojson?: (geoJson: GeoJSON.FeatureCollection, text: string) => void;
|
|
14
|
-
onViewOnlyFeatureClick?: (feature: Feature<Geometry>[]) => void;
|
|
17
|
+
onViewOnlyFeatureClick?: (feature: Feature<Geometry>[], isShiftClick?: boolean) => void;
|
|
15
18
|
onNoFeatureClick?: () => void;
|
|
19
|
+
boxSelect?: BoxSelect;
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
22
|
* Integrates with OpenLayers Draw and Modify (+Snap) interactions, to implement feature drawing
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const calculateNewSelection: (currentSelectedIndices: number[], clickedIndex: number, isShiftClick: boolean) => number[];
|
|
2
|
+
export declare const getAffectedIndices: (oldSelection: number[], newSelection: number[]) => number[];
|
|
3
|
+
export declare const shouldEnterEditMode: (isReadonly: boolean, isShiftClick: boolean, newSelectionCount: number) => boolean;
|
|
4
|
+
export declare const shouldExitEditModeForMultiSelect: (newSelectionCount: number) => boolean;
|
|
5
|
+
export declare const calculateBoxSelection: (currentSelectedIndices: number[], boxSelectedIndices: number[], addToSelection: boolean) => number[];
|
|
@@ -73,6 +73,21 @@ export declare const isPointFeatureCollection: (geojson: GeoJSON.FeatureCollecti
|
|
|
73
73
|
* @returns GeoJSONS extend with intersections
|
|
74
74
|
*/
|
|
75
75
|
export declare const createInterSections: (geojson: GeoJSON.FeatureCollection, otherGeoJSON: GeoJSON.FeatureCollection, geoJSONproperties?: GeoJSON.GeoJsonProperties, proj?: string) => GeoJSON.FeatureCollection;
|
|
76
|
+
/**
|
|
77
|
+
* Turns a feature which originates from another feature into a new feature: the
|
|
78
|
+
* id and the properties identifying the original feature are removed
|
|
79
|
+
* @param feature feature which originates from another feature
|
|
80
|
+
* @returns feature without the identity of the original feature
|
|
81
|
+
*/
|
|
82
|
+
export declare const asNewFeature: (feature: GeoJSON.Feature) => GeoJSON.Feature;
|
|
83
|
+
/**
|
|
84
|
+
* Keeps the identity of the original feature on the first of the features it was
|
|
85
|
+
* split into, the other features become new features
|
|
86
|
+
* @param splitFeatures features resulting from splitting a feature
|
|
87
|
+
* @param originalFeature feature which was split
|
|
88
|
+
* @returns split features where only the first one keeps the original identity
|
|
89
|
+
*/
|
|
90
|
+
export declare const keepIdentityOnFirstSplitFeature: (splitFeatures: GeoJSON.Feature[], originalFeature: GeoJSON.Feature | undefined) => GeoJSON.Feature[];
|
|
76
91
|
export declare const getGeoJson: (geojson: GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean) => GeoJSON.FeatureCollection;
|
|
77
92
|
export declare const getLastEmptyFeatureIndex: (geoJSONFeatureCollection: GeoJSON.FeatureCollection) => number | undefined;
|
|
78
93
|
export declare const getFeatureCollection: (geoJSONFeature: GeoJSON.Feature | GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean, geoJSONFeatureCollection?: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection;
|
|
@@ -2,6 +2,7 @@ export { default as MapContext } from './context/MapContext';
|
|
|
2
2
|
export * from './component/OpenLayersMapView';
|
|
3
3
|
export * from './utils/TimeAwareImageWrapper';
|
|
4
4
|
export type * from './utils/types';
|
|
5
|
+
export * from './utils/moveFeatures';
|
|
5
6
|
export * from './utils/projections';
|
|
6
7
|
export * from './utils/setMapCenter';
|
|
7
8
|
export * from './utils/viewUtils';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Feature } from 'ol';
|
|
2
2
|
import type { StyleLike } from 'ol/style/Style';
|
|
3
|
-
import
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { BoxSelect, ClickOnFeature, HoverSelect, MoveFeatures } from '../utils/types';
|
|
4
5
|
export interface FeatureLayerProps {
|
|
5
6
|
features: Feature[];
|
|
6
7
|
style: StyleLike;
|
|
@@ -8,6 +9,7 @@ export interface FeatureLayerProps {
|
|
|
8
9
|
hoverSelect?: HoverSelect;
|
|
9
10
|
clickOnFeature?: ClickOnFeature;
|
|
10
11
|
boxSelect?: BoxSelect;
|
|
12
|
+
moveFeatures?: MoveFeatures;
|
|
11
13
|
layerId?: string;
|
|
12
14
|
testId?: string;
|
|
13
15
|
opacity?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FeatureCollection } from 'geojson';
|
|
2
2
|
import type { StyleLike } from 'ol/style/Style';
|
|
3
|
-
import type { BoxSelect, ClickOnFeature, HoverSelect } from '../utils/types';
|
|
3
|
+
import type { BoxSelect, ClickOnFeature, HoverSelect, MoveFeaturesGeoJSON } from '../utils/types';
|
|
4
4
|
export interface OpenLayersFeatureLayerProps {
|
|
5
5
|
featureCollection?: FeatureCollection;
|
|
6
6
|
style?: StyleLike;
|
|
@@ -8,6 +8,7 @@ export interface OpenLayersFeatureLayerProps {
|
|
|
8
8
|
hoverSelect?: HoverSelect;
|
|
9
9
|
clickOnFeature?: ClickOnFeature;
|
|
10
10
|
boxSelect?: BoxSelect;
|
|
11
|
+
moveFeatures?: MoveFeaturesGeoJSON;
|
|
11
12
|
layerId?: string;
|
|
12
13
|
testId?: string;
|
|
13
14
|
opacity?: number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Feature, Map } from 'ol';
|
|
2
|
+
import DragBox from 'ol/interaction/DragBox';
|
|
3
|
+
import type VectorSource from 'ol/source/Vector';
|
|
4
|
+
export declare const isBoxSelectModifier: (event: {
|
|
5
|
+
altKey: boolean;
|
|
6
|
+
ctrlKey: boolean;
|
|
7
|
+
metaKey: boolean;
|
|
8
|
+
shiftKey: boolean;
|
|
9
|
+
}) => boolean;
|
|
10
|
+
export interface CreateDragBoxSelectOptions {
|
|
11
|
+
sources: VectorSource[];
|
|
12
|
+
onBoxSelect: (features: Feature[], addToSelection: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface DragBoxSelect {
|
|
15
|
+
dragBox: DragBox;
|
|
16
|
+
dispose: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const createDragBoxSelect: ({ sources, onBoxSelect, }: CreateDragBoxSelectOptions) => DragBoxSelect;
|
|
19
|
+
export interface UseDragBoxSelectOptions {
|
|
20
|
+
map?: Map | null;
|
|
21
|
+
source?: VectorSource;
|
|
22
|
+
active: boolean;
|
|
23
|
+
onBoxSelect?: (features: Feature[], addToSelection: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare const useDragBoxSelect: ({ map, source, active, onBoxSelect, }: UseDragBoxSelectOptions) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Feature, Map } from 'ol';
|
|
2
|
+
import Translate from 'ol/interaction/Translate';
|
|
3
|
+
export declare const getOlFeatureKey: (feature?: Feature) => string | undefined;
|
|
4
|
+
export declare const isDefaultMovable: (feature: Feature) => boolean;
|
|
5
|
+
export interface CreateMoveFeaturesOptions {
|
|
6
|
+
features: Feature[];
|
|
7
|
+
isMovable: (feature: Feature) => boolean;
|
|
8
|
+
onMoveEnd: (features: Feature[]) => void;
|
|
9
|
+
onMoveStart?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface MoveFeaturesInteraction {
|
|
12
|
+
translate: Translate;
|
|
13
|
+
dispose: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const createMoveFeatures: ({ features, isMovable, onMoveEnd, onMoveStart, }: CreateMoveFeaturesOptions) => MoveFeaturesInteraction | undefined;
|
|
16
|
+
export interface UseMoveFeaturesOptions {
|
|
17
|
+
map?: Map | null;
|
|
18
|
+
features: Feature[];
|
|
19
|
+
active: boolean;
|
|
20
|
+
isMovable?: (feature: Feature) => boolean;
|
|
21
|
+
onMoveEnd?: (features: Feature[]) => void;
|
|
22
|
+
onMoveStart?: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare const useMoveFeatures: ({ map, features, active, isMovable, onMoveEnd, onMoveStart, }: UseMoveFeaturesOptions) => void;
|
|
@@ -13,6 +13,19 @@ export interface BoxSelect {
|
|
|
13
13
|
onBoxSelect: (features: Feature[], addToSelection: boolean) => void;
|
|
14
14
|
active: boolean;
|
|
15
15
|
}
|
|
16
|
+
export interface MovedFeature {
|
|
17
|
+
featureId: string;
|
|
18
|
+
geometry: GeoJSON.Geometry;
|
|
19
|
+
}
|
|
20
|
+
export interface MoveFeatures {
|
|
21
|
+
onMoveEnd: (features: Feature[]) => void;
|
|
22
|
+
isMovable?: (feature: Feature) => boolean;
|
|
23
|
+
active: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface MoveFeaturesGeoJSON {
|
|
26
|
+
onMoveEnd: (movedFeatures: MovedFeature[]) => void;
|
|
27
|
+
active: boolean;
|
|
28
|
+
}
|
|
16
29
|
export interface OnInitializeLayerProps {
|
|
17
30
|
layerId: string;
|
|
18
31
|
style: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { View } from 'ol';
|
|
2
|
+
import type { Extent } from 'ol/extent';
|
|
3
|
+
import type { WMLayer } from '@opengeoweb/webmap';
|
|
2
4
|
import type { OpenLayersLayerProps } from '../components/OpenLayers/layers';
|
|
3
|
-
export declare const
|
|
5
|
+
export declare const getLayerExtentForProjection: (wmLayer: WMLayer, projectionCode: string) => Extent | undefined;
|
|
6
|
+
export declare const useViewFromLayer: (layerProps: OpenLayersLayerProps | undefined, baseView?: {
|
|
4
7
|
projection: string;
|
|
5
8
|
zoom: number;
|
|
6
9
|
center: number[];
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
2
|
+
"name": "@opengeoweb/webmap-react",
|
|
3
|
+
"version": "19.6.1-nightly-20260912",
|
|
4
|
+
"description": "GeoWeb react wrapper for webmap",
|
|
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/webmap": "19.6.1-nightly-20260912",
|
|
24
|
+
"@opengeoweb/theme": "19.6.1-nightly-20260912",
|
|
25
|
+
"@opengeoweb/shared": "19.6.1-nightly-20260912",
|
|
26
|
+
"lodash": "^4.18.1",
|
|
27
|
+
"ol": "^10.4.0",
|
|
28
|
+
"proj4": "^2.9.2",
|
|
29
|
+
"@turf/turf": "^7.1.0",
|
|
30
|
+
"immer": "^10.0.3",
|
|
31
|
+
"i18next": "^25.0.1",
|
|
32
|
+
"@mui/material": "^9.0.1",
|
|
33
|
+
"react-i18next": "^15.1.1",
|
|
34
|
+
"@tanstack/react-query": "^5.85.5",
|
|
35
|
+
"@types/geojson": "^7946.0.14"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "19",
|
|
39
|
+
"@emotion/react": "*",
|
|
40
|
+
"@emotion/styled": "*"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"eslint-plugin-storybook": "10.3.3"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"!dist/package.json",
|
|
48
|
+
"README.md",
|
|
49
|
+
"package.json"
|
|
50
|
+
]
|
|
51
|
+
}
|