terra-draw 1.6.2 → 1.7.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/common.d.ts CHANGED
@@ -116,15 +116,16 @@ export interface TerraDrawAdapter {
116
116
  export declare const SELECT_PROPERTIES: {
117
117
  readonly SELECTED: "selected";
118
118
  readonly MID_POINT: "midPoint";
119
+ readonly SELECTION_POINT_FEATURE_ID: "selectionPointFeatureId";
119
120
  readonly SELECTION_POINT: "selectionPoint";
120
121
  };
121
122
  export declare const COMMON_PROPERTIES: {
122
- EDITED: string;
123
- CLOSING_POINT: string;
124
- SNAPPING_POINT: string;
125
- COORDINATE_POINT: string;
126
- COORDINATE_POINT_FEATURE_ID: string;
127
- COORDINATE_POINT_IDS: string;
123
+ readonly EDITED: "edited";
124
+ readonly CLOSING_POINT: "closingPoint";
125
+ readonly SNAPPING_POINT: "snappingPoint";
126
+ readonly COORDINATE_POINT: "coordinatePoint";
127
+ readonly COORDINATE_POINT_FEATURE_ID: "coordinatePointFeatureId";
128
+ readonly COORDINATE_POINT_IDS: "coordinatePointIds";
128
129
  };
129
130
  export declare const Z_INDEX: {
130
131
  readonly LAYER_ONE: 10;
@@ -1,6 +1,6 @@
1
1
  import { Point, Position } from "geojson";
2
2
  import { JSONObject } from "../store/store";
3
- export declare function getCoordinatesAsPoints(selectedCoords: Position[], geometryType: "Polygon" | "LineString", properties: (index: number) => JSONObject): {
3
+ export declare function getCoordinatesAsPoints<Properties extends JSONObject>(selectedCoords: Position[], geometryType: "Polygon" | "LineString", properties: (index: number) => Properties): {
4
4
  geometry: Point;
5
- properties: JSONObject;
5
+ properties: Properties;
6
6
  }[];
@@ -1,6 +1,13 @@
1
1
  import { LineString, Point, Polygon, Position } from "geojson";
2
2
  import { BehaviorConfig, TerraDrawModeBehavior } from "../../base.behavior";
3
3
  import { FeatureId } from "../../../store/store";
4
+ import { SELECT_PROPERTIES } from "../../../common";
5
+ export type SelectionPointProperties = {
6
+ mode: string;
7
+ index: number;
8
+ [SELECT_PROPERTIES.SELECTION_POINT_FEATURE_ID]: string;
9
+ [SELECT_PROPERTIES.SELECTION_POINT]: true;
10
+ };
4
11
  export declare class SelectionPointBehavior extends TerraDrawModeBehavior {
5
12
  constructor(config: BehaviorConfig);
6
13
  private _selectionPoints;
@@ -87,7 +87,6 @@ export declare class TerraDrawSelectMode extends TerraDrawBaseSelectMode<Selecti
87
87
  private coordinatePoints;
88
88
  constructor(options?: TerraDrawSelectModeOptions<SelectionStyling>);
89
89
  updateOptions(options?: TerraDrawSelectModeOptions<SelectionStyling>): void;
90
- private createOrUpdateCoordinatePoint;
91
90
  selectFeature(featureId: FeatureId): void;
92
91
  setSelecting(): void;
93
92
  registerBehaviors(config: BehaviorConfig): void;