@opengeoweb/webmap-react 9.9.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.
Files changed (27) hide show
  1. package/index.esm.js +594 -453
  2. package/package.json +2 -2
  3. package/src/lib/components/MapDimensionSelect/DimensionSelectButton.d.ts +8 -0
  4. package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.d.ts +14 -0
  5. package/src/lib/components/MapDimensionSelect/DimensionSelectDialog.stories.d.ts +29 -0
  6. package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.d.ts +14 -0
  7. package/src/lib/components/MapDimensionSelect/DimensionSelectSlider.spec.d.ts +1 -0
  8. package/src/lib/components/MapDimensionSelect/MapDimensionSelect.d.ts +11 -0
  9. package/src/lib/components/MapDimensionSelect/MapDimensionSelect.spec.d.ts +1 -0
  10. package/src/lib/components/MapDimensionSelect/MapDimensionSelect.stories.d.ts +7 -0
  11. package/src/lib/components/MapDimensionSelect/index.d.ts +6 -0
  12. package/src/lib/components/MapDimensionSelect/utils.d.ts +17 -0
  13. package/src/lib/components/MapDimensionSelect/utils.spec.d.ts +1 -0
  14. package/src/lib/components/MapDraw/storyComponents/FeatureLayers.d.ts +2 -1
  15. package/src/lib/components/MapDraw/storyComponents/SelectField.d.ts +2 -2
  16. package/src/lib/components/MapDrawTool/MapDrawTool.stories.d.ts +1 -0
  17. package/src/lib/components/MapDrawTool/storyExamplesMapDrawTool.d.ts +3 -2
  18. package/src/lib/components/MapDrawTool/utils.d.ts +18 -4
  19. package/src/lib/components/ReactMapView/ReactMapView.d.ts +1 -0
  20. package/src/lib/components/ReactMapView/types.d.ts +1 -0
  21. package/src/lib/components/index.d.ts +1 -1
  22. package/src/lib/storyshots/Storyshots.spec.d.ts +1 -0
  23. package/src/lib/components/CanvasComponent/CanvasComponent.d.ts +0 -71
  24. package/src/lib/components/CanvasComponent/CanvasComponentDynamic.stories.d.ts +0 -6
  25. package/src/lib/components/CanvasComponent/CanvasComponentStatic.stories.d.ts +0 -6
  26. package/src/lib/components/CanvasComponent/index.d.ts +0 -1
  27. /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.9.0",
3
+ "version": "9.10.0",
4
4
  "description": "GeoWeb react wrapper for webmap",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -11,7 +11,7 @@
11
11
  "@opengeoweb/webmap": "*",
12
12
  "axios": "1.5.0",
13
13
  "@opengeoweb/theme": "*",
14
- "@mui/material": "5.12.0",
14
+ "@mui/material": "~5.15.11",
15
15
  "@opengeoweb/shared": "*",
16
16
  "lodash": "^4.17.21",
17
17
  "proj4": "^2.9.2",
@@ -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,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,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ component: React.FC<import("../MapView").MapViewProps>;
5
+ };
6
+ export default _default;
7
+ export declare const MapDimensionOnMap: () => React.ReactElement;
@@ -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[];
@@ -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,9 +1,9 @@
1
1
  import React from 'react';
2
2
  export declare const SelectField: React.FC<{
3
3
  label: string;
4
- value: string | number;
4
+ value: string;
5
5
  onChangeValue: (value: string) => void;
6
- options: (string | number)[];
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,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import { SelectionType } from './types';
3
3
  import { MapDrawToolOptions } from './useMapDrawTool';
4
- export declare const opacityOptions: number[];
4
+ export declare const opacityOptions: string[];
5
5
  export declare const fillOptions: any[];
6
- export declare const strokeWidthOptions: number[];
6
+ export declare const strokeWidthOptions: string[];
7
7
  export declare const getToolIcon: (selectionType: SelectionType) => React.ReactElement;
8
8
  export declare const basicExampleDrawOptions: MapDrawToolOptions;
9
9
  export declare const basicExampleMultipleShapeDrawOptions: MapDrawToolOptions;
10
+ export declare const basicExampleMultipleShapeWithValuesDrawOptions: MapDrawToolOptions;
@@ -1,5 +1,5 @@
1
1
  import { Feature } from '@turf/turf';
2
- import { FeatureCollection, GeoJsonProperties } from 'geojson';
2
+ import { FeatureCollection, GeoJsonProperties, Point } from 'geojson';
3
3
  import { DrawMode, SelectionType } from './types';
4
4
  /**
5
5
  * Adds properties to the first geojson feature based on the given property object.
@@ -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 intersectGeoJSONS: (a: GeoJSON.FeatureCollection, b: GeoJSON.FeatureCollection, geoJSONProperties?: {
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
@@ -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,6 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const DynamicCanvas: React.FC;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- declare const _default: {
3
- title: string;
4
- };
5
- export default _default;
6
- export declare const StaticCanvas: React.FC;
@@ -1 +0,0 @@
1
- export * from './CanvasComponent';