ol 10.6.2-dev.1753985579298 → 10.6.2-dev.1753992411402

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.
@@ -1,58 +1,3 @@
1
- /**
2
- * @typedef {Object} SegmentData
3
- * @property {Array<number>} [depth] Depth.
4
- * @property {Feature} feature Feature.
5
- * @property {import("../geom/SimpleGeometry.js").default} geometry Geometry.
6
- * @property {number} [index] Index.
7
- * @property {Array<Array<number>>} segment Segment.
8
- * @property {Array<SegmentData>} [featureSegments] FeatureSegments.
9
- */
10
- /**
11
- * @typedef {[SegmentData, number]} DragSegment
12
- */
13
- /**
14
- * @typedef {Object} Options
15
- * @property {import("../events/condition.js").Condition} [condition] A function that
16
- * takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
17
- * boolean to indicate whether that event will be considered to add or move a
18
- * vertex to the sketch. Default is
19
- * {@link module:ol/events/condition.primaryAction}.
20
- * @property {import("../events/condition.js").Condition} [deleteCondition] A function
21
- * that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a
22
- * boolean to indicate whether that event should be handled. By default,
23
- * {@link module:ol/events/condition.singleClick} with
24
- * {@link module:ol/events/condition.altKeyOnly} results in a vertex deletion.
25
- * @property {import("../events/condition.js").Condition} [insertVertexCondition] A
26
- * function that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and
27
- * returns a boolean to indicate whether a new vertex should be added to the sketch
28
- * features. Default is {@link module:ol/events/condition.always}.
29
- * @property {number} [pixelTolerance=10] Pixel tolerance for considering the
30
- * pointer close enough to a segment or vertex for editing.
31
- * @property {import("../style/Style.js").StyleLike|import("../style/flat.js").FlatStyleLike} [style]
32
- * Style used for the modification point or vertex. For linestrings and polygons, this will
33
- * be the affected vertex, for circles a point along the circle, and for points the actual
34
- * point. If not configured, the default edit style is used (see {@link module:ol/style/Style~Style}).
35
- * When using a style function, the point feature passed to the function will have an `existing` property -
36
- * indicating whether there is an existing vertex underneath or not, a `features`
37
- * property - an array whose entries are the features that are being modified, and a `geometries`
38
- * property - an array whose entries are the geometries that are being modified. Both arrays are
39
- * in the same order. The `geometries` are only useful when modifying geometry collections, where
40
- * the geometry will be the particular geometry from the collection that is being modified.
41
- * @property {VectorSource} [source] The vector source with
42
- * features to modify. If a vector source is not provided, a feature collection
43
- * must be provided with the `features` option.
44
- * @property {boolean|import("../layer/BaseVector").default} [hitDetection] When configured, point
45
- * features will be considered for modification based on their visual appearance, instead of being within
46
- * the `pixelTolerance` from the pointer location. When a {@link module:ol/layer/BaseVector~BaseVectorLayer} is
47
- * provided, only the rendered representation of the features on that layer will be considered.
48
- * @property {Collection<Feature>} [features]
49
- * The features the interaction works on. If a feature collection is not
50
- * provided, a vector source must be provided with the `source` option.
51
- * @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch
52
- * overlay.
53
- * @property {boolean} [snapToPointer=!hitDetection] The vertex, point or segment being modified snaps to the
54
- * pointer coordinate when clicked within the `pixelTolerance`.
55
- */
56
1
  /**
57
2
  * @classdesc
58
3
  * Events emitted by {@link module:ol/interaction/Modify~Modify} instances are
@@ -167,6 +112,17 @@ export type Options = {
167
112
  * provided, a vector source must be provided with the `source` option.
168
113
  */
169
114
  features?: Collection<Feature<import("../geom/Geometry.js").default>> | undefined;
115
+ /**
116
+ * Trace a portion of another geometry.
117
+ * Tracing starts when two neighboring vertices are dragged onto a trace target, without any other modification in between..
118
+ */
119
+ trace?: boolean | import("../events/condition.js").Condition | undefined;
120
+ /**
121
+ * Source for features to trace. If tracing is active and a `traceSource` is
122
+ * not provided, the interaction's `source` will be used. Tracing requires that the interaction is configured with
123
+ * either a `traceSource` or a `source`.
124
+ */
125
+ traceSource?: VectorSource<Feature<import("../geom/Geometry.js").default>> | undefined;
170
126
  /**
171
127
  * Wrap the world horizontally on the sketch
172
128
  * overlay.
@@ -273,10 +229,10 @@ declare class Modify extends PointerInteraction {
273
229
  */
274
230
  private vertexSegments_;
275
231
  /**
276
- * @type {import("../pixel.js").Pixel}
232
+ * @type {import("../coordinate.js").Coordinate}
277
233
  * @private
278
234
  */
279
- private lastPixel_;
235
+ private lastCoordinate_;
280
236
  /**
281
237
  * Tracks if the next `singleclick` event should be ignored to prevent
282
238
  * accidental deletion right after vertex creation.
@@ -334,6 +290,26 @@ declare class Modify extends PointerInteraction {
334
290
  * @private
335
291
  */
336
292
  private source_;
293
+ /**
294
+ * @type {VectorSource|null}
295
+ * @private
296
+ */
297
+ private traceSource_;
298
+ /**
299
+ * @type {import("../events/condition.js").Condition}
300
+ * @private
301
+ */
302
+ private traceCondition_;
303
+ /**
304
+ * @type {import('./tracing.js').TraceState}
305
+ * @private
306
+ */
307
+ private traceState_;
308
+ /**
309
+ * @type {Array<DragSegment>|null}
310
+ * @private
311
+ */
312
+ private traceSegments_;
337
313
  /**
338
314
  * @type {boolean|import("../layer/BaseVector").default}
339
315
  * @private
@@ -359,6 +335,13 @@ declare class Modify extends PointerInteraction {
359
335
  * @private
360
336
  */
361
337
  private snapToPointer_;
338
+ /**
339
+ * Toggle tracing mode or set a tracing condition.
340
+ *
341
+ * @param {boolean|import("../events/condition.js").Condition} trace A boolean to toggle tracing mode or an event
342
+ * condition that will be checked when a feature is clicked to determine if tracing should be active.
343
+ */
344
+ setTrace(trace: boolean | import("../events/condition.js").Condition): void;
362
345
  /**
363
346
  * @param {Feature} feature Feature.
364
347
  * @private
@@ -482,7 +465,53 @@ declare class Modify extends PointerInteraction {
482
465
  * @private
483
466
  */
484
467
  private createOrUpdateVertexFeature_;
485
- findInsertVerticesAndUpdateDragSegments_(pixelCoordinate: any): SegmentData[] | undefined;
468
+ /**
469
+ * @param {import("../coordinate.js").Coordinate} pixelCoordinate Pixel coordinate.
470
+ * @return {Array<SegmentData>|undefined} Insert vertices and update drag segments.
471
+ * @private
472
+ */
473
+ private findInsertVerticesAndUpdateDragSegments_;
474
+ /**
475
+ * @private
476
+ */
477
+ private deactivateTrace_;
478
+ /**
479
+ * Update the trace.
480
+ * @param {import("../MapBrowserEvent.js").default} event Event.
481
+ * @private
482
+ */
483
+ private updateTrace_;
484
+ getTraceCandidates_(event: any): Feature<import("../geom/Geometry.js").default>[];
485
+ /**
486
+ * Activate or deactivate trace state based on a browser event.
487
+ * @param {import("../MapBrowserEvent.js").default} event Event.
488
+ * @private
489
+ */
490
+ private toggleTraceState_;
491
+ /**
492
+ * @param {import('./tracing.js').TraceTarget} target The trace target.
493
+ * @param {number} endIndex The new end index of the trace.
494
+ * @private
495
+ */
496
+ private addOrRemoveTracedCoordinates_;
497
+ /**
498
+ * @param {number} fromIndex The start index.
499
+ * @param {number} toIndex The end index.
500
+ * @private
501
+ */
502
+ private removeTracedCoordinates_;
503
+ /**
504
+ * @param {import('./tracing.js').TraceTarget} target The trace target.
505
+ * @param {number} fromIndex The start index.
506
+ * @param {number} toIndex The end index.
507
+ * @private
508
+ */
509
+ private addTracedCoordinates_;
510
+ /**
511
+ * @param {import('../coordinate.js').Coordinate} vertex Vertex.
512
+ * @param {DragSegment} dragSegment Drag segment.
513
+ */
514
+ updateGeometry_(vertex: import("../coordinate.js").Coordinate, dragSegment: DragSegment): void;
486
515
  /**
487
516
  * @param {import("../MapBrowserEvent.js").default} evt Event.
488
517
  * @private
@@ -500,7 +529,12 @@ declare class Modify extends PointerInteraction {
500
529
  * @private
501
530
  */
502
531
  private insertVertex_;
503
- updatePointer_(coordinate: any): import("../coordinate.js").Coordinate;
532
+ /**
533
+ * @param {import("../coordinate.js").Coordinate} coordinate The coordinate.
534
+ * @return {import("../coordinate.js").Coordinate} The updated pointer coordinate.
535
+ * @private
536
+ */
537
+ private updatePointer_;
504
538
  /**
505
539
  * Get the current pointer position.
506
540
  * @return {import("../coordinate.js").Coordinate | null} The current pointer coordinate.
@@ -1 +1 @@
1
- {"version":3,"file":"Modify.d.ts","sourceRoot":"","sources":["Modify.js"],"names":[],"mappings":"AAgFA;;;;;;;;GAQG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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