terra-draw 1.10.0 → 1.12.0
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/extend.d.ts +1 -1
- package/dist/geometry/transform/scale.d.ts +8 -9
- package/dist/modes/freehand-linestring/freehand-linestring.mode.d.ts +62 -0
- package/dist/modes/freehand-linestring/freehand-linestring.mode.spec.d.ts +1 -0
- package/dist/terra-draw.cjs +1 -1
- package/dist/terra-draw.cjs.map +1 -1
- package/dist/terra-draw.d.ts +26 -2
- 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
package/dist/extend.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import { Cursor, HexColorStyling, NumericStyling, SELECT_PROPERTIES, TerraDrawCa
|
|
|
3
3
|
import { BaseModeOptions, CustomStyling, TerraDrawBaseDrawMode, TerraDrawBaseSelectMode } from "./modes/base.mode";
|
|
4
4
|
import { FeatureId, GeoJSONStore } from "./store/store";
|
|
5
5
|
import { getDefaultStyling } from "./util/styling";
|
|
6
|
-
export { GeoJSONStore, TerraDrawBaseDrawMode, TerraDrawBaseSelectMode, TerraDrawBaseAdapter, getDefaultStyling, SELECT_PROPERTIES, FeatureId, Cursor, BaseModeOptions, CustomStyling, NumericStyling, HexColorStyling, TerraDrawCallbacks, BaseAdapterConfig, };
|
|
6
|
+
export { GeoJSONStore, TerraDrawBaseDrawMode, TerraDrawBaseSelectMode, TerraDrawBaseAdapter, getDefaultStyling, SELECT_PROPERTIES, type FeatureId, type Cursor, type BaseModeOptions, type CustomStyling, type NumericStyling, type HexColorStyling, type TerraDrawCallbacks, type BaseAdapterConfig, };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare function transformScaleWebMercator(feature: Feature<Polygon | LineString>, factor: number, origin: Position): Feature<Polygon | LineString>;
|
|
1
|
+
import { Position } from "geojson";
|
|
2
|
+
export declare function transformScaleWebMercatorCoordinates({ coordinates, originX, originY, xScale, yScale, }: {
|
|
3
|
+
coordinates: Position[];
|
|
4
|
+
originX: number;
|
|
5
|
+
originY: number;
|
|
6
|
+
xScale: number;
|
|
7
|
+
yScale: number;
|
|
8
|
+
}): void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TerraDrawMouseEvent, TerraDrawAdapterStyling, TerraDrawKeyboardEvent, HexColorStyling, NumericStyling, Cursor } from "../../common";
|
|
2
|
+
import { BaseModeOptions, CustomStyling, TerraDrawBaseDrawMode } from "../base.mode";
|
|
3
|
+
import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
|
|
4
|
+
type TerraDrawFreehandLineStringModeKeyEvents = {
|
|
5
|
+
cancel: KeyboardEvent["key"] | null;
|
|
6
|
+
finish: KeyboardEvent["key"] | null;
|
|
7
|
+
};
|
|
8
|
+
type FreehandLineStringStyling = {
|
|
9
|
+
lineStringWidth: NumericStyling;
|
|
10
|
+
lineStringColor: HexColorStyling;
|
|
11
|
+
closingPointColor: HexColorStyling;
|
|
12
|
+
closingPointWidth: NumericStyling;
|
|
13
|
+
closingPointOutlineColor: HexColorStyling;
|
|
14
|
+
closingPointOutlineWidth: NumericStyling;
|
|
15
|
+
};
|
|
16
|
+
interface Cursors {
|
|
17
|
+
start?: Cursor;
|
|
18
|
+
close?: Cursor;
|
|
19
|
+
}
|
|
20
|
+
interface TerraDrawFreehandLineStringModeOptions<T extends CustomStyling> extends BaseModeOptions<T> {
|
|
21
|
+
minDistance?: number;
|
|
22
|
+
keyEvents?: TerraDrawFreehandLineStringModeKeyEvents | null;
|
|
23
|
+
cursors?: Cursors;
|
|
24
|
+
}
|
|
25
|
+
export declare class TerraDrawFreehandLineStringMode extends TerraDrawBaseDrawMode<FreehandLineStringStyling> {
|
|
26
|
+
mode: "freehand-linestring";
|
|
27
|
+
private startingClick;
|
|
28
|
+
private currentId;
|
|
29
|
+
private closingPointId;
|
|
30
|
+
private minDistance;
|
|
31
|
+
private keyEvents;
|
|
32
|
+
private cursors;
|
|
33
|
+
private preventNewFeature;
|
|
34
|
+
constructor(options?: TerraDrawFreehandLineStringModeOptions<FreehandLineStringStyling>);
|
|
35
|
+
updateOptions(options?: TerraDrawFreehandLineStringModeOptions<FreehandLineStringStyling> | undefined): void;
|
|
36
|
+
private close;
|
|
37
|
+
/** @internal */
|
|
38
|
+
start(): void;
|
|
39
|
+
/** @internal */
|
|
40
|
+
stop(): void;
|
|
41
|
+
/** @internal */
|
|
42
|
+
onMouseMove(event: TerraDrawMouseEvent): void;
|
|
43
|
+
/** @internal */
|
|
44
|
+
onClick(event: TerraDrawMouseEvent): void;
|
|
45
|
+
/** @internal */
|
|
46
|
+
onKeyDown(): void;
|
|
47
|
+
/** @internal */
|
|
48
|
+
onKeyUp(event: TerraDrawKeyboardEvent): void;
|
|
49
|
+
/** @internal */
|
|
50
|
+
onDragStart(): void;
|
|
51
|
+
/** @internal */
|
|
52
|
+
onDrag(): void;
|
|
53
|
+
/** @internal */
|
|
54
|
+
onDragEnd(): void;
|
|
55
|
+
/** @internal */
|
|
56
|
+
cleanUp(): void;
|
|
57
|
+
/** @internal */
|
|
58
|
+
styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
|
|
59
|
+
validateFeature(feature: unknown): StoreValidation;
|
|
60
|
+
afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|