diff --git a/packages/core/package.json b/packages/core/package.json index 0f162cc65..9809cc4d6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@thatopen/components", "description": "Collection of core functionalities to author BIM apps.", - "version": "2.1.0", + "version": "2.1.1", "author": "That Open Company", "contributors": [ "Antonio Gonzalez Viegas (https://github.com/agviegas)", diff --git a/packages/core/src/core/Components/index.ts b/packages/core/src/core/Components/index.ts index 7b7f91ef1..76c47a609 100644 --- a/packages/core/src/core/Components/index.ts +++ b/packages/core/src/core/Components/index.ts @@ -14,7 +14,7 @@ export class Components implements Disposable { /** * The version of the @thatopen/components library. */ - static readonly release = "2.0.26"; + static readonly release = "2.1.1"; /** {@link Disposable.onDisposed} */ readonly onDisposed = new Event(); diff --git a/packages/core/src/utils/vertex-picker.ts b/packages/core/src/utils/vertex-picker.ts index 68b68df1b..5fb48fb71 100644 --- a/packages/core/src/utils/vertex-picker.ts +++ b/packages/core/src/utils/vertex-picker.ts @@ -49,6 +49,11 @@ export class VertexPicker extends Component implements Disposable { */ readonly onVertexLost = new Event(); + /** + * An event that is triggered when the picker is enabled or disabled + */ + readonly onEnabled = new Event(); + /** * A reference to the Components instance associated with this VertexPicker. */ @@ -79,6 +84,7 @@ export class VertexPicker extends Component implements Disposable { if (!value) { this._pickedPoint = null; } + this.onEnabled.trigger(value); } /** diff --git a/packages/front/package.json b/packages/front/package.json index 27165c587..ab5154b31 100644 --- a/packages/front/package.json +++ b/packages/front/package.json @@ -1,7 +1,7 @@ { "name": "@thatopen/components-front", "description": "Collection of frontend tools to author BIM apps.", - "version": "2.1.0", + "version": "2.1.1", "author": "That Open Company", "contributors": [ "Antonio Gonzalez Viegas (https://github.com/agviegas)", diff --git a/packages/front/src/utils/graphic-vertex-picker.ts b/packages/front/src/utils/graphic-vertex-picker.ts index f545ae86a..86f227136 100644 --- a/packages/front/src/utils/graphic-vertex-picker.ts +++ b/packages/front/src/utils/graphic-vertex-picker.ts @@ -17,6 +17,18 @@ export class GraphicVertexPicker /** The marker used to indicate the picked vertex. */ marker: Mark | null = null; + constructor( + components: OBC.Components, + config?: Partial, + ) { + super(components, config); + this.onEnabled.add((value: boolean) => { + if (this.marker) { + this.marker.visible = value; + } + }); + } + /** {@link OBC.Disposable.onDisposed} */ dispose() { if (this.marker) {