@opengeoweb/webmap-react 6.0.4 → 6.1.1
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 +2216 -366
- package/package.json +1 -1
- package/src/lib/components/ReactMapView/MapViewLayer.d.ts +18 -0
- package/src/lib/components/ReactMapView/ReactMapView.d.ts +58 -0
- package/src/lib/components/ReactMapView/ReactMapViewLayer.d.ts +8 -0
- package/src/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +4 -0
- package/src/lib/components/ReactMapView/defaultLayers.d.ts +15 -0
- package/src/lib/components/ReactMapView/index.d.ts +5 -0
- package/src/lib/components/ReactMapView/types.d.ts +72 -0
- package/src/lib/components/ReactMapView/utils.d.ts +22 -0
- package/src/lib/components/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GeoJSONObject } from '@turf/turf';
|
|
3
|
+
import { WMJSMap, WMLayer } from '@opengeoweb/webmap';
|
|
4
|
+
import { DrawModeExitCallback, FeatureEvent } from '../MapDraw';
|
|
5
|
+
export interface MapViewLayerProps {
|
|
6
|
+
id: string;
|
|
7
|
+
onLayerReady?: (layer: WMLayer, webmap?: WMJSMap) => void;
|
|
8
|
+
geojson?: unknown;
|
|
9
|
+
onLayerError?: (layer: WMLayer, error?: Error) => void;
|
|
10
|
+
isInEditMode?: boolean;
|
|
11
|
+
drawMode?: string;
|
|
12
|
+
updateGeojson?: (geoJson: GeoJSONObject) => void;
|
|
13
|
+
exitDrawModeCallback?: (reason: DrawModeExitCallback) => void;
|
|
14
|
+
featureNrToEdit?: number;
|
|
15
|
+
onClickFeature?: (event: FeatureEvent) => void;
|
|
16
|
+
onHoverFeature?: (event: FeatureEvent) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const MapViewLayer: React.FC<MapViewLayerProps>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { WMJSMap, WMLayer, WMBBOX } from '@opengeoweb/webmap';
|
|
4
|
+
import { ReactMapViewProps } from './types';
|
|
5
|
+
export declare const ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION = "ORIGIN_REACTMAPVIEW_ONMAPCHANGEDIMENSION";
|
|
6
|
+
export declare const ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO = "ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO";
|
|
7
|
+
interface ReactMapViewState {
|
|
8
|
+
adagucInitialised: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface AdagucObjectProp {
|
|
11
|
+
initialized: boolean;
|
|
12
|
+
baseLayers: WMLayer[];
|
|
13
|
+
oldbbox: WMBBOX;
|
|
14
|
+
currentWidth: number;
|
|
15
|
+
currentHeight: number;
|
|
16
|
+
currentMapProps: {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare class ReactMapView extends React.Component<ReactMapViewProps, ReactMapViewState> {
|
|
21
|
+
adaguc: AdagucObjectProp;
|
|
22
|
+
adagucContainerRef: React.RefObject<HTMLDivElement>;
|
|
23
|
+
adagucWebMapJSRef: React.RefObject<HTMLDivElement>;
|
|
24
|
+
refetchTimer: NodeJS.Timeout | number | null;
|
|
25
|
+
static defaultProps: {
|
|
26
|
+
srs: string;
|
|
27
|
+
bbox: {
|
|
28
|
+
left: number;
|
|
29
|
+
bottom: number;
|
|
30
|
+
right: number;
|
|
31
|
+
top: number;
|
|
32
|
+
};
|
|
33
|
+
shouldAutoFetch: boolean;
|
|
34
|
+
displayMapPin: boolean;
|
|
35
|
+
disableMapPin: boolean;
|
|
36
|
+
onWMJSMount: () => void;
|
|
37
|
+
onMapChangeDimension: () => void;
|
|
38
|
+
onUpdateLayerInformation: () => void;
|
|
39
|
+
onMapZoomEnd: () => void;
|
|
40
|
+
};
|
|
41
|
+
constructor(props: ReactMapViewProps);
|
|
42
|
+
componentDidMount(): void;
|
|
43
|
+
componentDidUpdate(prevProps: ReactMapViewProps): void;
|
|
44
|
+
componentWillUnmount(): void;
|
|
45
|
+
handleWindowResize(): void;
|
|
46
|
+
onDimChangeListener(): void;
|
|
47
|
+
onAfterSetBBoxListener(): void;
|
|
48
|
+
onUpdateBBoxListener(newBbox: WMBBOX): void;
|
|
49
|
+
onStartRefetchTimer: () => void;
|
|
50
|
+
clearRefetchTimer: () => void;
|
|
51
|
+
parseWMJSLayer: (wmLayer: WMLayer, forceReload: boolean, child?: React.ReactElement) => void;
|
|
52
|
+
updateWMJSMapProps(prevProps: ReactMapViewProps, props: ReactMapViewProps): void;
|
|
53
|
+
drawDebounced(): void;
|
|
54
|
+
mountWMJSMap(): WMJSMap | null;
|
|
55
|
+
resize(): void;
|
|
56
|
+
render(): React.ReactElement;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WMLayer } from '@opengeoweb/webmap';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface ReactMapViewLayerProps {
|
|
4
|
+
id: string;
|
|
5
|
+
onLayerReady?: (layer: WMLayer) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ReactMapViewLayer: React.FC<ReactMapViewLayerProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WMLayer, WMJSDimension } from '@opengeoweb/webmap';
|
|
2
|
+
import { UpdateLayerInfoPayload } from './types';
|
|
3
|
+
export declare const getCurrentDimensionValue: (name: string, dimensions?: WMJSDimension[]) => string;
|
|
4
|
+
export declare const setLayerInfo: (wmLayer: WMLayer, mapId: string, onUpdateLayerInformation?: ((payload: UpdateLayerInfoPayload) => void) | undefined) => void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LayerType } from '@opengeoweb/webmap';
|
|
2
|
+
export declare const baseLayerGrey: {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
type: string;
|
|
6
|
+
layerType: LayerType;
|
|
7
|
+
};
|
|
8
|
+
export declare const overLayer: {
|
|
9
|
+
service: string;
|
|
10
|
+
name: string;
|
|
11
|
+
format: string;
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
id: string;
|
|
14
|
+
layerType: LayerType;
|
|
15
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Bbox, Dimension, WMJSMap } from '@opengeoweb/webmap';
|
|
3
|
+
export interface ReactMapViewProps {
|
|
4
|
+
listeners?: {
|
|
5
|
+
name?: string;
|
|
6
|
+
data: string;
|
|
7
|
+
keep: boolean;
|
|
8
|
+
callbackfunction: (webMap: WMJSMap, value: string) => void;
|
|
9
|
+
}[];
|
|
10
|
+
srs?: string;
|
|
11
|
+
bbox?: Bbox;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
mapId: string;
|
|
14
|
+
activeLayerId?: string;
|
|
15
|
+
showScaleBar?: boolean;
|
|
16
|
+
showLegend?: boolean;
|
|
17
|
+
passiveMap?: boolean;
|
|
18
|
+
displayTimeInMap?: boolean;
|
|
19
|
+
animationDelay?: number;
|
|
20
|
+
dimensions?: Dimension[];
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
displayMapPin?: boolean;
|
|
23
|
+
mapPinLocation?: MapLocation;
|
|
24
|
+
shouldAutoFetch?: boolean;
|
|
25
|
+
showLayerInfo?: boolean;
|
|
26
|
+
disableMapPin?: boolean;
|
|
27
|
+
onWMJSMount?: (mapId: string) => void;
|
|
28
|
+
onMapChangeDimension?: (payload: SetMapDimensionPayload) => void;
|
|
29
|
+
onMapZoomEnd?: (payload: SetBboxPayload) => void;
|
|
30
|
+
onMapPinChangeLocation?: (payload: MapPinLocationPayload) => void;
|
|
31
|
+
onUpdateLayerInformation?: (payload: UpdateLayerInfoPayload) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface MapLocation {
|
|
34
|
+
lat: number;
|
|
35
|
+
lon: number;
|
|
36
|
+
}
|
|
37
|
+
export interface MapPinLocationPayload {
|
|
38
|
+
mapId: string;
|
|
39
|
+
mapPinLocation: MapLocation;
|
|
40
|
+
}
|
|
41
|
+
export interface SetMapDimensionPayload {
|
|
42
|
+
origin: string;
|
|
43
|
+
mapId: string;
|
|
44
|
+
dimension: Dimension;
|
|
45
|
+
}
|
|
46
|
+
export interface SetBboxPayload {
|
|
47
|
+
mapId: string;
|
|
48
|
+
bbox: Bbox;
|
|
49
|
+
srs?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface SetLayerDimensionsPayload {
|
|
52
|
+
layerId: string;
|
|
53
|
+
origin: string;
|
|
54
|
+
dimensions: Dimension[];
|
|
55
|
+
}
|
|
56
|
+
export interface UpdateAllMapDimensionsPayload {
|
|
57
|
+
origin: string;
|
|
58
|
+
mapId: string;
|
|
59
|
+
dimensions: Dimension[];
|
|
60
|
+
}
|
|
61
|
+
export interface SetLayerStylePayload {
|
|
62
|
+
layerId: string;
|
|
63
|
+
style: string;
|
|
64
|
+
mapId?: string;
|
|
65
|
+
origin?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface UpdateLayerInfoPayload {
|
|
68
|
+
origin: string;
|
|
69
|
+
mapDimensions?: UpdateAllMapDimensionsPayload;
|
|
70
|
+
layerStyle?: SetLayerStylePayload;
|
|
71
|
+
layerDimensions?: SetLayerDimensionsPayload;
|
|
72
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Dimension, LayerFoundation, WMLayer } from '@opengeoweb/webmap';
|
|
2
|
+
import { FeatureLayer } from '../MapDraw';
|
|
3
|
+
/**
|
|
4
|
+
* Returns filtered list of props with geoJson
|
|
5
|
+
* @param children React.ReactNode, layers with geoJson
|
|
6
|
+
*/
|
|
7
|
+
export declare const getFeatureLayers: (children: React.ReactNode) => FeatureLayer[];
|
|
8
|
+
/**
|
|
9
|
+
* Returns true if this is a maplayer and not a baselayer or overlayer
|
|
10
|
+
* @param layer The LayerFoundation object, or the props from the ReactWMJSLayer
|
|
11
|
+
*/
|
|
12
|
+
export declare const isAMapLayer: (layer: LayerFoundation) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Returns true if this is a geojsonlayer (layer containing geojson field)
|
|
15
|
+
* @param layer The LayerFoundation object, or the props from the ReactWMJSLayer
|
|
16
|
+
*/
|
|
17
|
+
export declare const isAGeoJSONLayer: (layer: LayerFoundation) => boolean;
|
|
18
|
+
export declare const getWMJSLayerFromReactLayer: (mapId: string, wmLayers: WMLayer[], reactWebMapJSLayer: React.ReactElement, wmLayerIndex: number) => {
|
|
19
|
+
layer: WMLayer;
|
|
20
|
+
layerArrayMutated: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function getIsInsideAcceptanceTime(acceptanceTimeInMinutes: number | undefined, mapDimensions: Dimension[] | undefined, layerDimensions: Dimension[] | undefined): boolean;
|