terra-draw 1.17.0 → 1.18.1

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.
@@ -4,6 +4,7 @@ type BasePointerListener = (event: PointerEvent) => void;
4
4
  type BaseKeyboardListener = (event: KeyboardEvent) => void;
5
5
  type BaseMouseListener = (event: MouseEvent) => void;
6
6
  export type BaseAdapterConfig = {
7
+ ignoreMismatchedPointerEvents?: boolean;
7
8
  coordinatePrecision?: number;
8
9
  minPixelDragDistanceDrawing?: number;
9
10
  minPixelDragDistance?: number;
@@ -12,6 +13,8 @@ export type BaseAdapterConfig = {
12
13
  export declare abstract class TerraDrawBaseAdapter implements TerraDrawAdapter {
13
14
  constructor(config: BaseAdapterConfig);
14
15
  private _nextKeyUpIsContextMenu;
16
+ private _lastPointerDownEventTarget;
17
+ protected _ignoreMismatchedPointerEvents: boolean;
15
18
  protected _minPixelDragDistance: number;
16
19
  protected _minPixelDragDistanceDrawing: number;
17
20
  protected _minPixelDragDistanceSelecting: number;
package/dist/common.d.ts CHANGED
@@ -129,6 +129,7 @@ export interface TerraDrawAdapter {
129
129
  clear(): void;
130
130
  getCoordinatePrecision(): number;
131
131
  }
132
+ export declare const MARKER_URL_DEFAULT = "https://raw.githubusercontent.com/JamesLMilner/terra-draw/refs/heads/main/assets/markers/marker-blue.png";
132
133
  export declare const SELECT_PROPERTIES: {
133
134
  readonly SELECTED: "selected";
134
135
  readonly MID_POINT: "midPoint";
@@ -146,6 +147,7 @@ export declare const COMMON_PROPERTIES: {
146
147
  readonly COORDINATE_POINT_IDS: "coordinatePointIds";
147
148
  readonly PROVISIONAL_COORDINATE_COUNT: "provisionalCoordinateCount";
148
149
  readonly COMMITTED_COORDINATE_COUNT: "committedCoordinateCount";
150
+ readonly MARKER: "marker";
149
151
  };
150
152
  /**
151
153
  * Lower z-index represents layers that are lower in the stack
@@ -3,6 +3,7 @@ import { GeoJSONStoreFeatures, StoreValidation } from "../../store/store";
3
3
  import { BaseModeOptions, CustomStyling, TerraDrawBaseDrawMode } from "../base.mode";
4
4
  import { BehaviorConfig } from "../base.behavior";
5
5
  type MarkerModeStyling = {
6
+ /** Marker must be a PNG or JPG */
6
7
  markerUrl: UrlStyling;
7
8
  markerHeight: NumericStyling;
8
9
  markerWidth: NumericStyling;
@@ -1,4 +1,4 @@
1
- import { TerraDrawMouseEvent, TerraDrawKeyboardEvent, TerraDrawAdapterStyling, HexColorStyling, NumericStyling, Cursor, Validation, Snapping } from "../../common";
1
+ import { TerraDrawMouseEvent, TerraDrawKeyboardEvent, TerraDrawAdapterStyling, HexColorStyling, NumericStyling, Cursor, Validation, Snapping, UrlStyling } from "../../common";
2
2
  import { BaseModeOptions, CustomStyling, TerraDrawBaseSelectMode } from "../base.mode";
3
3
  import { BehaviorConfig } from "../base.behavior";
4
4
  import { FeatureId, GeoJSONStoreFeatures } from "../../store/store";
@@ -32,6 +32,9 @@ type SelectionStyling = {
32
32
  selectedPointWidth: NumericStyling;
33
33
  selectedPointOutlineColor: HexColorStyling;
34
34
  selectedPointOutlineWidth: NumericStyling;
35
+ selectedMarkerUrl: UrlStyling;
36
+ selectedMarkerHeight: NumericStyling;
37
+ selectedMarkerWidth: NumericStyling;
35
38
  selectedLineStringColor: HexColorStyling;
36
39
  selectedLineStringWidth: NumericStyling;
37
40
  selectedPolygonColor: HexColorStyling;