@opengeoweb/webmap-react 9.19.0 → 9.20.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 +1200 -1223
- package/package.json +2 -2
- package/src/lib/components/MapDraw/MapDraw.d.ts +4 -7
- package/src/lib/components/MapDraw/MapDrawContainer.d.ts +1 -1
- package/src/lib/components/MapDraw/geojsonShapes.d.ts +2 -1
- package/src/lib/components/MapDraw/mapDrawUtils.d.ts +9 -0
- package/src/lib/components/MapDraw/storyComponents/storyUtils.d.ts +1 -0
- package/src/lib/components/MapDrawTool/useMapDrawTool.d.ts +1 -1
- package/src/lib/components/MapView/MapViewLayer.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.20.1",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
"module": "./index.esm.js",
|
|
29
29
|
"type": "module",
|
|
30
30
|
"main": "./index.esm.js"
|
|
31
|
-
}
|
|
31
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { GeoJsonProperties, GeometryObject, Position } from 'geojson';
|
|
2
|
+
import { FeatureCollection, GeoJsonProperties, GeometryObject, Position } from 'geojson';
|
|
3
3
|
import { GeoJsonFeatureType, GeoJsonFeature, GeoFeatureStyle, Coordinate } from './geojsonShapes';
|
|
4
4
|
interface DrawStyle {
|
|
5
5
|
x: number;
|
|
@@ -26,7 +26,7 @@ export interface MapDrawProps {
|
|
|
26
26
|
geojson: GeoJSON.FeatureCollection;
|
|
27
27
|
drawMode: string;
|
|
28
28
|
deletePolygonCallback?: string;
|
|
29
|
-
exitDrawModeCallback: (reason: DrawModeExitCallback) => void;
|
|
29
|
+
exitDrawModeCallback: (reason: DrawModeExitCallback, newGeoJSON?: GeoJSON.FeatureCollection) => void;
|
|
30
30
|
isInEditMode: boolean;
|
|
31
31
|
isInDeleteMode: boolean;
|
|
32
32
|
selectedFeatureIndex: number;
|
|
@@ -75,7 +75,7 @@ export default class MapDraw extends React.PureComponent<MapDrawProps> {
|
|
|
75
75
|
somethingWasDragged: string;
|
|
76
76
|
mouseIsOverVertexNr: SNAPPEDFEATURE | VERTEX | number;
|
|
77
77
|
selectedEdge: EDGE;
|
|
78
|
-
geojson:
|
|
78
|
+
geojson: FeatureCollection;
|
|
79
79
|
listenersInitialized: boolean;
|
|
80
80
|
mouseGeoCoord: Coordinate;
|
|
81
81
|
snappedGeoCoords: Coordinate;
|
|
@@ -106,9 +106,9 @@ export default class MapDraw extends React.PureComponent<MapDrawProps> {
|
|
|
106
106
|
handleKeyDown(event: KeyboardEvent): void;
|
|
107
107
|
handleNewFeatureIndex(): void;
|
|
108
108
|
handleDrawMode(_drawMode: string): void;
|
|
109
|
-
getPixelCoordFromGeoCoord(featureCoords: Position[]): Coordinate[];
|
|
110
109
|
handleGeoJSONUpdate: (newGeoJSON: GeoJSON.FeatureCollection) => void;
|
|
111
110
|
handleExitDrawMode: (reason?: DrawModeExitCallback) => void;
|
|
111
|
+
getSelectedFeature: () => GeoJsonFeature;
|
|
112
112
|
hoverVertex(feature: GeoJsonFeature, mouseX: number, mouseY: number): void;
|
|
113
113
|
mouseMove(event: InputEvent): boolean;
|
|
114
114
|
triggerMouseDownTimer(event: InputEvent): void | boolean;
|
|
@@ -135,8 +135,6 @@ export default class MapDraw extends React.PureComponent<MapDrawProps> {
|
|
|
135
135
|
validateFeature(feature: GeoJsonFeature): void;
|
|
136
136
|
validatePolys(fixPolys: boolean): void;
|
|
137
137
|
beforeDraw(ctx: CanvasRenderingContext2D): void;
|
|
138
|
-
distance(a: Coordinate, b: Coordinate): number;
|
|
139
|
-
isBetween(a: Coordinate, c: Coordinate, b: Coordinate): boolean;
|
|
140
138
|
checkDist(coord: Coordinate, polygonIndex: SNAPPEDFEATURE | number, mouseX: number, mouseY: number): boolean;
|
|
141
139
|
hoverEdge(geometry: GeoJsonFeatureType, mouseX: number, mouseY: number): {
|
|
142
140
|
selectedEdge: EDGE | number;
|
|
@@ -148,7 +146,6 @@ export default class MapDraw extends React.PureComponent<MapDrawProps> {
|
|
|
148
146
|
drawMarker(ctx: CanvasRenderingContext2D, _coord: Coordinate, selected: boolean, middle: boolean, isInEditMode: boolean, featureProperties: GeoFeatureStyle): void | DrawStyle;
|
|
149
147
|
drawLine(ctx: CanvasRenderingContext2D, XYCoords: Coordinate[], featureIndex: number, lineStringIndex: number): void | DrawStyle;
|
|
150
148
|
drawPolygon(ctx: CanvasRenderingContext2D, XYCoords: Coordinate[], featureIndex: number, polygonIndex: number): void | DrawStyle;
|
|
151
|
-
convertGeoCoordsToScreenCoords(featureCoords: Position[]): Coordinate[];
|
|
152
149
|
initializeFeatureCoordinates(feature: GeoJsonFeature, type: string): GeoJsonFeature;
|
|
153
150
|
checkIfFeatureIsBox(feature: GeoJsonFeature): boolean;
|
|
154
151
|
featureHasChanged(text: string): void;
|
|
@@ -12,7 +12,7 @@ export interface FeatureLayer {
|
|
|
12
12
|
onHoverFeature?: (feature: FeatureEvent) => void;
|
|
13
13
|
onClickFeature?: (feature: FeatureEvent) => void;
|
|
14
14
|
updateGeojson?: (feature: GeometryObject, reason: string) => void;
|
|
15
|
-
exitDrawModeCallback?: (reason: DrawModeExitCallback) => void;
|
|
15
|
+
exitDrawModeCallback?: (reason: DrawModeExitCallback, newGeoJSON?: GeoJSON.FeatureCollection) => void;
|
|
16
16
|
selectedFeatureIndex?: string;
|
|
17
17
|
}
|
|
18
18
|
interface MapDrawContainerProps {
|
|
@@ -4,7 +4,8 @@ export declare const featurePoint: GeoJSON.Feature<GeoJSON.Point>;
|
|
|
4
4
|
export declare const featureMultiPoint: GeoJSON.Feature<GeoJSON.MultiPoint>;
|
|
5
5
|
export declare const featurePolygon: GeoJSON.Feature<GeoJSON.Polygon>;
|
|
6
6
|
export declare const featureBox: GeoJSON.Feature<GeoJSON.Polygon>;
|
|
7
|
-
export declare const lineString: GeoJSON.
|
|
7
|
+
export declare const lineString: GeoJSON.Feature<GeoJSON.LineString>;
|
|
8
|
+
export declare const lineStringCollection: GeoJSON.FeatureCollection;
|
|
8
9
|
export type GeoJsonFeatureType = GeoJSON.Polygon | GeoJSON.MultiPoint | GeoJSON.Point | GeoJSON.LineString | GeoJSON.MultiPolygon;
|
|
9
10
|
export type GeoJsonFeature = GeoJSON.Feature<GeoJsonFeatureType>;
|
|
10
11
|
export interface GeoFeatureStyle {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import proj4, { InterfaceProjection } from 'proj4';
|
|
1
2
|
import { Position } from 'geojson';
|
|
2
3
|
import { Coordinate, GeoJsonFeature } from './geojsonShapes';
|
|
3
4
|
export type CheckHoverFeaturesResult = {
|
|
@@ -5,7 +6,15 @@ export type CheckHoverFeaturesResult = {
|
|
|
5
6
|
featureIndex: number;
|
|
6
7
|
feature: GeoJsonFeature;
|
|
7
8
|
} | null;
|
|
9
|
+
export type ProjectorCache = Record<string, InterfaceProjection>;
|
|
10
|
+
export declare const Proj4js: typeof proj4;
|
|
11
|
+
export declare const projectorCache: ProjectorCache;
|
|
12
|
+
export declare const getProj4: (projection: string | proj4.InterfaceProjection) => InterfaceProjection;
|
|
8
13
|
export declare const distance: (a: Coordinate, b: Coordinate) => number;
|
|
14
|
+
export declare const isBetween: (a: Coordinate, c: Coordinate, b: Coordinate) => boolean;
|
|
15
|
+
export declare const convertGeoCoordsToScreenCoords: (featureCoords: Position[], mapId: string) => Coordinate[];
|
|
16
|
+
export declare const getPixelCoordFromGeoCoord: (featureCoords: Position[], mapId: string) => Coordinate[];
|
|
17
|
+
export declare const findClosestCoords: (positions: Coordinate[], mouseX: number, mouseY: number) => number[];
|
|
9
18
|
export declare const checkHoverFeatures: (geojson: GeoJSON.FeatureCollection, mouseX: number, mouseY: number, convertGeoCoordsToScreenCoords: (featureCoords: Position[]) => Coordinate[], ignoreCoordinateIndexInFeature?: boolean) => CheckHoverFeaturesResult;
|
|
10
19
|
export interface MapDrawDrawFunctionArgs {
|
|
11
20
|
context: CanvasRenderingContext2D;
|
|
@@ -12,7 +12,7 @@ export interface MapDrawToolProps {
|
|
|
12
12
|
geoJSON: GeoJSON.FeatureCollection;
|
|
13
13
|
geoJSONIntersection?: GeoJSON.FeatureCollection;
|
|
14
14
|
geoJSONIntersectionBounds?: GeoJSON.FeatureCollection;
|
|
15
|
-
setGeoJSON: (geojson: GeoJSON.Feature | GeoJSON.FeatureCollection, reason?: string) =>
|
|
15
|
+
setGeoJSON: (geojson: GeoJSON.Feature | GeoJSON.FeatureCollection, reason?: string) => GeoJSON.FeatureCollection[];
|
|
16
16
|
setGeoJSONIntersectionBounds: (geojson: GeoJSON.FeatureCollection) => void;
|
|
17
17
|
drawModes: DrawMode[];
|
|
18
18
|
changeDrawMode: (mode: DrawModeValue) => void;
|
|
@@ -8,7 +8,7 @@ export interface MapViewLayerProps extends LayerFoundation {
|
|
|
8
8
|
isInEditMode?: boolean;
|
|
9
9
|
drawMode?: string;
|
|
10
10
|
updateGeojson?: (geoJson: GeoJSON.FeatureCollection, reason: string) => void;
|
|
11
|
-
exitDrawModeCallback?: (reason: DrawModeExitCallback) => void;
|
|
11
|
+
exitDrawModeCallback?: (reason: DrawModeExitCallback, newGeoJSON?: GeoJSON.FeatureCollection) => void;
|
|
12
12
|
selectedFeatureIndex?: number;
|
|
13
13
|
onClickFeature?: (event?: FeatureEvent) => void;
|
|
14
14
|
onHoverFeature?: (event: FeatureEvent) => void;
|