@opengeoweb/webmap-react 19.6.1 → 20.0.0-nightly-20260918

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.
@@ -1,2 +1,6 @@
1
1
  import React from 'react';
2
- export declare const MapMousePosition: React.FC;
2
+ interface MapMousePositionProps {
3
+ bottom?: string;
4
+ }
5
+ export declare const MapMousePosition: React.FC<MapMousePositionProps>;
6
+ 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 getFeaturePointStyle: (fillColor?: string, fillOpacity?: number) => Style;
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[];
@@ -10,5 +10,6 @@ export interface OpenLayersMapViewProps {
10
10
  holdShiftToScroll?: boolean;
11
11
  mapId?: string;
12
12
  showMapMousePosition?: boolean;
13
+ mapMousePositionBottom?: string;
13
14
  }
14
15
  export declare const OpenLayersMapView: React.FC<OpenLayersMapViewProps>;
@@ -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
@@ -10,3 +10,4 @@ export * from './geojsonShapes';
10
10
  export * from './mapDrawUtils';
11
11
  export * from './storyComponents';
12
12
  export * from './polygonCleanDangling';
13
+ export * from './selectionUtils';
@@ -6,6 +6,7 @@ export declare const getProj4: (projection: string | Converter) => Converter;
6
6
  export declare const NEW_LINESTRING_CREATED = "new point in LineString created";
7
7
  export declare const NEW_FEATURE_CREATED = "new feature created";
8
8
  export declare const NEW_POINT_CREATED = "new point created";
9
+ export declare const COORDINATE_DECIMALS = 5;
9
10
  export declare const roundCoordinates: <T extends Position | Position[] | Position[][] | Position[][][]>(coords: T) => T;
10
11
  export declare const roundFeatureCoordinates: <T extends Feature>(feature: T) => T;
11
12
  export declare const splitPolygon: (polygonFeature: Feature<GeoJSON.Polygon>, splitFeature: Feature<GeoJSON.Polygon>) => FeatureCollection<GeoJSON.Polygon> | null;
@@ -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[];
@@ -6,4 +6,5 @@ export declare const strokeWidthOptions: string[];
6
6
  export declare const getToolIcon: (selectionType: SelectionType) => React.ReactElement;
7
7
  export declare const basicExampleDrawOptions: MapDrawToolOptions;
8
8
  export declare const basicExampleMultipleShapeDrawOptions: MapDrawToolOptions;
9
+ export declare const basicExampleSharedVertexDrawOptions: MapDrawToolOptions;
9
10
  export declare const basicExampleMultipleShapeWithValuesDrawOptions: MapDrawToolOptions;
@@ -73,6 +73,15 @@ 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
+ export declare const TRANSIENT_FEATURE_PROPERTIES: readonly ["isSelected", "highlightSelectedFeature", "highlightNearbyFeature", "hover", "boxSelectPreview", "isReadonly"];
77
+ /**
78
+ * Removes the passed properties from the features of a feature collection
79
+ * @param geoJSON feature collection
80
+ * @param propertiesToRemove names of the properties to remove
81
+ * @returns feature collection without the passed feature properties
82
+ */
83
+ export declare const removeFeatureProperties: (geoJSON: GeoJSON.FeatureCollection, propertiesToRemove: readonly string[]) => GeoJSON.FeatureCollection;
84
+ export declare const removeTransientFeatureProperties: (geoJSON: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection;
76
85
  /**
77
86
  * Turns a feature which originates from another feature into a new feature: the
78
87
  * id and the properties identifying the original feature are removed
@@ -2,6 +2,8 @@ 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/modifyFeatures';
6
+ export * from './utils/moveFeatures';
5
7
  export * from './utils/projections';
6
8
  export * from './utils/setMapCenter';
7
9
  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 type { BoxSelect, ClickOnFeature, HoverSelect } from '../utils/types';
3
+ import React from 'react';
4
+ import type { BoxSelect, ClickOnFeature, HoverSelect, ModifyFeatures, MoveFeatures } from '../utils/types';
4
5
  export interface FeatureLayerProps {
5
6
  features: Feature[];
6
7
  style: StyleLike;
@@ -8,6 +9,8 @@ export interface FeatureLayerProps {
8
9
  hoverSelect?: HoverSelect;
9
10
  clickOnFeature?: ClickOnFeature;
10
11
  boxSelect?: BoxSelect;
12
+ moveFeatures?: MoveFeatures;
13
+ modifyFeatures?: ModifyFeatures;
11
14
  layerId?: string;
12
15
  testId?: string;
13
16
  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, ModifyFeaturesGeoJSON, MoveFeaturesGeoJSON } from '../utils/types';
4
4
  export interface OpenLayersFeatureLayerProps {
5
5
  featureCollection?: FeatureCollection;
6
6
  style?: StyleLike;
@@ -8,6 +8,8 @@ export interface OpenLayersFeatureLayerProps {
8
8
  hoverSelect?: HoverSelect;
9
9
  clickOnFeature?: ClickOnFeature;
10
10
  boxSelect?: BoxSelect;
11
+ moveFeatures?: MoveFeaturesGeoJSON;
12
+ modifyFeatures?: ModifyFeaturesGeoJSON;
11
13
  layerId?: string;
12
14
  testId?: string;
13
15
  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,30 @@
1
+ import type { Feature, Map } from 'ol';
2
+ import Modify from 'ol/interaction/Modify';
3
+ import type { ProjectionLike } from 'ol/proj';
4
+ import Style from 'ol/style/Style';
5
+ export declare const CONSTRAINED_SELECTION_TYPES: ReadonlySet<string>;
6
+ export declare const hasEditableVertices: (feature: Feature) => boolean;
7
+ export declare const isDefaultModifiable: (feature: Feature) => boolean;
8
+ export declare const connectSharedVertices: (features: Feature[], projection: ProjectionLike) => void;
9
+ export declare const modifyHandleStyle: Style;
10
+ export interface CreateModifyFeaturesOptions {
11
+ features: Feature[];
12
+ isModifiable: (feature: Feature) => boolean;
13
+ projection: ProjectionLike;
14
+ onModifyEnd: (features: Feature[]) => void;
15
+ onModifyStart?: () => void;
16
+ }
17
+ export interface ModifyFeaturesInteraction {
18
+ modify: Modify;
19
+ dispose: () => void;
20
+ }
21
+ export declare const createModifyFeatures: ({ features, isModifiable, projection, onModifyEnd, onModifyStart, }: CreateModifyFeaturesOptions) => ModifyFeaturesInteraction | undefined;
22
+ export interface UseModifyFeaturesOptions {
23
+ map?: Map | null;
24
+ features: Feature[];
25
+ active: boolean;
26
+ isModifiable?: (feature: Feature) => boolean;
27
+ onModifyEnd?: (features: Feature[]) => void;
28
+ onModifyStart?: () => void;
29
+ }
30
+ export declare const useModifyFeatures: ({ map, features, active, isModifiable, onModifyEnd, onModifyStart, }: UseModifyFeaturesOptions) => void;
@@ -0,0 +1,27 @@
1
+ import type { Feature, Map } from 'ol';
2
+ import type { Geometry } from 'ol/geom';
3
+ import Translate from 'ol/interaction/Translate';
4
+ import type { MovedFeature } from './types';
5
+ export declare const getOlFeatureKey: (feature?: Feature) => string | undefined;
6
+ export declare const isDefaultMovable: (feature: Feature) => boolean;
7
+ export declare const toMovedFeatures: (olFeatures: Feature<Geometry>[], projection: string) => MovedFeature[];
8
+ export interface CreateMoveFeaturesOptions {
9
+ features: Feature[];
10
+ isMovable: (feature: Feature) => boolean;
11
+ onMoveEnd: (features: Feature[]) => void;
12
+ onMoveStart?: () => void;
13
+ }
14
+ export interface MoveFeaturesInteraction {
15
+ translate: Translate;
16
+ dispose: () => void;
17
+ }
18
+ export declare const createMoveFeatures: ({ features, isMovable, onMoveEnd, onMoveStart, }: CreateMoveFeaturesOptions) => MoveFeaturesInteraction | undefined;
19
+ export interface UseMoveFeaturesOptions {
20
+ map?: Map | null;
21
+ features: Feature[];
22
+ active: boolean;
23
+ isMovable?: (feature: Feature) => boolean;
24
+ onMoveEnd?: (features: Feature[]) => void;
25
+ onMoveStart?: () => void;
26
+ }
27
+ export declare const useMoveFeatures: ({ map, features, active, isMovable, onMoveEnd, onMoveStart, }: UseMoveFeaturesOptions) => void;
@@ -13,6 +13,28 @@ 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
+ }
29
+ export interface ModifyFeatures {
30
+ onModifyEnd: (features: Feature[]) => void;
31
+ isModifiable?: (feature: Feature) => boolean;
32
+ active: boolean;
33
+ }
34
+ export interface ModifyFeaturesGeoJSON {
35
+ onModifyEnd: (modifiedFeatures: MovedFeature[]) => void;
36
+ active: boolean;
37
+ }
16
38
  export interface OnInitializeLayerProps {
17
39
  layerId: string;
18
40
  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 useViewFromLayer: (layerProps: OpenLayersLayerProps, baseView?: {
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
- "name": "@opengeoweb/webmap-react",
3
- "version": "19.6.1",
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": "*",
24
- "@opengeoweb/theme": "*",
25
- "@opengeoweb/shared": "*",
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
- }
2
+ "name": "@opengeoweb/webmap-react",
3
+ "version": "20.0.0-nightly-20260918",
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": "20.0.0-nightly-20260918",
24
+ "@opengeoweb/theme": "20.0.0-nightly-20260918",
25
+ "@opengeoweb/shared": "20.0.0-nightly-20260918",
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
+ }