@opengeoweb/webmap-react 8.2.0 → 8.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap-react",
3
- "version": "8.2.0",
3
+ "version": "8.3.0",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -29,7 +29,7 @@ export interface MapDrawProps {
29
29
  exitDrawModeCallback: (reason: DrawModeExitCallback) => void;
30
30
  isInEditMode: boolean;
31
31
  isInDeleteMode: boolean;
32
- featureNrToEdit: number;
32
+ selectedFeatureIndex: number;
33
33
  onHoverFeature?: (event: FeatureEvent) => void;
34
34
  onClickFeature?: (event: FeatureEvent) => void;
35
35
  updateGeojson: (geoJson: GeometryObject, text: string) => void;
@@ -96,7 +96,7 @@ export default class MapDraw extends React.PureComponent<MapDrawProps> {
96
96
  isInEditMode: boolean;
97
97
  isInDeleteMode: boolean;
98
98
  webmapjs: undefined;
99
- featureNrToEdit: number;
99
+ selectedFeatureIndex: number;
100
100
  };
101
101
  featureEvent: FeatureEvent;
102
102
  constructor(props: MapDrawProps);
@@ -11,9 +11,9 @@ export type FeatureLayer = {
11
11
  drawMode?: string;
12
12
  onHoverFeature?: (feature: FeatureEvent) => void;
13
13
  onClickFeature?: (feature: FeatureEvent) => void;
14
- updateGeojson?: (feature: GeometryObject) => void;
14
+ updateGeojson?: (feature: GeometryObject, reason: string) => void;
15
15
  exitDrawModeCallback?: (reason: DrawModeExitCallback) => void;
16
- featureNrToEdit?: string;
16
+ selectedFeatureIndex?: string;
17
17
  };
18
18
  interface MapDrawContainerProps {
19
19
  featureLayers: FeatureLayer[];
@@ -24,34 +24,7 @@ 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, featureIndex?: number) => 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?: GeoJSON.GeoJsonProperties) => GeoJSON.FeatureCollection;
54
- export declare const getGeoJson: (geojson: GeoJSON.FeatureCollection, shouldAllowMultipleshapes: boolean) => GeoJSON.FeatureCollection;
55
- export declare const getFeatureCollection: (geoJSONFeature: GeoJSON.Feature | GeoJSON.FeatureCollection, shouldAllowMultipleshapes: boolean, geoJSONFeatureCollection?: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection;
56
- export declare const isGeoJSONFeatureCreatedByTool: (existingJSON: GeoJSON.FeatureCollection, newGeoJSON: GeoJSON.Feature | GeoJSON.FeatureCollection) => boolean;
27
+ export declare const NEW_LINESTRING_CREATED = "new point in LineString created";
28
+ export declare const NEW_FEATURE_CREATED = "new feature created";
29
+ export declare const NEW_POINT_CREATED = "new point created";
57
30
  export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export declare const SelectField: React.FC<{
3
+ label: string;
4
+ value: string | number;
5
+ onChangeValue: (value: string) => void;
6
+ options: (string | number)[];
7
+ width?: string;
8
+ showValueAsColor?: boolean;
9
+ labelSuffix?: string;
10
+ }>;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const StoryLayoutGrid: React.FC<{
3
+ children: React.ReactNode;
4
+ mapComponent: React.ReactNode;
5
+ }>;
@@ -3,3 +3,5 @@ export { default as FeatureLayers } from './FeatureLayers';
3
3
  export { default as EditModeButtonField } from './EditModeButton';
4
4
  export * from './geojsonExamples';
5
5
  export * from './storyUtils';
6
+ export * from './StoryLayoutGrid';
7
+ export * from './SelectField';
@@ -1,2 +1,5 @@
1
1
  export * from './types';
2
2
  export { useMapDrawTool, defaultPoint, defaultDelete, defaultPolygon, defaultBox, defaultIntersectionStyleProperties, getIcon, currentlySupportedDrawModes, defaultModes, } from './useMapDrawTool';
3
+ export type { MapDrawToolOptions } from './useMapDrawTool';
4
+ export * from './utils';
5
+ export * from './storyUtils';
@@ -0,0 +1,3 @@
1
+ import { MapDrawToolOptions } from './useMapDrawTool';
2
+ export declare const basicExampleDrawOptions: MapDrawToolOptions;
3
+ export declare const basicExampleMultipleShapeDrawOptions: MapDrawToolOptions;
@@ -13,10 +13,11 @@ export interface MapDrawToolProps {
13
13
  geoJSON: GeoJSON.FeatureCollection;
14
14
  geoJSONIntersection?: GeoJSON.FeatureCollection;
15
15
  geoJSONIntersectionBounds?: GeoJSON.FeatureCollection;
16
- setGeoJSON: (geojson: GeoJSON.Feature | GeoJSON.FeatureCollection) => void;
16
+ setGeoJSON: (geojson: GeoJSON.Feature | GeoJSON.FeatureCollection, reason?: string) => void;
17
17
  setGeoJSONIntersectionBounds: (geojson: GeoJSON.FeatureCollection) => void;
18
- editModes: DrawMode[];
18
+ drawModes: DrawMode[];
19
19
  changeDrawMode: (mode: DrawModeValue) => void;
20
+ setDrawModes: (drawModes: DrawMode[]) => void;
20
21
  isInEditMode: boolean;
21
22
  setEditMode: (shouldEnable: boolean) => void;
22
23
  featureLayerIndex: number;
@@ -27,13 +28,12 @@ export interface MapDrawToolProps {
27
28
  layers: MapViewLayerProps[];
28
29
  getLayer: (layerType: DrawLayerType, layerId: string) => MapViewLayerProps;
29
30
  deactivateTool: () => void;
30
- setEditModes: (editModes: DrawMode[]) => void;
31
31
  changeProperties: (geoJSONProperties: GeoJSON.GeoJsonProperties) => void;
32
32
  getProperties: () => GeoJSON.GeoJsonProperties;
33
33
  }
34
34
  export interface MapDrawToolOptions {
35
- shouldAllowMultipleshapes?: boolean;
36
- defaultEditModes?: DrawMode[];
35
+ shouldAllowMultipleShapes?: boolean;
36
+ defaultDrawModes?: DrawMode[];
37
37
  defaultGeoJSON?: GeoJSON.FeatureCollection;
38
38
  defaultGeoJSONIntersection?: GeoJSON.FeatureCollection;
39
39
  defaultGeoJSONIntersectionBounds?: GeoJSON.FeatureCollection;
@@ -101,5 +101,5 @@ export declare const currentlySupportedDrawModes: ({
101
101
  shape: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
102
102
  isSelectable: boolean;
103
103
  })[];
104
- export declare const useMapDrawTool: ({ defaultEditModes, shouldAllowMultipleshapes, defaultGeoJSON, defaultGeoJSONIntersection, defaultGeoJSONIntersectionBounds, defaultGeoJSONIntersectionProperties, }: MapDrawToolOptions) => MapDrawToolProps;
104
+ export declare const useMapDrawTool: ({ defaultDrawModes, shouldAllowMultipleShapes, defaultGeoJSON, defaultGeoJSONIntersection, defaultGeoJSONIntersectionBounds, defaultGeoJSONIntersectionProperties, }: MapDrawToolOptions) => MapDrawToolProps;
105
105
  export {};
@@ -0,0 +1,41 @@
1
+ import { DrawMode } from './types';
2
+ /**
3
+ * Adds properties to the first geojson feature based on the given property object.
4
+ * It only extends or changes the properties which are defined in styleConfig,
5
+ * all other properties in the geojson are left unchanged.
6
+ * @param geojson
7
+ * @param featureProperties
8
+ */
9
+ export declare const addFeatureProperties: (geojson: GeoJSON.FeatureCollection | undefined, featureProperties: GeoJSON.GeoJsonProperties, featureIndex?: number) => GeoJSON.FeatureCollection;
10
+ export declare const getGeoJSONPropertyValue: (property: string, properties: GeoJSON.GeoJsonProperties, polygonDrawMode: DrawMode | undefined, defaultProperties?: GeoJSON.GeoJsonProperties) => number | string;
11
+ /**
12
+ * moves geoJSON feature as new feature. Mutates newGeoJSON
13
+ * @constructor
14
+ * @param {GeoJSON.FeatureCollection} currentGeoJSON - current geoJSON
15
+ * @param {GeoJSON.FeatureCollection} newGeoJSON - new geoJSON
16
+ * @param {number} featureLayerIndex - feature layer index
17
+ * @param {string} text - reason of change
18
+ */
19
+ export declare const moveFeature: (currentGeoJSON: GeoJSON.FeatureCollection, newGeoJSON: GeoJSON.FeatureCollection, featureLayerIndex: number, reason: string) => number | undefined;
20
+ /**
21
+ * Returns the intersection of two features. In case of a polygon, only the first feature is used.
22
+ * @param a Feature A
23
+ * @param b Feature B
24
+ * @returns The intersection of the two features.
25
+ */
26
+ export declare const intersectGeoJSONS: (a: GeoJSON.FeatureCollection, b: GeoJSON.FeatureCollection, geoJSONProperties?: {
27
+ stroke: string;
28
+ 'stroke-width': number;
29
+ 'stroke-opacity': number;
30
+ fill: string;
31
+ 'fill-opacity': number;
32
+ }) => GeoJSON.FeatureCollection;
33
+ /**
34
+ * Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure
35
+ * @param geoJSONs
36
+ * @returns GeoJSONS extend with intersections
37
+ */
38
+ export declare const createInterSections: (geojson: GeoJSON.FeatureCollection, otherGeoJSON: GeoJSON.FeatureCollection, geoJSONproperties?: GeoJSON.GeoJsonProperties) => GeoJSON.FeatureCollection;
39
+ export declare const getGeoJson: (geojson: GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean) => GeoJSON.FeatureCollection;
40
+ export declare const getFeatureCollection: (geoJSONFeature: GeoJSON.Feature | GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean, geoJSONFeatureCollection?: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection;
41
+ export declare const isGeoJSONFeatureCreatedByTool: (existingJSON: GeoJSON.FeatureCollection, newGeoJSON: GeoJSON.Feature | GeoJSON.FeatureCollection) => boolean;
@@ -0,0 +1 @@
1
+ export {};
@@ -7,9 +7,9 @@ export interface MapViewLayerProps extends LayerFoundation {
7
7
  onLayerError?: (layer: WMLayer, error?: Error) => void;
8
8
  isInEditMode?: boolean;
9
9
  drawMode?: string;
10
- updateGeojson?: (geoJson: GeoJSON.FeatureCollection) => void;
10
+ updateGeojson?: (geoJson: GeoJSON.FeatureCollection, reason: string) => void;
11
11
  exitDrawModeCallback?: (reason: DrawModeExitCallback) => void;
12
- featureNrToEdit?: number;
12
+ selectedFeatureIndex?: number;
13
13
  onClickFeature?: (event: FeatureEvent) => void;
14
14
  onHoverFeature?: (event: FeatureEvent) => void;
15
15
  }