Skip to content

Commit

Permalink
Added ability to disable icons floating popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahim Saad committed Dec 12, 2024
1 parent d42ffe7 commit 22f3bb0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/DataVisualization/Icons/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class Icons implements IPlugin {
private _floatBody: HTMLDivElement;
private _instances : { [id: string] : Icon} = {}
private _selectedIcon: Icon | undefined;
private _floatingDetailsEnabled: boolean = true;
private _iconsCount = 0;

init(viewer: Viewer): void {
Expand Down Expand Up @@ -107,6 +108,10 @@ export class Icons implements IPlugin {
this._iconsCount++;
}

public setFloatingDetailsState(enabled: boolean){
this._floatingDetailsEnabled = enabled;
}

public moveIconTo(icon: Icon, location: Float32Array, speed: number): void {
if (!icon.location) {
console.warn("Icon location is not defined.");
Expand Down Expand Up @@ -234,7 +239,7 @@ export class Icons implements IPlugin {
}
});

if(this._selectedIcon && this._floatdetails) {
if(this._selectedIcon && this._floatdetails && this._floatingDetailsEnabled) {
const position = this._viewer.getHtmlCoordinatesOfVector(this._selectedIcon.location);
if(position.length == 2) {
this._floatTitle.textContent = this._selectedIcon.name;
Expand Down

0 comments on commit 22f3bb0

Please sign in to comment.