ol 10.2.2-dev.1728966372347 → 10.2.2-dev.1729024622781

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.
@@ -7,6 +7,9 @@
7
7
  * @property {Array<Array<number>>} segment Segment.
8
8
  * @property {Array<SegmentData>} [featureSegments] FeatureSegments.
9
9
  */
10
+ /**
11
+ * @typedef {[SegmentData, number]} DragSegment
12
+ */
10
13
  /**
11
14
  * @typedef {Object} Options
12
15
  * @property {import("../events/condition.js").Condition} [condition] A function that
@@ -29,7 +32,8 @@
29
32
  * Style used for the modification point or vertex. For linestrings and polygons, this will
30
33
  * be the affected vertex, for circles a point along the circle, and for points the actual
31
34
  * point. If not configured, the default edit style is used (see {@link module:ol/style/Style~Style}).
32
- * When using a style function, the point feature passed to the function will have a `features`
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`
33
37
  * property - an array whose entries are the features that are being modified, and a `geometries`
34
38
  * property - an array whose entries are the geometries that are being modified. Both arrays are
35
39
  * in the same order. The `geometries` are only useful when modifying geometry collections, where
@@ -103,6 +107,7 @@ export type SegmentData = {
103
107
  */
104
108
  featureSegments?: SegmentData[] | undefined;
105
109
  };
110
+ export type DragSegment = [SegmentData, number];
106
111
  export type Options = {
107
112
  /**
108
113
  * A function that
@@ -136,7 +141,8 @@ export type Options = {
136
141
  * Style used for the modification point or vertex. For linestrings and polygons, this will
137
142
  * be the affected vertex, for circles a point along the circle, and for points the actual
138
143
  * point. If not configured, the default edit style is used (see {@link module :ol/style/Style~Style}).
139
- * When using a style function, the point feature passed to the function will have a `features`
144
+ * When using a style function, the point feature passed to the function will have an `existing` property -
145
+ * indicating whether there is an existing vertex underneath or not, a `features`
140
146
  * property - an array whose entries are the features that are being modified, and a `geometries`
141
147
  * property - an array whose entries are the geometries that are being modified. Both arrays are
142
148
  * in the same order. The `geometries` are only useful when modifying geometry collections, where
@@ -307,7 +313,7 @@ declare class Modify extends PointerInteraction {
307
313
  */
308
314
  private changingFeature_;
309
315
  /**
310
- * @type {Array}
316
+ * @type {Array<DragSegment>}
311
317
  * @private
312
318
  */
313
319
  private dragSegments_;
@@ -360,7 +366,7 @@ declare class Modify extends PointerInteraction {
360
366
  private addFeature_;
361
367
  /**
362
368
  * @param {import("../MapBrowserEvent.js").default} evt Map browser event.
363
- * @param {Array<Array<SegmentData>>} segments The segments subject to modification.
369
+ * @param {Array<SegmentData>} segments The segments subject to modification.
364
370
  * @private
365
371
  */
366
372
  private willModifyFeatures_;
@@ -471,40 +477,71 @@ declare class Modify extends PointerInteraction {
471
477
  * @param {import("../coordinate.js").Coordinate} coordinates Coordinates.
472
478
  * @param {Array<Feature>} features The features being modified.
473
479
  * @param {Array<import("../geom/SimpleGeometry.js").default>} geometries The geometries being modified.
480
+ * @param {boolean} existing The vertex represents an existing vertex.
474
481
  * @return {Feature} Vertex feature.
475
482
  * @private
476
483
  */
477
484
  private createOrUpdateVertexFeature_;
485
+ findInsertVerticesAndUpdateDragSegments_(pixelCoordinate: any): SegmentData[] | undefined;
478
486
  /**
479
487
  * @param {import("../MapBrowserEvent.js").default} evt Event.
480
488
  * @private
481
489
  */
482
490
  private handlePointerMove_;
483
491
  /**
484
- * @param {import("../pixel.js").Pixel} pixel Pixel
485
- * @param {import("../Map.js").default} map Map.
486
- * @param {import("../coordinate.js").Coordinate} [coordinate] The pixel Coordinate.
492
+ * @param {import("../coordinate.js").Coordinate} pixelCoordinate The pixel Coordinate.
487
493
  * @private
488
494
  */
489
495
  private handlePointerAtPixel_;
490
496
  /**
491
497
  * @param {SegmentData} segmentData Segment data.
492
498
  * @param {import("../coordinate.js").Coordinate} vertex Vertex.
499
+ * @return {boolean} A vertex was inserted.
493
500
  * @private
494
501
  */
495
502
  private insertVertex_;
503
+ updatePointer_(coordinate: any): import("../coordinate.js").Coordinate;
504
+ /**
505
+ * Get the current pointer position.
506
+ * @return {import("../coordinate.js").Coordinate | null} The current pointer coordinate.
507
+ */
508
+ getPoint(): import("../coordinate.js").Coordinate | null;
509
+ /**
510
+ * Check if a point can be removed from the current linestring or polygon at the current
511
+ * pointer position.
512
+ * @return {boolean} A point can be deleted at the current pointer position.
513
+ * @api
514
+ */
515
+ canRemovePoint(): boolean;
496
516
  /**
497
- * Removes the vertex currently being pointed.
517
+ * Removes the vertex currently being pointed from the current linestring or polygon.
518
+ * @param {import('../coordinate.js').Coordinate} [coordinate] If provided, the pointer
519
+ * will be set to the provided coordinate. If not, the current pointer coordinate will be used.
498
520
  * @return {boolean} True when a vertex was removed.
499
521
  * @api
500
522
  */
501
- removePoint(): boolean;
523
+ removePoint(coordinate?: import("../coordinate.js").Coordinate | undefined): boolean;
502
524
  /**
503
525
  * Removes a vertex from all matching features.
504
526
  * @return {boolean} True when a vertex was removed.
505
527
  * @private
506
528
  */
507
529
  private removeVertex_;
530
+ /**
531
+ * Check if a point can be inserted to the current linestring or polygon at the current
532
+ * pointer position.
533
+ * @return {boolean} A point can be inserted at the current pointer position.
534
+ * @api
535
+ */
536
+ canInsertPoint(): boolean;
537
+ /**
538
+ * Inserts the vertex currently being pointed to the current linestring or polygon.
539
+ * @param {import('../coordinate.js').Coordinate} [coordinate] If provided, the pointer
540
+ * will be set to the provided coordinate. If not, the current pointer coordinate will be used.
541
+ * @return {boolean} A vertex was inserted.
542
+ * @api
543
+ */
544
+ insertPoint(coordinate?: import("../coordinate.js").Coordinate | undefined): boolean;
508
545
  /**
509
546
  * @param {import("../geom/SimpleGeometry.js").default} geometry Geometry.
510
547
  * @param {Array} coordinates Coordinates.
@@ -1 +1 @@
1
- {"version":3,"file":"Modify.d.ts","sourceRoot":"","sources":["Modify.js"],"names":[],"mappings":"AAgFA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;;;GAIG;AACH;IACE;;;;;;OAMG;IACH,kBANW,eAAe,YACf,UAAU,CAAC,OAAO,CAAC,mBAEnB,4C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