terra-draw 0.0.1-alpha.65 → 0.0.1-alpha.66
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/dist/adapters/arcgis-maps-sdk.adapter.d.ts +1 -0
- package/dist/adapters/google-maps.adapter.d.ts +1 -0
- package/dist/adapters/leaflet.adapter.d.ts +2 -0
- package/dist/adapters/mapbox-gl.adapter.d.ts +2 -0
- package/dist/adapters/maplibre-gl.adapter.d.ts +1 -0
- package/dist/adapters/openlayers.adapter.d.ts +2 -0
- package/dist/common.d.ts +3 -0
- package/dist/modes/select/behaviors/drag-coordinate-resize.behavior.d.ts +3 -3
- package/dist/modes/select/behaviors/drag-coordinate.behavior.d.ts +3 -3
- package/dist/modes/select/behaviors/drag-feature.behavior.d.ts +3 -3
- package/dist/modes/select/behaviors/rotate-feature.behavior.d.ts +3 -3
- package/dist/modes/select/behaviors/scale-feature.behavior.d.ts +3 -3
- package/dist/modes/select/select.mode.d.ts +2 -2
- package/dist/terra-draw.cjs +1 -1
- package/dist/terra-draw.cjs.map +1 -1
- package/dist/terra-draw.modern.js +1 -1
- package/dist/terra-draw.modern.js.map +1 -1
- package/dist/terra-draw.module.js +1 -1
- package/dist/terra-draw.module.js.map +1 -1
- package/dist/terra-draw.umd.js +1 -1
- package/dist/terra-draw.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,6 +38,7 @@ export declare class TerraDrawArcGISMapsSDKAdapter extends TerraDrawBaseAdapter
|
|
|
38
38
|
} & BaseAdapterConfig);
|
|
39
39
|
register(callbacks: TerraDrawCallbacks): void;
|
|
40
40
|
unregister(): void;
|
|
41
|
+
getCoordinatePrecision(): number;
|
|
41
42
|
/**
|
|
42
43
|
* Returns the longitude and latitude coordinates from a given PointerEvent on the map.
|
|
43
44
|
* @param event The PointerEvent or MouseEvent containing the screen coordinates of the pointer.
|
|
@@ -8,6 +8,7 @@ export declare class TerraDrawMapLibreGLAdapter extends TerraDrawBaseAdapter {
|
|
|
8
8
|
} & BaseAdapterConfig);
|
|
9
9
|
register(callbacks: TerraDrawCallbacks): void;
|
|
10
10
|
unregister(): void;
|
|
11
|
+
getCoordinatePrecision(): number;
|
|
11
12
|
/**
|
|
12
13
|
* Returns the longitude and latitude coordinates from a given PointerEvent on the map.
|
|
13
14
|
* @param event The PointerEvent or MouseEvent containing the screen coordinates of the pointer.
|
package/dist/common.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ export interface TerraDrawModeRegisterConfig {
|
|
|
58
58
|
unproject: Unproject;
|
|
59
59
|
coordinatePrecision: number;
|
|
60
60
|
}
|
|
61
|
+
type ValidationContext = Pick<TerraDrawModeRegisterConfig, "project" | "unproject" | "coordinatePrecision">;
|
|
62
|
+
export type Validation = (feature: GeoJSONStoreFeatures, context: ValidationContext) => boolean;
|
|
61
63
|
export type TerraDrawModeState = "unregistered" | "registered" | "started" | "drawing" | "selecting" | "stopped";
|
|
62
64
|
export interface TerraDrawCallbacks {
|
|
63
65
|
getState: () => TerraDrawModeState;
|
|
@@ -101,3 +103,4 @@ export declare const SELECT_PROPERTIES: {
|
|
|
101
103
|
export declare const POLYGON_PROPERTIES: {
|
|
102
104
|
CLOSING_POINT: string;
|
|
103
105
|
};
|
|
106
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TerraDrawMouseEvent } from "../../../common";
|
|
1
|
+
import { TerraDrawMouseEvent, Validation } from "../../../common";
|
|
2
2
|
import { BehaviorConfig, TerraDrawModeBehavior } from "../../base.behavior";
|
|
3
3
|
import { PixelDistanceBehavior } from "../../pixel-distance.behavior";
|
|
4
4
|
import { MidPointBehavior } from "./midpoint.behavior";
|
|
5
5
|
import { SelectionPointBehavior } from "./selection-point.behavior";
|
|
6
|
-
import { FeatureId
|
|
6
|
+
import { FeatureId } from "../../../store/store";
|
|
7
7
|
export type ResizeOptions = "center-web-mercator" | "opposite-web-mercator" | "center-fixed-web-mercator" | "opposite-fixed-web-mercator";
|
|
8
8
|
export declare class DragCoordinateResizeBehavior extends TerraDrawModeBehavior {
|
|
9
9
|
readonly config: BehaviorConfig;
|
|
@@ -58,5 +58,5 @@ export declare class DragCoordinateResizeBehavior extends TerraDrawModeBehavior
|
|
|
58
58
|
* @param resizeOption - the resize option, either "center-web-mercator" or "opposite-web-mercator"
|
|
59
59
|
* @returns - true is resize was successful, false otherwise
|
|
60
60
|
*/
|
|
61
|
-
drag(event: TerraDrawMouseEvent, resizeOption: ResizeOptions, validateFeature?:
|
|
61
|
+
drag(event: TerraDrawMouseEvent, resizeOption: ResizeOptions, validateFeature?: Validation): boolean;
|
|
62
62
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TerraDrawMouseEvent } from "../../../common";
|
|
1
|
+
import { TerraDrawMouseEvent, Validation } from "../../../common";
|
|
2
2
|
import { BehaviorConfig, TerraDrawModeBehavior } from "../../base.behavior";
|
|
3
3
|
import { PixelDistanceBehavior } from "../../pixel-distance.behavior";
|
|
4
4
|
import { MidPointBehavior } from "./midpoint.behavior";
|
|
5
5
|
import { SelectionPointBehavior } from "./selection-point.behavior";
|
|
6
|
-
import { FeatureId
|
|
6
|
+
import { FeatureId } from "../../../store/store";
|
|
7
7
|
export declare class DragCoordinateBehavior extends TerraDrawModeBehavior {
|
|
8
8
|
readonly config: BehaviorConfig;
|
|
9
9
|
private readonly pixelDistance;
|
|
@@ -13,7 +13,7 @@ export declare class DragCoordinateBehavior extends TerraDrawModeBehavior {
|
|
|
13
13
|
private draggedCoordinate;
|
|
14
14
|
private getClosestCoordinate;
|
|
15
15
|
getDraggableIndex(event: TerraDrawMouseEvent, selectedId: FeatureId): number;
|
|
16
|
-
drag(event: TerraDrawMouseEvent, allowSelfIntersection: boolean, validateFeature?:
|
|
16
|
+
drag(event: TerraDrawMouseEvent, allowSelfIntersection: boolean, validateFeature?: Validation): boolean;
|
|
17
17
|
isDragging(): boolean;
|
|
18
18
|
startDragging(id: FeatureId, index: number): void;
|
|
19
19
|
stopDragging(): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TerraDrawMouseEvent } from "../../../common";
|
|
1
|
+
import { TerraDrawMouseEvent, Validation } from "../../../common";
|
|
2
2
|
import { BehaviorConfig, TerraDrawModeBehavior } from "../../base.behavior";
|
|
3
3
|
import { FeatureAtPointerEventBehavior } from "./feature-at-pointer-event.behavior";
|
|
4
4
|
import { SelectionPointBehavior } from "./selection-point.behavior";
|
|
5
5
|
import { MidPointBehavior } from "./midpoint.behavior";
|
|
6
|
-
import { FeatureId
|
|
6
|
+
import { FeatureId } from "../../../store/store";
|
|
7
7
|
export declare class DragFeatureBehavior extends TerraDrawModeBehavior {
|
|
8
8
|
readonly config: BehaviorConfig;
|
|
9
9
|
private readonly featuresAtMouseEvent;
|
|
@@ -16,5 +16,5 @@ export declare class DragFeatureBehavior extends TerraDrawModeBehavior {
|
|
|
16
16
|
stopDragging(): void;
|
|
17
17
|
isDragging(): boolean;
|
|
18
18
|
canDrag(event: TerraDrawMouseEvent, selectedId: FeatureId): boolean;
|
|
19
|
-
drag(event: TerraDrawMouseEvent, validateFeature?:
|
|
19
|
+
drag(event: TerraDrawMouseEvent, validateFeature?: Validation): false | undefined;
|
|
20
20
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TerraDrawMouseEvent } from "../../../common";
|
|
1
|
+
import { TerraDrawMouseEvent, Validation } from "../../../common";
|
|
2
2
|
import { BehaviorConfig, TerraDrawModeBehavior } from "../../base.behavior";
|
|
3
3
|
import { SelectionPointBehavior } from "./selection-point.behavior";
|
|
4
4
|
import { MidPointBehavior } from "./midpoint.behavior";
|
|
5
|
-
import { FeatureId
|
|
5
|
+
import { FeatureId } from "../../../store/store";
|
|
6
6
|
export declare class RotateFeatureBehavior extends TerraDrawModeBehavior {
|
|
7
7
|
readonly config: BehaviorConfig;
|
|
8
8
|
private readonly selectionPoints;
|
|
@@ -10,5 +10,5 @@ export declare class RotateFeatureBehavior extends TerraDrawModeBehavior {
|
|
|
10
10
|
constructor(config: BehaviorConfig, selectionPoints: SelectionPointBehavior, midPoints: MidPointBehavior);
|
|
11
11
|
private lastBearing;
|
|
12
12
|
reset(): void;
|
|
13
|
-
rotate(event: TerraDrawMouseEvent, selectedId: FeatureId, validateFeature?:
|
|
13
|
+
rotate(event: TerraDrawMouseEvent, selectedId: FeatureId, validateFeature?: Validation): false | undefined;
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TerraDrawMouseEvent } from "../../../common";
|
|
1
|
+
import { TerraDrawMouseEvent, Validation } from "../../../common";
|
|
2
2
|
import { BehaviorConfig, TerraDrawModeBehavior } from "../../base.behavior";
|
|
3
3
|
import { SelectionPointBehavior } from "./selection-point.behavior";
|
|
4
4
|
import { MidPointBehavior } from "./midpoint.behavior";
|
|
5
|
-
import { FeatureId
|
|
5
|
+
import { FeatureId } from "../../../store/store";
|
|
6
6
|
export declare class ScaleFeatureBehavior extends TerraDrawModeBehavior {
|
|
7
7
|
readonly config: BehaviorConfig;
|
|
8
8
|
private readonly selectionPoints;
|
|
@@ -10,5 +10,5 @@ export declare class ScaleFeatureBehavior extends TerraDrawModeBehavior {
|
|
|
10
10
|
constructor(config: BehaviorConfig, selectionPoints: SelectionPointBehavior, midPoints: MidPointBehavior);
|
|
11
11
|
private lastDistance;
|
|
12
12
|
reset(): void;
|
|
13
|
-
scale(event: TerraDrawMouseEvent, selectedId: FeatureId, validateFeature?:
|
|
13
|
+
scale(event: TerraDrawMouseEvent, selectedId: FeatureId, validateFeature?: Validation): false | undefined;
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TerraDrawMouseEvent, TerraDrawKeyboardEvent, TerraDrawAdapterStyling, HexColorStyling, NumericStyling, Cursor } from "../../common";
|
|
1
|
+
import { TerraDrawMouseEvent, TerraDrawKeyboardEvent, TerraDrawAdapterStyling, HexColorStyling, NumericStyling, Cursor, Validation } from "../../common";
|
|
2
2
|
import { BaseModeOptions, CustomStyling, TerraDrawBaseSelectMode } from "../base.mode";
|
|
3
3
|
import { BehaviorConfig } from "../base.behavior";
|
|
4
4
|
import { FeatureId, GeoJSONStoreFeatures } from "../../store/store";
|
|
@@ -11,7 +11,7 @@ type TerraDrawSelectModeKeyEvents = {
|
|
|
11
11
|
};
|
|
12
12
|
type ModeFlags = {
|
|
13
13
|
feature?: {
|
|
14
|
-
validation?:
|
|
14
|
+
validation?: Validation;
|
|
15
15
|
draggable?: boolean;
|
|
16
16
|
rotateable?: boolean;
|
|
17
17
|
scaleable?: boolean;
|