terra-draw 0.0.1-alpha.56 → 0.0.1-alpha.57
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/geometry/transform/scale.d.ts +1 -1
- package/dist/modes/select/behaviors/{drag-maintained-shape.behavior.d.ts → drag-coordinate-resize.behavior.d.ts} +4 -2
- package/dist/modes/select/select.mode.d.ts +5 -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/e2e/src/index.ts +13 -0
- package/e2e/tests/leaflet.spec.ts +72 -4
- package/e2e/tests/setup.ts +29 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Feature, LineString, Polygon, Position } from "geojson";
|
|
2
|
-
export declare function transformScale(feature: Feature<Polygon | LineString>, factor: number, origin: Position): Feature<Polygon | LineString, import("geojson").GeoJsonProperties>;
|
|
2
|
+
export declare function transformScale(feature: Feature<Polygon | LineString>, factor: number, origin: Position, axis?: "x" | "y" | "xy"): Feature<Polygon | LineString, import("geojson").GeoJsonProperties>;
|
|
@@ -4,7 +4,8 @@ import { PixelDistanceBehavior } from "../../pixel-distance.behavior";
|
|
|
4
4
|
import { MidPointBehavior } from "./midpoint.behavior";
|
|
5
5
|
import { SelectionPointBehavior } from "./selection-point.behavior";
|
|
6
6
|
import { FeatureId } from "../../../store/store";
|
|
7
|
-
export
|
|
7
|
+
export type ResizeOptions = "center-fixed" | "opposite-corner-fixed";
|
|
8
|
+
export declare class DragCoordinateResizeBehavior extends TerraDrawModeBehavior {
|
|
8
9
|
readonly config: BehaviorConfig;
|
|
9
10
|
private readonly pixelDistance;
|
|
10
11
|
private readonly selectionPoints;
|
|
@@ -14,10 +15,11 @@ export declare class DragMaintainedShapeBehavior extends TerraDrawModeBehavior {
|
|
|
14
15
|
private getClosestCoordinate;
|
|
15
16
|
getDraggableIndex(event: TerraDrawMouseEvent, selectedId: FeatureId): number;
|
|
16
17
|
private lastDistance;
|
|
17
|
-
drag(event: TerraDrawMouseEvent,
|
|
18
|
+
drag(event: TerraDrawMouseEvent, resizeOption: ResizeOptions): boolean;
|
|
18
19
|
private getCenterOrigin;
|
|
19
20
|
private getOppositeOrigin;
|
|
20
21
|
isDragging(): boolean;
|
|
21
22
|
startDragging(id: FeatureId, index: number): void;
|
|
22
23
|
stopDragging(): void;
|
|
24
|
+
private boundingBoxMaps;
|
|
23
25
|
}
|
|
@@ -2,6 +2,7 @@ import { TerraDrawMouseEvent, TerraDrawKeyboardEvent, TerraDrawAdapterStyling, H
|
|
|
2
2
|
import { BaseModeOptions, CustomStyling, ModeTypes, TerraDrawBaseDrawMode } from "../base.mode";
|
|
3
3
|
import { BehaviorConfig } from "../base.behavior";
|
|
4
4
|
import { GeoJSONStoreFeatures } from "../../store/store";
|
|
5
|
+
import { ResizeOptions } from "./behaviors/drag-coordinate-resize.behavior";
|
|
5
6
|
type TerraDrawSelectModeKeyEvents = {
|
|
6
7
|
deselect: KeyboardEvent["key"] | null;
|
|
7
8
|
delete: KeyboardEvent["key"] | null;
|
|
@@ -17,7 +18,7 @@ type ModeFlags = {
|
|
|
17
18
|
coordinates?: {
|
|
18
19
|
midpoints?: boolean;
|
|
19
20
|
draggable?: boolean;
|
|
20
|
-
|
|
21
|
+
resizable?: ResizeOptions;
|
|
21
22
|
deletable?: boolean;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
@@ -56,10 +57,12 @@ interface TerraDrawSelectModeOptions<T extends CustomStyling> extends BaseModeOp
|
|
|
56
57
|
keyEvents?: TerraDrawSelectModeKeyEvents | null;
|
|
57
58
|
dragEventThrottle?: number;
|
|
58
59
|
cursors?: Cursors;
|
|
60
|
+
allowManualDeselection?: boolean;
|
|
59
61
|
}
|
|
60
62
|
export declare class TerraDrawSelectMode extends TerraDrawBaseDrawMode<SelectionStyling> {
|
|
61
63
|
type: ModeTypes;
|
|
62
64
|
mode: string;
|
|
65
|
+
private allowManualDeselection;
|
|
63
66
|
private dragEventThrottle;
|
|
64
67
|
private dragEventCount;
|
|
65
68
|
private selected;
|
|
@@ -74,7 +77,7 @@ export declare class TerraDrawSelectMode extends TerraDrawBaseDrawMode<Selection
|
|
|
74
77
|
private dragCoordinate;
|
|
75
78
|
private rotateFeature;
|
|
76
79
|
private scaleFeature;
|
|
77
|
-
private
|
|
80
|
+
private dragCoordinateResizeFeature;
|
|
78
81
|
private cursors;
|
|
79
82
|
constructor(options?: TerraDrawSelectModeOptions<SelectionStyling>);
|
|
80
83
|
setSelecting(): void;
|