terra-draw 0.0.1-alpha.55 → 0.0.1-alpha.56
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 +2 -2
- package/dist/modes/select/behaviors/drag-maintained-shape.behavior.d.ts +23 -0
- package/dist/modes/select/select.mode.d.ts +2 -0
- 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/package-lock.json +591 -2
- package/e2e/package.json +6 -3
- package/e2e/playwright.config.ts +1 -1
- package/e2e/public/index.html +1 -1
- package/e2e/src/index.ts +1 -0
- package/e2e/tests/leaflet.spec.ts +100 -23
- package/e2e/tests/setup.ts +50 -2
- package/e2e/webpack.config.js +4 -6
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Feature, LineString, Polygon } from "geojson";
|
|
2
|
-
export declare function transformScale(feature: Feature<Polygon | LineString>, factor: number): Feature<Polygon | LineString, import("geojson").GeoJsonProperties>;
|
|
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>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TerraDrawMouseEvent } from "../../../common";
|
|
2
|
+
import { BehaviorConfig, TerraDrawModeBehavior } from "../../base.behavior";
|
|
3
|
+
import { PixelDistanceBehavior } from "../../pixel-distance.behavior";
|
|
4
|
+
import { MidPointBehavior } from "./midpoint.behavior";
|
|
5
|
+
import { SelectionPointBehavior } from "./selection-point.behavior";
|
|
6
|
+
import { FeatureId } from "../../../store/store";
|
|
7
|
+
export declare class DragMaintainedShapeBehavior extends TerraDrawModeBehavior {
|
|
8
|
+
readonly config: BehaviorConfig;
|
|
9
|
+
private readonly pixelDistance;
|
|
10
|
+
private readonly selectionPoints;
|
|
11
|
+
private readonly midPoints;
|
|
12
|
+
constructor(config: BehaviorConfig, pixelDistance: PixelDistanceBehavior, selectionPoints: SelectionPointBehavior, midPoints: MidPointBehavior);
|
|
13
|
+
private draggedCoordinate;
|
|
14
|
+
private getClosestCoordinate;
|
|
15
|
+
getDraggableIndex(event: TerraDrawMouseEvent, selectedId: FeatureId): number;
|
|
16
|
+
private lastDistance;
|
|
17
|
+
drag(event: TerraDrawMouseEvent, maintainShapeFrom: "center" | "opposite"): boolean;
|
|
18
|
+
private getCenterOrigin;
|
|
19
|
+
private getOppositeOrigin;
|
|
20
|
+
isDragging(): boolean;
|
|
21
|
+
startDragging(id: FeatureId, index: number): void;
|
|
22
|
+
stopDragging(): void;
|
|
23
|
+
}
|
|
@@ -17,6 +17,7 @@ type ModeFlags = {
|
|
|
17
17
|
coordinates?: {
|
|
18
18
|
midpoints?: boolean;
|
|
19
19
|
draggable?: boolean;
|
|
20
|
+
maintainShapeFrom?: "center" | "opposite";
|
|
20
21
|
deletable?: boolean;
|
|
21
22
|
};
|
|
22
23
|
};
|
|
@@ -73,6 +74,7 @@ export declare class TerraDrawSelectMode extends TerraDrawBaseDrawMode<Selection
|
|
|
73
74
|
private dragCoordinate;
|
|
74
75
|
private rotateFeature;
|
|
75
76
|
private scaleFeature;
|
|
77
|
+
private maintainShape;
|
|
76
78
|
private cursors;
|
|
77
79
|
constructor(options?: TerraDrawSelectModeOptions<SelectionStyling>);
|
|
78
80
|
setSelecting(): void;
|