terra-draw 1.9.0 → 1.10.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.
@@ -54,5 +54,6 @@ export declare class TerraDrawAngledRectangleMode extends TerraDrawBaseDrawMode<
54
54
  /** @internal */
55
55
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
56
56
  validateFeature(feature: unknown): StoreValidation;
57
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
57
58
  }
58
59
  export {};
@@ -63,6 +63,7 @@ export declare abstract class TerraDrawBaseDrawMode<Styling extends CustomStylin
63
63
  register(config: TerraDrawModeRegisterConfig): void;
64
64
  validateFeature(feature: unknown): ReturnType<Validation>;
65
65
  afterFeatureAdded(feature: GeoJSONStoreFeatures): void;
66
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
66
67
  private performFeatureValidation;
67
68
  protected validateModeFeature(feature: unknown, modeValidationFn: (feature: GeoJSONStoreFeatures) => ReturnType<Validation>): ReturnType<Validation>;
68
69
  abstract start(): void;
@@ -64,5 +64,6 @@ export declare class TerraDrawCircleMode extends TerraDrawBaseDrawMode<CirclePol
64
64
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
65
65
  validateFeature(feature: unknown): StoreValidation;
66
66
  private updateCircle;
67
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
67
68
  }
68
69
  export {};
@@ -66,5 +66,6 @@ export declare class TerraDrawFreehandMode extends TerraDrawBaseDrawMode<Freehan
66
66
  /** @internal */
67
67
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
68
68
  validateFeature(feature: unknown): StoreValidation;
69
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
69
70
  }
70
71
  export {};
@@ -10,8 +10,8 @@ export declare class LineSnappingBehavior extends TerraDrawModeBehavior {
10
10
  private readonly clickBoundingBox;
11
11
  constructor(config: BehaviorConfig, pixelDistance: PixelDistanceBehavior, clickBoundingBox: ClickBoundingBoxBehavior);
12
12
  /** Returns the nearest snappable coordinate - on first click there is no currentId so no need to provide */
13
- getSnappableCoordinateFirstClick: (event: TerraDrawMouseEvent) => Position | undefined;
14
- getSnappableCoordinate: (event: TerraDrawMouseEvent, currentFeatureId: FeatureId) => Position | undefined;
13
+ getSnappableCoordinateFirstClick: (event: TerraDrawMouseEvent) => number[] | undefined;
14
+ getSnappableCoordinate: (event: TerraDrawMouseEvent, currentFeatureId: FeatureId) => number[] | undefined;
15
15
  getSnappable(event: TerraDrawMouseEvent, filter?: (feature: Feature) => boolean): {
16
16
  coordinate: undefined | Position;
17
17
  minDistance: number;
@@ -46,8 +46,9 @@ export declare class TerraDrawLineStringMode extends TerraDrawBaseDrawMode<LineS
46
46
  private cursors;
47
47
  private mouseMove;
48
48
  private insertCoordinates;
49
- private lastCommitedCoordinates;
49
+ private lastCommittedCoordinates;
50
50
  private snappedPointId;
51
+ private lastMouseMoveEvent;
51
52
  private editable;
52
53
  private editedFeatureId;
53
54
  private editedFeatureCoordinateIndex;
@@ -61,6 +62,7 @@ export declare class TerraDrawLineStringMode extends TerraDrawBaseDrawMode<LineS
61
62
  private clickBoundingBox;
62
63
  constructor(options?: TerraDrawLineStringModeOptions<LineStringStyling>);
63
64
  updateOptions(options?: TerraDrawLineStringModeOptions<LineStringStyling> | undefined): void;
65
+ private updateSnappedCoordinate;
64
66
  private close;
65
67
  private updateGeometries;
66
68
  private generateInsertCoordinates;
@@ -96,5 +98,6 @@ export declare class TerraDrawLineStringMode extends TerraDrawBaseDrawMode<LineS
96
98
  validateFeature(feature: unknown): StoreValidation;
97
99
  private lineStringFilter;
98
100
  private snapCoordinate;
101
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
99
102
  }
100
103
  export {};
@@ -56,5 +56,6 @@ export declare class TerraDrawPointMode extends TerraDrawBaseDrawMode<PointModeS
56
56
  private onLeftClick;
57
57
  private onRightClick;
58
58
  private getNearestPointFeature;
59
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
59
60
  }
60
61
  export {};
@@ -51,6 +51,7 @@ export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonS
51
51
  private cursors;
52
52
  private mouseMove;
53
53
  private showCoordinatePoints;
54
+ private lastMouseMoveEvent;
54
55
  private snapping;
55
56
  private snappedPointId;
56
57
  private editable;
@@ -74,6 +75,7 @@ export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonS
74
75
  start(): void;
75
76
  /** @internal */
76
77
  stop(): void;
78
+ private updateSnappedCoordinate;
77
79
  /** @internal */
78
80
  onMouseMove(event: TerraDrawMouseEvent): void;
79
81
  private updatePolygonGeometry;
@@ -97,6 +99,7 @@ export declare class TerraDrawPolygonMode extends TerraDrawBaseDrawMode<PolygonS
97
99
  /** @internal */
98
100
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
99
101
  afterFeatureAdded(feature: GeoJSONStoreFeatures): void;
102
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
100
103
  validateFeature(feature: unknown): StoreValidation;
101
104
  }
102
105
  export {};
@@ -52,5 +52,6 @@ export declare class TerraDrawRectangleMode extends TerraDrawBaseDrawMode<Rectan
52
52
  /** @internal */
53
53
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
54
54
  validateFeature(feature: unknown): StoreValidation;
55
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
55
56
  }
56
57
  export {};
@@ -57,5 +57,6 @@ export declare class TerraDrawSectorMode extends TerraDrawBaseDrawMode<SectorPol
57
57
  /** @internal */
58
58
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
59
59
  validateFeature(feature: unknown): StoreValidation;
60
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
60
61
  }
61
62
  export {};
@@ -122,5 +122,6 @@ export declare class TerraDrawSelectMode extends TerraDrawBaseSelectMode<Selecti
122
122
  onMouseMove(event: TerraDrawMouseEvent): void;
123
123
  /** @internal */
124
124
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
125
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
125
126
  }
126
127
  export {};
@@ -64,6 +64,7 @@ export declare class TerraDrawSensorMode extends TerraDrawBaseDrawMode<SensorPol
64
64
  /** @internal */
65
65
  styleFeature(feature: GeoJSONStoreFeatures): TerraDrawAdapterStyling;
66
66
  validateFeature(feature: unknown): StoreValidation;
67
+ afterFeatureUpdated(feature: GeoJSONStoreFeatures): void;
67
68
  private getDeltaBearing;
68
69
  private notInSector;
69
70
  }