Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f3a1ad
commit 5922e5b
Showing
2 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,41 @@ | ||
import BaseEvent from './Event.js'; | ||
/** | ||
* @module ol/events/SnapEvent | ||
*/ | ||
import Event from './Event.js'; | ||
|
||
export class SnapEvent extends BaseEvent { | ||
/** | ||
* @classdesc | ||
* Events emitted by {@link module:ol/interaction/Snap~Snap} instances are instances of this | ||
*/ | ||
class SnapEvent extends Event { | ||
/** | ||
* @param {Object} options Options. | ||
* @param {import("../coordinate.js").Coordinate} options.vertex The snapped vertex. | ||
* @param {import("../coordinate.js").Coordinate} options.vertexPixel The pixel of the snapped vertex. | ||
* @param {import("../Feature.js").default} options.feature The feature being snapped. | ||
* | ||
*/ | ||
constructor(options) { | ||
super('snap'); | ||
/** | ||
* The Map coordinate of the snapped point. | ||
* @type {import("../coordinate.js").Coordinate} | ||
* @api | ||
*/ | ||
this.vertex = options.vertex; | ||
/** | ||
* The Map pixel of the snapped point. | ||
* @type {Array<number>&Array<number>} | ||
* @api | ||
*/ | ||
this.vertexPixel = options.vertexPixel; | ||
/** | ||
* The feature closest to the snapped point. | ||
* @type {import("../Feature.js").default<import("../geom/Geometry.js").default>} | ||
* @api | ||
*/ | ||
this.feature = options.feature; | ||
} | ||
} | ||
|
||
export default SnapEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters